diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-30 20:25:05 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-30 20:25:05 +0000 |
commit | d0e865a89b8d5a8ef5d93ea0bf2d9644c94c0b5c (patch) | |
tree | 106dae251c952fb0ae4a9df750ac950536d3b9d8 /chrome | |
parent | 567f23965887abeee2901ba3f6014ee53d0ae6eb (diff) | |
download | chromium_src-d0e865a89b8d5a8ef5d93ea0bf2d9644c94c0b5c.zip chromium_src-d0e865a89b8d5a8ef5d93ea0bf2d9644c94c0b5c.tar.gz chromium_src-d0e865a89b8d5a8ef5d93ea0bf2d9644c94c0b5c.tar.bz2 |
Enable streaming in ffmpeg based on data sourcemedia::DataSource interface has IsSeekable() method to decideon runtime whether the data source is seekable or not. Thisinformation is provided to FFmpeg to decide whether to dostreaming or not. In the case of streaming, FFmpeg does notsupport seeking.
Review URL: http://codereview.chromium.org/57015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12802 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/renderer/media/data_source_impl.cc | 6 | ||||
-rw-r--r-- | chrome/renderer/media/data_source_impl.h | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/chrome/renderer/media/data_source_impl.cc b/chrome/renderer/media/data_source_impl.cc index ba78743..65a725f 100644 --- a/chrome/renderer/media/data_source_impl.cc +++ b/chrome/renderer/media/data_source_impl.cc @@ -139,6 +139,12 @@ bool DataSourceImpl::GetSize(int64* size_out) { return false; } +bool DataSourceImpl::IsSeekable() { + // If URI is file then it is seekable. + // TODO(hclam): make other protocols seekable. + return uri_.find("file:///") == 0; +} + void DataSourceImpl::OnCreateFileStream(base::PlatformFile file) { stream_.reset( new net::FileStream( diff --git a/chrome/renderer/media/data_source_impl.h b/chrome/renderer/media/data_source_impl.h index d5326cb..c56be77 100644 --- a/chrome/renderer/media/data_source_impl.h +++ b/chrome/renderer/media/data_source_impl.h @@ -56,8 +56,10 @@ // | Called to obtain current position in the file. // |-- SetPosition() // | Performs a seek operation. -// \-- GetSize() -// Retrieve the size of the resource. +// |-- GetSize() +// | Retrieve the size of the resource. +// \-- IsSeekable() +// Returns true if URL is file:/// or else false. // // IO thread // +-- OnCreateFileStream() @@ -138,6 +140,7 @@ class DataSourceImpl : public media::DataSource, virtual bool GetPosition(int64* position_out); virtual bool SetPosition(int64 position); virtual bool GetSize(int64* size_out); + virtual bool IsSeekable(); const media::MediaFormat& media_format(); |