xref: /aosp_15_r20/frameworks/av/media/module/codecs/mp3dec/Android.bp (revision ec779b8e0859a360c3d303172224686826e6e0e1)
1package {
2    default_applicable_licenses: ["frameworks_av_media_codecs_mp3dec_license"],
3}
4
5// Added automatically by a large-scale-change that took the approach of
6// 'apply every license found to every target'. While this makes sure we respect
7// every license restriction, it may not be entirely correct.
8//
9// e.g. GPL in an MIT project might only apply to the contrib/ directory.
10//
11// Please consider splitting the single license below into multiple licenses,
12// taking care not to lose any license_kind information, and overriding the
13// default license using the 'licenses: [...]' property on targets as needed.
14//
15// For unused files, consider creating a 'fileGroup' with "//visibility:private"
16// to attach the license to, and including a comment whether the files may be
17// used in the current project.
18// See: http://go/android-license-faq
19license {
20    name: "frameworks_av_media_codecs_mp3dec_license",
21    visibility: [":__subpackages__"],
22    license_kinds: [
23        "SPDX-license-identifier-Apache-2.0",
24        "SPDX-license-identifier-BSD",
25    ],
26    license_text: [
27        "NOTICE",
28    ],
29}
30
31cc_library_headers {
32    name: "libstagefright_mp3dec_headers",
33    vendor_available: true,
34    min_sdk_version: "29",
35    host_supported:true,
36    export_include_dirs: [
37        "include",
38        "src",
39    ],
40    apex_available: [
41        "//apex_available:platform",
42        "com.android.media.swcodec",
43    ],
44}
45
46cc_library_static {
47    name: "libstagefright_mp3dec",
48    vendor_available: true,
49    min_sdk_version: "29",
50    apex_available: [
51        "//apex_available:platform",
52        "com.android.media.swcodec",
53    ],
54
55    host_supported:true,
56    srcs: [
57        "src/pvmp3_normalize.cpp",
58        "src/pvmp3_alias_reduction.cpp",
59        "src/pvmp3_crc.cpp",
60        "src/pvmp3_decode_header.cpp",
61        "src/pvmp3_decode_huff_cw.cpp",
62        "src/pvmp3_getbits.cpp",
63        "src/pvmp3_dequantize_sample.cpp",
64        "src/pvmp3_framedecoder.cpp",
65        "src/pvmp3_get_main_data_size.cpp",
66        "src/pvmp3_get_side_info.cpp",
67        "src/pvmp3_get_scale_factors.cpp",
68        "src/pvmp3_mpeg2_get_scale_data.cpp",
69        "src/pvmp3_mpeg2_get_scale_factors.cpp",
70        "src/pvmp3_mpeg2_stereo_proc.cpp",
71        "src/pvmp3_huffman_decoding.cpp",
72        "src/pvmp3_huffman_parsing.cpp",
73        "src/pvmp3_tables.cpp",
74        "src/pvmp3_imdct_synth.cpp",
75        "src/pvmp3_mdct_6.cpp",
76        "src/pvmp3_dct_6.cpp",
77        "src/pvmp3_poly_phase_synthesis.cpp",
78        "src/pvmp3_equalizer.cpp",
79        "src/pvmp3_seek_synch.cpp",
80        "src/pvmp3_stereo_proc.cpp",
81        "src/pvmp3_reorder.cpp",
82
83        "src/pvmp3_polyphase_filter_window.cpp",
84        "src/pvmp3_mdct_18.cpp",
85        "src/pvmp3_dct_9.cpp",
86        "src/pvmp3_dct_16.cpp",
87    ],
88
89    arch: {
90        arm: {
91            exclude_srcs: [
92                "src/pvmp3_polyphase_filter_window.cpp",
93                "src/pvmp3_mdct_18.cpp",
94                "src/pvmp3_dct_9.cpp",
95                "src/pvmp3_dct_16.cpp",
96            ],
97            srcs: [
98                "src/asm/pvmp3_polyphase_filter_window_gcc.s",
99                "src/asm/pvmp3_mdct_18_gcc.s",
100                "src/asm/pvmp3_dct_9_gcc.s",
101                "src/asm/pvmp3_dct_16_gcc.s",
102            ],
103
104            instruction_set: "arm",
105        },
106    },
107
108    sanitize: {
109        misc_undefined: [
110            "signed-integer-overflow",
111        ],
112        cfi: true,
113    },
114
115    header_libs: ["libstagefright_mp3dec_headers"],
116    export_header_lib_headers: ["libstagefright_mp3dec_headers"],
117
118    cflags: [
119        "-DOSCL_UNUSED_ARG(x)=(void)(x)",
120        "-Werror",
121    ],
122
123    target: {
124        darwin: {
125            enabled: false,
126        },
127    },
128}
129
130//###############################################################################
131cc_test {
132    name: "libstagefright_mp3dec_test",
133    gtest: false,
134
135    srcs: [
136        "test/mp3dec_test.cpp",
137        "test/mp3reader.cpp",
138    ],
139
140    cflags: ["-Wall", "-Werror"],
141
142    local_include_dirs: [
143        "src",
144        "include",
145    ],
146
147    sanitize: {
148        misc_undefined: [
149            "signed-integer-overflow",
150        ],
151        cfi: true,
152    },
153
154    static_libs: [
155        "libstagefright_mp3dec",
156        "libsndfile",
157    ],
158
159    shared_libs: ["libaudioutils"],
160}
161