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

Side by Side Diff: media/filters/gpu_video_decoder.h

Issue 14199002: Send hardware video frames with mailboxes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: video-mailbox: remove extra produce in webmediaplayer_impl Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ 5 #ifndef MEDIA_FILTERS_GPU_VIDEO_DECODER_H_
6 #define MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ 6 #define MEDIA_FILTERS_GPU_VIDEO_DECODER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // GpuVideoDecoder. 42 // GpuVideoDecoder.
43 class MEDIA_EXPORT Factories : public base::RefCountedThreadSafe<Factories> { 43 class MEDIA_EXPORT Factories : public base::RefCountedThreadSafe<Factories> {
44 public: 44 public:
45 // Caller owns returned pointer. 45 // Caller owns returned pointer.
46 virtual VideoDecodeAccelerator* CreateVideoDecodeAccelerator( 46 virtual VideoDecodeAccelerator* CreateVideoDecodeAccelerator(
47 VideoCodecProfile, VideoDecodeAccelerator::Client*) = 0; 47 VideoCodecProfile, VideoDecodeAccelerator::Client*) = 0;
48 48
49 // Allocate & delete native textures. 49 // Allocate & delete native textures.
50 virtual bool CreateTextures(int32 count, const gfx::Size& size, 50 virtual bool CreateTextures(int32 count, const gfx::Size& size,
51 std::vector<uint32>* texture_ids, 51 std::vector<uint32>* texture_ids,
52 std::vector<gpu::Mailbox>* texture_mailboxes,
52 uint32 texture_target) = 0; 53 uint32 texture_target) = 0;
53 virtual void DeleteTexture(uint32 texture_id) = 0; 54 virtual void DeleteTexture(uint32 texture_id) = 0;
54 55
56 virtual uint32 ProduceTexturesToMailboxes(
57 const std::vector<gpu::Mailbox>& mailboxes,
58 const std::vector<uint32>& texture_ids,
59 uint32 texture_target) = 0;
60
61 virtual void WaitSyncPoint(uint32 sync_point) = 0;
62
55 // Read pixels from a native texture and store into |pixels| as RGBA. 63 // Read pixels from a native texture and store into |pixels| as RGBA.
56 virtual void ReadPixels(uint32 texture_id, uint32 texture_target, 64 virtual void ReadPixels(uint32 texture_id, uint32 texture_target,
57 const gfx::Size& size, const SkBitmap& pixels) = 0; 65 const gfx::Size& size, const SkBitmap& pixels) = 0;
58 66
59 // Allocate & return a shared memory segment. Caller is responsible for 67 // Allocate & return a shared memory segment. Caller is responsible for
60 // Close()ing the returned pointer. 68 // Close()ing the returned pointer.
61 virtual base::SharedMemory* CreateSharedMemory(size_t size) = 0; 69 virtual base::SharedMemory* CreateSharedMemory(size_t size) = 0;
62 70
63 // Returns the message loop the VideoDecodeAccelerator runs on. 71 // Returns the message loop the VideoDecodeAccelerator runs on.
64 virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() = 0; 72 virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() = 0;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 133
126 // Enqueue a frame for later delivery (or drop it on the floor if a 134 // Enqueue a frame for later delivery (or drop it on the floor if a
127 // vda->Reset() is in progress) and trigger out-of-line delivery of the oldest 135 // vda->Reset() is in progress) and trigger out-of-line delivery of the oldest
128 // ready frame to the client if there is a pending read. A NULL |frame| 136 // ready frame to the client if there is a pending read. A NULL |frame|
129 // merely triggers delivery, and requires the ready_video_frames_ queue not be 137 // merely triggers delivery, and requires the ready_video_frames_ queue not be
130 // empty. 138 // empty.
131 void EnqueueFrameAndTriggerFrameDelivery( 139 void EnqueueFrameAndTriggerFrameDelivery(
132 const scoped_refptr<VideoFrame>& frame); 140 const scoped_refptr<VideoFrame>& frame);
133 141
134 // Indicate the picture buffer can be reused by the decoder. 142 // Indicate the picture buffer can be reused by the decoder.
135 void ReusePictureBuffer(int64 picture_buffer_id); 143 void ReusePictureBuffer(int64 picture_buffer_id, uint32 sync_point);
136 144
137 void RecordBufferData( 145 void RecordBufferData(
138 const BitstreamBuffer& bitstream_buffer, const DecoderBuffer& buffer); 146 const BitstreamBuffer& bitstream_buffer, const DecoderBuffer& buffer);
139 void GetBufferData(int32 id, base::TimeDelta* timetamp, 147 void GetBufferData(int32 id, base::TimeDelta* timetamp,
140 gfx::Rect* visible_rect, gfx::Size* natural_size); 148 gfx::Rect* visible_rect, gfx::Size* natural_size);
141 149
142 // Sets |vda_| and |weak_vda_| on the GVD thread and runs |status_cb|. 150 // Sets |vda_| and |weak_vda_| on the GVD thread and runs |status_cb|.
143 void SetVDA(const PipelineStatusCB& status_cb, 151 void SetVDA(const PipelineStatusCB& status_cb,
144 VideoDecodeAccelerator* vda, 152 VideoDecodeAccelerator* vda,
145 base::WeakPtr<VideoDecodeAccelerator> weak_vda); 153 base::WeakPtr<VideoDecodeAccelerator> weak_vda);
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 // Set during ProvidePictureBuffers(), used for checking and implementing 256 // Set during ProvidePictureBuffers(), used for checking and implementing
249 // HasAvailableOutputFrames(). 257 // HasAvailableOutputFrames().
250 int available_pictures_; 258 int available_pictures_;
251 259
252 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); 260 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder);
253 }; 261 };
254 262
255 } // namespace media 263 } // namespace media
256 264
257 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ 265 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698