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

Unified Diff: media/filters/gpu_video_decoder.h

Issue 331863004: Revert 276344 "Add callback in VideoDecoder and AudioDecoder to ..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/2049/src/
Patch Set: Created 6 years, 6 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
« no previous file with comments | « media/filters/ffmpeg_video_decoder_unittest.cc ('k') | media/filters/gpu_video_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/gpu_video_decoder.h
===================================================================
--- media/filters/gpu_video_decoder.h (revision 277175)
+++ media/filters/gpu_video_decoder.h (working copy)
@@ -44,15 +44,13 @@
// VideoDecoder implementation.
virtual void Initialize(const VideoDecoderConfig& config,
bool live_mode,
- const PipelineStatusCB& status_cb,
- const OutputCB& output_cb) OVERRIDE;
+ const PipelineStatusCB& status_cb) OVERRIDE;
virtual void Decode(const scoped_refptr<DecoderBuffer>& buffer,
const DecodeCB& decode_cb) OVERRIDE;
virtual void Reset(const base::Closure& closure) OVERRIDE;
virtual void Stop() OVERRIDE;
virtual bool NeedsBitstreamConversion() const OVERRIDE;
virtual bool CanReadWithoutStalling() const OVERRIDE;
- virtual int GetMaxDecodeRequests() const OVERRIDE;
// VideoDecodeAccelerator::Client implementation.
virtual void ProvidePictureBuffers(uint32 count,
@@ -85,20 +83,26 @@
};
// A SHMBuffer and the DecoderBuffer its data came from.
- struct PendingDecoderBuffer {
- PendingDecoderBuffer(SHMBuffer* s,
- const scoped_refptr<DecoderBuffer>& b,
- const DecodeCB& done_cb);
- ~PendingDecoderBuffer();
+ struct BufferPair {
+ BufferPair(SHMBuffer* s, const scoped_refptr<DecoderBuffer>& b);
+ ~BufferPair();
SHMBuffer* shm_buffer;
scoped_refptr<DecoderBuffer> buffer;
- DecodeCB done_cb;
};
typedef std::map<int32, PictureBuffer> PictureBufferMap;
- void DeliverFrame(const scoped_refptr<VideoFrame>& frame);
+ // Return true if more decode work can be piled on to the VDA.
+ bool CanMoreDecodeWorkBeDone();
+ // Enqueue a frame for later delivery (or drop it on the floor if a
+ // vda->Reset() is in progress) and trigger out-of-line delivery of the oldest
+ // ready frame to the client if there is a pending read. A NULL |frame|
+ // merely triggers delivery, and requires the ready_video_frames_ queue not be
+ // empty.
+ void EnqueueFrameAndTriggerFrameDelivery(
+ const scoped_refptr<VideoFrame>& frame);
+
// Static method is to allow it to run even after GVD is deleted.
static void ReleaseMailbox(
base::WeakPtr<GpuVideoDecoder> decoder,
@@ -137,11 +141,9 @@
// occurs.
scoped_ptr<VideoDecodeAccelerator> vda_;
- OutputCB output_cb_;
-
- DecodeCB eos_decode_cb_;
-
- // Not null only during reset.
+ // Callbacks that are !is_null() only during their respective operation being
+ // asynchronously executed.
+ DecodeCB pending_decode_cb_;
base::Closure pending_reset_cb_;
State state_;
@@ -155,7 +157,7 @@
scoped_refptr<MediaLog> media_log_;
- std::map<int32, PendingDecoderBuffer> bitstream_buffers_in_decoder_;
+ std::map<int32, BufferPair> bitstream_buffers_in_decoder_;
PictureBufferMap assigned_picture_buffers_;
// PictureBuffers given to us by VDA via PictureReady, which we sent forward
// as VideoFrames to be rendered via decode_cb_, and which will be returned
@@ -180,6 +182,7 @@
// picture_buffer_id and the frame wrapping the corresponding Picture, for
// frames that have been decoded but haven't been requested by a Decode() yet.
+ std::list<scoped_refptr<VideoFrame> > ready_video_frames_;
int32 next_picture_buffer_id_;
int32 next_bitstream_buffer_id_;
« no previous file with comments | « media/filters/ffmpeg_video_decoder_unittest.cc ('k') | media/filters/gpu_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698