| 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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 // function itself, another in GetChannel() and a third in | 386 // function itself, another in GetChannel() and a third in |
| 387 // GetPlayoutTimestamp. Seems excessive. Anyhow, I'm assuming the function | 387 // GetPlayoutTimestamp. Seems excessive. Anyhow, I'm assuming the function |
| 388 // succeeds most of the time, which leads to grabbing a fourth lock. | 388 // succeeds most of the time, which leads to grabbing a fourth lock. |
| 389 if (rtp_stream_sync_.GetStreamSyncOffsetInMs(video_frame.timestamp(), | 389 if (rtp_stream_sync_.GetStreamSyncOffsetInMs(video_frame.timestamp(), |
| 390 video_frame.render_time_ms(), | 390 video_frame.render_time_ms(), |
| 391 &sync_offset_ms, | 391 &sync_offset_ms, |
| 392 &estimated_freq_khz)) { | 392 &estimated_freq_khz)) { |
| 393 // TODO(tommi): OnSyncOffsetUpdated grabs a lock. | 393 // TODO(tommi): OnSyncOffsetUpdated grabs a lock. |
| 394 stats_proxy_.OnSyncOffsetUpdated(sync_offset_ms, estimated_freq_khz); | 394 stats_proxy_.OnSyncOffsetUpdated(sync_offset_ms, estimated_freq_khz); |
| 395 } | 395 } |
| 396 |
| 396 // config_.renderer must never be null if we're getting this callback. | 397 // config_.renderer must never be null if we're getting this callback. |
| 397 config_.renderer->OnFrame(video_frame); | 398 config_.renderer->OnFrame(video_frame); |
| 398 | 399 |
| 399 // TODO(tommi): OnRenderFrame grabs a lock too. | 400 // TODO(tommi): OnRenderFrame grabs a lock too. |
| 400 stats_proxy_.OnRenderedFrame(video_frame); | 401 stats_proxy_.OnRenderedFrame(video_frame); |
| 401 } | 402 } |
| 402 | 403 |
| 403 // TODO(asapersson): Consider moving callback from video_encoder.h or | 404 // TODO(asapersson): Consider moving callback from video_encoder.h or |
| 404 // creating a different callback. | 405 // creating a different callback. |
| 405 EncodedImageCallback::Result VideoReceiveStream::OnEncodedImage( | 406 EncodedImageCallback::Result VideoReceiveStream::OnEncodedImage( |
| 406 const EncodedImage& encoded_image, | 407 const EncodedImage& encoded_image, |
| 407 const CodecSpecificInfo* codec_specific_info, | 408 const CodecSpecificInfo* codec_specific_info, |
| 408 const RTPFragmentationHeader* fragmentation) { | 409 const RTPFragmentationHeader* fragmentation) { |
| 409 stats_proxy_.OnPreDecode(encoded_image, codec_specific_info); | 410 stats_proxy_.OnPreDecode(encoded_image, codec_specific_info); |
| 410 if (config_.pre_decode_callback) { | 411 if (config_.pre_decode_callback) { |
| 411 config_.pre_decode_callback->EncodedFrameCallback( | 412 config_.pre_decode_callback->EncodedFrameCallback( |
| 412 EncodedFrame(encoded_image._buffer, encoded_image._length, | 413 EncodedFrame(encoded_image._buffer, encoded_image._length, |
| 413 encoded_image._frameType, encoded_image._encodedWidth, | 414 encoded_image._frameType)); |
| 414 encoded_image._encodedHeight, encoded_image._timeStamp)); | |
| 415 } | 415 } |
| 416 { | 416 { |
| 417 rtc::CritScope lock(&ivf_writer_lock_); | 417 rtc::CritScope lock(&ivf_writer_lock_); |
| 418 if (ivf_writer_.get()) { | 418 if (ivf_writer_.get()) { |
| 419 RTC_DCHECK(codec_specific_info); | 419 RTC_DCHECK(codec_specific_info); |
| 420 bool ok = ivf_writer_->WriteFrame(encoded_image, | 420 bool ok = ivf_writer_->WriteFrame(encoded_image, |
| 421 codec_specific_info->codecType); | 421 codec_specific_info->codecType); |
| 422 RTC_DCHECK(ok); | 422 RTC_DCHECK(ok); |
| 423 } | 423 } |
| 424 } | 424 } |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 LOG(LS_WARNING) << "No decodable frame in " << kMaxWaitForFrameMs | 505 LOG(LS_WARNING) << "No decodable frame in " << kMaxWaitForFrameMs |
| 506 << " ms, requesting keyframe."; | 506 << " ms, requesting keyframe."; |
| 507 RequestKeyFrame(); | 507 RequestKeyFrame(); |
| 508 } | 508 } |
| 509 } else { | 509 } else { |
| 510 video_receiver_.Decode(kMaxDecodeWaitTimeMs); | 510 video_receiver_.Decode(kMaxDecodeWaitTimeMs); |
| 511 } | 511 } |
| 512 } | 512 } |
| 513 } // namespace internal | 513 } // namespace internal |
| 514 } // namespace webrtc | 514 } // namespace webrtc |
| OLD | NEW |