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

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: Created 7 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 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 <utility> 10 #include <utility>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // Caller owns returned pointer. 42 // Caller owns returned pointer.
43 virtual VideoDecodeAccelerator* CreateVideoDecodeAccelerator( 43 virtual VideoDecodeAccelerator* CreateVideoDecodeAccelerator(
44 VideoCodecProfile, VideoDecodeAccelerator::Client*) = 0; 44 VideoCodecProfile, VideoDecodeAccelerator::Client*) = 0;
45 45
46 // Allocate & delete native textures. 46 // Allocate & delete native textures.
47 virtual bool CreateTextures(int32 count, const gfx::Size& size, 47 virtual bool CreateTextures(int32 count, const gfx::Size& size,
48 std::vector<uint32>* texture_ids, 48 std::vector<uint32>* texture_ids,
49 uint32 texture_target) = 0; 49 uint32 texture_target) = 0;
50 virtual void DeleteTexture(uint32 texture_id) = 0; 50 virtual void DeleteTexture(uint32 texture_id) = 0;
51 51
52 virtual gpu::Mailbox ProduceTextureToMailbox(uint32 texture_id) = 0;
53 virtual void ConsumeMailboxToTexture(const gpu::Mailbox& mailbox,
54 uint32 texture_id) = 0;
55
52 // Read pixels from a native texture and store into |pixels| as RGBA. 56 // Read pixels from a native texture and store into |pixels| as RGBA.
53 virtual void ReadPixels(uint32 texture_id, uint32 texture_target, 57 virtual void ReadPixels(uint32 texture_id, uint32 texture_target,
54 const gfx::Size& size, const SkBitmap& pixels) = 0; 58 const gfx::Size& size, const SkBitmap& pixels) = 0;
55 59
56 // Allocate & return a shared memory segment. Caller is responsible for 60 // Allocate & return a shared memory segment. Caller is responsible for
57 // Close()ing the returned pointer. 61 // Close()ing the returned pointer.
58 virtual base::SharedMemory* CreateSharedMemory(size_t size) = 0; 62 virtual base::SharedMemory* CreateSharedMemory(size_t size) = 0;
59 63
60 // Returns the message loop the VideoDecodeAccelerator runs on. 64 // Returns the message loop the VideoDecodeAccelerator runs on.
61 virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() = 0; 65 virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() = 0;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 129
126 // Enqueue a frame for later delivery (or drop it on the floor if a 130 // 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 131 // 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| 132 // 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 133 // merely triggers delivery, and requires the ready_video_frames_ queue not be
130 // empty. 134 // empty.
131 void EnqueueFrameAndTriggerFrameDelivery( 135 void EnqueueFrameAndTriggerFrameDelivery(
132 const scoped_refptr<VideoFrame>& frame); 136 const scoped_refptr<VideoFrame>& frame);
133 137
134 // Indicate the picturebuffer can be reused by the decoder. 138 // Indicate the picturebuffer can be reused by the decoder.
135 void ReusePictureBuffer(int64 picture_buffer_id); 139 void ReusePictureBuffer(int64 picture_buffer_id, gpu::Mailbox mailbox);
136 140
137 void RecordBufferData( 141 void RecordBufferData(
138 const BitstreamBuffer& bitstream_buffer, const DecoderBuffer& buffer); 142 const BitstreamBuffer& bitstream_buffer, const DecoderBuffer& buffer);
139 void GetBufferData(int32 id, base::TimeDelta* timetamp, 143 void GetBufferData(int32 id, base::TimeDelta* timetamp,
140 gfx::Rect* visible_rect, gfx::Size* natural_size); 144 gfx::Rect* visible_rect, gfx::Size* natural_size);
141 145
142 // Set |vda_| and |weak_vda_| on the VDA thread (in practice the render 146 // Set |vda_| and |weak_vda_| on the VDA thread (in practice the render
143 // thread). 147 // thread).
144 void SetVDA(VideoDecodeAccelerator* vda); 148 void SetVDA(VideoDecodeAccelerator* vda);
145 149
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 // Set during ProvidePictureBuffers(), used for checking and implementing 241 // Set during ProvidePictureBuffers(), used for checking and implementing
238 // HasAvailableOutputFrames(). 242 // HasAvailableOutputFrames().
239 int available_pictures_; 243 int available_pictures_;
240 244
241 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); 245 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder);
242 }; 246 };
243 247
244 } // namespace media 248 } // namespace media
245 249
246 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ 250 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698