Index: webrtc/modules/video_coding/packet_buffer.cc |
diff --git a/webrtc/modules/video_coding/packet_buffer.cc b/webrtc/modules/video_coding/packet_buffer.cc |
index df173504ff79af6be8ee667269e84596a45f270e..e740e1d2ed31dbfc160487ce7025accb5442002a 100644 |
--- a/webrtc/modules/video_coding/packet_buffer.cc |
+++ b/webrtc/modules/video_coding/packet_buffer.cc |
@@ -21,6 +21,15 @@ |
namespace webrtc { |
namespace video_coding { |
+rtc::scoped_refptr<PacketBuffer> PacketBuffer::Create( |
+ Clock* clock, |
+ size_t start_buffer_size, |
+ size_t max_buffer_size, |
+ OnCompleteFrameCallback* frame_callback) { |
+ return rtc::scoped_refptr<PacketBuffer>(new PacketBuffer(clock, |
+ start_buffer_size, max_buffer_size, frame_callback)); |
+} |
+ |
PacketBuffer::PacketBuffer(Clock* clock, |
size_t start_buffer_size, |
size_t max_buffer_size, |
@@ -239,5 +248,17 @@ void PacketBuffer::Clear() { |
first_packet_received_ = false; |
} |
+int PacketBuffer::AddRef() const { |
+ return rtc::AtomicOps::Increment(&ref_count_); |
+} |
+ |
+int PacketBuffer::Release() const { |
+ int count = rtc::AtomicOps::Decrement(&ref_count_); |
+ if (!count) { |
+ delete this; |
+ } |
+ return count; |
+} |
+ |
} // namespace video_coding |
} // namespace webrtc |