Commit 3e7e1d4f authored by Hirokazu Honda's avatar Hirokazu Honda Committed by Commit Bot

third_party/libgav1: Build libgav1 library on ChromeOS ARM

This CL make libgav1 library built on ChromeOS ARM. VideoDecoder
using libgav1, Gav1VideoDecoder, is also available on ChromeOS
ARM. The VideoDecoder is enabled by the chrome option,
--enable-features=Gav1VideoDecoder.

The chrome binary size (bytes) increases as follows for kevin (CrOS ARM 32bit);
No dav1d/libgav1: 120,898,388
dav1d (ToT)     : 121,397,308 (+  498,920 bytes)
libgav1         : 121,760,372 (+  861,984 bytes)
libgav1 + dav1d : 122,255,484 (+1,357,096 bytes)

Bug: 1047051
Test: Build chrome
Test: Gav1VideoDecoder is used on kevin with --enable-features=Gav1VideoDecoder
Change-Id: I0fae28bf390e2f3f421411ad2617f153df8f191d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2028875Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Reviewed-by: default avatarJames Zern <jzern@google.com>
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#752715}
parent d07807bc
......@@ -245,7 +245,7 @@ void Gav1VideoDecoder::Initialize(const VideoDecoderConfig& config,
InitCB bound_init_cb = bind_callbacks_ ? BindToCurrentLoop(std::move(init_cb))
: std::move(init_cb);
if (config.is_encrypted() || config.codec() != kCodecAV1) {
std::move(bound_init_cb).Run(false);
std::move(bound_init_cb).Run(StatusCode::kEncryptedContentUnsupported);
return;
}
......@@ -264,7 +264,7 @@ void Gav1VideoDecoder::Initialize(const VideoDecoderConfig& config,
if (status != kLibgav1StatusOk) {
MEDIA_LOG(ERROR, media_log_) << "libgav1::Decoder::Init() failed, "
<< "status=" << status;
std::move(bound_init_cb).Run(false);
std::move(bound_init_cb).Run(StatusCode::kDecoderFailedConfigure);
return;
}
......@@ -272,7 +272,7 @@ void Gav1VideoDecoder::Initialize(const VideoDecoderConfig& config,
state_ = DecoderState::kDecoding;
color_space_ = config.color_space_info();
natural_size_ = config.natural_size();
std::move(bound_init_cb).Run(true);
std::move(bound_init_cb).Run(OkStatus());
}
void Gav1VideoDecoder::Decode(scoped_refptr<DecoderBuffer> buffer,
......
......@@ -49,7 +49,12 @@ class Gav1VideoDecoderTest : public testing::Test {
void InitializeWithConfigWithResult(const VideoDecoderConfig& config,
bool success) {
decoder_->Initialize(config, false, nullptr, NewExpectedBoolCB(success),
decoder_->Initialize(config, false, nullptr,
base::BindOnce(
[](bool success, Status status) {
EXPECT_EQ(status.is_ok(), success);
},
success),
base::BindRepeating(&Gav1VideoDecoderTest::FrameReady,
base::Unretained(this)),
base::NullCallback());
......
......@@ -37,6 +37,7 @@ if (enable_libgav1_decoder) {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
deps = [ ":libgav1_utils" ]
public_configs = [ ":public_libgav1_config" ]
sources = gav1_dsp_sources
......
......@@ -6,5 +6,6 @@ import("//build/config/gclient_args.gni")
declare_args() {
# Enable libgav1 decoder.
enable_libgav1_decoder = false
enable_libgav1_decoder =
is_chromeos && (target_cpu == "arm" || target_cpu == "arm64")
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment