| OLD | NEW |
| 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 |
| 11 #include "webrtc/modules/video_coding/frame_object.h" | 11 #include "webrtc/modules/video_coding/frame_object.h" |
| 12 #include "webrtc/base/criticalsection.h" | 12 #include "webrtc/base/criticalsection.h" |
| 13 #include "webrtc/modules/video_coding/packet_buffer.h" | 13 #include "webrtc/modules/video_coding/packet_buffer.h" |
| 14 | 14 |
| 15 namespace webrtc { | 15 namespace webrtc { |
| 16 namespace video_coding { | 16 namespace video_coding { |
| 17 | 17 |
| 18 FrameObject::FrameObject() | 18 FrameObject::FrameObject() |
| 19 : picture_id(0), | 19 : picture_id(0), |
| 20 spatial_layer(0), | 20 spatial_layer(0), |
| 21 timestamp(0), |
| 21 num_references(0), | 22 num_references(0), |
| 22 inter_layer_predicted(false) {} | 23 inter_layer_predicted(false) {} |
| 23 | 24 |
| 24 RtpFrameObject::RtpFrameObject(PacketBuffer* packet_buffer, | 25 RtpFrameObject::RtpFrameObject(PacketBuffer* packet_buffer, |
| 25 uint16_t first_packet, | 26 uint16_t first_packet, |
| 26 uint16_t last_packet) | 27 uint16_t last_packet) |
| 27 : packet_buffer_(packet_buffer), | 28 : packet_buffer_(packet_buffer), |
| 28 first_packet_(first_packet), | 29 first_packet_(first_packet), |
| 29 last_packet_(last_packet) {} | 30 last_packet_(last_packet) {} |
| 30 | 31 |
| 31 RtpFrameObject::~RtpFrameObject() { | 32 RtpFrameObject::~RtpFrameObject() { |
| 32 packet_buffer_->ReturnFrame(this); | 33 packet_buffer_->ReturnFrame(this); |
| 33 } | 34 } |
| 34 | 35 |
| 35 uint16_t RtpFrameObject::first_seq_num() const { | 36 uint16_t RtpFrameObject::first_seq_num() const { |
| 36 return first_packet_; | 37 return first_packet_; |
| 37 } | 38 } |
| 38 | 39 |
| 39 uint16_t RtpFrameObject::last_seq_num() const { | 40 uint16_t RtpFrameObject::last_seq_num() const { |
| 40 return last_packet_; | 41 return last_packet_; |
| 41 } | 42 } |
| 42 | 43 |
| 43 bool RtpFrameObject::GetBitstream(uint8_t* destination) const { | 44 bool RtpFrameObject::GetBitstream(uint8_t* destination) const { |
| 44 return packet_buffer_->GetBitstream(*this, destination); | 45 return packet_buffer_->GetBitstream(*this, destination); |
| 45 } | 46 } |
| 46 | 47 |
| 47 } // namespace video_coding | 48 } // namespace video_coding |
| 48 } // namespace webrtc | 49 } // namespace webrtc |
| OLD | NEW |