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), | |
36 received_time_(received_time), | 35 received_time_(received_time), |
37 times_nacked_(times_nacked) { | 36 times_nacked_(times_nacked) { |
38 VCMPacket* first_packet = packet_buffer_->GetPacket(first_seq_num); | 37 VCMPacket* first_packet = packet_buffer_->GetPacket(first_seq_num); |
39 RTC_CHECK(first_packet); | 38 RTC_CHECK(first_packet); |
40 | 39 |
41 // RtpFrameObject members | 40 // RtpFrameObject members |
42 frame_type_ = first_packet->frameType; | 41 frame_type_ = first_packet->frameType; |
43 codec_type_ = first_packet->codec; | 42 codec_type_ = first_packet->codec; |
44 | 43 |
45 // TODO(philipel): Remove when encoded image is replaced by FrameObject. | 44 // TODO(philipel): Remove when encoded image is replaced by FrameObject. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 RTC_CHECK(last_packet->markerBit); | 106 RTC_CHECK(last_packet->markerBit); |
108 // http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/12.07.00_60/ | 107 // http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/12.07.00_60/ |
109 // ts_126114v120700p.pdf Section 7.4.5. | 108 // ts_126114v120700p.pdf Section 7.4.5. |
110 // The MTSI client shall add the payload bytes as defined in this clause | 109 // The MTSI client shall add the payload bytes as defined in this clause |
111 // onto the last RTP packet in each group of packets which make up a key | 110 // onto the last RTP packet in each group of packets which make up a key |
112 // frame (I-frame or IDR frame in H.264 (AVC), or an IRAP picture in H.265 | 111 // frame (I-frame or IDR frame in H.264 (AVC), or an IRAP picture in H.265 |
113 // (HEVC)). | 112 // (HEVC)). |
114 rotation_ = last_packet->video_header.rotation; | 113 rotation_ = last_packet->video_header.rotation; |
115 _rotation_set = true; | 114 _rotation_set = true; |
116 content_type_ = last_packet->video_header.content_type; | 115 content_type_ = last_packet->video_header.content_type; |
117 if (last_packet->video_header.video_timing.flags != | 116 if (last_packet->video_header.video_timing.is_timing_frame) { |
118 TimingFrameFlags::kInvalid) { | |
119 // ntp_time_ms_ may be -1 if not estimated yet. This is not a problem, | 117 // ntp_time_ms_ may be -1 if not estimated yet. This is not a problem, |
120 // as this will be dealt with at the time of reporting. | 118 // as this will be dealt with at the time of reporting. |
| 119 timing_.is_timing_frame = true; |
121 timing_.encode_start_ms = | 120 timing_.encode_start_ms = |
122 ntp_time_ms_ + | 121 ntp_time_ms_ + |
123 last_packet->video_header.video_timing.encode_start_delta_ms; | 122 last_packet->video_header.video_timing.encode_start_delta_ms; |
124 timing_.encode_finish_ms = | 123 timing_.encode_finish_ms = |
125 ntp_time_ms_ + | 124 ntp_time_ms_ + |
126 last_packet->video_header.video_timing.encode_finish_delta_ms; | 125 last_packet->video_header.video_timing.encode_finish_delta_ms; |
127 timing_.packetization_finish_ms = | 126 timing_.packetization_finish_ms = |
128 ntp_time_ms_ + | 127 ntp_time_ms_ + |
129 last_packet->video_header.video_timing.packetization_finish_delta_ms; | 128 last_packet->video_header.video_timing.packetization_finish_delta_ms; |
130 timing_.pacer_exit_ms = | 129 timing_.pacer_exit_ms = |
131 ntp_time_ms_ + | 130 ntp_time_ms_ + |
132 last_packet->video_header.video_timing.pacer_exit_delta_ms; | 131 last_packet->video_header.video_timing.pacer_exit_delta_ms; |
133 timing_.network_timestamp_ms = | 132 timing_.network_timestamp_ms = |
134 ntp_time_ms_ + | 133 ntp_time_ms_ + |
135 last_packet->video_header.video_timing.network_timstamp_delta_ms; | 134 last_packet->video_header.video_timing.network_timstamp_delta_ms; |
136 timing_.network2_timestamp_ms = | 135 timing_.network2_timestamp_ms = |
137 ntp_time_ms_ + | 136 ntp_time_ms_ + |
138 last_packet->video_header.video_timing.network2_timstamp_delta_ms; | 137 last_packet->video_header.video_timing.network2_timstamp_delta_ms; |
139 | 138 |
140 timing_.receive_start_ms = first_packet->receive_time_ms; | 139 timing_.receive_start_ms = first_packet->receive_time_ms; |
141 timing_.receive_finish_ms = last_packet->receive_time_ms; | 140 timing_.receive_finish_ms = last_packet->receive_time_ms; |
| 141 } else { |
| 142 timing_.is_timing_frame = false; |
142 } | 143 } |
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 |