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