niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
mikhal@webrtc.org | a2031d5 | 2012-07-31 15:53:44 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [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 06:47:31 +0200 | [diff] [blame] | 11 | #include "modules/video_coding/generic_decoder.h" |
tommi | 5b7fc8c | 2017-07-05 16:45:57 -0700 | [diff] [blame] | 12 | |
Yves Gerey | 3e70781 | 2018-11-28 16:47:49 +0100 | [diff] [blame] | 13 | #include <stddef.h> |
ilnik | 2edc684 | 2017-07-06 03:06:50 -0700 | [diff] [blame] | 14 | #include <algorithm> |
| 15 | |
Yves Gerey | 3e70781 | 2018-11-28 16:47:49 +0100 | [diff] [blame] | 16 | #include "api/video/video_timing.h" |
| 17 | #include "modules/video_coding/include/video_error_codes.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 18 | #include "rtc_base/checks.h" |
| 19 | #include "rtc_base/logging.h" |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame^] | 20 | #include "rtc_base/time_utils.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 21 | #include "rtc_base/trace_event.h" |
| 22 | #include "system_wrappers/include/clock.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 23 | |
| 24 | namespace webrtc { |
| 25 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 26 | VCMDecodedFrameCallback::VCMDecodedFrameCallback(VCMTiming* timing, |
stefan@webrtc.org | a678a3b | 2013-01-21 07:42:11 +0000 | [diff] [blame] | 27 | Clock* clock) |
tommi | d0a71ba | 2017-03-14 04:16:20 -0700 | [diff] [blame] | 28 | : _clock(clock), |
Peter Boström | b7d9a97 | 2015-12-18 16:01:11 +0100 | [diff] [blame] | 29 | _timing(timing), |
| 30 | _timestampMap(kDecoderFrameMemoryLength), |
ilnik | 04f4d12 | 2017-06-19 07:18:55 -0700 | [diff] [blame] | 31 | _lastReceivedPictureID(0) { |
| 32 | ntp_offset_ = |
| 33 | _clock->CurrentNtpInMilliseconds() - _clock->TimeInMilliseconds(); |
| 34 | } |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 35 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 36 | VCMDecodedFrameCallback::~VCMDecodedFrameCallback() {} |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 37 | |
stefan@webrtc.org | 06887ae | 2011-10-10 14:17:46 +0000 | [diff] [blame] | 38 | void VCMDecodedFrameCallback::SetUserReceiveCallback( |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 39 | VCMReceiveCallback* receiveCallback) { |
tommi | d0a71ba | 2017-03-14 04:16:20 -0700 | [diff] [blame] | 40 | RTC_DCHECK(construction_thread_.CalledOnValidThread()); |
| 41 | RTC_DCHECK((!_receiveCallback && receiveCallback) || |
| 42 | (_receiveCallback && !receiveCallback)); |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 43 | _receiveCallback = receiveCallback; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 44 | } |
| 45 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 46 | VCMReceiveCallback* VCMDecodedFrameCallback::UserReceiveCallback() { |
tommi | d0a71ba | 2017-03-14 04:16:20 -0700 | [diff] [blame] | 47 | // Called on the decode thread via VCMCodecDataBase::GetDecoder. |
| 48 | // The callback must always have been set before this happens. |
| 49 | RTC_DCHECK(_receiveCallback); |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 50 | return _receiveCallback; |
wuchengli@chromium.org | 0d94c2f | 2013-08-12 14:20:49 +0000 | [diff] [blame] | 51 | } |
| 52 | |
Miguel Casas-Sanchez | 4765070 | 2015-05-29 17:21:40 -0700 | [diff] [blame] | 53 | int32_t VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage) { |
Per | 327d8ba | 2015-11-10 14:00:27 +0100 | [diff] [blame] | 54 | return Decoded(decodedImage, -1); |
| 55 | } |
| 56 | |
| 57 | int32_t VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage, |
| 58 | int64_t decode_time_ms) { |
sakal | cc452e1 | 2017-02-09 04:53:45 -0800 | [diff] [blame] | 59 | Decoded(decodedImage, |
Danil Chapovalov | 0040b66 | 2018-06-18 10:48:16 +0200 | [diff] [blame] | 60 | decode_time_ms >= 0 ? absl::optional<int32_t>(decode_time_ms) |
| 61 | : absl::nullopt, |
| 62 | absl::nullopt); |
sakal | cc452e1 | 2017-02-09 04:53:45 -0800 | [diff] [blame] | 63 | return WEBRTC_VIDEO_CODEC_OK; |
| 64 | } |
| 65 | |
| 66 | void VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage, |
Danil Chapovalov | 0040b66 | 2018-06-18 10:48:16 +0200 | [diff] [blame] | 67 | absl::optional<int32_t> decode_time_ms, |
| 68 | absl::optional<uint8_t> qp) { |
tommi | d0a71ba | 2017-03-14 04:16:20 -0700 | [diff] [blame] | 69 | RTC_DCHECK(_receiveCallback) << "Callback must not be null at this point"; |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 70 | TRACE_EVENT_INSTANT1("webrtc", "VCMDecodedFrameCallback::Decoded", |
| 71 | "timestamp", decodedImage.timestamp()); |
| 72 | // TODO(holmer): We should improve this so that we can handle multiple |
| 73 | // callbacks from one call to Decode(). |
Lu Liu | 352314a | 2018-02-21 19:38:59 +0000 | [diff] [blame] | 74 | VCMFrameInformation* frameInfo; |
| 75 | { |
| 76 | rtc::CritScope cs(&lock_); |
| 77 | frameInfo = _timestampMap.Pop(decodedImage.timestamp()); |
| 78 | } |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 79 | |
| 80 | if (frameInfo == NULL) { |
Mirko Bonadei | 675513b | 2017-11-09 11:09:25 +0100 | [diff] [blame] | 81 | RTC_LOG(LS_WARNING) << "Too many frames backed up in the decoder, dropping " |
| 82 | "this one."; |
sakal | cc452e1 | 2017-02-09 04:53:45 -0800 | [diff] [blame] | 83 | return; |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 84 | } |
| 85 | |
| 86 | const int64_t now_ms = _clock->TimeInMilliseconds(); |
sakal | cc452e1 | 2017-02-09 04:53:45 -0800 | [diff] [blame] | 87 | if (!decode_time_ms) { |
Oskar Sundbom | 6bd3902 | 2017-11-16 10:54:49 +0100 | [diff] [blame] | 88 | decode_time_ms = now_ms - frameInfo->decodeStartTimeMs; |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 89 | } |
sakal | cc452e1 | 2017-02-09 04:53:45 -0800 | [diff] [blame] | 90 | _timing->StopDecodeTimer(decodedImage.timestamp(), *decode_time_ms, now_ms, |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 91 | frameInfo->renderTimeMs); |
| 92 | |
ilnik | 04f4d12 | 2017-06-19 07:18:55 -0700 | [diff] [blame] | 93 | // Report timing information. |
Benjamin Wright | 3f10ca8 | 2018-12-07 03:45:19 -0800 | [diff] [blame] | 94 | TimingFrameInfo timing_frame_info; |
Ilya Nikolaevskiy | b6c462d | 2018-06-05 15:21:32 +0200 | [diff] [blame] | 95 | if (frameInfo->timing.flags != VideoSendTiming::kInvalid) { |
ilnik | 2edc684 | 2017-07-06 03:06:50 -0700 | [diff] [blame] | 96 | int64_t capture_time_ms = decodedImage.ntp_time_ms() - ntp_offset_; |
ilnik | 04f4d12 | 2017-06-19 07:18:55 -0700 | [diff] [blame] | 97 | // Convert remote timestamps to local time from ntp timestamps. |
| 98 | frameInfo->timing.encode_start_ms -= ntp_offset_; |
| 99 | frameInfo->timing.encode_finish_ms -= ntp_offset_; |
| 100 | frameInfo->timing.packetization_finish_ms -= ntp_offset_; |
| 101 | frameInfo->timing.pacer_exit_ms -= ntp_offset_; |
| 102 | frameInfo->timing.network_timestamp_ms -= ntp_offset_; |
| 103 | frameInfo->timing.network2_timestamp_ms -= ntp_offset_; |
ilnik | 2edc684 | 2017-07-06 03:06:50 -0700 | [diff] [blame] | 104 | |
| 105 | int64_t sender_delta_ms = 0; |
| 106 | if (decodedImage.ntp_time_ms() < 0) { |
| 107 | // Sender clock is not estimated yet. Make sure that sender times are all |
| 108 | // negative to indicate that. Yet they still should be relatively correct. |
| 109 | sender_delta_ms = |
| 110 | std::max({capture_time_ms, frameInfo->timing.encode_start_ms, |
| 111 | frameInfo->timing.encode_finish_ms, |
| 112 | frameInfo->timing.packetization_finish_ms, |
| 113 | frameInfo->timing.pacer_exit_ms, |
| 114 | frameInfo->timing.network_timestamp_ms, |
| 115 | frameInfo->timing.network2_timestamp_ms}) + |
| 116 | 1; |
| 117 | } |
| 118 | |
ilnik | 2edc684 | 2017-07-06 03:06:50 -0700 | [diff] [blame] | 119 | |
| 120 | timing_frame_info.capture_time_ms = capture_time_ms - sender_delta_ms; |
| 121 | timing_frame_info.encode_start_ms = |
| 122 | frameInfo->timing.encode_start_ms - sender_delta_ms; |
| 123 | timing_frame_info.encode_finish_ms = |
| 124 | frameInfo->timing.encode_finish_ms - sender_delta_ms; |
| 125 | timing_frame_info.packetization_finish_ms = |
| 126 | frameInfo->timing.packetization_finish_ms - sender_delta_ms; |
| 127 | timing_frame_info.pacer_exit_ms = |
| 128 | frameInfo->timing.pacer_exit_ms - sender_delta_ms; |
| 129 | timing_frame_info.network_timestamp_ms = |
| 130 | frameInfo->timing.network_timestamp_ms - sender_delta_ms; |
| 131 | timing_frame_info.network2_timestamp_ms = |
| 132 | frameInfo->timing.network2_timestamp_ms - sender_delta_ms; |
ilnik | 04f4d12 | 2017-06-19 07:18:55 -0700 | [diff] [blame] | 133 | } |
| 134 | |
Benjamin Wright | 3f10ca8 | 2018-12-07 03:45:19 -0800 | [diff] [blame] | 135 | timing_frame_info.flags = frameInfo->timing.flags; |
| 136 | timing_frame_info.decode_start_ms = frameInfo->decodeStartTimeMs; |
| 137 | timing_frame_info.decode_finish_ms = now_ms; |
| 138 | timing_frame_info.render_time_ms = frameInfo->renderTimeMs; |
| 139 | timing_frame_info.rtp_timestamp = decodedImage.timestamp(); |
| 140 | timing_frame_info.receive_start_ms = frameInfo->timing.receive_start_ms; |
| 141 | timing_frame_info.receive_finish_ms = frameInfo->timing.receive_finish_ms; |
| 142 | _timing->SetTimingFrameInfo(timing_frame_info); |
| 143 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 144 | decodedImage.set_timestamp_us(frameInfo->renderTimeMs * |
| 145 | rtc::kNumMicrosecsPerMillisec); |
sakal | 55d932b | 2016-09-30 06:19:08 -0700 | [diff] [blame] | 146 | decodedImage.set_rotation(frameInfo->rotation); |
ilnik | 00d802b | 2017-04-11 10:34:31 -0700 | [diff] [blame] | 147 | _receiveCallback->FrameToRender(decodedImage, qp, frameInfo->content_type); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 148 | } |
| 149 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 150 | int32_t VCMDecodedFrameCallback::ReceivedDecodedReferenceFrame( |
| 151 | const uint64_t pictureId) { |
tommi | d0a71ba | 2017-03-14 04:16:20 -0700 | [diff] [blame] | 152 | return _receiveCallback->ReceivedDecodedReferenceFrame(pictureId); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 153 | } |
| 154 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 155 | int32_t VCMDecodedFrameCallback::ReceivedDecodedFrame( |
| 156 | const uint64_t pictureId) { |
| 157 | _lastReceivedPictureID = pictureId; |
| 158 | return 0; |
| 159 | } |
| 160 | |
| 161 | uint64_t VCMDecodedFrameCallback::LastReceivedPictureID() const { |
| 162 | return _lastReceivedPictureID; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 163 | } |
| 164 | |
Peter Boström | b7d9a97 | 2015-12-18 16:01:11 +0100 | [diff] [blame] | 165 | void VCMDecodedFrameCallback::OnDecoderImplementationName( |
| 166 | const char* implementation_name) { |
tommi | d0a71ba | 2017-03-14 04:16:20 -0700 | [diff] [blame] | 167 | _receiveCallback->OnDecoderImplementationName(implementation_name); |
Peter Boström | b7d9a97 | 2015-12-18 16:01:11 +0100 | [diff] [blame] | 168 | } |
| 169 | |
pbos | 1968d3f | 2015-09-28 08:52:18 -0700 | [diff] [blame] | 170 | void VCMDecodedFrameCallback::Map(uint32_t timestamp, |
| 171 | VCMFrameInformation* frameInfo) { |
Lu Liu | 352314a | 2018-02-21 19:38:59 +0000 | [diff] [blame] | 172 | rtc::CritScope cs(&lock_); |
pbos | 1968d3f | 2015-09-28 08:52:18 -0700 | [diff] [blame] | 173 | _timestampMap.Add(timestamp, frameInfo); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 174 | } |
| 175 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 176 | int32_t VCMDecodedFrameCallback::Pop(uint32_t timestamp) { |
Lu Liu | 352314a | 2018-02-21 19:38:59 +0000 | [diff] [blame] | 177 | rtc::CritScope cs(&lock_); |
| 178 | if (_timestampMap.Pop(timestamp) == NULL) { |
| 179 | return VCM_GENERAL_ERROR; |
| 180 | } |
| 181 | return VCM_OK; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 182 | } |
| 183 | |
Magnus Jedvert | 46a2765 | 2017-11-13 14:10:02 +0100 | [diff] [blame] | 184 | VCMGenericDecoder::VCMGenericDecoder(std::unique_ptr<VideoDecoder> decoder) |
| 185 | : VCMGenericDecoder(decoder.release(), false /* isExternal */) {} |
| 186 | |
Peter Boström | 187db63 | 2015-12-01 17:20:01 +0100 | [diff] [blame] | 187 | VCMGenericDecoder::VCMGenericDecoder(VideoDecoder* decoder, bool isExternal) |
| 188 | : _callback(NULL), |
| 189 | _frameInfos(), |
| 190 | _nextFrameInfoIdx(0), |
tommi | 5b7fc8c | 2017-07-05 16:45:57 -0700 | [diff] [blame] | 191 | decoder_(decoder), |
Kári Tristan Helgason | 84ccb2d | 2018-08-16 14:35:26 +0200 | [diff] [blame] | 192 | _codecType(kVideoCodecGeneric), |
guidou | c337258 | 2017-04-04 07:16:21 -0700 | [diff] [blame] | 193 | _isExternal(isExternal), |
tommi | 5b7fc8c | 2017-07-05 16:45:57 -0700 | [diff] [blame] | 194 | _last_keyframe_content_type(VideoContentType::UNSPECIFIED) { |
| 195 | RTC_DCHECK(decoder_); |
| 196 | } |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 197 | |
tommi | 5b7fc8c | 2017-07-05 16:45:57 -0700 | [diff] [blame] | 198 | VCMGenericDecoder::~VCMGenericDecoder() { |
| 199 | decoder_->Release(); |
| 200 | if (_isExternal) |
| 201 | decoder_.release(); |
tommi | 058aa71 | 2017-07-15 11:33:35 -0700 | [diff] [blame] | 202 | RTC_DCHECK(_isExternal || decoder_); |
tommi | 5b7fc8c | 2017-07-05 16:45:57 -0700 | [diff] [blame] | 203 | } |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 204 | |
pbos@webrtc.org | 7b859cc | 2013-04-02 15:54:38 +0000 | [diff] [blame] | 205 | int32_t VCMGenericDecoder::InitDecode(const VideoCodec* settings, |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 206 | int32_t numberOfCores) { |
| 207 | TRACE_EVENT0("webrtc", "VCMGenericDecoder::InitDecode"); |
| 208 | _codecType = settings->codecType; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 209 | |
tommi | 5b7fc8c | 2017-07-05 16:45:57 -0700 | [diff] [blame] | 210 | return decoder_->InitDecode(settings, numberOfCores); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 211 | } |
| 212 | |
pbos | d9eec76 | 2015-11-17 06:03:43 -0800 | [diff] [blame] | 213 | int32_t VCMGenericDecoder::Decode(const VCMEncodedFrame& frame, int64_t nowMs) { |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 214 | TRACE_EVENT1("webrtc", "VCMGenericDecoder::Decode", "timestamp", |
Niels Möller | 2377588 | 2018-08-16 10:24:12 +0200 | [diff] [blame] | 215 | frame.Timestamp()); |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 216 | _frameInfos[_nextFrameInfoIdx].decodeStartTimeMs = nowMs; |
| 217 | _frameInfos[_nextFrameInfoIdx].renderTimeMs = frame.RenderTimeMs(); |
| 218 | _frameInfos[_nextFrameInfoIdx].rotation = frame.rotation(); |
| 219 | _frameInfos[_nextFrameInfoIdx].timing = frame.video_timing(); |
| 220 | // Set correctly only for key frames. Thus, use latest key frame |
| 221 | // content type. If the corresponding key frame was lost, decode will fail |
| 222 | // and content type will be ignored. |
| 223 | if (frame.FrameType() == kVideoFrameKey) { |
| 224 | _frameInfos[_nextFrameInfoIdx].content_type = frame.contentType(); |
| 225 | _last_keyframe_content_type = frame.contentType(); |
| 226 | } else { |
| 227 | _frameInfos[_nextFrameInfoIdx].content_type = _last_keyframe_content_type; |
| 228 | } |
Niels Möller | 2377588 | 2018-08-16 10:24:12 +0200 | [diff] [blame] | 229 | _callback->Map(frame.Timestamp(), &_frameInfos[_nextFrameInfoIdx]); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 230 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 231 | _nextFrameInfoIdx = (_nextFrameInfoIdx + 1) % kDecoderFrameMemoryLength; |
| 232 | int32_t ret = decoder_->Decode(frame.EncodedImage(), frame.MissingFrame(), |
| 233 | frame.CodecSpecific(), frame.RenderTimeMs()); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 234 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 235 | _callback->OnDecoderImplementationName(decoder_->ImplementationName()); |
| 236 | if (ret < WEBRTC_VIDEO_CODEC_OK) { |
| 237 | RTC_LOG(LS_WARNING) << "Failed to decode frame with timestamp " |
Niels Möller | 2377588 | 2018-08-16 10:24:12 +0200 | [diff] [blame] | 238 | << frame.Timestamp() << ", error code: " << ret; |
| 239 | _callback->Pop(frame.Timestamp()); |
Lu Liu | 352314a | 2018-02-21 19:38:59 +0000 | [diff] [blame] | 240 | return ret; |
Niels Möller | 9cccf85 | 2018-12-04 11:01:26 +0100 | [diff] [blame] | 241 | } else if (ret == WEBRTC_VIDEO_CODEC_NO_OUTPUT) { |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 242 | // No output |
Niels Möller | 2377588 | 2018-08-16 10:24:12 +0200 | [diff] [blame] | 243 | _callback->Pop(frame.Timestamp()); |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 244 | } |
| 245 | return ret; |
guidou | c337258 | 2017-04-04 07:16:21 -0700 | [diff] [blame] | 246 | } |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 247 | |
Peter Boström | 187db63 | 2015-12-01 17:20:01 +0100 | [diff] [blame] | 248 | int32_t VCMGenericDecoder::RegisterDecodeCompleteCallback( |
| 249 | VCMDecodedFrameCallback* callback) { |
| 250 | _callback = callback; |
tommi | 5b7fc8c | 2017-07-05 16:45:57 -0700 | [diff] [blame] | 251 | return decoder_->RegisterDecodeCompleteCallback(callback); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 252 | } |
| 253 | |
perkj | 796cfaf | 2015-12-10 09:27:38 -0800 | [diff] [blame] | 254 | bool VCMGenericDecoder::PrefersLateDecoding() const { |
tommi | 5b7fc8c | 2017-07-05 16:45:57 -0700 | [diff] [blame] | 255 | return decoder_->PrefersLateDecoding(); |
perkj | 796cfaf | 2015-12-10 09:27:38 -0800 | [diff] [blame] | 256 | } |
| 257 | |
philipel | 9d3ab61 | 2015-12-21 04:12:39 -0800 | [diff] [blame] | 258 | } // namespace webrtc |