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 timestamp(0), |
22 num_references(0), | 22 num_references(0), |
23 inter_layer_predicted(false) {} | 23 inter_layer_predicted(false) {} |
24 | 24 |
25 RtpFrameObject::RtpFrameObject(PacketBuffer* packet_buffer, | 25 RtpFrameObject::RtpFrameObject(PacketBuffer* packet_buffer, |
26 uint16_t first_seq_num, | 26 uint16_t first_seq_num, |
27 uint16_t last_seq_num, | 27 uint16_t last_seq_num, |
28 size_t frame_size, | 28 size_t frame_size, |
29 int times_nacked) | 29 int times_nacked, |
| 30 int64_t received_time) |
30 : packet_buffer_(packet_buffer), | 31 : packet_buffer_(packet_buffer), |
31 first_seq_num_(first_seq_num), | 32 first_seq_num_(first_seq_num), |
32 last_seq_num_(last_seq_num), | 33 last_seq_num_(last_seq_num), |
| 34 received_time_(received_time), |
33 times_nacked_(times_nacked) { | 35 times_nacked_(times_nacked) { |
34 size = frame_size; | 36 size = frame_size; |
35 VCMPacket* packet = packet_buffer_->GetPacket(first_seq_num); | 37 VCMPacket* packet = packet_buffer_->GetPacket(first_seq_num); |
36 if (packet) { | 38 if (packet) { |
37 // TODO(philipel): Remove when encoded image is replaced by FrameObject. | 39 // TODO(philipel): Remove when encoded image is replaced by FrameObject. |
38 // VCMEncodedFrame members | 40 // VCMEncodedFrame members |
39 CopyCodecSpecific(&packet->video_header); | 41 CopyCodecSpecific(&packet->video_header); |
40 _completeFrame = true; | 42 _completeFrame = true; |
41 _payloadType = packet->payloadType; | 43 _payloadType = packet->payloadType; |
42 _timeStamp = packet->timestamp; | 44 _timeStamp = packet->timestamp; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 } | 79 } |
78 | 80 |
79 VideoCodecType RtpFrameObject::codec_type() const { | 81 VideoCodecType RtpFrameObject::codec_type() const { |
80 return codec_type_; | 82 return codec_type_; |
81 } | 83 } |
82 | 84 |
83 bool RtpFrameObject::GetBitstream(uint8_t* destination) const { | 85 bool RtpFrameObject::GetBitstream(uint8_t* destination) const { |
84 return packet_buffer_->GetBitstream(*this, destination); | 86 return packet_buffer_->GetBitstream(*this, destination); |
85 } | 87 } |
86 | 88 |
| 89 uint32_t RtpFrameObject::Timestamp() const { |
| 90 return timestamp_; |
| 91 } |
| 92 |
| 93 int64_t RtpFrameObject::ReceivedTime() const { |
| 94 return received_time_; |
| 95 } |
| 96 |
| 97 int64_t RtpFrameObject::RenderTime() const { |
| 98 return _renderTimeMs; |
| 99 } |
| 100 |
87 RTPVideoTypeHeader* RtpFrameObject::GetCodecHeader() const { | 101 RTPVideoTypeHeader* RtpFrameObject::GetCodecHeader() const { |
88 VCMPacket* packet = packet_buffer_->GetPacket(first_seq_num_); | 102 VCMPacket* packet = packet_buffer_->GetPacket(first_seq_num_); |
89 if (!packet) | 103 if (!packet) |
90 return nullptr; | 104 return nullptr; |
91 return &packet->video_header.codecHeader; | 105 return &packet->video_header.codecHeader; |
92 } | 106 } |
93 | 107 |
94 } // namespace video_coding | 108 } // namespace video_coding |
95 } // namespace webrtc | 109 } // namespace webrtc |
OLD | NEW |