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

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

Issue 2084893002: Implement scoped_const_refptr template. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 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
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/forward_error_correction.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 21 matching lines...) Expand all
32 const uint8_t kUlpHeaderSizeLBitSet = (2 + kMaskSizeLBitSet); 32 const uint8_t kUlpHeaderSizeLBitSet = (2 + kMaskSizeLBitSet);
33 33
34 // ULP header size in bytes (L bit is cleared). 34 // ULP header size in bytes (L bit is cleared).
35 const uint8_t kUlpHeaderSizeLBitClear = (2 + kMaskSizeLBitClear); 35 const uint8_t kUlpHeaderSizeLBitClear = (2 + kMaskSizeLBitClear);
36 36
37 // Transport header size in bytes. Assume UDP/IPv4 as a reasonable minimum. 37 // Transport header size in bytes. Assume UDP/IPv4 as a reasonable minimum.
38 const uint8_t kTransportOverhead = 28; 38 const uint8_t kTransportOverhead = 28;
39 39
40 enum { kMaxFecPackets = ForwardErrorCorrection::kMaxMediaPackets }; 40 enum { kMaxFecPackets = ForwardErrorCorrection::kMaxMediaPackets };
41 41
42 int32_t ForwardErrorCorrection::Packet::AddRef() { 42 int32_t ForwardErrorCorrection::Packet::AddRef() const {
43 return ++ref_count_; 43 return ++ref_count_;
44 } 44 }
45 45
46 int32_t ForwardErrorCorrection::Packet::Release() { 46 int32_t ForwardErrorCorrection::Packet::Release() const {
47 int32_t ref_count; 47 int32_t ref_count;
48 ref_count = --ref_count_; 48 ref_count = --ref_count_;
49 if (ref_count == 0) 49 if (ref_count == 0)
50 delete this; 50 delete this;
51 return ref_count; 51 return ref_count;
52 } 52 }
53 53
54 // Used to link media packets to their protecting FEC packets. 54 // Used to link media packets to their protecting FEC packets.
55 // 55 //
56 // TODO(holmer): Refactor into a proper class. 56 // TODO(holmer): Refactor into a proper class.
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 } 851 }
852 InsertPackets(received_packet_list, recovered_packet_list); 852 InsertPackets(received_packet_list, recovered_packet_list);
853 AttemptRecover(recovered_packet_list); 853 AttemptRecover(recovered_packet_list);
854 return 0; 854 return 0;
855 } 855 }
856 856
857 size_t ForwardErrorCorrection::PacketOverhead() { 857 size_t ForwardErrorCorrection::PacketOverhead() {
858 return kFecHeaderSize + kUlpHeaderSizeLBitSet; 858 return kFecHeaderSize + kUlpHeaderSizeLBitSet;
859 } 859 }
860 } // namespace webrtc 860 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/forward_error_correction.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698