Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(424)

Unified Diff: media/filters/decoder_stream.h

Issue 239893002: Allow multiple concurrent Decode() requests in VideoDecoder interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/filters/decoder_stream.h
diff --git a/media/filters/decoder_stream.h b/media/filters/decoder_stream.h
index 4992141443b3410d71c050318fb2b160807a870b..ffb82886f99292f58140de41879f0cc2ce496962 100644
--- a/media/filters/decoder_stream.h
+++ b/media/filters/decoder_stream.h
@@ -87,6 +87,9 @@ class MEDIA_EXPORT DecoderStream {
// behavior.
bool CanReadWithoutStalling() const;
+ // Returns true if one more decode request can be submitted to the decoder.
+ bool CanDecodeMore() const;
+
// Allows callers to register for notification of splice buffers from the
// demuxer. I.e., DecoderBuffer::splice_timestamp() is not kNoTimestamp().
//
@@ -129,9 +132,6 @@ class MEDIA_EXPORT DecoderStream {
void SatisfyRead(Status status,
const scoped_refptr<Output>& output);
- // Abort pending |read_cb_|.
- void AbortRead();
-
// Decodes |buffer| and returns the result via OnDecodeOutputReady().
void Decode(const scoped_refptr<DecoderBuffer>& buffer);
@@ -187,6 +187,13 @@ class MEDIA_EXPORT DecoderStream {
// splice_timestamp() of kNoTimestamp() is encountered.
bool active_splice_;
+ // Decoded buffers that haven't been read yet. Used when the decoder supports
+ // parallel decoding.
+ std::list<scoped_refptr<Output> > ready_outputs_;
+
+ // Number of outstanding decode requests sent to the |decoder_|.
+ int pending_decode_requests_;
+
// NOTE: Weak pointers must be invalidated before all other member variables.
base::WeakPtrFactory<DecoderStream<StreamType> > weak_factory_;
@@ -198,6 +205,9 @@ class MEDIA_EXPORT DecoderStream {
template <>
bool DecoderStream<DemuxerStream::AUDIO>::CanReadWithoutStalling() const;
+template <>
+bool DecoderStream<DemuxerStream::AUDIO>::CanDecodeMore() const;
+
typedef DecoderStream<DemuxerStream::VIDEO> VideoFrameStream;
typedef DecoderStream<DemuxerStream::AUDIO> AudioBufferStream;

Powered by Google App Engine
This is Rietveld 408576698