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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 // Must be called from inside the receive side critical section. | 364 // Must be called from inside the receive side critical section. |
365 int32_t VideoReceiver::Decode(const VCMEncodedFrame& frame) { | 365 int32_t VideoReceiver::Decode(const VCMEncodedFrame& frame) { |
366 TRACE_EVENT_ASYNC_STEP1("webrtc", | 366 TRACE_EVENT_ASYNC_STEP1("webrtc", |
367 "Video", | 367 "Video", |
368 frame.TimeStamp(), | 368 frame.TimeStamp(), |
369 "Decode", | 369 "Decode", |
370 "type", | 370 "type", |
371 frame.FrameType()); | 371 frame.FrameType()); |
372 // Change decoder if payload type has changed | 372 // Change decoder if payload type has changed |
373 const bool renderTimingBefore = _codecDataBase.SupportsRenderScheduling(); | 373 const bool renderTimingBefore = _codecDataBase.SupportsRenderScheduling(); |
374 _decoder = | 374 _decoder = _codecDataBase.GetDecoder(frame, &_decodedFrameCallback); |
375 _codecDataBase.GetDecoder(frame.PayloadType(), &_decodedFrameCallback); | |
376 if (renderTimingBefore != _codecDataBase.SupportsRenderScheduling()) { | 375 if (renderTimingBefore != _codecDataBase.SupportsRenderScheduling()) { |
377 // Make sure we reset the decode time estimate since it will | 376 // Make sure we reset the decode time estimate since it will |
378 // be zero for codecs without render timing. | 377 // be zero for codecs without render timing. |
379 _timing.ResetDecodeTime(); | 378 _timing.ResetDecodeTime(); |
380 } | 379 } |
381 if (_decoder == NULL) { | 380 if (_decoder == NULL) { |
382 return VCM_NO_CODEC_REGISTERED; | 381 return VCM_NO_CODEC_REGISTERED; |
383 } | 382 } |
384 // Decode a frame | 383 // Decode a frame |
385 int32_t ret = _decoder->Decode(frame, clock_->TimeInMilliseconds()); | 384 int32_t ret = _decoder->Decode(frame, clock_->TimeInMilliseconds()); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 } | 568 } |
570 | 569 |
571 void VideoReceiver::RegisterPreDecodeImageCallback( | 570 void VideoReceiver::RegisterPreDecodeImageCallback( |
572 EncodedImageCallback* observer) { | 571 EncodedImageCallback* observer) { |
573 CriticalSectionScoped cs(_receiveCritSect); | 572 CriticalSectionScoped cs(_receiveCritSect); |
574 pre_decode_image_callback_ = observer; | 573 pre_decode_image_callback_ = observer; |
575 } | 574 } |
576 | 575 |
577 } // namespace vcm | 576 } // namespace vcm |
578 } // namespace webrtc | 577 } // namespace webrtc |
OLD | NEW |