OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 | 230 |
231 int32_t VideoReceiver::RegisterDecoderTimingCallback( | 231 int32_t VideoReceiver::RegisterDecoderTimingCallback( |
232 VCMDecoderTimingCallback* decoderTiming) { | 232 VCMDecoderTimingCallback* decoderTiming) { |
233 CriticalSectionScoped cs(process_crit_sect_.get()); | 233 CriticalSectionScoped cs(process_crit_sect_.get()); |
234 _decoderTimingCallback = decoderTiming; | 234 _decoderTimingCallback = decoderTiming; |
235 return VCM_OK; | 235 return VCM_OK; |
236 } | 236 } |
237 | 237 |
238 // Register an externally defined decoder/render object. | 238 // Register an externally defined decoder/render object. |
239 // Can be a decoder only or a decoder coupled with a renderer. | 239 // Can be a decoder only or a decoder coupled with a renderer. |
240 int32_t VideoReceiver::RegisterExternalDecoder(VideoDecoder* externalDecoder, | 240 void VideoReceiver::RegisterExternalDecoder(VideoDecoder* externalDecoder, |
241 uint8_t payloadType, | 241 uint8_t payloadType, |
242 bool internalRenderTiming) { | 242 bool internalRenderTiming) { |
243 CriticalSectionScoped cs(_receiveCritSect); | 243 CriticalSectionScoped cs(_receiveCritSect); |
244 if (externalDecoder == NULL) { | 244 if (externalDecoder == NULL) { |
245 // Make sure the VCM updates the decoder next time it decodes. | 245 // Make sure the VCM updates the decoder next time it decodes. |
246 _decoder = NULL; | 246 _decoder = NULL; |
247 return _codecDataBase.DeregisterExternalDecoder(payloadType) ? 0 : -1; | 247 RTC_CHECK(_codecDataBase.DeregisterExternalDecoder(payloadType)); |
248 } | 248 } |
249 return _codecDataBase.RegisterExternalDecoder( | 249 _codecDataBase.RegisterExternalDecoder(externalDecoder, payloadType, |
250 externalDecoder, payloadType, internalRenderTiming) | 250 internalRenderTiming); |
251 ? 0 | |
252 : -1; | |
253 } | 251 } |
254 | 252 |
255 // Register a frame type request callback. | 253 // Register a frame type request callback. |
256 int32_t VideoReceiver::RegisterFrameTypeCallback( | 254 int32_t VideoReceiver::RegisterFrameTypeCallback( |
257 VCMFrameTypeCallback* frameTypeCallback) { | 255 VCMFrameTypeCallback* frameTypeCallback) { |
258 CriticalSectionScoped cs(process_crit_sect_.get()); | 256 CriticalSectionScoped cs(process_crit_sect_.get()); |
259 _frameTypeCallback = frameTypeCallback; | 257 _frameTypeCallback = frameTypeCallback; |
260 return VCM_OK; | 258 return VCM_OK; |
261 } | 259 } |
262 | 260 |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 } | 567 } |
570 | 568 |
571 void VideoReceiver::RegisterPreDecodeImageCallback( | 569 void VideoReceiver::RegisterPreDecodeImageCallback( |
572 EncodedImageCallback* observer) { | 570 EncodedImageCallback* observer) { |
573 CriticalSectionScoped cs(_receiveCritSect); | 571 CriticalSectionScoped cs(_receiveCritSect); |
574 pre_decode_image_callback_ = observer; | 572 pre_decode_image_callback_ = observer; |
575 } | 573 } |
576 | 574 |
577 } // namespace vcm | 575 } // namespace vcm |
578 } // namespace webrtc | 576 } // namespace webrtc |
OLD | NEW |