Remove webrtc::VideoDecoder::PrefersLateDecoding.

This is just general cleanup.

The assumed behavior is late decoding, and this function is not used to make any decision (except in the deprecated jitter buffer).

Bug: webrtc:12271
Change-Id: Ifb48186d55903f068f25e44c5f73e7a724f6f456
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/200804
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32940}
This commit is contained in:
philipel
2021-01-11 15:44:43 +01:00
committed by Commit Bot
parent d892e6e1b4
commit 360da05ed1
16 changed files with 6 additions and 52 deletions

View File

@ -59,6 +59,7 @@ class RTC_EXPORT VideoDecoder {
// Returns true if the decoder prefer to decode frames late.
// That is, it can not decode infinite number of frames before the decoded
// frame is consumed.
// TODO(bugs.webrtc.org/12271): Remove when downstream has been updated.
virtual bool PrefersLateDecoding() const;
virtual const char* ImplementationName() const;

View File

@ -50,7 +50,6 @@ class VideoDecoderSoftwareFallbackWrapper final : public VideoDecoder {
DecodedImageCallback* callback) override;
int32_t Release() override;
bool PrefersLateDecoding() const override;
const char* ImplementationName() const override;
@ -262,10 +261,6 @@ int32_t VideoDecoderSoftwareFallbackWrapper::Release() {
return status;
}
bool VideoDecoderSoftwareFallbackWrapper::PrefersLateDecoding() const {
return active_decoder().PrefersLateDecoding();
}
const char* VideoDecoderSoftwareFallbackWrapper::ImplementationName() const {
return decoder_type_ == DecoderType::kFallback
? fallback_implementation_name_.c_str()

View File

@ -133,10 +133,6 @@ VCMGenericDecoder* VCMDecoderDataBase::GetDecoder(
return ptr_decoder_.get();
}
bool VCMDecoderDataBase::PrefersLateDecoding() const {
return ptr_decoder_ ? ptr_decoder_->PrefersLateDecoding() : true;
}
std::unique_ptr<VCMGenericDecoder> VCMDecoderDataBase::CreateAndInitDecoder(
const VCMEncodedFrame& frame,
VideoCodec* new_codec) const {

View File

@ -59,10 +59,6 @@ class VCMDecoderDataBase {
const VCMEncodedFrame& frame,
VCMDecodedFrameCallback* decoded_frame_callback);
// Returns true if the currently active decoder prefer to decode frames late.
// That means that frames must be decoded near the render times stamp.
bool PrefersLateDecoding() const;
private:
typedef std::map<uint8_t, VCMDecoderMapItem*> DecoderMap;
typedef std::map<uint8_t, VCMExtDecoderMapItem*> ExternalDecoderMap;

View File

@ -294,8 +294,4 @@ int32_t VCMGenericDecoder::RegisterDecodeCompleteCallback(
return decoder_->RegisterDecodeCompleteCallback(callback);
}
bool VCMGenericDecoder::PrefersLateDecoding() const {
return decoder_->PrefersLateDecoding();
}
} // namespace webrtc

View File

@ -111,7 +111,6 @@ class VCMGenericDecoder {
*/
int32_t RegisterDecodeCompleteCallback(VCMDecodedFrameCallback* callback);
bool PrefersLateDecoding() const;
bool IsSameDecoder(VideoDecoder* decoder) const {
return decoder_.get() == decoder;
}

View File

@ -173,8 +173,7 @@ int32_t VideoReceiver::RegisterPacketRequestCallback(
// Should be called as often as possible to get the most out of the decoder.
int32_t VideoReceiver::Decode(uint16_t maxWaitTimeMs) {
RTC_DCHECK_RUN_ON(&decoder_thread_checker_);
VCMEncodedFrame* frame = _receiver.FrameForDecoding(
maxWaitTimeMs, _codecDataBase.PrefersLateDecoding());
VCMEncodedFrame* frame = _receiver.FrameForDecoding(maxWaitTimeMs, true);
if (!frame)
return VCM_FRAME_NOT_READY;

View File

@ -90,7 +90,10 @@ public interface VideoDecoder {
* The decoder should return true if it prefers late decoding. That is, it can not decode
* infinite number of frames before the decoded frame is consumed.
*/
@CalledByNative boolean getPrefersLateDecoding();
// TODO(bugs.webrtc.org/12271): Remove when downstream has been updated.
default boolean getPrefersLateDecoding() {
return true;
}
/**
* Should return a descriptive name for the implementation. Gets called once and cached. May be
* called from arbitrary thread.

View File

@ -31,11 +31,6 @@ public abstract class WrappedNativeVideoDecoder implements VideoDecoder {
throw new UnsupportedOperationException("Not implemented.");
}
@Override
public final boolean getPrefersLateDecoding() {
throw new UnsupportedOperationException("Not implemented.");
}
@Override
public final String getImplementationName() {
throw new UnsupportedOperationException("Not implemented.");

View File

@ -291,11 +291,6 @@ class AndroidVideoDecoder implements VideoDecoder, VideoSink {
return VideoCodecStatus.OK;
}
@Override
public boolean getPrefersLateDecoding() {
return true;
}
@Override
public String getImplementationName() {
return codecName;

View File

@ -144,11 +144,6 @@ int32_t VideoDecoderWrapper::Release() {
return status;
}
bool VideoDecoderWrapper::PrefersLateDecoding() const {
JNIEnv* jni = AttachCurrentThreadIfNeeded();
return Java_VideoDecoder_getPrefersLateDecoding(jni, decoder_);
}
const char* VideoDecoderWrapper::ImplementationName() const {
return implementation_name_.c_str();
}

View File

@ -47,11 +47,6 @@ class VideoDecoderWrapper : public VideoDecoder {
// still safe and synchronous.
int32_t Release() override RTC_NO_THREAD_SAFETY_ANALYSIS;
// Returns true if the decoder prefer to decode frames late.
// That is, it can not decode infinite number of frames before the decoded
// frame is consumed.
bool PrefersLateDecoding() const override;
const char* ImplementationName() const override;
// Wraps the frame to a AndroidVideoBuffer and passes it to the callback.

View File

@ -123,10 +123,6 @@ int32_t QualityAnalyzingVideoDecoder::Release() {
return result;
}
bool QualityAnalyzingVideoDecoder::PrefersLateDecoding() const {
return delegate_->PrefersLateDecoding();
}
const char* QualityAnalyzingVideoDecoder::ImplementationName() const {
return implementation_name_.c_str();
}

View File

@ -69,7 +69,6 @@ class QualityAnalyzingVideoDecoder : public VideoDecoder {
int32_t RegisterDecodeCompleteCallback(
DecodedImageCallback* callback) override;
int32_t Release() override;
bool PrefersLateDecoding() const override;
const char* ImplementationName() const override;
private:

View File

@ -61,7 +61,6 @@ class VideoDecoderProxyFactory final : public VideoDecoderFactory {
return decoder_->RegisterDecodeCompleteCallback(callback);
}
int32_t Release() override { return decoder_->Release(); }
bool PrefersLateDecoding() const { return decoder_->PrefersLateDecoding(); }
const char* ImplementationName() const override {
return decoder_->ImplementationName();
}

View File

@ -32,7 +32,6 @@ class FrameDumpingDecoder : public VideoDecoder {
int32_t RegisterDecodeCompleteCallback(
DecodedImageCallback* callback) override;
int32_t Release() override;
bool PrefersLateDecoding() const override;
const char* ImplementationName() const override;
private:
@ -73,10 +72,6 @@ int32_t FrameDumpingDecoder::Release() {
return decoder_->Release();
}
bool FrameDumpingDecoder::PrefersLateDecoding() const {
return decoder_->PrefersLateDecoding();
}
const char* FrameDumpingDecoder::ImplementationName() const {
return decoder_->ImplementationName();
}