Add Av1 Decoder wrapper behind a build flag

Bug: webrtc:11404
Change-Id: I090ffd173d667e8845de1b986af462516b7c76e6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/169452
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Michael Horowitz <mhoro@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30757}
This commit is contained in:
Danil Chapovalov
2020-03-11 10:45:57 +01:00
committed by Commit Bot
parent 45c104b4fd
commit c46385c346
13 changed files with 317 additions and 0 deletions

View File

@ -13,10 +13,16 @@
#include "api/video_codecs/sdp_video_format.h"
#include "api/video_codecs/video_decoder.h"
#include "media/base/media_constants.h"
#include "modules/video_coding/codecs/av1/libaom_av1_decoder.h"
#include "test/gmock.h"
#include "test/gtest.h"
namespace webrtc {
using ::testing::Contains;
using ::testing::Field;
using ::testing::Not;
TEST(InternalDecoderFactory, TestVP8) {
InternalDecoderFactory factory;
std::unique_ptr<VideoDecoder> decoder =
@ -24,4 +30,16 @@ TEST(InternalDecoderFactory, TestVP8) {
EXPECT_TRUE(decoder);
}
TEST(InternalDecoderFactory, Av1) {
InternalDecoderFactory factory;
if (kIsLibaomAv1DecoderSupported) {
EXPECT_THAT(factory.GetSupportedFormats(),
Contains(Field(&SdpVideoFormat::name, "AV1X")));
EXPECT_TRUE(factory.CreateVideoDecoder(SdpVideoFormat("AV1X")));
} else {
EXPECT_THAT(factory.GetSupportedFormats(),
Not(Contains(Field(&SdpVideoFormat::name, "AV1X"))));
}
}
} // namespace webrtc