mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-20 09:07:52 +01:00
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:
parent
80d07289fd
commit
38c1ab1e6c
3 changed files with 3 additions and 32 deletions
|
@ -34,10 +34,6 @@ class MockVideoDecoderFactory : public VideoDecoderFactory {
|
||||||
Create,
|
Create,
|
||||||
(const Environment&, const SdpVideoFormat&),
|
(const Environment&, const SdpVideoFormat&),
|
||||||
(override));
|
(override));
|
||||||
MOCK_METHOD(std::unique_ptr<VideoDecoder>,
|
|
||||||
CreateVideoDecoder,
|
|
||||||
(const SdpVideoFormat&),
|
|
||||||
(override));
|
|
||||||
MOCK_METHOD(void, Die, ());
|
MOCK_METHOD(void, Die, ());
|
||||||
};
|
};
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
|
@ -10,11 +10,7 @@
|
||||||
|
|
||||||
#include "api/video_codecs/video_decoder_factory.h"
|
#include "api/video_codecs/video_decoder_factory.h"
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
#include "api/video_codecs/sdp_video_format.h"
|
#include "api/video_codecs/sdp_video_format.h"
|
||||||
#include "api/video_codecs/video_decoder.h"
|
|
||||||
#include "rtc_base/checks.h"
|
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
|
@ -28,18 +24,4 @@ VideoDecoderFactory::CodecSupport VideoDecoderFactory::QueryCodecSupport(
|
||||||
format.IsCodecInList(GetSupportedFormats())};
|
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
|
} // namespace webrtc
|
||||||
|
|
|
@ -50,16 +50,9 @@ class RTC_EXPORT VideoDecoderFactory {
|
||||||
bool reference_scaling) const;
|
bool reference_scaling) const;
|
||||||
|
|
||||||
// Creates a VideoDecoder for the specified `format`.
|
// Creates a VideoDecoder for the specified `format`.
|
||||||
// TODO: bugs.webrtc.org/15791 - Make pure virtual when implemented in all
|
virtual std::unique_ptr<VideoDecoder> Create(
|
||||||
// derived classes.
|
const Environment& env,
|
||||||
virtual std::unique_ptr<VideoDecoder> Create(const Environment& env,
|
const SdpVideoFormat& format) = 0;
|
||||||
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);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
Loading…
Reference in a new issue