Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Side by Side Diff: webrtc/modules/video_coding/frame_object.cc

Issue 2911193002: Implement timing frames. (Closed)
Patch Set: Fix uninitialized variables memcheck errors Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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_ms_delta;
121 timing_.encode_finish_ms =
122 ntp_time_ms_ +
123 last_packet->video_header.video_timing.encode_finish_ms_delta;
124 timing_.packetization_finish_ms =
125 ntp_time_ms_ +
126 last_packet->video_header.video_timing.packetization_finish_ms_delta;
127 timing_.pacer_exit_ms =
128 ntp_time_ms_ +
129 last_packet->video_header.video_timing.pacer_exit_ms_delta;
130 timing_.network_timestamp_ms =
131 ntp_time_ms_ +
132 last_packet->video_header.video_timing.network_timstamp_ms_delta;
133 timing_.receive_start_ms = first_packet->receive_time_ms;
134 timing_.receive_finish_ms = last_packet->receive_time_ms;
135 } else {
136 timing_.is_timing_frame = false;
137 }
114 } 138 }
115 139
116 RtpFrameObject::~RtpFrameObject() { 140 RtpFrameObject::~RtpFrameObject() {
117 packet_buffer_->ReturnFrame(this); 141 packet_buffer_->ReturnFrame(this);
118 } 142 }
119 143
120 uint16_t RtpFrameObject::first_seq_num() const { 144 uint16_t RtpFrameObject::first_seq_num() const {
121 return first_seq_num_; 145 return first_seq_num_;
122 } 146 }
123 147
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 rtc::Optional<RTPVideoTypeHeader> RtpFrameObject::GetCodecHeader() const { 184 rtc::Optional<RTPVideoTypeHeader> RtpFrameObject::GetCodecHeader() const {
161 rtc::CritScope lock(&packet_buffer_->crit_); 185 rtc::CritScope lock(&packet_buffer_->crit_);
162 VCMPacket* packet = packet_buffer_->GetPacket(first_seq_num_); 186 VCMPacket* packet = packet_buffer_->GetPacket(first_seq_num_);
163 if (!packet) 187 if (!packet)
164 return rtc::Optional<RTPVideoTypeHeader>(); 188 return rtc::Optional<RTPVideoTypeHeader>();
165 return rtc::Optional<RTPVideoTypeHeader>(packet->video_header.codecHeader); 189 return rtc::Optional<RTPVideoTypeHeader>(packet->video_header.codecHeader);
166 } 190 }
167 191
168 } // namespace video_coding 192 } // namespace video_coding
169 } // namespace webrtc 193 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698