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

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

Issue 2993513002: Fix off-by-one bugs in video_coding::PacketBuffer when the buffer is filled with a single frame. (Closed)
Patch Set: new --> new[] Created 3 years, 4 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 frame_type_ = kVideoFrameKey; 86 frame_type_ = kVideoFrameKey;
87 break; 87 break;
88 } 88 }
89 } 89 }
90 } 90 }
91 } else { 91 } else {
92 _frameType = first_packet->frameType; 92 _frameType = first_packet->frameType;
93 frame_type_ = first_packet->frameType; 93 frame_type_ = first_packet->frameType;
94 } 94 }
95 95
96 GetBitstream(_buffer); 96 RTC_DCHECK(GetBitstream(_buffer));
97 _encodedWidth = first_packet->width; 97 _encodedWidth = first_packet->width;
98 _encodedHeight = first_packet->height; 98 _encodedHeight = first_packet->height;
99 99
100 // FrameObject members 100 // FrameObject members
101 timestamp = first_packet->timestamp; 101 timestamp = first_packet->timestamp;
102 102
103 VCMPacket* last_packet = packet_buffer_->GetPacket(last_seq_num); 103 VCMPacket* last_packet = packet_buffer_->GetPacket(last_seq_num);
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.
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 rtc::Optional<RTPVideoTypeHeader> RtpFrameObject::GetCodecHeader() const { 188 rtc::Optional<RTPVideoTypeHeader> RtpFrameObject::GetCodecHeader() const {
189 rtc::CritScope lock(&packet_buffer_->crit_); 189 rtc::CritScope lock(&packet_buffer_->crit_);
190 VCMPacket* packet = packet_buffer_->GetPacket(first_seq_num_); 190 VCMPacket* packet = packet_buffer_->GetPacket(first_seq_num_);
191 if (!packet) 191 if (!packet)
192 return rtc::Optional<RTPVideoTypeHeader>(); 192 return rtc::Optional<RTPVideoTypeHeader>();
193 return rtc::Optional<RTPVideoTypeHeader>(packet->video_header.codecHeader); 193 return rtc::Optional<RTPVideoTypeHeader>(packet->video_header.codecHeader);
194 } 194 }
195 195
196 } // namespace video_coding 196 } // namespace video_coding
197 } // namespace webrtc 197 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/frame_object.h ('k') | webrtc/modules/video_coding/packet_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698