Adds VideoDecoder::GetDecoderInfo()

This adds a new way to poll decoder metadata.
A default implementation still delegates to the old methods.
Root call site is updates to not use the olds methods.

Follow-ups will dismantle usage of the olds methods in wrappers.

Bug: webrtc:12271
Change-Id: Id0fa6863c96ff9e3b849da452d6540e7c5da4512
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196520
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32976}
This commit is contained in:
Erik Språng
2021-01-13 21:49:59 +01:00
committed by Commit Bot
parent a0bb2ef2dc
commit c12f625938
21 changed files with 140 additions and 15 deletions

View File

@ -53,6 +53,7 @@ class LibaomAv1Decoder final : public VideoDecoder {
int32_t Release() override;
DecoderInfo GetDecoderInfo() const override;
const char* ImplementationName() const override;
private:
@ -182,6 +183,13 @@ int32_t LibaomAv1Decoder::Release() {
return WEBRTC_VIDEO_CODEC_OK;
}
VideoDecoder::DecoderInfo LibaomAv1Decoder::GetDecoderInfo() const {
DecoderInfo info;
info.implementation_name = "libaom";
info.is_hardware_accelerated = false;
return info;
}
const char* LibaomAv1Decoder::ImplementationName() const {
return "libaom";
}

View File

@ -748,7 +748,7 @@ void VideoCodecTestFixtureImpl::PrintSettings(
task_queue->SendTask(
[this, &encoder_name, &decoder_name] {
encoder_name = encoder_->GetEncoderInfo().implementation_name;
decoder_name = decoders_.at(0)->ImplementationName();
decoder_name = decoders_.at(0)->GetDecoderInfo().implementation_name;
},
RTC_FROM_HERE);
RTC_LOG(LS_INFO) << "enc_impl_name: " << encoder_name;

View File

@ -397,6 +397,13 @@ int LibvpxVp8Decoder::Release() {
return ret_val;
}
VideoDecoder::DecoderInfo LibvpxVp8Decoder::GetDecoderInfo() const {
DecoderInfo info;
info.implementation_name = "libvpx";
info.is_hardware_accelerated = false;
return info;
}
const char* LibvpxVp8Decoder::ImplementationName() const {
return "libvpx";
}

View File

@ -38,6 +38,7 @@ class LibvpxVp8Decoder : public VideoDecoder {
int RegisterDecodeCompleteCallback(DecodedImageCallback* callback) override;
int Release() override;
DecoderInfo GetDecoderInfo() const override;
const char* ImplementationName() const override;
struct DeblockParams {

View File

@ -391,6 +391,13 @@ int LibvpxVp9Decoder::Release() {
return ret_val;
}
VideoDecoder::DecoderInfo LibvpxVp9Decoder::GetDecoderInfo() const {
DecoderInfo info;
info.implementation_name = "libvpx";
info.is_hardware_accelerated = false;
return info;
}
const char* LibvpxVp9Decoder::ImplementationName() const {
return "libvpx";
}

View File

@ -40,6 +40,7 @@ class LibvpxVp9Decoder : public VP9Decoder {
int Release() override;
DecoderInfo GetDecoderInfo() const override;
const char* ImplementationName() const override;
private: