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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_format_vp8.cc

Issue 2999063002: Add flag enabling more packets to be retransmittable. (Closed)
Patch Set: Addressed comments Created 3 years, 3 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) 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2011 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 : max_payload_len_); 204 : max_payload_len_);
205 int bytes = WriteHeaderAndPayload(packet_info, buffer, max_payload_len_); 205 int bytes = WriteHeaderAndPayload(packet_info, buffer, max_payload_len_);
206 if (bytes < 0) { 206 if (bytes < 0) {
207 return false; 207 return false;
208 } 208 }
209 packet->SetPayloadSize(bytes); 209 packet->SetPayloadSize(bytes);
210 packet->SetMarker(packets_.empty()); 210 packet->SetMarker(packets_.empty());
211 return true; 211 return true;
212 } 212 }
213 213
214 ProtectionType RtpPacketizerVp8::GetProtectionType() {
215 bool protect =
216 hdr_info_.temporalIdx == 0 || hdr_info_.temporalIdx == kNoTemporalIdx;
217 return protect ? kProtectedPacket : kUnprotectedPacket;
218 }
219
220 StorageType RtpPacketizerVp8::GetStorageType(uint32_t retransmission_settings) {
221 if (hdr_info_.temporalIdx == 0 &&
222 !(retransmission_settings & kRetransmitBaseLayer)) {
223 return kDontRetransmit;
224 }
225 if (hdr_info_.temporalIdx != kNoTemporalIdx &&
226 hdr_info_.temporalIdx > 0 &&
227 !(retransmission_settings & kRetransmitHigherLayers)) {
228 return kDontRetransmit;
229 }
230 return kAllowRetransmission;
231 }
232
233 std::string RtpPacketizerVp8::ToString() { 214 std::string RtpPacketizerVp8::ToString() {
234 return "RtpPacketizerVp8"; 215 return "RtpPacketizerVp8";
235 } 216 }
236 217
237 int RtpPacketizerVp8::GeneratePackets() { 218 int RtpPacketizerVp8::GeneratePackets() {
238 if (max_payload_len_ < vp8_fixed_payload_descriptor_bytes_ + 219 if (max_payload_len_ < vp8_fixed_payload_descriptor_bytes_ +
239 PayloadDescriptorExtraLength() + 1 + 220 PayloadDescriptorExtraLength() + 1 +
240 last_packet_reduction_len_) { 221 last_packet_reduction_len_) {
241 // The provided payload length is not long enough for the payload 222 // The provided payload length is not long enough for the payload
242 // descriptor and one payload byte in the last packet. 223 // descriptor and one payload byte in the last packet.
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 if (ParseVP8FrameSize(parsed_payload, payload_data, payload_data_length) != 676 if (ParseVP8FrameSize(parsed_payload, payload_data, payload_data_length) !=
696 0) { 677 0) {
697 return false; 678 return false;
698 } 679 }
699 680
700 parsed_payload->payload = payload_data; 681 parsed_payload->payload = payload_data;
701 parsed_payload->payload_length = payload_data_length; 682 parsed_payload->payload_length = payload_data_length;
702 return true; 683 return true;
703 } 684 }
704 } // namespace webrtc 685 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_format_vp8.h ('k') | webrtc/modules/rtp_rtcp/source/rtp_format_vp9.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698