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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 | 360 |
361 if (file != rtc::kInvalidPlatformFileValue) { | 361 if (file != rtc::kInvalidPlatformFileValue) { |
362 // Make a keyframe appear as early as possible in the logs, to give actually | 362 // Make a keyframe appear as early as possible in the logs, to give actually |
363 // decodable output. | 363 // decodable output. |
364 RequestKeyFrame(); | 364 RequestKeyFrame(); |
365 } | 365 } |
366 } | 366 } |
367 | 367 |
368 // TODO(tommi): This method grabs a lock 6 times. | 368 // TODO(tommi): This method grabs a lock 6 times. |
369 void VideoReceiveStream::OnFrame(const VideoFrame& video_frame) { | 369 void VideoReceiveStream::OnFrame(const VideoFrame& video_frame) { |
| 370 // TODO(tommi): OnDecodedFrame grabs a lock, incidentally the same lock |
| 371 // that OnSyncOffsetUpdated() and OnRenderedFrame() below grab. |
| 372 stats_proxy_.OnDecodedFrame(); |
| 373 |
370 int64_t sync_offset_ms; | 374 int64_t sync_offset_ms; |
371 double estimated_freq_khz; | 375 double estimated_freq_khz; |
372 // TODO(tommi): GetStreamSyncOffsetInMs grabs three locks. One inside the | 376 // TODO(tommi): GetStreamSyncOffsetInMs grabs three locks. One inside the |
373 // function itself, another in GetChannel() and a third in | 377 // function itself, another in GetChannel() and a third in |
374 // GetPlayoutTimestamp. Seems excessive. Anyhow, I'm assuming the function | 378 // GetPlayoutTimestamp. Seems excessive. Anyhow, I'm assuming the function |
375 // succeeds most of the time, which leads to grabbing a fourth lock. | 379 // succeeds most of the time, which leads to grabbing a fourth lock. |
376 if (rtp_stream_sync_.GetStreamSyncOffsetInMs(video_frame.timestamp(), | 380 if (rtp_stream_sync_.GetStreamSyncOffsetInMs(video_frame.timestamp(), |
377 video_frame.render_time_ms(), | 381 video_frame.render_time_ms(), |
378 &sync_offset_ms, | 382 &sync_offset_ms, |
379 &estimated_freq_khz)) { | 383 &estimated_freq_khz)) { |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 if (video_receiver_.Decode(frame.get()) == VCM_OK) | 491 if (video_receiver_.Decode(frame.get()) == VCM_OK) |
488 rtp_stream_receiver_.FrameDecoded(frame->picture_id); | 492 rtp_stream_receiver_.FrameDecoded(frame->picture_id); |
489 } else { | 493 } else { |
490 LOG(LS_WARNING) << "No decodable frame in " << kMaxWaitForFrameMs | 494 LOG(LS_WARNING) << "No decodable frame in " << kMaxWaitForFrameMs |
491 << " ms, requesting keyframe."; | 495 << " ms, requesting keyframe."; |
492 RequestKeyFrame(); | 496 RequestKeyFrame(); |
493 } | 497 } |
494 } | 498 } |
495 } // namespace internal | 499 } // namespace internal |
496 } // namespace webrtc | 500 } // namespace webrtc |
OLD | NEW |