diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-20 12:07:10 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-20 12:07:10 +0000 |
commit | ddb5e56ff2f76f2734187d9477f0732f68dff396 (patch) | |
tree | 280cb0eb704b949e512afdfa9ae9e65cdf009d06 /media/base | |
parent | 13485fa0a0cbfb97b66cb52a298ddd278d247ec8 (diff) | |
download | chromium_src-ddb5e56ff2f76f2734187d9477f0732f68dff396.zip chromium_src-ddb5e56ff2f76f2734187d9477f0732f68dff396.tar.gz chromium_src-ddb5e56ff2f76f2734187d9477f0732f68dff396.tar.bz2 |
Introduce VideoDecoder::HasOutputFrameAvailable().
By default HasOutputFrameAvailable() will return true since typically VideoFrames can be dynamically allocated. Decoders that use a fixed pool of pre-allocated VideoFrames can override this method to return false when all VideoFrames are currently spoken for.
VideoRendererBase now uses the result to determine whether it should finish prerolling.
BUG=177730
Review URL: https://chromiumcodereview.appspot.com/12902004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189247 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base')
-rw-r--r-- | media/base/video_decoder.cc | 4 | ||||
-rw-r--r-- | media/base/video_decoder.h | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/media/base/video_decoder.cc b/media/base/video_decoder.cc index 4c7c4b7..dd1ab7c 100644 --- a/media/base/video_decoder.cc +++ b/media/base/video_decoder.cc @@ -14,4 +14,8 @@ bool VideoDecoder::HasAlpha() const { return false; } +bool VideoDecoder::HasOutputFrameAvailable() const { + return true; +} + } // namespace media diff --git a/media/base/video_decoder.h b/media/base/video_decoder.h index 915a9b4..904a6fd 100644 --- a/media/base/video_decoder.h +++ b/media/base/video_decoder.h @@ -69,6 +69,12 @@ class MEDIA_EXPORT VideoDecoder // that return formats with an alpha channel. virtual bool HasAlpha() const; + // Returns true if the decoder currently has the ability to decode and return + // a VideoFrame. Most implementations can allocate a new VideoFrame and hence + // this will always return true. Override and return false for decoders that + // use a fixed set of VideoFrames for decoding. + virtual bool HasOutputFrameAvailable() const; + protected: friend class base::RefCountedThreadSafe<VideoDecoder>; virtual ~VideoDecoder(); |