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 30 matching lines...) Expand all Loading... |
41 // GpuVideoDecoder. | 41 // GpuVideoDecoder. |
42 class MEDIA_EXPORT Factories : public base::RefCountedThreadSafe<Factories> { | 42 class MEDIA_EXPORT Factories : public base::RefCountedThreadSafe<Factories> { |
43 public: | 43 public: |
44 // Caller owns returned pointer. | 44 // Caller owns returned pointer. |
45 virtual VideoDecodeAccelerator* CreateVideoDecodeAccelerator( | 45 virtual VideoDecodeAccelerator* CreateVideoDecodeAccelerator( |
46 VideoCodecProfile, VideoDecodeAccelerator::Client*) = 0; | 46 VideoCodecProfile, VideoDecodeAccelerator::Client*) = 0; |
47 | 47 |
48 // Allocate & delete native textures. | 48 // Allocate & delete native textures. |
49 virtual bool CreateTextures(int32 count, const gfx::Size& size, | 49 virtual bool CreateTextures(int32 count, const gfx::Size& size, |
50 std::vector<uint32>* texture_ids, | 50 std::vector<uint32>* texture_ids, |
| 51 std::vector<gpu::Mailbox>* texture_mailboxes, |
51 uint32 texture_target) = 0; | 52 uint32 texture_target) = 0; |
52 virtual void DeleteTexture(uint32 texture_id) = 0; | 53 virtual void DeleteTexture(uint32 texture_id) = 0; |
53 | 54 |
| 55 virtual uint32 ProduceTextureToMailbox(const gpu::Mailbox& mailbox, |
| 56 uint32 texture_id, |
| 57 uint32 texture_target) = 0; |
| 58 virtual void ConsumeMailboxToTexture(const gpu::Mailbox& mailbox, |
| 59 uint32 texture_id, |
| 60 uint32 texture_target, |
| 61 uint32 sync_point) = 0; |
| 62 |
54 // 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. |
55 virtual void ReadPixels(uint32 texture_id, uint32 texture_target, | 64 virtual void ReadPixels(uint32 texture_id, uint32 texture_target, |
56 const gfx::Size& size, const SkBitmap& pixels) = 0; | 65 const gfx::Size& size, const SkBitmap& pixels) = 0; |
57 | 66 |
58 // Allocate & return a shared memory segment. Caller is responsible for | 67 // Allocate & return a shared memory segment. Caller is responsible for |
59 // Close()ing the returned pointer. | 68 // Close()ing the returned pointer. |
60 virtual base::SharedMemory* CreateSharedMemory(size_t size) = 0; | 69 virtual base::SharedMemory* CreateSharedMemory(size_t size) = 0; |
61 | 70 |
62 // Returns the message loop the VideoDecodeAccelerator runs on. | 71 // Returns the message loop the VideoDecodeAccelerator runs on. |
63 virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() = 0; | 72 virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() = 0; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 131 |
123 // Enqueue a frame for later delivery (or drop it on the floor if a | 132 // Enqueue a frame for later delivery (or drop it on the floor if a |
124 // vda->Reset() is in progress) and trigger out-of-line delivery of the oldest | 133 // vda->Reset() is in progress) and trigger out-of-line delivery of the oldest |
125 // ready frame to the client if there is a pending read. A NULL |frame| | 134 // ready frame to the client if there is a pending read. A NULL |frame| |
126 // merely triggers delivery, and requires the ready_video_frames_ queue not be | 135 // merely triggers delivery, and requires the ready_video_frames_ queue not be |
127 // empty. | 136 // empty. |
128 void EnqueueFrameAndTriggerFrameDelivery( | 137 void EnqueueFrameAndTriggerFrameDelivery( |
129 const scoped_refptr<VideoFrame>& frame); | 138 const scoped_refptr<VideoFrame>& frame); |
130 | 139 |
131 // Indicate the picture buffer can be reused by the decoder. | 140 // Indicate the picture buffer can be reused by the decoder. |
132 void ReusePictureBuffer(int64 picture_buffer_id); | 141 void ReusePictureBuffer(int64 picture_buffer_id, uint32 sync_point); |
133 | 142 |
134 void RecordBufferData( | 143 void RecordBufferData( |
135 const BitstreamBuffer& bitstream_buffer, const DecoderBuffer& buffer); | 144 const BitstreamBuffer& bitstream_buffer, const DecoderBuffer& buffer); |
136 void GetBufferData(int32 id, base::TimeDelta* timetamp, | 145 void GetBufferData(int32 id, base::TimeDelta* timetamp, |
137 gfx::Rect* visible_rect, gfx::Size* natural_size); | 146 gfx::Rect* visible_rect, gfx::Size* natural_size); |
138 | 147 |
139 // Sets |vda_| and |weak_vda_| on the GVD thread and runs |status_cb|. | 148 // Sets |vda_| and |weak_vda_| on the GVD thread and runs |status_cb|. |
140 void SetVDA(const PipelineStatusCB& status_cb, | 149 void SetVDA(const PipelineStatusCB& status_cb, |
141 VideoDecodeAccelerator* vda, | 150 VideoDecodeAccelerator* vda, |
142 base::WeakPtr<VideoDecodeAccelerator> weak_vda); | 151 base::WeakPtr<VideoDecodeAccelerator> weak_vda); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 // Set during ProvidePictureBuffers(), used for checking and implementing | 250 // Set during ProvidePictureBuffers(), used for checking and implementing |
242 // HasAvailableOutputFrames(). | 251 // HasAvailableOutputFrames(). |
243 int available_pictures_; | 252 int available_pictures_; |
244 | 253 |
245 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); | 254 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); |
246 }; | 255 }; |
247 | 256 |
248 } // namespace media | 257 } // namespace media |
249 | 258 |
250 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ | 259 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ |
OLD | NEW |