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 14 matching lines...) Expand all Loading... |
25 | 25 |
26 RtpFrameObject::RtpFrameObject(PacketBuffer* packet_buffer, | 26 RtpFrameObject::RtpFrameObject(PacketBuffer* packet_buffer, |
27 uint16_t first_seq_num, | 27 uint16_t first_seq_num, |
28 uint16_t last_seq_num, | 28 uint16_t last_seq_num, |
29 size_t frame_size, | 29 size_t frame_size, |
30 int times_nacked, | 30 int times_nacked, |
31 int64_t received_time) | 31 int64_t received_time) |
32 : packet_buffer_(packet_buffer), | 32 : packet_buffer_(packet_buffer), |
33 first_seq_num_(first_seq_num), | 33 first_seq_num_(first_seq_num), |
34 last_seq_num_(last_seq_num), | 34 last_seq_num_(last_seq_num), |
| 35 timestamp_(0), |
35 received_time_(received_time), | 36 received_time_(received_time), |
36 times_nacked_(times_nacked) { | 37 times_nacked_(times_nacked) { |
37 VCMPacket* first_packet = packet_buffer_->GetPacket(first_seq_num); | 38 VCMPacket* first_packet = packet_buffer_->GetPacket(first_seq_num); |
38 RTC_CHECK(first_packet); | 39 RTC_CHECK(first_packet); |
39 | 40 |
40 // RtpFrameObject members | 41 // RtpFrameObject members |
41 frame_type_ = first_packet->frameType; | 42 frame_type_ = first_packet->frameType; |
42 codec_type_ = first_packet->codec; | 43 codec_type_ = first_packet->codec; |
43 | 44 |
44 // TODO(philipel): Remove when encoded image is replaced by FrameObject. | 45 // TODO(philipel): Remove when encoded image is replaced by FrameObject. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 RTC_CHECK(last_packet->markerBit); | 107 RTC_CHECK(last_packet->markerBit); |
107 // http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/12.07.00_60/ | 108 // http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/12.07.00_60/ |
108 // ts_126114v120700p.pdf Section 7.4.5. | 109 // ts_126114v120700p.pdf Section 7.4.5. |
109 // The MTSI client shall add the payload bytes as defined in this clause | 110 // The MTSI client shall add the payload bytes as defined in this clause |
110 // onto the last RTP packet in each group of packets which make up a key | 111 // onto the last RTP packet in each group of packets which make up a key |
111 // frame (I-frame or IDR frame in H.264 (AVC), or an IRAP picture in H.265 | 112 // frame (I-frame or IDR frame in H.264 (AVC), or an IRAP picture in H.265 |
112 // (HEVC)). | 113 // (HEVC)). |
113 rotation_ = last_packet->video_header.rotation; | 114 rotation_ = last_packet->video_header.rotation; |
114 _rotation_set = true; | 115 _rotation_set = true; |
115 content_type_ = last_packet->video_header.content_type; | 116 content_type_ = last_packet->video_header.content_type; |
116 if (last_packet->video_header.video_timing.is_timing_frame) { | 117 if (last_packet->video_header.video_timing.flags != |
| 118 TimingFrameFlags::kInvalid) { |
117 // ntp_time_ms_ may be -1 if not estimated yet. This is not a problem, | 119 // ntp_time_ms_ may be -1 if not estimated yet. This is not a problem, |
118 // as this will be dealt with at the time of reporting. | 120 // as this will be dealt with at the time of reporting. |
119 timing_.is_timing_frame = true; | |
120 timing_.encode_start_ms = | 121 timing_.encode_start_ms = |
121 ntp_time_ms_ + | 122 ntp_time_ms_ + |
122 last_packet->video_header.video_timing.encode_start_delta_ms; | 123 last_packet->video_header.video_timing.encode_start_delta_ms; |
123 timing_.encode_finish_ms = | 124 timing_.encode_finish_ms = |
124 ntp_time_ms_ + | 125 ntp_time_ms_ + |
125 last_packet->video_header.video_timing.encode_finish_delta_ms; | 126 last_packet->video_header.video_timing.encode_finish_delta_ms; |
126 timing_.packetization_finish_ms = | 127 timing_.packetization_finish_ms = |
127 ntp_time_ms_ + | 128 ntp_time_ms_ + |
128 last_packet->video_header.video_timing.packetization_finish_delta_ms; | 129 last_packet->video_header.video_timing.packetization_finish_delta_ms; |
129 timing_.pacer_exit_ms = | 130 timing_.pacer_exit_ms = |
130 ntp_time_ms_ + | 131 ntp_time_ms_ + |
131 last_packet->video_header.video_timing.pacer_exit_delta_ms; | 132 last_packet->video_header.video_timing.pacer_exit_delta_ms; |
132 timing_.network_timestamp_ms = | 133 timing_.network_timestamp_ms = |
133 ntp_time_ms_ + | 134 ntp_time_ms_ + |
134 last_packet->video_header.video_timing.network_timstamp_delta_ms; | 135 last_packet->video_header.video_timing.network_timstamp_delta_ms; |
135 timing_.network2_timestamp_ms = | 136 timing_.network2_timestamp_ms = |
136 ntp_time_ms_ + | 137 ntp_time_ms_ + |
137 last_packet->video_header.video_timing.network2_timstamp_delta_ms; | 138 last_packet->video_header.video_timing.network2_timstamp_delta_ms; |
138 | 139 |
139 timing_.receive_start_ms = first_packet->receive_time_ms; | 140 timing_.receive_start_ms = first_packet->receive_time_ms; |
140 timing_.receive_finish_ms = last_packet->receive_time_ms; | 141 timing_.receive_finish_ms = last_packet->receive_time_ms; |
141 } else { | |
142 timing_.is_timing_frame = false; | |
143 } | 142 } |
| 143 timing_.flags = last_packet->video_header.video_timing.flags; |
144 } | 144 } |
145 | 145 |
146 RtpFrameObject::~RtpFrameObject() { | 146 RtpFrameObject::~RtpFrameObject() { |
147 packet_buffer_->ReturnFrame(this); | 147 packet_buffer_->ReturnFrame(this); |
148 } | 148 } |
149 | 149 |
150 uint16_t RtpFrameObject::first_seq_num() const { | 150 uint16_t RtpFrameObject::first_seq_num() const { |
151 return first_seq_num_; | 151 return first_seq_num_; |
152 } | 152 } |
153 | 153 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 rtc::Optional<RTPVideoTypeHeader> RtpFrameObject::GetCodecHeader() const { | 190 rtc::Optional<RTPVideoTypeHeader> RtpFrameObject::GetCodecHeader() const { |
191 rtc::CritScope lock(&packet_buffer_->crit_); | 191 rtc::CritScope lock(&packet_buffer_->crit_); |
192 VCMPacket* packet = packet_buffer_->GetPacket(first_seq_num_); | 192 VCMPacket* packet = packet_buffer_->GetPacket(first_seq_num_); |
193 if (!packet) | 193 if (!packet) |
194 return rtc::Optional<RTPVideoTypeHeader>(); | 194 return rtc::Optional<RTPVideoTypeHeader>(); |
195 return rtc::Optional<RTPVideoTypeHeader>(packet->video_header.codecHeader); | 195 return rtc::Optional<RTPVideoTypeHeader>(packet->video_header.codecHeader); |
196 } | 196 } |
197 | 197 |
198 } // namespace video_coding | 198 } // namespace video_coding |
199 } // namespace webrtc | 199 } // namespace webrtc |
OLD | NEW |