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}
diff --git a/api/video_codecs/video_decoder_software_fallback_wrapper.cc b/api/video_codecs/video_decoder_software_fallback_wrapper.cc
index 32941d2..e5743b3 100644
--- a/api/video_codecs/video_decoder_software_fallback_wrapper.cc
+++ b/api/video_codecs/video_decoder_software_fallback_wrapper.cc
@@ -51,6 +51,7 @@
int32_t Release() override;
+ DecoderInfo GetDecoderInfo() const override;
const char* ImplementationName() const override;
private:
@@ -261,10 +262,23 @@
return status;
}
+VideoDecoder::DecoderInfo VideoDecoderSoftwareFallbackWrapper::GetDecoderInfo()
+ const {
+ DecoderInfo info = active_decoder().GetDecoderInfo();
+ if (decoder_type_ == DecoderType::kFallback) {
+ // Cached "A (fallback from B)" string.
+ info.implementation_name = fallback_implementation_name_;
+ }
+ return info;
+}
+
const char* VideoDecoderSoftwareFallbackWrapper::ImplementationName() const {
- return decoder_type_ == DecoderType::kFallback
- ? fallback_implementation_name_.c_str()
- : hw_decoder_->ImplementationName();
+ if (decoder_type_ == DecoderType::kFallback) {
+ // Cached "A (fallback from B)" string.
+ return fallback_implementation_name_.c_str();
+ } else {
+ return hw_decoder_->ImplementationName();
+ }
}
VideoDecoder& VideoDecoderSoftwareFallbackWrapper::active_decoder() const {