OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 void ViEEncoder::OnFrame(const VideoFrame& video_frame) { | 457 void ViEEncoder::OnFrame(const VideoFrame& video_frame) { |
458 RTC_DCHECK_RUNS_SERIALIZED(&incoming_frame_race_checker_); | 458 RTC_DCHECK_RUNS_SERIALIZED(&incoming_frame_race_checker_); |
459 VideoFrame incoming_frame = video_frame; | 459 VideoFrame incoming_frame = video_frame; |
460 | 460 |
461 // Local time in webrtc time base. | 461 // Local time in webrtc time base. |
462 int64_t current_time = clock_->TimeInMilliseconds(); | 462 int64_t current_time = clock_->TimeInMilliseconds(); |
463 incoming_frame.set_render_time_ms(current_time); | 463 incoming_frame.set_render_time_ms(current_time); |
464 | 464 |
465 // Capture time may come from clock with an offset and drift from clock_. | 465 // Capture time may come from clock with an offset and drift from clock_. |
466 int64_t capture_ntp_time_ms; | 466 int64_t capture_ntp_time_ms; |
467 if (video_frame.ntp_time_ms() != 0) { | 467 if (video_frame.ntp_time_ms() > 0) { |
468 capture_ntp_time_ms = video_frame.ntp_time_ms(); | 468 capture_ntp_time_ms = video_frame.ntp_time_ms(); |
469 } else if (video_frame.render_time_ms() != 0) { | 469 } else if (video_frame.render_time_ms() != 0) { |
470 capture_ntp_time_ms = video_frame.render_time_ms() + delta_ntp_internal_ms_; | 470 capture_ntp_time_ms = video_frame.render_time_ms() + delta_ntp_internal_ms_; |
471 } else { | 471 } else { |
472 capture_ntp_time_ms = current_time + delta_ntp_internal_ms_; | 472 capture_ntp_time_ms = current_time + delta_ntp_internal_ms_; |
473 } | 473 } |
474 incoming_frame.set_ntp_time_ms(capture_ntp_time_ms); | 474 incoming_frame.set_ntp_time_ms(capture_ntp_time_ms); |
475 | 475 |
476 // Convert NTP time, in ms, to RTP timestamp. | 476 // Convert NTP time, in ms, to RTP timestamp. |
477 const int kMsToRtpTimestamp = 90; | 477 const int kMsToRtpTimestamp = 90; |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 --scale_counter_[reason]; | 754 --scale_counter_[reason]; |
755 source_proxy_->RequestHigherResolutionThan(current_pixel_count); | 755 source_proxy_->RequestHigherResolutionThan(current_pixel_count); |
756 LOG(LS_INFO) << "Scaling up resolution."; | 756 LOG(LS_INFO) << "Scaling up resolution."; |
757 for (size_t i = 0; i < kScaleReasonSize; ++i) { | 757 for (size_t i = 0; i < kScaleReasonSize; ++i) { |
758 LOG(LS_INFO) << "Scaled " << scale_counter_[i] | 758 LOG(LS_INFO) << "Scaled " << scale_counter_[i] |
759 << " times for reason: " << (i ? "cpu" : "quality"); | 759 << " times for reason: " << (i ? "cpu" : "quality"); |
760 } | 760 } |
761 } | 761 } |
762 | 762 |
763 } // namespace webrtc | 763 } // namespace webrtc |
OLD | NEW |