Delete CreateVideoDecoder from VideoDecoderFactory interface

Instead require Create to be implemented

Bug: webrtc:15791
Change-Id: I17477b5f047d86b6a05bda594c66d20f8f43a2c6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/340480
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41857}
This commit is contained in:
Danil Chapovalov 2024-02-23 14:51:23 +01:00 committed by WebRTC LUCI CQ
parent 80d07289fd
commit 38c1ab1e6c
3 changed files with 3 additions and 32 deletions

View file

@ -34,10 +34,6 @@ class MockVideoDecoderFactory : public VideoDecoderFactory {
Create,
(const Environment&, const SdpVideoFormat&),
(override));
MOCK_METHOD(std::unique_ptr<VideoDecoder>,
CreateVideoDecoder,
(const SdpVideoFormat&),
(override));
MOCK_METHOD(void, Die, ());
};
} // namespace webrtc

View file

@ -10,11 +10,7 @@
#include "api/video_codecs/video_decoder_factory.h"
#include <memory>
#include "api/video_codecs/sdp_video_format.h"
#include "api/video_codecs/video_decoder.h"
#include "rtc_base/checks.h"
namespace webrtc {
@ -28,18 +24,4 @@ VideoDecoderFactory::CodecSupport VideoDecoderFactory::QueryCodecSupport(
format.IsCodecInList(GetSupportedFormats())};
}
std::unique_ptr<VideoDecoder> VideoDecoderFactory::Create(
const Environment& env,
const SdpVideoFormat& format) {
return CreateVideoDecoder(format);
}
std::unique_ptr<VideoDecoder> VideoDecoderFactory::CreateVideoDecoder(
const SdpVideoFormat& format) {
// Newer code shouldn't call this function,
// Older code should implement it in derived classes.
RTC_CHECK_NOTREACHED();
return nullptr;
}
} // namespace webrtc

View file

@ -50,16 +50,9 @@ class RTC_EXPORT VideoDecoderFactory {
bool reference_scaling) const;
// Creates a VideoDecoder for the specified `format`.
// TODO: bugs.webrtc.org/15791 - Make pure virtual when implemented in all
// derived classes.
virtual std::unique_ptr<VideoDecoder> Create(const Environment& env,
const SdpVideoFormat& format);
private:
// TODO: bugs.webrtc.org/15791 - Delete when all derived classes implement
// `Create`.
virtual std::unique_ptr<VideoDecoder> CreateVideoDecoder(
const SdpVideoFormat& format);
virtual std::unique_ptr<VideoDecoder> Create(
const Environment& env,
const SdpVideoFormat& format) = 0;
};
} // namespace webrtc