OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 RTC_CHECK(last_packet && last_packet->markerBit); | 104 RTC_CHECK(last_packet && last_packet->markerBit); |
105 // http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/12.07.00_60/ | 105 // http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/12.07.00_60/ |
106 // ts_126114v120700p.pdf Section 7.4.5. | 106 // ts_126114v120700p.pdf Section 7.4.5. |
107 // The MTSI client shall add the payload bytes as defined in this clause | 107 // The MTSI client shall add the payload bytes as defined in this clause |
108 // onto the last RTP packet in each group of packets which make up a key | 108 // onto the last RTP packet in each group of packets which make up a key |
109 // frame (I-frame or IDR frame in H.264 (AVC), or an IRAP picture in H.265 | 109 // frame (I-frame or IDR frame in H.264 (AVC), or an IRAP picture in H.265 |
110 // (HEVC)). | 110 // (HEVC)). |
111 rotation_ = last_packet->video_header.rotation; | 111 rotation_ = last_packet->video_header.rotation; |
112 _rotation_set = true; | 112 _rotation_set = true; |
113 content_type_ = last_packet->video_header.content_type; | 113 content_type_ = last_packet->video_header.content_type; |
| 114 if (last_packet->video_header.video_timing.is_timing_frame) { |
| 115 // ntp_time_ms_ may be -1 if not estimated yet. This is not a problem, |
| 116 // as this will be dealt with at the time of reporting. |
| 117 timing_.is_timing_frame = true; |
| 118 timing_.encode_start_ms = |
| 119 ntp_time_ms_ + |
| 120 last_packet->video_header.video_timing.encode_start_delta_ms; |
| 121 timing_.encode_finish_ms = |
| 122 ntp_time_ms_ + |
| 123 last_packet->video_header.video_timing.encode_finish_delta_ms; |
| 124 timing_.packetization_finish_ms = |
| 125 ntp_time_ms_ + |
| 126 last_packet->video_header.video_timing.packetization_finish_delta_ms; |
| 127 timing_.pacer_exit_ms = |
| 128 ntp_time_ms_ + |
| 129 last_packet->video_header.video_timing.pacer_exit_delta_ms; |
| 130 timing_.network_timestamp_ms = |
| 131 ntp_time_ms_ + |
| 132 last_packet->video_header.video_timing.network_timstamp_delta_ms; |
| 133 timing_.network2_timestamp_ms = |
| 134 ntp_time_ms_ + |
| 135 last_packet->video_header.video_timing.network2_timstamp_delta_ms; |
| 136 |
| 137 timing_.receive_start_ms = first_packet->receive_time_ms; |
| 138 timing_.receive_finish_ms = last_packet->receive_time_ms; |
| 139 } else { |
| 140 timing_.is_timing_frame = false; |
| 141 } |
114 } | 142 } |
115 | 143 |
116 RtpFrameObject::~RtpFrameObject() { | 144 RtpFrameObject::~RtpFrameObject() { |
117 packet_buffer_->ReturnFrame(this); | 145 packet_buffer_->ReturnFrame(this); |
118 } | 146 } |
119 | 147 |
120 uint16_t RtpFrameObject::first_seq_num() const { | 148 uint16_t RtpFrameObject::first_seq_num() const { |
121 return first_seq_num_; | 149 return first_seq_num_; |
122 } | 150 } |
123 | 151 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 rtc::Optional<RTPVideoTypeHeader> RtpFrameObject::GetCodecHeader() const { | 188 rtc::Optional<RTPVideoTypeHeader> RtpFrameObject::GetCodecHeader() const { |
161 rtc::CritScope lock(&packet_buffer_->crit_); | 189 rtc::CritScope lock(&packet_buffer_->crit_); |
162 VCMPacket* packet = packet_buffer_->GetPacket(first_seq_num_); | 190 VCMPacket* packet = packet_buffer_->GetPacket(first_seq_num_); |
163 if (!packet) | 191 if (!packet) |
164 return rtc::Optional<RTPVideoTypeHeader>(); | 192 return rtc::Optional<RTPVideoTypeHeader>(); |
165 return rtc::Optional<RTPVideoTypeHeader>(packet->video_header.codecHeader); | 193 return rtc::Optional<RTPVideoTypeHeader>(packet->video_header.codecHeader); |
166 } | 194 } |
167 | 195 |
168 } // namespace video_coding | 196 } // namespace video_coding |
169 } // namespace webrtc | 197 } // namespace webrtc |
OLD | NEW |