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" | |
13 #include "webrtc/modules/video_coding/packet_buffer.h" | 12 #include "webrtc/modules/video_coding/packet_buffer.h" |
14 | 13 |
15 namespace webrtc { | 14 namespace webrtc { |
16 namespace video_coding { | 15 namespace video_coding { |
17 | 16 |
18 FrameObject::FrameObject() | 17 FrameObject::FrameObject() |
19 : picture_id(0), | 18 : picture_id(0), |
20 spatial_layer(0), | 19 spatial_layer(0), |
21 timestamp(0), | 20 timestamp(0), |
22 num_references(0), | 21 num_references(0), |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 } | 89 } |
91 | 90 |
92 int64_t RtpFrameObject::ReceivedTime() const { | 91 int64_t RtpFrameObject::ReceivedTime() const { |
93 return received_time_; | 92 return received_time_; |
94 } | 93 } |
95 | 94 |
96 int64_t RtpFrameObject::RenderTime() const { | 95 int64_t RtpFrameObject::RenderTime() const { |
97 return _renderTimeMs; | 96 return _renderTimeMs; |
98 } | 97 } |
99 | 98 |
100 RTPVideoTypeHeader* RtpFrameObject::GetCodecHeader() const { | 99 rtc::Optional<RTPVideoTypeHeader> RtpFrameObject::GetCodecHeader() const { |
| 100 rtc::CritScope lock(&packet_buffer_->crit_); |
101 VCMPacket* packet = packet_buffer_->GetPacket(first_seq_num_); | 101 VCMPacket* packet = packet_buffer_->GetPacket(first_seq_num_); |
102 if (!packet) | 102 if (!packet) |
103 return nullptr; | 103 return rtc::Optional<RTPVideoTypeHeader>(); |
104 return &packet->video_header.codecHeader; | 104 return rtc::Optional<RTPVideoTypeHeader>(packet->video_header.codecHeader); |
105 } | 105 } |
106 | 106 |
107 } // namespace video_coding | 107 } // namespace video_coding |
108 } // namespace webrtc | 108 } // namespace webrtc |
OLD | NEW |