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

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

Issue 2989313003: Reland of Fix off-by-one bugs in PacketBuffer when the buffer is filled with a single frame. (Closed)
Patch Set: Memcpy fix 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 bool bitstream_copied = GetBitstream(_buffer);
97 RTC_DCHECK(bitstream_copied);
97 _encodedWidth = first_packet->width; 98 _encodedWidth = first_packet->width;
98 _encodedHeight = first_packet->height; 99 _encodedHeight = first_packet->height;
99 100
100 // FrameObject members 101 // FrameObject members
101 timestamp = first_packet->timestamp; 102 timestamp = first_packet->timestamp;
102 103
103 VCMPacket* last_packet = packet_buffer_->GetPacket(last_seq_num); 104 VCMPacket* last_packet = packet_buffer_->GetPacket(last_seq_num);
104 RTC_CHECK(last_packet && last_packet->markerBit); 105 RTC_CHECK(last_packet && last_packet->markerBit);
105 // http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/12.07.00_60/ 106 // http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/12.07.00_60/
106 // ts_126114v120700p.pdf Section 7.4.5. 107 // 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 { 189 rtc::Optional<RTPVideoTypeHeader> RtpFrameObject::GetCodecHeader() const {
189 rtc::CritScope lock(&packet_buffer_->crit_); 190 rtc::CritScope lock(&packet_buffer_->crit_);
190 VCMPacket* packet = packet_buffer_->GetPacket(first_seq_num_); 191 VCMPacket* packet = packet_buffer_->GetPacket(first_seq_num_);
191 if (!packet) 192 if (!packet)
192 return rtc::Optional<RTPVideoTypeHeader>(); 193 return rtc::Optional<RTPVideoTypeHeader>();
193 return rtc::Optional<RTPVideoTypeHeader>(packet->video_header.codecHeader); 194 return rtc::Optional<RTPVideoTypeHeader>(packet->video_header.codecHeader);
194 } 195 }
195 196
196 } // namespace video_coding 197 } // namespace video_coding
197 } // namespace webrtc 198 } // 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