niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 1 | /* |
mflodman@webrtc.org | c80d9d9 | 2012-02-06 10:11:25 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 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 | |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 11 | #include "modules/video_coding/frame_buffer.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 12 | |
pbos@webrtc.org | 12dc1a3 | 2013-08-05 16:22:53 | [diff] [blame] | 13 | #include <assert.h> |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 14 | #include <string.h> |
| 15 | |
Yves Gerey | 3e70781 | 2018-11-28 15:47:49 | [diff] [blame] | 16 | #include "api/video/encoded_image.h" |
| 17 | #include "api/video/video_timing.h" |
Yves Gerey | 3e70781 | 2018-11-28 15:47:49 | [diff] [blame] | 18 | #include "modules/video_coding/include/video_codec_interface.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 19 | #include "modules/video_coding/packet.h" |
| 20 | #include "rtc_base/checks.h" |
| 21 | #include "rtc_base/logging.h" |
| 22 | #include "rtc_base/trace_event.h" |
agalusza@google.com | d818dcb | 2013-07-29 21:48:11 | [diff] [blame] | 23 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 24 | namespace webrtc { |
| 25 | |
stefan@webrtc.org | c3d8910 | 2011-09-08 06:50:28 | [diff] [blame] | 26 | VCMFrameBuffer::VCMFrameBuffer() |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 27 | : _state(kStateEmpty), _nackCount(0), _latestPacketTimeMs(-1) {} |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 28 | |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 29 | VCMFrameBuffer::~VCMFrameBuffer() {} |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 30 | |
Niels Möller | 87e2d78 | 2019-03-07 09:18:23 | [diff] [blame] | 31 | webrtc::VideoFrameType VCMFrameBuffer::FrameType() const { |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 32 | return _sessionInfo.FrameType(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 33 | } |
| 34 | |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 35 | int32_t VCMFrameBuffer::GetLowSeqNum() const { |
| 36 | return _sessionInfo.LowSequenceNumber(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 37 | } |
| 38 | |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 39 | int32_t VCMFrameBuffer::GetHighSeqNum() const { |
| 40 | return _sessionInfo.HighSequenceNumber(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 41 | } |
| 42 | |
stefan@webrtc.org | ffd28f9 | 2011-10-19 15:55:39 | [diff] [blame] | 43 | int VCMFrameBuffer::PictureId() const { |
| 44 | return _sessionInfo.PictureId(); |
| 45 | } |
| 46 | |
mikhal@webrtc.org | f5ee1dc | 2011-12-08 19:04:47 | [diff] [blame] | 47 | int VCMFrameBuffer::TemporalId() const { |
| 48 | return _sessionInfo.TemporalId(); |
| 49 | } |
| 50 | |
henrik.lundin@webrtc.org | eda86dc | 2011-12-13 14:11:06 | [diff] [blame] | 51 | bool VCMFrameBuffer::LayerSync() const { |
| 52 | return _sessionInfo.LayerSync(); |
| 53 | } |
| 54 | |
mikhal@webrtc.org | f5ee1dc | 2011-12-08 19:04:47 | [diff] [blame] | 55 | int VCMFrameBuffer::Tl0PicId() const { |
| 56 | return _sessionInfo.Tl0PicId(); |
| 57 | } |
| 58 | |
stefan | a669a3a | 2016-10-06 12:04:52 | [diff] [blame] | 59 | std::vector<NaluInfo> VCMFrameBuffer::GetNaluInfos() const { |
| 60 | return _sessionInfo.GetNaluInfos(); |
| 61 | } |
| 62 | |
asapersson | 9a4cd87 | 2015-10-23 07:27:14 | [diff] [blame] | 63 | void VCMFrameBuffer::SetGofInfo(const GofInfoVP9& gof_info, size_t idx) { |
tommi | db23ea6 | 2017-03-03 15:21:18 | [diff] [blame] | 64 | TRACE_EVENT0("webrtc", "VCMFrameBuffer::SetGofInfo"); |
asapersson | 9a4cd87 | 2015-10-23 07:27:14 | [diff] [blame] | 65 | _sessionInfo.SetGofInfo(gof_info, idx); |
| 66 | // TODO(asapersson): Consider adding hdr->VP9.ref_picture_id for testing. |
| 67 | _codecSpecificInfo.codecSpecific.VP9.temporal_idx = |
| 68 | gof_info.temporal_idx[idx]; |
| 69 | _codecSpecificInfo.codecSpecific.VP9.temporal_up_switch = |
| 70 | gof_info.temporal_up_switch[idx]; |
| 71 | } |
| 72 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 73 | // Insert packet |
Jonas Olsson | a4d8737 | 2019-07-05 17:08:33 | [diff] [blame] | 74 | VCMFrameBufferEnum VCMFrameBuffer::InsertPacket(const VCMPacket& packet, |
| 75 | int64_t timeInMs, |
| 76 | const FrameData& frame_data) { |
tommi | db23ea6 | 2017-03-03 15:21:18 | [diff] [blame] | 77 | TRACE_EVENT0("webrtc", "VCMFrameBuffer::InsertPacket"); |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 78 | assert(!(NULL == packet.dataPtr && packet.sizeBytes > 0)); |
| 79 | if (packet.dataPtr != NULL) { |
| 80 | _payloadType = packet.payloadType; |
| 81 | } |
| 82 | |
| 83 | if (kStateEmpty == _state) { |
| 84 | // First packet (empty and/or media) inserted into this frame. |
| 85 | // store some info and set some initial values. |
Niels Möller | 2377588 | 2018-08-16 08:24:12 | [diff] [blame] | 86 | SetTimestamp(packet.timestamp); |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 87 | // We only take the ntp timestamp of the first packet of a frame. |
| 88 | ntp_time_ms_ = packet.ntp_time_ms_; |
Niels Möller | d5e02f0 | 2019-02-20 12:12:21 | [diff] [blame] | 89 | _codec = packet.codec(); |
Niels Möller | abbc50e | 2019-04-24 07:41:16 | [diff] [blame] | 90 | if (packet.video_header.frame_type != VideoFrameType::kEmptyFrame) { |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 91 | // first media packet |
| 92 | SetState(kStateIncomplete); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 93 | } |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 94 | } |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 95 | |
Niels Möller | d60e32a | 2020-09-23 12:26:42 | [diff] [blame] | 96 | size_t oldSize = encoded_image_buffer_ ? encoded_image_buffer_->size() : 0; |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 97 | uint32_t requiredSizeBytes = |
Niels Möller | f0eee00 | 2018-11-28 15:31:29 | [diff] [blame] | 98 | size() + packet.sizeBytes + |
Niels Möller | 009ab3c | 2019-03-08 10:26:58 | [diff] [blame] | 99 | (packet.insertStartCode ? kH264StartCodeLengthBytes : 0); |
Niels Möller | d60e32a | 2020-09-23 12:26:42 | [diff] [blame] | 100 | if (requiredSizeBytes > oldSize) { |
Niels Möller | 24871e4 | 2019-01-17 10:31:13 | [diff] [blame] | 101 | const uint8_t* prevBuffer = data(); |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 102 | const uint32_t increments = |
| 103 | requiredSizeBytes / kBufferIncStepSizeBytes + |
| 104 | (requiredSizeBytes % kBufferIncStepSizeBytes > 0); |
Niels Möller | d60e32a | 2020-09-23 12:26:42 | [diff] [blame] | 105 | const uint32_t newSize = oldSize + increments * kBufferIncStepSizeBytes; |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 106 | if (newSize > kMaxJBFrameSizeBytes) { |
Mirko Bonadei | 675513b | 2017-11-09 10:09:25 | [diff] [blame] | 107 | RTC_LOG(LS_ERROR) << "Failed to insert packet due to frame being too " |
| 108 | "big."; |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 109 | return kSizeError; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 110 | } |
Niels Möller | 2449d7a | 2019-09-30 08:18:16 | [diff] [blame] | 111 | if (data() == nullptr) { |
| 112 | encoded_image_buffer_ = EncodedImageBuffer::Create(newSize); |
| 113 | SetEncodedData(encoded_image_buffer_); |
| 114 | set_size(0); |
| 115 | } else { |
| 116 | RTC_CHECK(encoded_image_buffer_ != nullptr); |
| 117 | RTC_DCHECK_EQ(encoded_image_buffer_->data(), data()); |
| 118 | encoded_image_buffer_->Realloc(newSize); |
| 119 | } |
Niels Möller | 24871e4 | 2019-01-17 10:31:13 | [diff] [blame] | 120 | _sessionInfo.UpdateDataPointers(prevBuffer, data()); |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 121 | } |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 122 | |
Niels Möller | d5e02f0 | 2019-02-20 12:12:21 | [diff] [blame] | 123 | if (packet.width() > 0 && packet.height() > 0) { |
| 124 | _encodedWidth = packet.width(); |
| 125 | _encodedHeight = packet.height(); |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 126 | } |
henrik.lundin@webrtc.org | 473bac8 | 2011-08-17 09:47:33 | [diff] [blame] | 127 | |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 128 | // Don't copy payload specific data for empty packets (e.g padding packets). |
| 129 | if (packet.sizeBytes > 0) |
isheriff | 6b4b5f3 | 2016-06-08 07:24:21 | [diff] [blame] | 130 | CopyCodecSpecific(&packet.video_header); |
stefan@webrtc.org | 3417eb4 | 2013-05-21 15:25:53 | [diff] [blame] | 131 | |
Niels Möller | 08ae7ce | 2020-09-23 13:58:12 | [diff] [blame] | 132 | int retVal = _sessionInfo.InsertPacket( |
| 133 | packet, encoded_image_buffer_ ? encoded_image_buffer_->data() : nullptr, |
| 134 | frame_data); |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 135 | if (retVal == -1) { |
| 136 | return kSizeError; |
| 137 | } else if (retVal == -2) { |
| 138 | return kDuplicatePacket; |
| 139 | } else if (retVal == -3) { |
| 140 | return kOutOfBoundsPacket; |
| 141 | } |
Niels Möller | 77536a2 | 2019-01-15 07:50:01 | [diff] [blame] | 142 | // update size |
| 143 | set_size(size() + static_cast<uint32_t>(retVal)); |
henrik.lundin@webrtc.org | 473bac8 | 2011-08-17 09:47:33 | [diff] [blame] | 144 | |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 145 | _latestPacketTimeMs = timeInMs; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 146 | |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 147 | // http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/12.07.00_60/ |
| 148 | // ts_126114v120700p.pdf Section 7.4.5. |
| 149 | // The MTSI client shall add the payload bytes as defined in this clause |
| 150 | // onto the last RTP packet in each group of packets which make up a key |
| 151 | // frame (I-frame or IDR frame in H.264 (AVC), or an IRAP picture in H.265 |
| 152 | // (HEVC)). |
| 153 | if (packet.markerBit) { |
perkj | 414dda1 | 2016-07-04 08:45:23 | [diff] [blame] | 154 | rotation_ = packet.video_header.rotation; |
ilnik | 00d802b | 2017-04-11 17:34:31 | [diff] [blame] | 155 | content_type_ = packet.video_header.content_type; |
Ilya Nikolaevskiy | b6c462d | 2018-06-05 13:21:32 | [diff] [blame] | 156 | if (packet.video_header.video_timing.flags != VideoSendTiming::kInvalid) { |
ilnik | 04f4d12 | 2017-06-19 14:18:55 | [diff] [blame] | 157 | timing_.encode_start_ms = |
| 158 | ntp_time_ms_ + packet.video_header.video_timing.encode_start_delta_ms; |
| 159 | timing_.encode_finish_ms = |
| 160 | ntp_time_ms_ + |
| 161 | packet.video_header.video_timing.encode_finish_delta_ms; |
| 162 | timing_.packetization_finish_ms = |
| 163 | ntp_time_ms_ + |
| 164 | packet.video_header.video_timing.packetization_finish_delta_ms; |
| 165 | timing_.pacer_exit_ms = |
| 166 | ntp_time_ms_ + packet.video_header.video_timing.pacer_exit_delta_ms; |
| 167 | timing_.network_timestamp_ms = |
| 168 | ntp_time_ms_ + |
Danil Chapovalov | 996eb9e | 2017-10-30 16:14:41 | [diff] [blame] | 169 | packet.video_header.video_timing.network_timestamp_delta_ms; |
ilnik | 04f4d12 | 2017-06-19 14:18:55 | [diff] [blame] | 170 | timing_.network2_timestamp_ms = |
| 171 | ntp_time_ms_ + |
Danil Chapovalov | 996eb9e | 2017-10-30 16:14:41 | [diff] [blame] | 172 | packet.video_header.video_timing.network2_timestamp_delta_ms; |
ilnik | 04f4d12 | 2017-06-19 14:18:55 | [diff] [blame] | 173 | } |
sprang | ba050a6 | 2017-08-18 09:51:12 | [diff] [blame] | 174 | timing_.flags = packet.video_header.video_timing.flags; |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 175 | } |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 176 | |
Niels Möller | d5e02f0 | 2019-02-20 12:12:21 | [diff] [blame] | 177 | if (packet.is_first_packet_in_frame()) { |
isheriff | 6b4b5f3 | 2016-06-08 07:24:21 | [diff] [blame] | 178 | playout_delay_ = packet.video_header.playout_delay; |
| 179 | } |
| 180 | |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 181 | if (_sessionInfo.complete()) { |
| 182 | SetState(kStateComplete); |
| 183 | return kCompleteSession; |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 184 | } |
| 185 | return kIncomplete; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 186 | } |
| 187 | |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 188 | int64_t VCMFrameBuffer::LatestPacketTimeMs() const { |
tommi | db23ea6 | 2017-03-03 15:21:18 | [diff] [blame] | 189 | TRACE_EVENT0("webrtc", "VCMFrameBuffer::LatestPacketTimeMs"); |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 190 | return _latestPacketTimeMs; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 191 | } |
| 192 | |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 193 | void VCMFrameBuffer::IncrementNackCount() { |
tommi | db23ea6 | 2017-03-03 15:21:18 | [diff] [blame] | 194 | TRACE_EVENT0("webrtc", "VCMFrameBuffer::IncrementNackCount"); |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 195 | _nackCount++; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 196 | } |
| 197 | |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 198 | int16_t VCMFrameBuffer::GetNackCount() const { |
tommi | db23ea6 | 2017-03-03 15:21:18 | [diff] [blame] | 199 | TRACE_EVENT0("webrtc", "VCMFrameBuffer::GetNackCount"); |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 200 | return _nackCount; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 201 | } |
| 202 | |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 203 | bool VCMFrameBuffer::HaveFirstPacket() const { |
tommi | db23ea6 | 2017-03-03 15:21:18 | [diff] [blame] | 204 | TRACE_EVENT0("webrtc", "VCMFrameBuffer::HaveFirstPacket"); |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 205 | return _sessionInfo.HaveFirstPacket(); |
stefan@webrtc.org | 885cd13 | 2013-04-16 09:38:26 | [diff] [blame] | 206 | } |
| 207 | |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 208 | int VCMFrameBuffer::NumPackets() const { |
tommi | db23ea6 | 2017-03-03 15:21:18 | [diff] [blame] | 209 | TRACE_EVENT0("webrtc", "VCMFrameBuffer::NumPackets"); |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 210 | return _sessionInfo.NumPackets(); |
agalusza@google.com | d818dcb | 2013-07-29 21:48:11 | [diff] [blame] | 211 | } |
| 212 | |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 213 | void VCMFrameBuffer::Reset() { |
tommi | db23ea6 | 2017-03-03 15:21:18 | [diff] [blame] | 214 | TRACE_EVENT0("webrtc", "VCMFrameBuffer::Reset"); |
Niels Möller | 77536a2 | 2019-01-15 07:50:01 | [diff] [blame] | 215 | set_size(0); |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 216 | _sessionInfo.Reset(); |
| 217 | _payloadType = 0; |
| 218 | _nackCount = 0; |
| 219 | _latestPacketTimeMs = -1; |
| 220 | _state = kStateEmpty; |
| 221 | VCMEncodedFrame::Reset(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 222 | } |
| 223 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 224 | // Set state of frame |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 225 | void VCMFrameBuffer::SetState(VCMFrameBufferStateEnum state) { |
tommi | db23ea6 | 2017-03-03 15:21:18 | [diff] [blame] | 226 | TRACE_EVENT0("webrtc", "VCMFrameBuffer::SetState"); |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 227 | if (_state == state) { |
| 228 | return; |
| 229 | } |
| 230 | switch (state) { |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 231 | case kStateIncomplete: |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 232 | // we can go to this state from state kStateEmpty |
| 233 | assert(_state == kStateEmpty); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 234 | |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 235 | // Do nothing, we received a packet |
| 236 | break; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 237 | |
| 238 | case kStateComplete: |
Niels Möller | 375b346 | 2019-01-10 14:35:56 | [diff] [blame] | 239 | assert(_state == kStateEmpty || _state == kStateIncomplete); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 240 | |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 241 | break; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 242 | |
| 243 | case kStateEmpty: |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 244 | // Should only be set to empty through Reset(). |
| 245 | assert(false); |
| 246 | break; |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 247 | } |
| 248 | _state = state; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 249 | } |
| 250 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 251 | // Get current state of frame |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 252 | VCMFrameBufferStateEnum VCMFrameBuffer::GetState() const { |
| 253 | return _state; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 254 | } |
| 255 | |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 256 | void VCMFrameBuffer::PrepareForDecode(bool continuous) { |
tommi | db23ea6 | 2017-03-03 15:21:18 | [diff] [blame] | 257 | TRACE_EVENT0("webrtc", "VCMFrameBuffer::PrepareForDecode"); |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 258 | size_t bytes_removed = _sessionInfo.MakeDecodable(); |
Niels Möller | 77536a2 | 2019-01-15 07:50:01 | [diff] [blame] | 259 | set_size(size() - bytes_removed); |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 260 | // Transfer frame information to EncodedFrame and create any codec |
| 261 | // specific information. |
| 262 | _frameType = _sessionInfo.FrameType(); |
philipel | 9d3ab61 | 2015-12-21 12:12:39 | [diff] [blame] | 263 | _missingFrame = !continuous; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 | [diff] [blame] | 264 | } |
| 265 | |
agalusza@google.com | d818dcb | 2013-07-29 21:48:11 | [diff] [blame] | 266 | } // namespace webrtc |