1 # Copyright 2014 The Chromium Authors
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//build/buildflag_header.gni")
6 import("//build/config/chromecast_build.gni")
7 import("//media/media_options.gni")
8 import("//testing/test.gni")
10 buildflag_header("buildflags") {
11 header = "buildflags.h"
13 enable_mojo_renderer = false
14 enable_mojo_cdm = false
15 enable_mojo_audio_decoder = false
16 enable_mojo_audio_encoder = false
17 enable_mojo_video_decoder = false
18 enable_mojo_media_in_browser_process = false
19 enable_mojo_media_in_gpu_process = false
21 foreach(service, mojo_media_services) {
22 if (service == "renderer") {
23 enable_mojo_renderer = true
24 } else if (service == "cdm") {
25 # Fuchsia communicates directly with the platform CDM via FIDL instead of
28 enable_mojo_cdm = true
30 } else if (service == "audio_decoder") {
31 enable_mojo_audio_decoder = true
32 } else if (service == "audio_encoder") {
33 enable_mojo_audio_encoder = true
34 } else if (service == "video_decoder") {
35 enable_mojo_video_decoder = true
37 assert(false, "Invalid mojo media service: $service")
41 if (mojo_media_host == "browser") {
42 enable_mojo_media_in_browser_process = true
43 } else if (mojo_media_host == "gpu") {
44 enable_mojo_media_in_gpu_process = true
45 } else if (mojo_media_host != "") {
46 assert(false, "Invalid mojo media host: $mojo_media_host")
50 "ENABLE_CAST_RENDERER=$enable_cast_renderer",
51 "ENABLE_MOJO_RENDERER=$enable_mojo_renderer",
52 "ENABLE_MOJO_CDM=$enable_mojo_cdm",
53 "ENABLE_MOJO_AUDIO_DECODER=$enable_mojo_audio_decoder",
54 "ENABLE_MOJO_AUDIO_ENCODER=$enable_mojo_audio_encoder",
55 "ENABLE_MOJO_VIDEO_DECODER=$enable_mojo_video_decoder",
56 "ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS=$enable_mojo_media_in_browser_process",
57 "ENABLE_MOJO_MEDIA_IN_GPU_PROCESS=$enable_mojo_media_in_gpu_process",
61 source_set("test_support") {
64 "//media/mojo/clients",
65 "//media/mojo/common",
67 "//media/mojo/mojom:test_interfaces",
68 "//media/mojo/services",
72 source_set("unit_tests") {
76 "//media/learning/mojo:unit_tests",
77 "//media/mojo/clients:unit_tests",
78 "//media/mojo/common:unit_tests",
79 "//media/mojo/mojom:unit_tests",
80 "//media/mojo/services:unit_tests",
81 "//media/mojo/test:unit_tests",
85 test("media_mojo_unittests") {
88 "//mojo/core/test:run_all_unittests",