2011-07-07 08:21:25 +00:00
|
|
|
/*
|
2012-07-31 15:53:44 +00:00
|
|
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
2011-07-07 08:21:25 +00:00
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-04-04 03:53:02 -07:00
|
|
|
#include "webrtc/modules/video_coding/generic_decoder.h"
|
|
|
|
|
|
2016-09-30 06:19:08 -07:00
|
|
|
#include "webrtc/base/checks.h"
|
2015-11-16 16:39:06 -08:00
|
|
|
#include "webrtc/base/logging.h"
|
2015-11-17 06:03:43 -08:00
|
|
|
#include "webrtc/base/trace_event.h"
|
2015-11-30 19:14:50 +01:00
|
|
|
#include "webrtc/modules/video_coding/include/video_coding.h"
|
2015-11-18 22:00:21 +01:00
|
|
|
#include "webrtc/modules/video_coding/internal_defines.h"
|
2015-10-28 18:17:40 +01:00
|
|
|
#include "webrtc/system_wrappers/include/clock.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
2015-12-21 04:12:39 -08:00
|
|
|
VCMDecodedFrameCallback::VCMDecodedFrameCallback(VCMTiming* timing,
|
2013-01-21 07:42:11 +00:00
|
|
|
Clock* clock)
|
2017-03-14 04:16:20 -07:00
|
|
|
: _clock(clock),
|
2015-12-18 16:01:11 +01:00
|
|
|
_timing(timing),
|
|
|
|
|
_timestampMap(kDecoderFrameMemoryLength),
|
2017-04-04 03:53:02 -07:00
|
|
|
_lastReceivedPictureID(0) {
|
|
|
|
|
decoder_thread_.DetachFromThread();
|
|
|
|
|
}
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-12-21 04:12:39 -08:00
|
|
|
VCMDecodedFrameCallback::~VCMDecodedFrameCallback() {
|
2017-04-04 03:53:02 -07:00
|
|
|
RTC_DCHECK(construction_thread_.CalledOnValidThread());
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2011-10-10 14:17:46 +00:00
|
|
|
void VCMDecodedFrameCallback::SetUserReceiveCallback(
|
2015-12-21 04:12:39 -08:00
|
|
|
VCMReceiveCallback* receiveCallback) {
|
2017-03-14 04:16:20 -07:00
|
|
|
RTC_DCHECK(construction_thread_.CalledOnValidThread());
|
|
|
|
|
RTC_DCHECK((!_receiveCallback && receiveCallback) ||
|
|
|
|
|
(_receiveCallback && !receiveCallback));
|
2015-12-21 04:12:39 -08:00
|
|
|
_receiveCallback = receiveCallback;
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2015-12-21 04:12:39 -08:00
|
|
|
VCMReceiveCallback* VCMDecodedFrameCallback::UserReceiveCallback() {
|
2017-04-04 03:53:02 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&decoder_thread_);
|
2017-03-14 04:16:20 -07:00
|
|
|
// Called on the decode thread via VCMCodecDataBase::GetDecoder.
|
|
|
|
|
// The callback must always have been set before this happens.
|
|
|
|
|
RTC_DCHECK(_receiveCallback);
|
2015-12-21 04:12:39 -08:00
|
|
|
return _receiveCallback;
|
2013-08-12 14:20:49 +00:00
|
|
|
}
|
|
|
|
|
|
2015-05-29 17:21:40 -07:00
|
|
|
int32_t VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage) {
|
2015-11-10 14:00:27 +01:00
|
|
|
return Decoded(decodedImage, -1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int32_t VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage,
|
|
|
|
|
int64_t decode_time_ms) {
|
Reland of Add QP sum stats for received streams. (patchset #2 id:300001 of https://codereview.webrtc.org/2680893002/ )
Reason for revert:
Fix the problem.
Original issue's description:
> Revert of Add QP sum stats for received streams. (patchset #10 id:180001 of https://codereview.webrtc.org/2649133005/ )
>
> Reason for revert:
> Breaks downstream build.
>
> Original issue's description:
> > Add QP sum stats for received streams.
> >
> > This is not implemented yet in any of the decoders.
> >
> > BUG=webrtc:6541
> >
> > Review-Url: https://codereview.webrtc.org/2649133005
> > Cr-Commit-Position: refs/heads/master@{#16475}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/ff0e72fd165facac27f0313aa178648782e63bc4
>
> TBR=hta@webrtc.org,hbos@webrtc.org,sprang@webrtc.org,magjed@webrtc.org,stefan@webrtc.org,sakal@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6541
>
> Review-Url: https://codereview.webrtc.org/2680893002 .
> Cr-Commit-Position: refs/heads/master@{#16480}
> Committed: https://chromium.googlesource.com/external/webrtc/+/69fb2cca4d54f3df7ceddcd1c3e9b0ad80fa849b
TBR=hta@webrtc.org,hbos@webrtc.org,sprang@webrtc.org,magjed@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
BUG=webrtc:6541
Review-Url: https://codereview.webrtc.org/2681663005
Cr-Commit-Position: refs/heads/master@{#16511}
2017-02-09 04:53:45 -08:00
|
|
|
Decoded(decodedImage,
|
|
|
|
|
decode_time_ms >= 0 ? rtc::Optional<int32_t>(decode_time_ms)
|
|
|
|
|
: rtc::Optional<int32_t>(),
|
|
|
|
|
rtc::Optional<uint8_t>());
|
|
|
|
|
return WEBRTC_VIDEO_CODEC_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage,
|
|
|
|
|
rtc::Optional<int32_t> decode_time_ms,
|
|
|
|
|
rtc::Optional<uint8_t> qp) {
|
2017-04-04 03:53:02 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&decoder_thread_);
|
2017-03-14 04:16:20 -07:00
|
|
|
RTC_DCHECK(_receiveCallback) << "Callback must not be null at this point";
|
2017-04-04 03:53:02 -07:00
|
|
|
|
2015-12-21 04:12:39 -08:00
|
|
|
TRACE_EVENT_INSTANT1("webrtc", "VCMDecodedFrameCallback::Decoded",
|
|
|
|
|
"timestamp", decodedImage.timestamp());
|
|
|
|
|
// TODO(holmer): We should improve this so that we can handle multiple
|
|
|
|
|
// callbacks from one call to Decode().
|
2017-04-04 03:53:02 -07:00
|
|
|
VCMFrameInformation* frameInfo = _timestampMap.Pop(decodedImage.timestamp());
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-12-21 04:12:39 -08:00
|
|
|
if (frameInfo == NULL) {
|
|
|
|
|
LOG(LS_WARNING) << "Too many frames backed up in the decoder, dropping "
|
|
|
|
|
"this one.";
|
Reland of Add QP sum stats for received streams. (patchset #2 id:300001 of https://codereview.webrtc.org/2680893002/ )
Reason for revert:
Fix the problem.
Original issue's description:
> Revert of Add QP sum stats for received streams. (patchset #10 id:180001 of https://codereview.webrtc.org/2649133005/ )
>
> Reason for revert:
> Breaks downstream build.
>
> Original issue's description:
> > Add QP sum stats for received streams.
> >
> > This is not implemented yet in any of the decoders.
> >
> > BUG=webrtc:6541
> >
> > Review-Url: https://codereview.webrtc.org/2649133005
> > Cr-Commit-Position: refs/heads/master@{#16475}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/ff0e72fd165facac27f0313aa178648782e63bc4
>
> TBR=hta@webrtc.org,hbos@webrtc.org,sprang@webrtc.org,magjed@webrtc.org,stefan@webrtc.org,sakal@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6541
>
> Review-Url: https://codereview.webrtc.org/2680893002 .
> Cr-Commit-Position: refs/heads/master@{#16480}
> Committed: https://chromium.googlesource.com/external/webrtc/+/69fb2cca4d54f3df7ceddcd1c3e9b0ad80fa849b
TBR=hta@webrtc.org,hbos@webrtc.org,sprang@webrtc.org,magjed@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
BUG=webrtc:6541
Review-Url: https://codereview.webrtc.org/2681663005
Cr-Commit-Position: refs/heads/master@{#16511}
2017-02-09 04:53:45 -08:00
|
|
|
return;
|
2015-12-21 04:12:39 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const int64_t now_ms = _clock->TimeInMilliseconds();
|
Reland of Add QP sum stats for received streams. (patchset #2 id:300001 of https://codereview.webrtc.org/2680893002/ )
Reason for revert:
Fix the problem.
Original issue's description:
> Revert of Add QP sum stats for received streams. (patchset #10 id:180001 of https://codereview.webrtc.org/2649133005/ )
>
> Reason for revert:
> Breaks downstream build.
>
> Original issue's description:
> > Add QP sum stats for received streams.
> >
> > This is not implemented yet in any of the decoders.
> >
> > BUG=webrtc:6541
> >
> > Review-Url: https://codereview.webrtc.org/2649133005
> > Cr-Commit-Position: refs/heads/master@{#16475}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/ff0e72fd165facac27f0313aa178648782e63bc4
>
> TBR=hta@webrtc.org,hbos@webrtc.org,sprang@webrtc.org,magjed@webrtc.org,stefan@webrtc.org,sakal@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6541
>
> Review-Url: https://codereview.webrtc.org/2680893002 .
> Cr-Commit-Position: refs/heads/master@{#16480}
> Committed: https://chromium.googlesource.com/external/webrtc/+/69fb2cca4d54f3df7ceddcd1c3e9b0ad80fa849b
TBR=hta@webrtc.org,hbos@webrtc.org,sprang@webrtc.org,magjed@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
BUG=webrtc:6541
Review-Url: https://codereview.webrtc.org/2681663005
Cr-Commit-Position: refs/heads/master@{#16511}
2017-02-09 04:53:45 -08:00
|
|
|
if (!decode_time_ms) {
|
2015-12-21 04:12:39 -08:00
|
|
|
decode_time_ms =
|
Reland of Add QP sum stats for received streams. (patchset #2 id:300001 of https://codereview.webrtc.org/2680893002/ )
Reason for revert:
Fix the problem.
Original issue's description:
> Revert of Add QP sum stats for received streams. (patchset #10 id:180001 of https://codereview.webrtc.org/2649133005/ )
>
> Reason for revert:
> Breaks downstream build.
>
> Original issue's description:
> > Add QP sum stats for received streams.
> >
> > This is not implemented yet in any of the decoders.
> >
> > BUG=webrtc:6541
> >
> > Review-Url: https://codereview.webrtc.org/2649133005
> > Cr-Commit-Position: refs/heads/master@{#16475}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/ff0e72fd165facac27f0313aa178648782e63bc4
>
> TBR=hta@webrtc.org,hbos@webrtc.org,sprang@webrtc.org,magjed@webrtc.org,stefan@webrtc.org,sakal@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6541
>
> Review-Url: https://codereview.webrtc.org/2680893002 .
> Cr-Commit-Position: refs/heads/master@{#16480}
> Committed: https://chromium.googlesource.com/external/webrtc/+/69fb2cca4d54f3df7ceddcd1c3e9b0ad80fa849b
TBR=hta@webrtc.org,hbos@webrtc.org,sprang@webrtc.org,magjed@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
BUG=webrtc:6541
Review-Url: https://codereview.webrtc.org/2681663005
Cr-Commit-Position: refs/heads/master@{#16511}
2017-02-09 04:53:45 -08:00
|
|
|
rtc::Optional<int32_t>(now_ms - frameInfo->decodeStartTimeMs);
|
2015-12-21 04:12:39 -08:00
|
|
|
}
|
Reland of Add QP sum stats for received streams. (patchset #2 id:300001 of https://codereview.webrtc.org/2680893002/ )
Reason for revert:
Fix the problem.
Original issue's description:
> Revert of Add QP sum stats for received streams. (patchset #10 id:180001 of https://codereview.webrtc.org/2649133005/ )
>
> Reason for revert:
> Breaks downstream build.
>
> Original issue's description:
> > Add QP sum stats for received streams.
> >
> > This is not implemented yet in any of the decoders.
> >
> > BUG=webrtc:6541
> >
> > Review-Url: https://codereview.webrtc.org/2649133005
> > Cr-Commit-Position: refs/heads/master@{#16475}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/ff0e72fd165facac27f0313aa178648782e63bc4
>
> TBR=hta@webrtc.org,hbos@webrtc.org,sprang@webrtc.org,magjed@webrtc.org,stefan@webrtc.org,sakal@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6541
>
> Review-Url: https://codereview.webrtc.org/2680893002 .
> Cr-Commit-Position: refs/heads/master@{#16480}
> Committed: https://chromium.googlesource.com/external/webrtc/+/69fb2cca4d54f3df7ceddcd1c3e9b0ad80fa849b
TBR=hta@webrtc.org,hbos@webrtc.org,sprang@webrtc.org,magjed@webrtc.org,stefan@webrtc.org,skvlad@webrtc.org
BUG=webrtc:6541
Review-Url: https://codereview.webrtc.org/2681663005
Cr-Commit-Position: refs/heads/master@{#16511}
2017-02-09 04:53:45 -08:00
|
|
|
_timing->StopDecodeTimer(decodedImage.timestamp(), *decode_time_ms, now_ms,
|
2015-12-21 04:12:39 -08:00
|
|
|
frameInfo->renderTimeMs);
|
|
|
|
|
|
2017-01-30 02:43:18 -08:00
|
|
|
decodedImage.set_timestamp_us(
|
|
|
|
|
frameInfo->renderTimeMs * rtc::kNumMicrosecsPerMillisec);
|
2016-09-30 06:19:08 -07:00
|
|
|
decodedImage.set_rotation(frameInfo->rotation);
|
2017-03-14 04:16:20 -07:00
|
|
|
_receiveCallback->FrameToRender(decodedImage, qp);
|
2015-12-21 04:12:39 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int32_t VCMDecodedFrameCallback::ReceivedDecodedReferenceFrame(
|
|
|
|
|
const uint64_t pictureId) {
|
2017-04-04 03:53:02 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&decoder_thread_);
|
2017-03-14 04:16:20 -07:00
|
|
|
return _receiveCallback->ReceivedDecodedReferenceFrame(pictureId);
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2015-12-21 04:12:39 -08:00
|
|
|
int32_t VCMDecodedFrameCallback::ReceivedDecodedFrame(
|
|
|
|
|
const uint64_t pictureId) {
|
2017-04-04 03:53:02 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&decoder_thread_);
|
2015-12-21 04:12:39 -08:00
|
|
|
_lastReceivedPictureID = pictureId;
|
|
|
|
|
return 0;
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2015-12-21 04:12:39 -08:00
|
|
|
uint64_t VCMDecodedFrameCallback::LastReceivedPictureID() const {
|
2017-04-04 03:53:02 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&decoder_thread_);
|
2015-12-21 04:12:39 -08:00
|
|
|
return _lastReceivedPictureID;
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2015-12-18 16:01:11 +01:00
|
|
|
void VCMDecodedFrameCallback::OnDecoderImplementationName(
|
|
|
|
|
const char* implementation_name) {
|
2017-04-04 03:53:02 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&decoder_thread_);
|
2017-03-14 04:16:20 -07:00
|
|
|
_receiveCallback->OnDecoderImplementationName(implementation_name);
|
2015-12-18 16:01:11 +01:00
|
|
|
}
|
|
|
|
|
|
2015-09-28 08:52:18 -07:00
|
|
|
void VCMDecodedFrameCallback::Map(uint32_t timestamp,
|
|
|
|
|
VCMFrameInformation* frameInfo) {
|
2017-04-04 03:53:02 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&decoder_thread_);
|
2015-09-28 08:52:18 -07:00
|
|
|
_timestampMap.Add(timestamp, frameInfo);
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2015-12-21 04:12:39 -08:00
|
|
|
int32_t VCMDecodedFrameCallback::Pop(uint32_t timestamp) {
|
2017-04-04 03:53:02 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&decoder_thread_);
|
|
|
|
|
return _timestampMap.Pop(timestamp) == nullptr ? VCM_GENERAL_ERROR : VCM_OK;
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2015-12-01 17:20:01 +01:00
|
|
|
VCMGenericDecoder::VCMGenericDecoder(VideoDecoder* decoder, bool isExternal)
|
|
|
|
|
: _callback(NULL),
|
|
|
|
|
_frameInfos(),
|
|
|
|
|
_nextFrameInfoIdx(0),
|
2017-04-04 03:53:02 -07:00
|
|
|
decoder_(decoder),
|
2015-12-01 17:20:01 +01:00
|
|
|
_codecType(kVideoCodecUnknown),
|
2017-04-04 03:53:02 -07:00
|
|
|
_isExternal(isExternal) {}
|
|
|
|
|
|
|
|
|
|
VCMGenericDecoder::~VCMGenericDecoder() {
|
|
|
|
|
decoder_->Release();
|
|
|
|
|
if (_isExternal)
|
|
|
|
|
decoder_.release();
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2017-04-04 03:53:02 -07:00
|
|
|
RTC_DCHECK(_isExternal || !decoder_);
|
|
|
|
|
}
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-04-02 15:54:38 +00:00
|
|
|
int32_t VCMGenericDecoder::InitDecode(const VideoCodec* settings,
|
2015-12-21 04:12:39 -08:00
|
|
|
int32_t numberOfCores) {
|
2017-04-04 03:53:02 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&decoder_thread_);
|
2015-12-21 04:12:39 -08:00
|
|
|
TRACE_EVENT0("webrtc", "VCMGenericDecoder::InitDecode");
|
|
|
|
|
_codecType = settings->codecType;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2017-04-04 03:53:02 -07:00
|
|
|
return decoder_->InitDecode(settings, numberOfCores);
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2015-11-17 06:03:43 -08:00
|
|
|
int32_t VCMGenericDecoder::Decode(const VCMEncodedFrame& frame, int64_t nowMs) {
|
2017-04-04 03:53:02 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&decoder_thread_);
|
|
|
|
|
TRACE_EVENT2("webrtc", "VCMGenericDecoder::Decode", "timestamp",
|
|
|
|
|
frame.EncodedImage()._timeStamp, "decoder",
|
|
|
|
|
decoder_->ImplementationName());
|
|
|
|
|
_frameInfos[_nextFrameInfoIdx].decodeStartTimeMs = nowMs;
|
|
|
|
|
_frameInfos[_nextFrameInfoIdx].renderTimeMs = frame.RenderTimeMs();
|
|
|
|
|
_frameInfos[_nextFrameInfoIdx].rotation = frame.rotation();
|
|
|
|
|
_callback->Map(frame.TimeStamp(), &_frameInfos[_nextFrameInfoIdx]);
|
|
|
|
|
|
|
|
|
|
_nextFrameInfoIdx = (_nextFrameInfoIdx + 1) % kDecoderFrameMemoryLength;
|
|
|
|
|
const RTPFragmentationHeader dummy_header;
|
|
|
|
|
int32_t ret = decoder_->Decode(frame.EncodedImage(), frame.MissingFrame(),
|
|
|
|
|
&dummy_header, frame.CodecSpecific(),
|
|
|
|
|
frame.RenderTimeMs());
|
|
|
|
|
|
|
|
|
|
// TODO(tommi): Necessary every time?
|
|
|
|
|
// Maybe this should be the first thing the function does, and only the first
|
|
|
|
|
// time around?
|
|
|
|
|
_callback->OnDecoderImplementationName(decoder_->ImplementationName());
|
|
|
|
|
|
|
|
|
|
if (ret != WEBRTC_VIDEO_CODEC_OK) {
|
2015-12-21 04:12:39 -08:00
|
|
|
if (ret < WEBRTC_VIDEO_CODEC_OK) {
|
2017-04-04 03:53:02 -07:00
|
|
|
LOG(LS_WARNING) << "Failed to decode frame with timestamp "
|
|
|
|
|
<< frame.TimeStamp() << ", error code: " << ret;
|
2011-10-10 14:17:46 +00:00
|
|
|
}
|
2017-04-04 03:53:02 -07:00
|
|
|
// We pop the frame for all non-'OK', failure or success codes such as
|
|
|
|
|
// WEBRTC_VIDEO_CODEC_NO_OUTPUT and WEBRTC_VIDEO_CODEC_REQUEST_SLI.
|
|
|
|
|
_callback->Pop(frame.TimeStamp());
|
|
|
|
|
}
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2017-04-04 03:53:02 -07:00
|
|
|
return ret;
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2015-12-01 17:20:01 +01:00
|
|
|
int32_t VCMGenericDecoder::RegisterDecodeCompleteCallback(
|
|
|
|
|
VCMDecodedFrameCallback* callback) {
|
2017-04-04 03:53:02 -07:00
|
|
|
RTC_DCHECK_RUN_ON(&decoder_thread_);
|
2015-12-01 17:20:01 +01:00
|
|
|
_callback = callback;
|
2017-04-04 03:53:02 -07:00
|
|
|
return decoder_->RegisterDecodeCompleteCallback(callback);
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2017-04-04 03:53:02 -07:00
|
|
|
bool VCMGenericDecoder::PrefersLateDecoding() const {
|
|
|
|
|
RTC_DCHECK_RUN_ON(&decoder_thread_);
|
|
|
|
|
return decoder_->PrefersLateDecoding();
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2017-04-04 03:53:02 -07:00
|
|
|
#if defined(WEBRTC_ANDROID)
|
|
|
|
|
void VCMGenericDecoder::PollDecodedFrames() {
|
|
|
|
|
RTC_DCHECK_RUN_ON(&decoder_thread_);
|
|
|
|
|
decoder_->PollDecodedFrames();
|
2015-12-10 09:27:38 -08:00
|
|
|
}
|
2017-04-04 03:53:02 -07:00
|
|
|
#endif
|
2015-12-10 09:27:38 -08:00
|
|
|
|
2015-12-21 04:12:39 -08:00
|
|
|
} // namespace webrtc
|