OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ |
6 #define CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ | 6 #define CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 void RecordBufferData(const BufferData& buffer_data); | 170 void RecordBufferData(const BufferData& buffer_data); |
171 // Gets the buffer metadata from |input_buffer_data_|. | 171 // Gets the buffer metadata from |input_buffer_data_|. |
172 void GetBufferData(int32 bitstream_buffer_id, uint32_t* timestamp); | 172 void GetBufferData(int32 bitstream_buffer_id, uint32_t* timestamp); |
173 | 173 |
174 // Records the result of InitDecode to UMA and returns |status|. | 174 // Records the result of InitDecode to UMA and returns |status|. |
175 int32_t RecordInitDecodeUMA(int32_t status); | 175 int32_t RecordInitDecodeUMA(int32_t status); |
176 | 176 |
177 // Assert the contract that this class is operated on the right thread. | 177 // Assert the contract that this class is operated on the right thread. |
178 void DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() const; | 178 void DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() const; |
179 | 179 |
| 180 // Query factories_ whether |profile| is supported and return true is so, |
| 181 // false otherwise. If true, also set resolution limits for |profile| |
| 182 // in min/max_resolution_. |
| 183 bool IsProfileSupported(media::VideoCodecProfile profile); |
| 184 |
180 enum State { | 185 enum State { |
181 UNINITIALIZED, // The decoder has not initialized. | 186 UNINITIALIZED, // The decoder has not initialized. |
182 INITIALIZED, // The decoder has initialized. | 187 INITIALIZED, // The decoder has initialized. |
183 RESETTING, // The decoder is being reset. | 188 RESETTING, // The decoder is being reset. |
184 DECODE_ERROR, // Decoding error happened. | 189 DECODE_ERROR, // Decoding error happened. |
185 }; | 190 }; |
186 | 191 |
187 static const int32 ID_LAST; // maximum bitstream buffer id | 192 static const int32 ID_LAST; // maximum bitstream buffer id |
188 static const int32 ID_HALF; // half of the maximum bitstream buffer id | 193 static const int32 ID_HALF; // half of the maximum bitstream buffer id |
189 static const int32 ID_INVALID; // indicates Reset or Release never occurred | 194 static const int32 ID_INVALID; // indicates Reset or Release never occurred |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 // decode. The queue owns SHM buffers. Guarded by |lock_|. | 255 // decode. The queue owns SHM buffers. Guarded by |lock_|. |
251 std::deque<std::pair<SHMBuffer*, BufferData> > decode_buffers_; | 256 std::deque<std::pair<SHMBuffer*, BufferData> > decode_buffers_; |
252 | 257 |
253 // The id that will be given to the next bitstream buffer. Guarded by |lock_|. | 258 // The id that will be given to the next bitstream buffer. Guarded by |lock_|. |
254 int32 next_bitstream_buffer_id_; | 259 int32 next_bitstream_buffer_id_; |
255 | 260 |
256 // A buffer that has an id less than this should be dropped because Reset or | 261 // A buffer that has an id less than this should be dropped because Reset or |
257 // Release has been called. Guarded by |lock_|. | 262 // Release has been called. Guarded by |lock_|. |
258 int32 reset_bitstream_buffer_id_; | 263 int32 reset_bitstream_buffer_id_; |
259 | 264 |
| 265 // Minimum and maximum supported resolutions for the current profile/VDA. |
| 266 gfx::Size min_resolution_; |
| 267 gfx::Size max_resolution_; |
| 268 |
260 // Must be destroyed, or invalidated, on |vda_loop_proxy_| | 269 // Must be destroyed, or invalidated, on |vda_loop_proxy_| |
261 // NOTE: Weak pointers must be invalidated before all other member variables. | 270 // NOTE: Weak pointers must be invalidated before all other member variables. |
262 base::WeakPtrFactory<RTCVideoDecoder> weak_factory_; | 271 base::WeakPtrFactory<RTCVideoDecoder> weak_factory_; |
263 | 272 |
264 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoder); | 273 DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoder); |
265 }; | 274 }; |
266 | 275 |
267 } // namespace content | 276 } // namespace content |
268 | 277 |
269 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ | 278 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_DECODER_H_ |
OLD | NEW |