| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/cast/sender/video_sender.h" | 5 #include "media/cast/sender/video_sender.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <cstring> | 10 #include <cstring> |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 NOTREACHED(); | 138 NOTREACHED(); |
| 139 return; | 139 return; |
| 140 } | 140 } |
| 141 | 141 |
| 142 const RtpTimeTicks rtp_timestamp = | 142 const RtpTimeTicks rtp_timestamp = |
| 143 RtpTimeTicks::FromTimeDelta(video_frame->timestamp(), kVideoFrequency); | 143 RtpTimeTicks::FromTimeDelta(video_frame->timestamp(), kVideoFrequency); |
| 144 LogVideoCaptureTimestamps(cast_environment_.get(), *video_frame, | 144 LogVideoCaptureTimestamps(cast_environment_.get(), *video_frame, |
| 145 rtp_timestamp); | 145 rtp_timestamp); |
| 146 | 146 |
| 147 // Used by chrome/browser/extension/api/cast_streaming/performance_test.cc | 147 // Used by chrome/browser/extension/api/cast_streaming/performance_test.cc |
| 148 TRACE_EVENT_INSTANT2( | 148 TRACE_EVENT_INSTANT2("cast_perf_test", "InsertRawVideoFrame", |
| 149 "cast_perf_test", "InsertRawVideoFrame", | 149 TRACE_EVENT_SCOPE_THREAD, "timestamp", |
| 150 TRACE_EVENT_SCOPE_THREAD, | 150 (reference_time - base::TimeTicks()).InMicroseconds(), |
| 151 "timestamp", reference_time.ToInternalValue(), | 151 "rtp_timestamp", rtp_timestamp.lower_32_bits()); |
| 152 "rtp_timestamp", rtp_timestamp.lower_32_bits()); | |
| 153 | 152 |
| 154 bool low_latency_mode; | 153 bool low_latency_mode; |
| 155 if (video_frame->metadata()->GetBoolean( | 154 if (video_frame->metadata()->GetBoolean( |
| 156 VideoFrameMetadata::INTERACTIVE_CONTENT, &low_latency_mode)) { | 155 VideoFrameMetadata::INTERACTIVE_CONTENT, &low_latency_mode)) { |
| 157 if (low_latency_mode && !low_latency_mode_) { | 156 if (low_latency_mode && !low_latency_mode_) { |
| 158 VLOG(1) << "Interactive mode playout time " << min_playout_delay_; | 157 VLOG(1) << "Interactive mode playout time " << min_playout_delay_; |
| 159 playout_delay_change_cb_.Run(min_playout_delay_); | 158 playout_delay_change_cb_.Run(min_playout_delay_); |
| 160 } | 159 } |
| 161 low_latency_mode_ = low_latency_mode; | 160 low_latency_mode_ = low_latency_mode; |
| 162 } | 161 } |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 media::VideoFrameMetadata::RESOURCE_UTILIZATION, | 334 media::VideoFrameMetadata::RESOURCE_UTILIZATION, |
| 336 encoded_frame->dependency == EncodedFrame::KEY ? | 335 encoded_frame->dependency == EncodedFrame::KEY ? |
| 337 std::min(1.0, attenuated_utilization) : attenuated_utilization); | 336 std::min(1.0, attenuated_utilization) : attenuated_utilization); |
| 338 } | 337 } |
| 339 | 338 |
| 340 SendEncodedFrame(encoder_bitrate, std::move(encoded_frame)); | 339 SendEncodedFrame(encoder_bitrate, std::move(encoded_frame)); |
| 341 } | 340 } |
| 342 | 341 |
| 343 } // namespace cast | 342 } // namespace cast |
| 344 } // namespace media | 343 } // namespace media |
| OLD | NEW |