webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder_unittest.cc
Jerome Jiang 7f7fb830ba Reland "Add av1 test running real video clips."
This reverts commit 6958d2c6f0.

Disable the test on iOS.

Bug: None
Change-Id: Ie42fada10a92bd4a802c6c79caeb4965410ddf6a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176461
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Jerome Jiang <jianj@google.com>
Cr-Commit-Position: refs/heads/master@{#31437}
2020-06-04 06:32:46 +00:00

45 lines
1.5 KiB
C++

/*
* Copyright (c) 2020 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "modules/video_coding/codecs/av1/libaom_av1_encoder.h"
#include <memory>
#include "api/video_codecs/video_codec.h"
#include "api/video_codecs/video_encoder.h"
#include "modules/video_coding/include/video_error_codes.h"
#include "test/gtest.h"
namespace webrtc {
namespace {
TEST(LibaomAv1EncoderTest, CanCreate) {
std::unique_ptr<VideoEncoder> encoder = CreateLibaomAv1Encoder();
EXPECT_TRUE(encoder);
}
TEST(LibaomAv1EncoderTest, InitAndRelease) {
std::unique_ptr<VideoEncoder> encoder = CreateLibaomAv1Encoder();
ASSERT_TRUE(encoder);
VideoCodec codec_settings;
codec_settings.width = 1280;
codec_settings.height = 720;
codec_settings.maxFramerate = 30;
codec_settings.qpMax = 63;
VideoEncoder::Capabilities capabilities(/*loss_notification=*/false);
VideoEncoder::Settings encoder_settings(capabilities, /*number_of_cores=*/1,
/*max_payload_size=*/1200);
EXPECT_EQ(encoder->InitEncode(&codec_settings, encoder_settings),
WEBRTC_VIDEO_CODEC_OK);
EXPECT_EQ(encoder->Release(), WEBRTC_VIDEO_CODEC_OK);
}
} // namespace
} // namespace webrtc