1/*
2 * Copyright (C) 2021 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17
18// these headers include the structure of needed function pointers
19package {
20    // See: http://go/android-license-faq
21    // A large-scale-change added 'default_applicable_licenses' to import
22    // all of the 'license_kinds' from "frameworks_av_license"
23    // to get the below license kinds:
24    //   SPDX-license-identifier-Apache-2.0
25    default_applicable_licenses: ["frameworks_av_license"],
26}
27
28cc_library_headers {
29    name: "libmediaformatshaper_headers",
30    export_include_dirs: ["include"],
31    apex_available: [
32        "//apex_available:platform",
33        "com.android.media",
34    ],
35    min_sdk_version: "29",
36    host_supported: true,
37    target: {
38        darwin: {
39            enabled: false,
40        },
41    },
42}
43
44cc_defaults {
45    name: "libmediaformatshaper_defaults",
46    srcs: [
47        "CodecProperties.cpp",
48        "CodecSeeding.cpp",
49        "FormatShaper.cpp",
50        "ManageShapingCodecs.cpp",
51        "VideoShaper.cpp",
52        "VQApply.cpp",
53    ],
54
55    local_include_dirs: [
56        "include",
57    ],
58
59    header_libs: [
60        "libstagefright_headers",
61    ],
62
63    shared_libs: [
64        "liblog",
65        "libutils",
66    ],
67
68    cflags: [
69        "-Werror",
70        "-Wall",
71        "-fvisibility=hidden",
72        "-Wthread-safety",                      // enables GUARDED_BY()
73    ],
74
75    target: {
76        android: {
77            shared_libs: [
78                "libmediandk#29",
79            ],
80        },
81    },
82
83    sanitize: {
84        cfi: true,
85        misc_undefined: [
86            "unsigned-integer-overflow",
87            "signed-integer-overflow",
88        ],
89    },
90}
91
92cc_library {
93    name: "libmediaformatshaper",
94    defaults: ["libmediaformatshaper_defaults"],
95
96    min_sdk_version: "29",
97
98    // the library lives only in the module
99    // framework accesses with dlopen() and uses "libmediaformatshaper_headers" so both
100    // sides track to the interface.
101    apex_available: ["com.android.media"],
102
103    version_script: "exports.lds",
104
105}
106