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 |
(...skipping 30 matching lines...) Expand all Loading... |
41 codec_type_ = first_packet->codec; | 41 codec_type_ = first_packet->codec; |
42 | 42 |
43 // TODO(philipel): Remove when encoded image is replaced by FrameObject. | 43 // TODO(philipel): Remove when encoded image is replaced by FrameObject. |
44 // VCMEncodedFrame members | 44 // VCMEncodedFrame members |
45 CopyCodecSpecific(&first_packet->video_header); | 45 CopyCodecSpecific(&first_packet->video_header); |
46 _completeFrame = true; | 46 _completeFrame = true; |
47 _payloadType = first_packet->payloadType; | 47 _payloadType = first_packet->payloadType; |
48 _timeStamp = first_packet->timestamp; | 48 _timeStamp = first_packet->timestamp; |
49 ntp_time_ms_ = first_packet->ntp_time_ms_; | 49 ntp_time_ms_ = first_packet->ntp_time_ms_; |
50 | 50 |
| 51 // Setting frame's playout delays to the same values |
| 52 // as of the first packet's. |
| 53 SetPlayoutDelay(first_packet->video_header.playout_delay); |
| 54 |
51 // Since FFmpeg use an optimized bitstream reader that reads in chunks of | 55 // Since FFmpeg use an optimized bitstream reader that reads in chunks of |
52 // 32/64 bits we have to add at least that much padding to the buffer | 56 // 32/64 bits we have to add at least that much padding to the buffer |
53 // to make sure the decoder doesn't read out of bounds. | 57 // to make sure the decoder doesn't read out of bounds. |
54 // NOTE! EncodedImage::_size is the size of the buffer (think capacity of | 58 // NOTE! EncodedImage::_size is the size of the buffer (think capacity of |
55 // an std::vector) and EncodedImage::_length is the actual size of | 59 // an std::vector) and EncodedImage::_length is the actual size of |
56 // the bitstream (think size of an std::vector). | 60 // the bitstream (think size of an std::vector). |
57 if (codec_type_ == kVideoCodecH264) | 61 if (codec_type_ == kVideoCodecH264) |
58 _size = frame_size + EncodedImage::kBufferPaddingBytesH264; | 62 _size = frame_size + EncodedImage::kBufferPaddingBytesH264; |
59 else | 63 else |
60 _size = frame_size; | 64 _size = frame_size; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 rtc::Optional<RTPVideoTypeHeader> RtpFrameObject::GetCodecHeader() const { | 133 rtc::Optional<RTPVideoTypeHeader> RtpFrameObject::GetCodecHeader() const { |
130 rtc::CritScope lock(&packet_buffer_->crit_); | 134 rtc::CritScope lock(&packet_buffer_->crit_); |
131 VCMPacket* packet = packet_buffer_->GetPacket(first_seq_num_); | 135 VCMPacket* packet = packet_buffer_->GetPacket(first_seq_num_); |
132 if (!packet) | 136 if (!packet) |
133 return rtc::Optional<RTPVideoTypeHeader>(); | 137 return rtc::Optional<RTPVideoTypeHeader>(); |
134 return rtc::Optional<RTPVideoTypeHeader>(packet->video_header.codecHeader); | 138 return rtc::Optional<RTPVideoTypeHeader>(packet->video_header.codecHeader); |
135 } | 139 } |
136 | 140 |
137 } // namespace video_coding | 141 } // namespace video_coding |
138 } // namespace webrtc | 142 } // namespace webrtc |
OLD | NEW |