OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 void RegisterPreDecodeImageCallback(EncodedImageCallback* observer); | 199 void RegisterPreDecodeImageCallback(EncodedImageCallback* observer); |
200 void TriggerDecoderShutdown(); | 200 void TriggerDecoderShutdown(); |
201 | 201 |
202 protected: | 202 protected: |
203 int32_t Decode(const webrtc::VCMEncodedFrame& frame) | 203 int32_t Decode(const webrtc::VCMEncodedFrame& frame) |
204 EXCLUSIVE_LOCKS_REQUIRED(_receiveCritSect); | 204 EXCLUSIVE_LOCKS_REQUIRED(_receiveCritSect); |
205 int32_t RequestKeyFrame(); | 205 int32_t RequestKeyFrame(); |
206 int32_t RequestSliceLossIndication(const uint64_t pictureID) const; | 206 int32_t RequestSliceLossIndication(const uint64_t pictureID) const; |
207 | 207 |
208 private: | 208 private: |
209 enum VCMKeyRequestMode { | |
210 kKeyOnError, // Normal mode, request key frames on decoder error | |
211 kKeyOnKeyLoss, // Request key frames on decoder error and on packet loss | |
212 // in key frames. | |
213 kKeyOnLoss, // Request key frames on decoder error and on packet loss | |
214 // in any frame | |
215 }; | |
216 | |
217 Clock* const clock_; | 209 Clock* const clock_; |
218 rtc::scoped_ptr<CriticalSectionWrapper> process_crit_sect_; | 210 rtc::scoped_ptr<CriticalSectionWrapper> process_crit_sect_; |
219 CriticalSectionWrapper* _receiveCritSect; | 211 CriticalSectionWrapper* _receiveCritSect; |
220 VCMTiming _timing; | 212 VCMTiming _timing; |
221 VCMReceiver _receiver; | 213 VCMReceiver _receiver; |
222 VCMDecodedFrameCallback _decodedFrameCallback; | 214 VCMDecodedFrameCallback _decodedFrameCallback; |
223 VCMFrameTypeCallback* _frameTypeCallback GUARDED_BY(process_crit_sect_); | 215 VCMFrameTypeCallback* _frameTypeCallback GUARDED_BY(process_crit_sect_); |
224 VCMReceiveStatisticsCallback* _receiveStatsCallback | 216 VCMReceiveStatisticsCallback* _receiveStatsCallback |
225 GUARDED_BY(process_crit_sect_); | 217 GUARDED_BY(process_crit_sect_); |
226 VCMDecoderTimingCallback* _decoderTimingCallback | 218 VCMDecoderTimingCallback* _decoderTimingCallback |
227 GUARDED_BY(process_crit_sect_); | 219 GUARDED_BY(process_crit_sect_); |
228 VCMPacketRequestCallback* _packetRequestCallback | 220 VCMPacketRequestCallback* _packetRequestCallback |
229 GUARDED_BY(process_crit_sect_); | 221 GUARDED_BY(process_crit_sect_); |
230 VCMRenderBufferSizeCallback* render_buffer_callback_ | 222 VCMRenderBufferSizeCallback* render_buffer_callback_ |
231 GUARDED_BY(process_crit_sect_); | 223 GUARDED_BY(process_crit_sect_); |
232 VCMGenericDecoder* _decoder; | 224 VCMGenericDecoder* _decoder; |
233 #ifdef DEBUG_DECODER_BIT_STREAM | 225 #ifdef DEBUG_DECODER_BIT_STREAM |
234 FILE* _bitStreamBeforeDecoder; | 226 FILE* _bitStreamBeforeDecoder; |
235 #endif | 227 #endif |
236 VCMFrameBuffer _frameFromFile; | 228 VCMFrameBuffer _frameFromFile; |
237 VCMKeyRequestMode _keyRequestMode; | |
238 bool _scheduleKeyRequest GUARDED_BY(process_crit_sect_); | 229 bool _scheduleKeyRequest GUARDED_BY(process_crit_sect_); |
239 size_t max_nack_list_size_ GUARDED_BY(process_crit_sect_); | 230 size_t max_nack_list_size_ GUARDED_BY(process_crit_sect_); |
240 EncodedImageCallback* pre_decode_image_callback_ GUARDED_BY(_receiveCritSect); | 231 EncodedImageCallback* pre_decode_image_callback_ GUARDED_BY(_receiveCritSect); |
241 | 232 |
242 VCMCodecDataBase _codecDataBase GUARDED_BY(_receiveCritSect); | 233 VCMCodecDataBase _codecDataBase GUARDED_BY(_receiveCritSect); |
243 VCMProcessTimer _receiveStatsTimer; | 234 VCMProcessTimer _receiveStatsTimer; |
244 VCMProcessTimer _retransmissionTimer; | 235 VCMProcessTimer _retransmissionTimer; |
245 VCMProcessTimer _keyRequestTimer; | 236 VCMProcessTimer _keyRequestTimer; |
246 }; | 237 }; |
247 | 238 |
248 } // namespace vcm | 239 } // namespace vcm |
249 } // namespace webrtc | 240 } // namespace webrtc |
250 #endif // WEBRTC_MODULES_VIDEO_CODING_VIDEO_CODING_IMPL_H_ | 241 #endif // WEBRTC_MODULES_VIDEO_CODING_VIDEO_CODING_IMPL_H_ |
OLD | NEW |