| 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 <set> | 10 #include <set> |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 public: | 40 public: |
| 41 // Helper interface for specifying factories needed to instantiate a | 41 // Helper interface for specifying factories needed to instantiate a |
| 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 uint32 CreateTextures(int32 count, const gfx::Size& size, |
| 51 std::vector<uint32>* texture_ids, | 51 std::vector<uint32>* texture_ids, |
| 52 uint32 texture_target) = 0; | 52 std::vector<gpu::Mailbox>* texture_mailboxes, |
| 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 void WaitSyncPoint(uint32 sync_point) = 0; |
| 57 |
| 55 // Read pixels from a native texture and store into |pixels| as RGBA. | 58 // Read pixels from a native texture and store into |pixels| as RGBA. |
| 56 virtual void ReadPixels(uint32 texture_id, uint32 texture_target, | 59 virtual void ReadPixels(uint32 texture_id, uint32 texture_target, |
| 57 const gfx::Size& size, const SkBitmap& pixels) = 0; | 60 const gfx::Size& size, const SkBitmap& pixels) = 0; |
| 58 | 61 |
| 59 // Allocate & return a shared memory segment. Caller is responsible for | 62 // Allocate & return a shared memory segment. Caller is responsible for |
| 60 // Close()ing the returned pointer. | 63 // Close()ing the returned pointer. |
| 61 virtual base::SharedMemory* CreateSharedMemory(size_t size) = 0; | 64 virtual base::SharedMemory* CreateSharedMemory(size_t size) = 0; |
| 62 | 65 |
| 63 // Returns the message loop the VideoDecodeAccelerator runs on. | 66 // Returns the message loop the VideoDecodeAccelerator runs on. |
| 64 virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() = 0; | 67 virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() = 0; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 128 |
| 126 // Enqueue a frame for later delivery (or drop it on the floor if a | 129 // 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 | 130 // 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| | 131 // 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 | 132 // merely triggers delivery, and requires the ready_video_frames_ queue not be |
| 130 // empty. | 133 // empty. |
| 131 void EnqueueFrameAndTriggerFrameDelivery( | 134 void EnqueueFrameAndTriggerFrameDelivery( |
| 132 const scoped_refptr<VideoFrame>& frame); | 135 const scoped_refptr<VideoFrame>& frame); |
| 133 | 136 |
| 134 // Indicate the picture buffer can be reused by the decoder. | 137 // Indicate the picture buffer can be reused by the decoder. |
| 135 void ReusePictureBuffer(int64 picture_buffer_id); | 138 void ReusePictureBuffer(int64 picture_buffer_id, uint32 sync_point); |
| 136 | 139 |
| 137 void RecordBufferData( | 140 void RecordBufferData( |
| 138 const BitstreamBuffer& bitstream_buffer, const DecoderBuffer& buffer); | 141 const BitstreamBuffer& bitstream_buffer, const DecoderBuffer& buffer); |
| 139 void GetBufferData(int32 id, base::TimeDelta* timetamp, | 142 void GetBufferData(int32 id, base::TimeDelta* timetamp, |
| 140 gfx::Rect* visible_rect, gfx::Size* natural_size); | 143 gfx::Rect* visible_rect, gfx::Size* natural_size); |
| 141 | 144 |
| 142 // Sets |vda_| and |weak_vda_| on the GVD thread and runs |status_cb|. | 145 // Sets |vda_| and |weak_vda_| on the GVD thread and runs |status_cb|. |
| 143 void SetVDA(const PipelineStatusCB& status_cb, | 146 void SetVDA(const PipelineStatusCB& status_cb, |
| 144 VideoDecodeAccelerator* vda, | 147 VideoDecodeAccelerator* vda, |
| 145 base::WeakPtr<VideoDecodeAccelerator> weak_vda); | 148 base::WeakPtr<VideoDecodeAccelerator> weak_vda); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 // Set during ProvidePictureBuffers(), used for checking and implementing | 251 // Set during ProvidePictureBuffers(), used for checking and implementing |
| 249 // HasAvailableOutputFrames(). | 252 // HasAvailableOutputFrames(). |
| 250 int available_pictures_; | 253 int available_pictures_; |
| 251 | 254 |
| 252 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); | 255 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); |
| 253 }; | 256 }; |
| 254 | 257 |
| 255 } // namespace media | 258 } // namespace media |
| 256 | 259 |
| 257 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ | 260 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ |
| OLD | NEW |