| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // empty. | 120 // empty. |
| 121 void EnqueueFrameAndTriggerFrameDelivery( | 121 void EnqueueFrameAndTriggerFrameDelivery( |
| 122 const scoped_refptr<VideoFrame>& frame); | 122 const scoped_refptr<VideoFrame>& frame); |
| 123 | 123 |
| 124 // Indicate the picturebuffer can be reused by the decoder. | 124 // Indicate the picturebuffer can be reused by the decoder. |
| 125 void ReusePictureBuffer(int64 picture_buffer_id); | 125 void ReusePictureBuffer(int64 picture_buffer_id); |
| 126 | 126 |
| 127 void RecordBufferData( | 127 void RecordBufferData( |
| 128 const BitstreamBuffer& bitstream_buffer, const Buffer& buffer); | 128 const BitstreamBuffer& bitstream_buffer, const Buffer& buffer); |
| 129 void GetBufferData(int32 id, base::TimeDelta* timetamp, | 129 void GetBufferData(int32 id, base::TimeDelta* timetamp, |
| 130 gfx::Size* natural_size); | 130 gfx::Rect* visible_rect, gfx::Size* natural_size); |
| 131 | 131 |
| 132 // Set |vda_| and |weak_vda_| on the VDA thread (in practice the render | 132 // Set |vda_| and |weak_vda_| on the VDA thread (in practice the render |
| 133 // thread). | 133 // thread). |
| 134 void SetVDA(VideoDecodeAccelerator* vda); | 134 void SetVDA(VideoDecodeAccelerator* vda); |
| 135 | 135 |
| 136 // Call VDA::Destroy() on |vda_loop_proxy_| ensuring that |this| outlives the | 136 // Call VDA::Destroy() on |vda_loop_proxy_| ensuring that |this| outlives the |
| 137 // Destroy() call. | 137 // Destroy() call. |
| 138 void DestroyVDA(); | 138 void DestroyVDA(); |
| 139 | 139 |
| 140 // A shared memory segment and its allocated size. | 140 // A shared memory segment and its allocated size. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 SHMBuffer* shm_buffer; | 201 SHMBuffer* shm_buffer; |
| 202 scoped_refptr<DecoderBuffer> buffer; | 202 scoped_refptr<DecoderBuffer> buffer; |
| 203 }; | 203 }; |
| 204 std::map<int32, BufferPair> bitstream_buffers_in_decoder_; | 204 std::map<int32, BufferPair> bitstream_buffers_in_decoder_; |
| 205 std::map<int32, PictureBuffer> picture_buffers_in_decoder_; | 205 std::map<int32, PictureBuffer> picture_buffers_in_decoder_; |
| 206 | 206 |
| 207 // The texture target used for decoded pictures. | 207 // The texture target used for decoded pictures. |
| 208 uint32 decoder_texture_target_; | 208 uint32 decoder_texture_target_; |
| 209 | 209 |
| 210 struct BufferData { | 210 struct BufferData { |
| 211 BufferData(int32 bbid, base::TimeDelta ts, | 211 BufferData(int32 bbid, base::TimeDelta ts, const gfx::Rect& visible_rect, |
| 212 const gfx::Size& natural_size); | 212 const gfx::Size& natural_size); |
| 213 ~BufferData(); | 213 ~BufferData(); |
| 214 int32 bitstream_buffer_id; | 214 int32 bitstream_buffer_id; |
| 215 base::TimeDelta timestamp; | 215 base::TimeDelta timestamp; |
| 216 gfx::Rect visible_rect; |
| 216 gfx::Size natural_size; | 217 gfx::Size natural_size; |
| 217 }; | 218 }; |
| 218 std::list<BufferData> input_buffer_data_; | 219 std::list<BufferData> input_buffer_data_; |
| 219 | 220 |
| 220 // picture_buffer_id and the frame wrapping the corresponding Picture, for | 221 // picture_buffer_id and the frame wrapping the corresponding Picture, for |
| 221 // frames that have been decoded but haven't been requested by a Read() yet. | 222 // frames that have been decoded but haven't been requested by a Read() yet. |
| 222 std::list<scoped_refptr<VideoFrame> > ready_video_frames_; | 223 std::list<scoped_refptr<VideoFrame> > ready_video_frames_; |
| 223 int64 next_picture_buffer_id_; | 224 int64 next_picture_buffer_id_; |
| 224 int64 next_bitstream_buffer_id_; | 225 int64 next_bitstream_buffer_id_; |
| 225 | 226 |
| 226 // Indicates decoding error occurred. | 227 // Indicates decoding error occurred. |
| 227 bool error_occured_; | 228 bool error_occured_; |
| 228 | 229 |
| 229 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); | 230 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); |
| 230 }; | 231 }; |
| 231 | 232 |
| 232 } // namespace media | 233 } // namespace media |
| 233 | 234 |
| 234 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ | 235 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ |
| OLD | NEW |