mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 05:40:42 +01:00
Delete deprecated VideoDecoder::InitDecode
Bug: webrtc:13045 Change-Id: Id1ca822c3be5a4f496dd67b59eab31a79a74bf67 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228949 Reviewed-by: Erik Språng <sprang@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/main@{#34884}
This commit is contained in:
parent
25edb62a94
commit
00dd5ced24
3 changed files with 1 additions and 38 deletions
|
@ -44,10 +44,6 @@ class MockVideoDecoder : public VideoDecoder {
|
||||||
}
|
}
|
||||||
|
|
||||||
MOCK_METHOD(bool, Configure, (const Settings& settings), (override));
|
MOCK_METHOD(bool, Configure, (const Settings& settings), (override));
|
||||||
MOCK_METHOD(int32_t,
|
|
||||||
InitDecode,
|
|
||||||
(const VideoCodec* codec_settings, int32_t number_of_cores),
|
|
||||||
(override));
|
|
||||||
MOCK_METHOD(int32_t,
|
MOCK_METHOD(int32_t,
|
||||||
Decode,
|
Decode,
|
||||||
(const EncodedImage& input_image,
|
(const EncodedImage& input_image,
|
||||||
|
|
|
@ -62,29 +62,4 @@ void VideoDecoder::Settings::set_number_of_cores(int value) {
|
||||||
number_of_cores_ = value;
|
number_of_cores_ = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VideoDecoder::Configure(const Settings& settings) {
|
|
||||||
VideoCodec codec_settings = {};
|
|
||||||
codec_settings.buffer_pool_size = settings.buffer_pool_size();
|
|
||||||
RenderResolution max_resolution = settings.max_render_resolution();
|
|
||||||
if (max_resolution.Valid()) {
|
|
||||||
codec_settings.width = max_resolution.Width();
|
|
||||||
codec_settings.height = max_resolution.Height();
|
|
||||||
}
|
|
||||||
codec_settings.codecType = settings.codec_type();
|
|
||||||
return InitDecode(&codec_settings, settings.number_of_cores()) >= 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t VideoDecoder::InitDecode(const VideoCodec* codec_settings,
|
|
||||||
int32_t number_of_cores) {
|
|
||||||
Settings settings;
|
|
||||||
if (codec_settings != nullptr) {
|
|
||||||
settings.set_buffer_pool_size(codec_settings->buffer_pool_size);
|
|
||||||
settings.set_max_render_resolution(
|
|
||||||
{codec_settings->width, codec_settings->height});
|
|
||||||
settings.set_codec_type(codec_settings->codecType);
|
|
||||||
}
|
|
||||||
settings.set_number_of_cores(number_of_cores);
|
|
||||||
return Configure(settings) ? 0 : -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
#include "api/video/render_resolution.h"
|
#include "api/video/render_resolution.h"
|
||||||
#include "api/video/video_codec_type.h"
|
#include "api/video/video_codec_type.h"
|
||||||
#include "api/video/video_frame.h"
|
#include "api/video/video_frame.h"
|
||||||
#include "api/video_codecs/video_codec.h"
|
|
||||||
#include "rtc_base/system/rtc_export.h"
|
#include "rtc_base/system/rtc_export.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
@ -97,14 +96,7 @@ class RTC_EXPORT VideoDecoder {
|
||||||
|
|
||||||
// Prepares decoder to handle incoming encoded frames. Can be called multiple
|
// Prepares decoder to handle incoming encoded frames. Can be called multiple
|
||||||
// times, in such case only latest `settings` are in effect.
|
// times, in such case only latest `settings` are in effect.
|
||||||
// TODO(bugs.webrtc.org/13045): Make pure virtual when implemented by all
|
virtual bool Configure(const Settings& settings) = 0;
|
||||||
// derived classes.
|
|
||||||
virtual bool Configure(const Settings& settings);
|
|
||||||
|
|
||||||
// TODO(bugs.webrtc.org/13045): Delete in favor of the Configure function
|
|
||||||
// above.
|
|
||||||
virtual int32_t InitDecode(const VideoCodec* codec_settings,
|
|
||||||
int32_t number_of_cores);
|
|
||||||
|
|
||||||
virtual int32_t Decode(const EncodedImage& input_image,
|
virtual int32_t Decode(const EncodedImage& input_image,
|
||||||
bool missing_frames,
|
bool missing_frames,
|
||||||
|
|
Loading…
Reference in a new issue