| 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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 // function itself, another in GetChannel() and a third in | 408 // function itself, another in GetChannel() and a third in |
| 409 // GetPlayoutTimestamp. Seems excessive. Anyhow, I'm assuming the function | 409 // GetPlayoutTimestamp. Seems excessive. Anyhow, I'm assuming the function |
| 410 // succeeds most of the time, which leads to grabbing a fourth lock. | 410 // succeeds most of the time, which leads to grabbing a fourth lock. |
| 411 if (rtp_stream_sync_.GetStreamSyncOffsetInMs(video_frame.timestamp(), | 411 if (rtp_stream_sync_.GetStreamSyncOffsetInMs(video_frame.timestamp(), |
| 412 video_frame.render_time_ms(), | 412 video_frame.render_time_ms(), |
| 413 &sync_offset_ms, | 413 &sync_offset_ms, |
| 414 &estimated_freq_khz)) { | 414 &estimated_freq_khz)) { |
| 415 // TODO(tommi): OnSyncOffsetUpdated grabs a lock. | 415 // TODO(tommi): OnSyncOffsetUpdated grabs a lock. |
| 416 stats_proxy_.OnSyncOffsetUpdated(sync_offset_ms, estimated_freq_khz); | 416 stats_proxy_.OnSyncOffsetUpdated(sync_offset_ms, estimated_freq_khz); |
| 417 } | 417 } |
| 418 | |
| 419 // config_.renderer must never be null if we're getting this callback. | 418 // config_.renderer must never be null if we're getting this callback. |
| 420 config_.renderer->OnFrame(video_frame); | 419 config_.renderer->OnFrame(video_frame); |
| 421 | 420 |
| 422 // TODO(tommi): OnRenderFrame grabs a lock too. | 421 // TODO(tommi): OnRenderFrame grabs a lock too. |
| 423 stats_proxy_.OnRenderedFrame(video_frame); | 422 stats_proxy_.OnRenderedFrame(video_frame); |
| 424 } | 423 } |
| 425 | 424 |
| 426 // TODO(asapersson): Consider moving callback from video_encoder.h or | 425 // TODO(asapersson): Consider moving callback from video_encoder.h or |
| 427 // creating a different callback. | 426 // creating a different callback. |
| 428 EncodedImageCallback::Result VideoReceiveStream::OnEncodedImage( | 427 EncodedImageCallback::Result VideoReceiveStream::OnEncodedImage( |
| 429 const EncodedImage& encoded_image, | 428 const EncodedImage& encoded_image, |
| 430 const CodecSpecificInfo* codec_specific_info, | 429 const CodecSpecificInfo* codec_specific_info, |
| 431 const RTPFragmentationHeader* fragmentation) { | 430 const RTPFragmentationHeader* fragmentation) { |
| 432 stats_proxy_.OnPreDecode(encoded_image, codec_specific_info); | 431 stats_proxy_.OnPreDecode(encoded_image, codec_specific_info); |
| 433 if (config_.pre_decode_callback) { | 432 if (config_.pre_decode_callback) { |
| 434 config_.pre_decode_callback->EncodedFrameCallback( | 433 config_.pre_decode_callback->EncodedFrameCallback( |
| 435 EncodedFrame(encoded_image._buffer, encoded_image._length, | 434 EncodedFrame(encoded_image._buffer, encoded_image._length, |
| 436 encoded_image._frameType)); | 435 encoded_image._frameType, encoded_image._encodedWidth, |
| 436 encoded_image._encodedHeight, encoded_image._timeStamp)); |
| 437 } | 437 } |
| 438 { | 438 { |
| 439 rtc::CritScope lock(&ivf_writer_lock_); | 439 rtc::CritScope lock(&ivf_writer_lock_); |
| 440 if (ivf_writer_.get()) { | 440 if (ivf_writer_.get()) { |
| 441 RTC_DCHECK(codec_specific_info); | 441 RTC_DCHECK(codec_specific_info); |
| 442 bool ok = ivf_writer_->WriteFrame(encoded_image, | 442 bool ok = ivf_writer_->WriteFrame(encoded_image, |
| 443 codec_specific_info->codecType); | 443 codec_specific_info->codecType); |
| 444 RTC_DCHECK(ok); | 444 RTC_DCHECK(ok); |
| 445 } | 445 } |
| 446 } | 446 } |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 LOG(LS_WARNING) << "No decodable frame in " << kMaxWaitForFrameMs | 527 LOG(LS_WARNING) << "No decodable frame in " << kMaxWaitForFrameMs |
| 528 << " ms, requesting keyframe."; | 528 << " ms, requesting keyframe."; |
| 529 RequestKeyFrame(); | 529 RequestKeyFrame(); |
| 530 } | 530 } |
| 531 } else { | 531 } else { |
| 532 video_receiver_.Decode(kMaxDecodeWaitTimeMs); | 532 video_receiver_.Decode(kMaxDecodeWaitTimeMs); |
| 533 } | 533 } |
| 534 } | 534 } |
| 535 } // namespace internal | 535 } // namespace internal |
| 536 } // namespace webrtc | 536 } // namespace webrtc |
| OLD | NEW |