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