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