| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 const int64_t now_ms = _clock->TimeInMilliseconds(); | 86 const int64_t now_ms = _clock->TimeInMilliseconds(); |
| 87 if (!decode_time_ms) { | 87 if (!decode_time_ms) { |
| 88 decode_time_ms = | 88 decode_time_ms = |
| 89 rtc::Optional<int32_t>(now_ms - frameInfo->decodeStartTimeMs); | 89 rtc::Optional<int32_t>(now_ms - frameInfo->decodeStartTimeMs); |
| 90 } | 90 } |
| 91 _timing->StopDecodeTimer(decodedImage.timestamp(), *decode_time_ms, now_ms, | 91 _timing->StopDecodeTimer(decodedImage.timestamp(), *decode_time_ms, now_ms, |
| 92 frameInfo->renderTimeMs); | 92 frameInfo->renderTimeMs); |
| 93 | 93 |
| 94 // Report timing information. | 94 // Report timing information. |
| 95 if (frameInfo->timing.flags != TimingFrameFlags::kInvalid) { | 95 if (frameInfo->timing.is_timing_frame) { |
| 96 int64_t capture_time_ms = decodedImage.ntp_time_ms() - ntp_offset_; | 96 int64_t capture_time_ms = decodedImage.ntp_time_ms() - ntp_offset_; |
| 97 // Convert remote timestamps to local time from ntp timestamps. | 97 // Convert remote timestamps to local time from ntp timestamps. |
| 98 frameInfo->timing.encode_start_ms -= ntp_offset_; | 98 frameInfo->timing.encode_start_ms -= ntp_offset_; |
| 99 frameInfo->timing.encode_finish_ms -= ntp_offset_; | 99 frameInfo->timing.encode_finish_ms -= ntp_offset_; |
| 100 frameInfo->timing.packetization_finish_ms -= ntp_offset_; | 100 frameInfo->timing.packetization_finish_ms -= ntp_offset_; |
| 101 frameInfo->timing.pacer_exit_ms -= ntp_offset_; | 101 frameInfo->timing.pacer_exit_ms -= ntp_offset_; |
| 102 frameInfo->timing.network_timestamp_ms -= ntp_offset_; | 102 frameInfo->timing.network_timestamp_ms -= ntp_offset_; |
| 103 frameInfo->timing.network2_timestamp_ms -= ntp_offset_; | 103 frameInfo->timing.network2_timestamp_ms -= ntp_offset_; |
| 104 | 104 |
| 105 int64_t sender_delta_ms = 0; | 105 int64_t sender_delta_ms = 0; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 130 timing_frame_info.network_timestamp_ms = | 130 timing_frame_info.network_timestamp_ms = |
| 131 frameInfo->timing.network_timestamp_ms - sender_delta_ms; | 131 frameInfo->timing.network_timestamp_ms - sender_delta_ms; |
| 132 timing_frame_info.network2_timestamp_ms = | 132 timing_frame_info.network2_timestamp_ms = |
| 133 frameInfo->timing.network2_timestamp_ms - sender_delta_ms; | 133 frameInfo->timing.network2_timestamp_ms - sender_delta_ms; |
| 134 timing_frame_info.receive_start_ms = frameInfo->timing.receive_start_ms; | 134 timing_frame_info.receive_start_ms = frameInfo->timing.receive_start_ms; |
| 135 timing_frame_info.receive_finish_ms = frameInfo->timing.receive_finish_ms; | 135 timing_frame_info.receive_finish_ms = frameInfo->timing.receive_finish_ms; |
| 136 timing_frame_info.decode_start_ms = frameInfo->decodeStartTimeMs; | 136 timing_frame_info.decode_start_ms = frameInfo->decodeStartTimeMs; |
| 137 timing_frame_info.decode_finish_ms = now_ms; | 137 timing_frame_info.decode_finish_ms = now_ms; |
| 138 timing_frame_info.render_time_ms = frameInfo->renderTimeMs; | 138 timing_frame_info.render_time_ms = frameInfo->renderTimeMs; |
| 139 timing_frame_info.rtp_timestamp = decodedImage.timestamp(); | 139 timing_frame_info.rtp_timestamp = decodedImage.timestamp(); |
| 140 timing_frame_info.flags = frameInfo->timing.flags; | |
| 141 | 140 |
| 142 _timing->SetTimingFrameInfo(timing_frame_info); | 141 _timing->SetTimingFrameInfo(timing_frame_info); |
| 143 } | 142 } |
| 144 | 143 |
| 145 decodedImage.set_timestamp_us( | 144 decodedImage.set_timestamp_us( |
| 146 frameInfo->renderTimeMs * rtc::kNumMicrosecsPerMillisec); | 145 frameInfo->renderTimeMs * rtc::kNumMicrosecsPerMillisec); |
| 147 decodedImage.set_rotation(frameInfo->rotation); | 146 decodedImage.set_rotation(frameInfo->rotation); |
| 148 _receiveCallback->FrameToRender(decodedImage, qp, frameInfo->content_type); | 147 _receiveCallback->FrameToRender(decodedImage, qp, frameInfo->content_type); |
| 149 } | 148 } |
| 150 | 149 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 VCMDecodedFrameCallback* callback) { | 249 VCMDecodedFrameCallback* callback) { |
| 251 _callback = callback; | 250 _callback = callback; |
| 252 return decoder_->RegisterDecodeCompleteCallback(callback); | 251 return decoder_->RegisterDecodeCompleteCallback(callback); |
| 253 } | 252 } |
| 254 | 253 |
| 255 bool VCMGenericDecoder::PrefersLateDecoding() const { | 254 bool VCMGenericDecoder::PrefersLateDecoding() const { |
| 256 return decoder_->PrefersLateDecoding(); | 255 return decoder_->PrefersLateDecoding(); |
| 257 } | 256 } |
| 258 | 257 |
| 259 } // namespace webrtc | 258 } // namespace webrtc |
| OLD | NEW |