philipel | c707ab7 | 2016-04-01 02:01:54 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #include "webrtc/modules/video_coding/frame_object.h" |
| 12 | #include "webrtc/base/criticalsection.h" |
| 13 | #include "webrtc/modules/video_coding/packet_buffer.h" |
| 14 | |
| 15 | namespace webrtc { |
| 16 | namespace video_coding { |
| 17 | |
| 18 | RtpFrameObject::RtpFrameObject(PacketBuffer* packet_buffer, |
philipel | c707ab7 | 2016-04-01 02:01:54 -0700 | [diff] [blame] | 19 | uint16_t first_packet, |
| 20 | uint16_t last_packet) |
| 21 | : packet_buffer_(packet_buffer), |
| 22 | first_packet_(first_packet), |
| 23 | last_packet_(last_packet) {} |
| 24 | |
| 25 | RtpFrameObject::~RtpFrameObject() { |
| 26 | packet_buffer_->ReturnFrame(this); |
| 27 | } |
| 28 | |
philipel | f413933 | 2016-04-20 10:26:34 +0200 | [diff] [blame^] | 29 | uint16_t RtpFrameObject::first_seq_num() const { |
philipel | c707ab7 | 2016-04-01 02:01:54 -0700 | [diff] [blame] | 30 | return first_packet_; |
| 31 | } |
| 32 | |
philipel | f413933 | 2016-04-20 10:26:34 +0200 | [diff] [blame^] | 33 | uint16_t RtpFrameObject::last_seq_num() const { |
philipel | c707ab7 | 2016-04-01 02:01:54 -0700 | [diff] [blame] | 34 | return last_packet_; |
| 35 | } |
| 36 | |
philipel | c707ab7 | 2016-04-01 02:01:54 -0700 | [diff] [blame] | 37 | bool RtpFrameObject::GetBitstream(uint8_t* destination) const { |
| 38 | return packet_buffer_->GetBitstream(*this, destination); |
| 39 | } |
| 40 | |
| 41 | } // namespace video_coding |
| 42 | } // namespace webrtc |