| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 base::WeakPtr<GpuVideoDecoder> decoder, | 103 base::WeakPtr<GpuVideoDecoder> decoder, |
| 104 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories, | 104 const scoped_refptr<media::GpuVideoAcceleratorFactories>& factories, |
| 105 int64 picture_buffer_id, | 105 int64 picture_buffer_id, |
| 106 uint32 texture_id, | 106 uint32 texture_id, |
| 107 uint32 release_sync_point); | 107 uint32 release_sync_point); |
| 108 // Indicate the picture buffer can be reused by the decoder. | 108 // Indicate the picture buffer can be reused by the decoder. |
| 109 void ReusePictureBuffer(int64 picture_buffer_id); | 109 void ReusePictureBuffer(int64 picture_buffer_id); |
| 110 | 110 |
| 111 void RecordBufferData( | 111 void RecordBufferData( |
| 112 const BitstreamBuffer& bitstream_buffer, const DecoderBuffer& buffer); | 112 const BitstreamBuffer& bitstream_buffer, const DecoderBuffer& buffer); |
| 113 void GetBufferData(int32 id, base::TimeDelta* timetamp, | 113 void GetBufferData(int32 id, base::TimeDelta* timetamp); |
| 114 gfx::Rect* visible_rect, gfx::Size* natural_size); | |
| 115 | 114 |
| 116 void DestroyVDA(); | 115 void DestroyVDA(); |
| 117 | 116 |
| 118 // Request a shared-memory segment of at least |min_size| bytes. Will | 117 // Request a shared-memory segment of at least |min_size| bytes. Will |
| 119 // allocate as necessary. Caller does not own returned pointer. | 118 // allocate as necessary. Caller does not own returned pointer. |
| 120 SHMBuffer* GetSHM(size_t min_size); | 119 SHMBuffer* GetSHM(size_t min_size); |
| 121 | 120 |
| 122 // Return a shared-memory segment to the available pool. | 121 // Return a shared-memory segment to the available pool. |
| 123 void PutSHM(SHMBuffer* shm_buffer); | 122 void PutSHM(SHMBuffer* shm_buffer); |
| 124 | 123 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 // as VideoFrames to be rendered via decode_cb_, and which will be returned | 159 // as VideoFrames to be rendered via decode_cb_, and which will be returned |
| 161 // to us via ReusePictureBuffer. | 160 // to us via ReusePictureBuffer. |
| 162 typedef std::map<int32 /* picture_buffer_id */, uint32 /* texture_id */> | 161 typedef std::map<int32 /* picture_buffer_id */, uint32 /* texture_id */> |
| 163 PictureBufferTextureMap; | 162 PictureBufferTextureMap; |
| 164 PictureBufferTextureMap picture_buffers_at_display_; | 163 PictureBufferTextureMap picture_buffers_at_display_; |
| 165 | 164 |
| 166 // The texture target used for decoded pictures. | 165 // The texture target used for decoded pictures. |
| 167 uint32 decoder_texture_target_; | 166 uint32 decoder_texture_target_; |
| 168 | 167 |
| 169 struct BufferData { | 168 struct BufferData { |
| 170 BufferData(int32 bbid, base::TimeDelta ts, const gfx::Rect& visible_rect, | 169 BufferData(int32 bbid, base::TimeDelta ts); |
| 171 const gfx::Size& natural_size); | |
| 172 ~BufferData(); | 170 ~BufferData(); |
| 173 int32 bitstream_buffer_id; | 171 int32 bitstream_buffer_id; |
| 174 base::TimeDelta timestamp; | 172 base::TimeDelta timestamp; |
| 175 gfx::Rect visible_rect; | |
| 176 gfx::Size natural_size; | |
| 177 }; | 173 }; |
| 178 std::list<BufferData> input_buffer_data_; | 174 std::list<BufferData> input_buffer_data_; |
| 179 | 175 |
| 180 // picture_buffer_id and the frame wrapping the corresponding Picture, for | 176 // picture_buffer_id and the frame wrapping the corresponding Picture, for |
| 181 // frames that have been decoded but haven't been requested by a Decode() yet. | 177 // frames that have been decoded but haven't been requested by a Decode() yet. |
| 182 int32 next_picture_buffer_id_; | 178 int32 next_picture_buffer_id_; |
| 183 int32 next_bitstream_buffer_id_; | 179 int32 next_bitstream_buffer_id_; |
| 184 | 180 |
| 185 // Set during ProvidePictureBuffers(), used for checking and implementing | 181 // Set during ProvidePictureBuffers(), used for checking and implementing |
| 186 // HasAvailableOutputFrames(). | 182 // HasAvailableOutputFrames(). |
| 187 int available_pictures_; | 183 int available_pictures_; |
| 188 | 184 |
| 189 // Bound to factories_->GetMessageLoop(). | 185 // Bound to factories_->GetMessageLoop(). |
| 190 // NOTE: Weak pointers must be invalidated before all other member variables. | 186 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 191 base::WeakPtrFactory<GpuVideoDecoder> weak_factory_; | 187 base::WeakPtrFactory<GpuVideoDecoder> weak_factory_; |
| 192 | 188 |
| 193 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); | 189 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); |
| 194 }; | 190 }; |
| 195 | 191 |
| 196 } // namespace media | 192 } // namespace media |
| 197 | 193 |
| 198 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ | 194 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ |
| OLD | NEW |