diff --git a/api/BUILD.gn b/api/BUILD.gn index ba7570dad3..28ddff11be 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -803,6 +803,7 @@ if (rtc_include_tests) { "../test:test_support", "task_queue:task_queue_default_factory_unittests", "units:units_unittests", + "video:video_unittests", ] } diff --git a/api/video/BUILD.gn b/api/video/BUILD.gn index 533e8d397c..59b6a4b982 100644 --- a/api/video/BUILD.gn +++ b/api/video/BUILD.gn @@ -165,6 +165,7 @@ rtc_source_set("video_stream_decoder") { deps = [ ":encoded_frame", ":video_frame", + "../task_queue", "../video_codecs:video_codecs_api", "//third_party/abseil-cpp/absl/types:optional", ] @@ -181,6 +182,8 @@ rtc_source_set("video_stream_decoder_create") { ":video_stream_decoder", "../../rtc_base:rtc_base_approved", "../../video:video_stream_decoder_impl", + "../task_queue", + "../video_codecs:video_codecs_api", "//third_party/abseil-cpp/absl/memory", ] } @@ -246,3 +249,18 @@ rtc_static_library("builtin_video_bitrate_allocator_factory") { "//third_party/abseil-cpp/absl/memory", ] } + +if (rtc_include_tests) { + rtc_source_set("video_unittests") { + testonly = true + sources = [ + "video_stream_decoder_create_unittest.cc", + ] + deps = [ + ":video_stream_decoder_create", + "../../test:test_support", + "../task_queue:default_task_queue_factory", + "../video_codecs:builtin_video_decoder_factory", + ] + } +} diff --git a/api/video/video_stream_decoder.h b/api/video/video_stream_decoder.h index dff60d87e6..80c70d374b 100644 --- a/api/video/video_stream_decoder.h +++ b/api/video/video_stream_decoder.h @@ -22,7 +22,7 @@ namespace webrtc { // NOTE: This class is still under development and may change without notice. -class VideoStreamDecoder { +class VideoStreamDecoderInterface { public: class Callbacks { public: @@ -41,7 +41,7 @@ class VideoStreamDecoder { absl::optional qp) = 0; }; - virtual ~VideoStreamDecoder() = default; + virtual ~VideoStreamDecoderInterface() = default; virtual void OnFrame(std::unique_ptr frame) = 0; }; diff --git a/api/video/video_stream_decoder_create.cc b/api/video/video_stream_decoder_create.cc index d57925524b..d17d739a9b 100644 --- a/api/video/video_stream_decoder_create.cc +++ b/api/video/video_stream_decoder_create.cc @@ -14,11 +14,15 @@ #include "video/video_stream_decoder_impl.h" namespace webrtc { -std::unique_ptr CreateVideoStreamDecoder( - VideoStreamDecoder::Callbacks* callbacks, + +std::unique_ptr CreateVideoStreamDecoder( + VideoStreamDecoderInterface::Callbacks* callbacks, VideoDecoderFactory* decoder_factory, + TaskQueueFactory* task_queue_factory, std::map> decoder_settings) { return absl::make_unique(callbacks, decoder_factory, + task_queue_factory, std::move(decoder_settings)); } + } // namespace webrtc diff --git a/api/video/video_stream_decoder_create.h b/api/video/video_stream_decoder_create.h index 04682901da..4958dc1084 100644 --- a/api/video/video_stream_decoder_create.h +++ b/api/video/video_stream_decoder_create.h @@ -15,16 +15,19 @@ #include #include +#include "api/task_queue/task_queue_factory.h" #include "api/video/video_stream_decoder.h" +#include "api/video_codecs/sdp_video_format.h" namespace webrtc { // The |decoder_settings| parameter is a map between: // --> <