blob: ff7f33c02b054af2ad15956364a554a151a81df6 [file] [log] [blame]
# Copyright 2016 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/fidl/fidl.gni")
import("//build/package.gni")
import("//build/testing/environments.gni")
declare_args() {
build_all_vp9_file_decoder_conformance_tests = false
}
# We have a separate package for each example to clarify the dependencies of
# each example.
# Test video encode of camera stream
package("encode-camera") {
testonly = true
deps = [ "//src/media/codec/examples/encode_camera" ]
binaries = [
{
name = "encode_camera"
shell = true
},
]
meta = [
{
path = rebase_path("encode_camera/meta/encode_camera.cmx")
dest = "encode_camera.cmx"
},
]
}
# Test video encode of from raw video file
package("encode-file") {
testonly = true
deps = [ "//src/media/codec/examples/encode_file" ]
binaries = [
{
name = "encode_file"
shell = true
},
]
meta = [
{
path = rebase_path("encode_file/meta/encode_file.cmx")
dest = "encode_file.cmx"
},
]
}
package("use_media_decoder") {
testonly = true
deps = [ "//src/media/codec/examples/use_media_decoder" ]
binaries = [
{
name = "use_media_decoder"
shell = true
},
]
meta = [
{
path = rebase_path("use_media_decoder/meta/use_media_decoder.cmx")
dest = "use_media_decoder.cmx"
},
]
}
# Test amlogic-video h264 decode. Can also work in QEMU using SW decode, but
# when decode HW is present we'll use that to decode.
package("use_h264_decoder_test") {
testonly = true
deps =
[ "//src/media/codec/examples/use_media_decoder:use_h264_decoder_test" ]
meta = [
{
path = rebase_path("use_media_decoder/meta/use_h264_decoder_test.cmx")
dest = "use_h264_decoder_test.cmx"
},
]
tests = [
{
# Should pass when run on VIM2, sherlock, or QEMU.
name = "use_h264_decoder_test"
environments = [
astro_env,
sherlock_env,
emu_env,
]
},
]
resources = [
{
path = rebase_path(
"//garnet/test_data/media/third_party/chromium_media_test_data/bear.h264")
dest = "bear.h264"
},
]
}
# Force SW decode. Only run in environments where we include a SW h264 decoder.
package("use-h264-sw-decoder-test") {
testonly = true
deps = [
"//src/media/codec/examples/use_media_decoder:use_h264_sw_decoder_test",
]
meta = [
{
path = rebase_path("use_media_decoder/meta/use_h264_sw_decoder_test.cmx")
dest = "use_h264_sw_decoder_test.cmx"
},
]
tests = [
{
# Should pass when run on QEMU.
name = "use_h264_sw_decoder_test"
environments = [ emu_env ]
},
]
resources = [
{
path = rebase_path(
"//garnet/test_data/media/third_party/chromium_media_test_data_downstream/1080p_10_frames.h264")
dest = "1080p_10_frames.h264"
},
]
}
package("use-h264-multi-decoder-test") {
testonly = true
deps = [
"//src/media/codec/examples/use_media_decoder:use_h264_multi_decoder_test",
]
meta = [
{
path =
rebase_path("use_media_decoder/meta/use_h264_multi_decoder_test.cmx")
dest = "use_h264_multi_decoder_test.cmx"
},
]
tests = [
{
name = "use_h264_multi_decoder_test"
# Only works on amlogic hardware.
environments = [
astro_env,
sherlock_env,
]
},
]
resources = [
{
path = rebase_path(
"//garnet/test_data/media/third_party/chromium_media_test_data/bear.h264")
dest = "bear.h264"
},
]
}
package("use-h264-multi-decoder-flake-repro-test") {
testonly = true
deps = [ "//src/media/codec/examples/use_media_decoder:use_h264_multi_decoder_flake_repro_test" ]
meta = [
{
path = rebase_path(
"use_media_decoder/meta/use_h264_multi_decoder_flake_repro_test.cmx")
dest = "use_h264_multi_decoder_flake_repro_test.cmx"
},
]
tests = [
{
name = "use_h264_multi_decoder_flake_repro_test"
# Only works on amlogic hardware.
environments = [
astro_env,
sherlock_env,
]
},
]
resources = [
{
path = rebase_path(
"//garnet/test_data/media/third_party/chromium_media_test_data/bear.h264")
dest = "bear.h264"
},
]
}
# Test amlogic-video h264 decode with stream switching. Can also work in QEMU
# using SW decode, but when decode HW is present we'll use that to decode.
package("use_h264_decoder_stream_switching_test") {
testonly = true
deps = [ "//src/media/codec/examples/use_media_decoder:use_h264_decoder_stream_switching_test" ]
meta = [
{
path = rebase_path(
"use_media_decoder/meta/use_h264_decoder_stream_switching_test.cmx")
dest = "use_h264_decoder_stream_switching_test.cmx"
},
]
tests = [
{
# Should pass when run on VIM2, sherlock, or QEMU.
name = "use_h264_decoder_stream_switching_test"
# Disable on astro because not enough contiguous memory. TODO(fxbug.dev/41735) Re-enable in
# astro_env.
#
# Disable on qemu because the test flakes so far. TODO(fxbug.dev/49932) Re-enable in emu_env.
environments = [
sherlock_env,
# emu_env,
# astro_env,
]
},
]
resources = [
{
path = rebase_path(
"//garnet/test_data/media/third_party/chromium_media_test_data/bear.h264")
dest = "bear.h264"
},
]
}
# Test amlogic-video multi-instance h264 decode with stream switching.
package("use-h264-multi-decoder-stream-switching-test") {
testonly = true
deps = [ "//src/media/codec/examples/use_media_decoder:use_h264_multi_decoder_stream_switching_test" ]
meta = [
{
path = rebase_path(
"use_media_decoder/meta/use_h264_multi_decoder_stream_switching_test.cmx")
dest = "use_h264_multi_decoder_stream_switching_test.cmx"
},
]
tests = [
{
# Should pass when run on VIM2, sherlock, or QEMU.
name = "use_h264_multi_decoder_stream_switching_test"
# Disable on astro because not enough contiguous memory. TODO(fxbug.dev/41735) Re-enable in
# astro_env.
environments = [ sherlock_env ]
},
]
resources = [
{
path = rebase_path(
"//garnet/test_data/media/third_party/chromium_media_test_data/bear.h264")
dest = "bear.h264"
},
]
}
# Test amlogic-video multi-instance h264 decode with stream switching.
package("use-h264-multi-decoder-concurrent-stream-switching-test") {
testonly = true
deps = [ "//src/media/codec/examples/use_media_decoder:use_h264_multi_decoder_concurrent_stream_switching_test" ]
meta = [
{
path = rebase_path(
"use_media_decoder/meta/use_h264_multi_decoder_concurrent_stream_switching_test.cmx")
dest = "use_h264_multi_decoder_concurrent_stream_switching_test.cmx"
},
]
tests = [
{
# Should pass when run on VIM2, astro, sherlock, or QEMU.
name = "use_h264_multi_decoder_concurrent_stream_switching_test"
environments = [
astro_env,
sherlock_env,
]
},
]
resources = [
{
path = rebase_path(
"//garnet/test_data/media/third_party/chromium_media_test_data/bear.h264")
dest = "bear.h264"
},
]
}
package("use_h264_decoder_secure_output_test") {
testonly = true
deps = [
"//src/media/codec/examples/use_media_decoder:use_h264_decoder_secure_output_test",
"//src/media/codec/examples/use_media_decoder:use_h264_multi_decoder_secure_output_test",
]
meta = [
{
path = rebase_path(
"use_media_decoder/meta/use_h264_decoder_secure_output_test.cmx")
dest = "use_h264_decoder_secure_output_test.cmx"
},
{
path = rebase_path(
"use_media_decoder/meta/use_h264_multi_decoder_secure_output_test.cmx")
dest = "use_h264_multi_decoder_secure_output_test.cmx"
},
]
tests = [
{
# Should pass when run on astro.
name = "use_h264_decoder_secure_output_test"
environments = [
astro_env,
sherlock_env,
]
},
{
# Should pass when run on astro.
name = "use_h264_multi_decoder_secure_output_test"
environments = [
astro_env,
sherlock_env,
]
},
]
resources = [
{
path = rebase_path(
"//garnet/test_data/media/third_party/chromium_media_test_data/bear.h264")
dest = "bear.h264"
},
]
}
package("use_h264_decoder_secure_input_output_test") {
testonly = true
deps = [ "//src/media/codec/examples/use_media_decoder:use_h264_decoder_secure_input_output_test" ]
meta = [
{
path = rebase_path(
"use_media_decoder/meta/use_h264_decoder_secure_input_output_test.cmx")
dest = "use_h264_decoder_secure_input_output_test.cmx"
},
]
tests = [
{
name = "use_h264_decoder_secure_input_output_test"
# Without ClearTVP, can't pass anywhere at the moment.
# TODO(fxbug.dev/42991): Re-enable.
disabled = true
},
]
resources = [
{
path = rebase_path(
"//garnet/test_data/media/third_party/chromium_media_test_data/bear.h264")
dest = "bear.h264"
},
]
}
package("h264_decoder_fuzzer_test") {
testonly = true
deps = [
"//src/media/codec/examples/use_media_decoder:h264_decoder_fuzzer_test",
"//src/media/codec/examples/use_media_decoder:h264_decoder_malformed_stream_test",
"//src/media/codec/examples/use_media_decoder:h264_multi_decoder_fuzzer_test",
]
meta = [
{
path = rebase_path("use_media_decoder/meta/h264_decoder_fuzzer_test.cmx")
dest = "h264_decoder_fuzzer_test.cmx"
},
{
path = rebase_path(
"use_media_decoder/meta/h264_multi_decoder_fuzzer_test.cmx")
dest = "h264_multi_decoder_fuzzer_test.cmx"
},
{
path = rebase_path(
"use_media_decoder/meta/h264_decoder_malformed_stream_test.cmx")
dest = "h264_decoder_malformed_stream_test.cmx"
},
]
tests = [
{
# Should pass when run on VIM2, sherlock, or QEMU.
name = "h264_decoder_fuzzer_test"
# Disable on astro because not enough contiguous memory. TODO(fxbug.dev/41735) Re-enable
environments = [
sherlock_env,
emu_env,
]
},
{
# Should pass when run on VIM2, sherlock.
name = "h264_multi_decoder_fuzzer_test"
# Disable on astro because not enough contiguous memory. TODO(fxbug.dev/41735) Re-enable
environments = [ sherlock_env ]
},
{
# Should pass when run on VIM2, sherlock, or QEMU.
name = "h264_decoder_malformed_stream_test"
# Disable on astro because not enough contiguous memory. TODO(fxbug.dev/41735) Re-enable
environments = [
sherlock_env,
emu_env,
]
},
]
resources = [
{
path = rebase_path(
"//garnet/test_data/media/third_party/chromium_media_test_data/bear.h264")
dest = "bear.h264"
},
]
}
package("vp9_decoder_fuzzer_test") {
testonly = true
deps =
[ "//src/media/codec/examples/use_media_decoder:vp9_decoder_fuzzer_test" ]
meta = [
{
path = rebase_path("use_media_decoder/meta/vp9_decoder_fuzzer_test.cmx")
dest = "vp9_decoder_fuzzer_test.cmx"
},
]
tests = [
{
name = "vp9_decoder_fuzzer_test"
# Disable on astro because not enough contiguous memory. TODO(fxbug.dev/41735) Re-enable
environments = [ sherlock_env ]
},
]
resources = [
{
path = rebase_path(
"//garnet/test_data/media/third_party/chromium_media_test_data/bear-vp9.ivf")
dest = "bear-vp9.ivf"
},
]
}
#
# Tests that don't run on CQ yet.
#
package("use_aac_decoder_test") {
testonly = true
deps = [ "//src/media/codec/examples/use_media_decoder:use_aac_decoder_test" ]
tests = [
{
name = "use_aac_decoder_test"
},
]
resources = [
{
path = rebase_path("use_media_decoder/test/test_audio.adts")
dest = "media_test_data/test_audio.adts"
},
]
meta = [
{
path = rebase_path("use_media_decoder/meta/use_aac_decoder_test.cmx")
dest = "use_aac_decoder_test.cmx"
},
]
}
# Test amlogic-video vp9 decode.
package("use_vp9_decoder_test") {
testonly = true
deps = [
"//src/media/codec/examples/use_media_decoder:use_vp9_decoder_1280x546_test",
"//src/media/codec/examples/use_media_decoder:use_vp9_decoder_test",
]
meta = [
{
path = rebase_path("use_media_decoder/meta/use_vp9_decoder_test.cmx")
dest = "use_vp9_decoder_test.cmx"
},
{
path = rebase_path(
"use_media_decoder/meta/use_vp9_decoder_1280x546_test.cmx")
dest = "use_vp9_decoder_1280x546_test.cmx"
},
]
tests = [
{
name = "use_vp9_decoder_test"
# Astro has enough contiguous memory for this.
environments = [
astro_env,
sherlock_env,
]
},
{
name = "use_vp9_decoder_1280x546_test"
# Astro has enough contiguous memory for this.
environments = [
astro_env,
sherlock_env,
]
},
]
resources = [
{
path = rebase_path(
"//garnet/test_data/media/third_party/chromium_media_test_data_downstream/bear-1280x546-vp9.ivf")
dest = "bear-1280x546-vp9.ivf"
},
{
path = rebase_path(
"//garnet/test_data/media/third_party/chromium_media_test_data/bear-vp9.ivf")
dest = "bear-vp9.ivf"
},
]
}
# Test amlogic-video vp9 decode, with stream switching.
package("use-vp9-decoder-stream-switching-test") {
testonly = true
deps = [ "//src/media/codec/examples/use_media_decoder:use_vp9_decoder_stream_switching_test" ]
meta = [
{
path = rebase_path(
"use_media_decoder/meta/use_vp9_decoder_stream_switching_test.cmx")
dest = "use_vp9_decoder_stream_switching_test.cmx"
},
]
tests = [
{
name = "use_vp9_decoder_stream_switching_test"
# Disable on astro because not enough contiguous memory. TODO(fxbug.dev/41735) Re-enable
environments = [ sherlock_env ]
},
]
resources = [
{
path = rebase_path(
"//garnet/test_data/media/third_party/chromium_media_test_data/bear-vp9.ivf")
dest = "bear-vp9.ivf"
},
]
}
# Test amlogic-video vp9 decoder's ability to skip frames until keyframe when
# input starts at non-keyframe.
package("use_vp9_decoder_skip_first_frame_test") {
testonly = true
deps = [ "//src/media/codec/examples/use_media_decoder:use_vp9_decoder_skip_first_frame_test" ]
meta = [
{
path = rebase_path(
"use_media_decoder/meta/use_vp9_decoder_skip_first_frame_test.cmx")
dest = "use_vp9_decoder_skip_first_frame_test.cmx"
},
]
tests = [
{
name = "use_vp9_decoder_skip_first_frame_test"
# Disable on astro because not enough contiguous memory. TODO(fxbug.dev/41735) Re-enable
environments = [ sherlock_env ]
},
]
resources = [
{
path = rebase_path(
"//garnet/test_data/media/third_party/chromium_media_test_data/test-25fps.vp9")
dest = "test-25fps.vp9.ivf"
},
]
}
# Test amlogic-video vp9 decode with max output frame count, on environments
# that have enough contiguous SYSTEM_RAM configured for sysmem.
package("use_vp9_decoder_24_output_frames_test") {
testonly = true
deps = [ "//src/media/codec/examples/use_media_decoder:use_vp9_decoder_24_output_frames_test" ]
meta = [
{
path = rebase_path(
"use_media_decoder/meta/use_vp9_decoder_24_output_frames_test.cmx")
dest = "use_vp9_decoder_24_output_frames_test.cmx"
},
]
tests = [
{
name = "use_vp9_decoder_24_output_frames_test"
# Should pass when run on VIM2, sherlock. Astro may not have enough
# contiguous pool.
#
# TODO(fxbug.dev/41735): Depending on how we re-enable, maybe we can also enable
# this one.
environments = [ sherlock_env ]
},
]
resources = [
{
path = rebase_path(
"//garnet/test_data/media/third_party/chromium_media_test_data/bear-vp9.ivf")
dest = "bear-vp9.ivf"
},
]
}
package("use_vp9_decoder_secure_output_test") {
testonly = true
deps = [ "//src/media/codec/examples/use_media_decoder:use_vp9_decoder_secure_output_test" ]
meta = [
{
path = rebase_path(
"use_media_decoder/meta/use_vp9_decoder_secure_output_test.cmx")
dest = "use_vp9_decoder_secure_output_test.cmx"
},
]
tests = [
{
name = "use_vp9_decoder_secure_output_test"
environments = [
sherlock_env,
astro_env,
]
},
]
resources = [
{
path = rebase_path(
"//garnet/test_data/media/third_party/chromium_media_test_data/bear-vp9.ivf")
dest = "bear-vp9.ivf"
},
]
}
package("use_vp9_decoder_secure_input_output_test") {
testonly = true
deps = [ "//src/media/codec/examples/use_media_decoder:use_vp9_decoder_secure_input_output_test" ]
meta = [
{
path = rebase_path(
"use_media_decoder/meta/use_vp9_decoder_secure_input_output_test.cmx")
dest = "use_vp9_decoder_secure_input_output_test.cmx"
},
]
tests = [
{
name = "use_vp9_decoder_secure_input_output_test"
# Without ClearTVP, can't pass anywhere at the moment.
# TODO(fxbug.dev/42991): Re-enable.
disabled = true
},
]
resources = [
{
path = rebase_path(
"//garnet/test_data/media/third_party/chromium_media_test_data/bear-vp9.ivf")
dest = "bear-vp9.ivf"
},
]
}
template("vp9_file_decoder_conformance_test") {
package(target_name) {
testonly = true
deps = [ "//src/media/codec/examples/use_media_decoder:vp9_decoder_conformance_test" ]
meta = [
{
path = rebase_path(
"use_media_decoder/meta/vp9_decoder_conformance_test.cmx")
dest = "vp9_decoder_conformance_test.cmx"
},
]
tests = [
{
name = "vp9_decoder_conformance_test"
# This should pass when run on VIM2 or astro, and will fail in any env
# that lacks VP9 decode.
# Disable on astro because not enough contiguous memory. TODO(fxbug.dev/41735) Re-enable
environments = [ sherlock_env ]
},
]
resources = [
{
path = rebase_path(invoker.ivf_file)
dest = "vp9.ivf"
},
{
path = rebase_path(invoker.md5_file)
dest = "vp9.md5"
},
]
}
}
# Running this binary, the --http=<url> command-line parameter needs to be
# passed, and the binary won't verify the MD5. Instead it'll stream the URL
# data in, parse it as ivf, decode it, compute MD5, and output the MD5.
package("vp9_decoder_conformance_http") {
testonly = true
deps = [
"//src/media/codec/examples/use_media_decoder:vp9_decoder_conformance_test",
]
meta = [
{
path =
rebase_path("use_media_decoder/meta/vp9_decoder_conformance_http.cmx")
dest = "vp9_decoder_conformance_http.cmx"
},
]
binaries = [
{
name = "vp9_decoder_conformance_http"
# We share the binary for now, but this could change.
source = "$root_out_dir/vp9_decoder_conformance_test"
},
]
}
# Running this binary, the --http=<url> command-line parameter needs to be
# passed, and the binary won't verify the MD5. Instead it'll stream the URL
# data in, parse it as h264, decode it, compute MD5, and output the MD5.
package("h264-decoder-conformance-http") {
testonly = true
deps = [ "//src/media/codec/examples/use_media_decoder:h264_decoder_conformance_test" ]
meta = [
{
path = rebase_path(
"use_media_decoder/meta/h264_decoder_conformance_http.cmx")
dest = "h264_decoder_conformance_http.cmx"
},
]
binaries = [
{
name = "h264_decoder_conformance_http"
# We share the binary for now, but this could change.
source = "$root_out_dir/h264_decoder_conformance_test"
},
]
}
# Put the below group of vp9 conformance tests last in the file. Otherwise,
# with the above __http package last in this file, the build complains about
# duplicate packages, at least when fx set with these:
# --args=build_all_vp9_file_decoder_conformance_tests=true \
# --with //src/media/codec/examples:vp9_decoder_conformance_tests \
# --with //src/media/codec/examples:vp9_decoder_conformance_test__http
_vp9_file_conformance_tests_group_deps = []
# This target makes sure the vp9_decoder_conformance_test executable builds and
# can verify an md5 hash of decompressed frames.
#
# Test amlogic-video vp9 decode. This uses the same test executable as VP9
# decode conformance tests.
package_name = "vp9-decoder-conformance-test--bear-vp9"
vp9_file_decoder_conformance_test(package_name) {
ivf_file = "//garnet/test_data/media/third_party/chromium_media_test_data/bear-vp9.ivf"
md5_file = "use_media_decoder/test/bear-vp9.i420.md5"
}
_vp9_file_conformance_tests_group_deps += [ ":" + package_name ]
# build_all_vp9_file_decoder_conformance_tests is currently false by default.
# These tests currently require a directory of converted VP9 test streams which
# is not yet hosted on CIPD.
#
# The self-contained variants of these tests rely on having enough flash space
# for the whole input file, and running more than one large test per pave will
# tend to fail due to insufficient flash space (at the moment). Still, for
# debugging it's useful to be able to run this way, especially since re-building
# the code doesn't require re-copying the input file blob whose hash hasn't
# changed - and building tests this way avoids relying on a local http server.
#
# For automated testing, we instead use vp9_decoder_conformance_test__http
# (single target), which will fetch a .ivf file from a local http server and
# output it's MD5 hash to stdout. That target is driven by e2e test script
# running off-target that scrapts stdout for the MD5 and deteremines e2e test
# success/failure in the e2e test script, not on the target.
if (build_all_vp9_file_decoder_conformance_tests) {
testcases = read_file(
"//garnet/test_data/media/third_party/webm_vp9_conformance_streams/test_cases_all.list",
"trim list lines")
foreach(testcase, testcases) {
# remove prefix
testcase = string_replace(testcase, "processed/", "")
# remove suffix
testcase_partial_path = string_replace(testcase, ".webm.ivf", "")
# don't have any "/" in the name
testcase = string_replace(testcase_partial_path, "/", "__")
# shorten profile string
testcase = string_replace(testcase, "Profile_0_8bit", "0")
testcase = string_replace(testcase, "Profile_2_10bit", "2")
# Downcase the only uppercase letters that actually exist; uppercase isn't
# allowed in package names.
testcase = string_replace(testcase, "X", "x")
package_name = "vp9_decoder_conformance_test__file__" + testcase
# Avoid any "_" in the package name.
package_name = string_replace(package_name, "_", "-")
vp9_file_decoder_conformance_test(package_name) {
ivf_file = "//garnet/test_data/media/third_party/webm_vp9_conformance_streams/processed/" + testcase_partial_path + ".webm.ivf"
md5_file = "//garnet/test_data/media/third_party/webm_vp9_conformance_streams/decompressed_md5/" + testcase_partial_path + ".md5"
}
_vp9_file_conformance_tests_group_deps += [ ":" + package_name ]
}
}
group("vp9_decoder_conformance_tests") {
testonly = true
deps = _vp9_file_conformance_tests_group_deps
}