1/* 2 * Copyright (C) 2020 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 17package { 18 // See: http://go/android-license-faq 19 // A large-scale-change added 'default_applicable_licenses' to import 20 // all of the 'license_kinds' from "frameworks_av_license" 21 // to get the below license kinds: 22 // SPDX-license-identifier-Apache-2.0 23 default_applicable_licenses: ["frameworks_av_license"], 24} 25 26filegroup { 27 name: "libmediatranscoding_aidl", 28 srcs: [ 29 "aidl/android/media/IMediaTranscodingService.aidl", 30 "aidl/android/media/ITranscodingClient.aidl", 31 "aidl/android/media/ITranscodingClientCallback.aidl", 32 "aidl/android/media/TranscodingErrorCode.aidl", 33 "aidl/android/media/TranscodingSessionPriority.aidl", 34 "aidl/android/media/TranscodingSessionStats.aidl", 35 "aidl/android/media/TranscodingType.aidl", 36 "aidl/android/media/TranscodingVideoCodecType.aidl", 37 "aidl/android/media/TranscodingVideoTrackFormat.aidl", 38 "aidl/android/media/TranscodingSessionParcel.aidl", 39 "aidl/android/media/TranscodingRequestParcel.aidl", 40 "aidl/android/media/TranscodingResultParcel.aidl", 41 "aidl/android/media/TranscodingTestConfig.aidl", 42 ], 43 path: "aidl", 44} 45 46// AIDL interfaces of MediaTranscoding. 47aidl_interface { 48 name: "mediatranscoding_aidl_interface", 49 unstable: true, 50 local_include_dir: "aidl", 51 srcs: [":libmediatranscoding_aidl"], 52 backend: 53 { 54 java: { 55 enabled: true, 56 apex_available: [ 57 "com.android.media", 58 "test_com.android.media", 59 ], 60 min_sdk_version: "29", 61 }, 62 ndk: { 63 enabled: true, 64 apex_available: [ 65 "com.android.media", 66 "test_com.android.media", 67 ], 68 min_sdk_version: "29", 69 }, 70 }, 71} 72 73cc_library { 74 name: "libmediatranscoding", 75 76 min_sdk_version: "29", 77 apex_available: [ 78 "com.android.media", 79 "test_com.android.media", 80 ], 81 82 srcs: [ 83 "TranscoderWrapper.cpp", 84 "TranscodingClientManager.cpp", 85 "TranscodingLogger.cpp", 86 "TranscodingResourcePolicy.cpp", 87 "TranscodingSessionController.cpp", 88 "TranscodingThermalPolicy.cpp", 89 "TranscodingUidPolicy.cpp", 90 ], 91 92 shared_libs: [ 93 "libandroid#31", 94 "libbinder_ndk", 95 "libcutils", 96 "liblog", 97 "libutils", 98 "libmediatranscoder", 99 "libmediandk", 100 "libstatssocket#30", 101 ], 102 export_shared_lib_headers: [ 103 "libmediandk", 104 ], 105 106 export_include_dirs: ["include"], 107 108 static_libs: [ 109 "mediatranscoding_aidl_interface-ndk", 110 "resourceobserver_aidl_interface-V1-ndk", 111 "libstatslog_media", 112 ], 113 114 cflags: [ 115 "-Wall", 116 "-Werror", 117 "-Wformat", 118 "-Wno-error=deprecated-declarations", 119 "-Wthread-safety", 120 "-Wunused", 121 "-Wunreachable-code", 122 ], 123 124 sanitize: { 125 misc_undefined: [ 126 "unsigned-integer-overflow", 127 "signed-integer-overflow", 128 ], 129 cfi: true, 130 }, 131} 132 133cc_library_static { 134 name: "libstatslog_media", 135 generated_sources: ["statslog_media.cpp"], 136 generated_headers: ["statslog_media.h"], 137 min_sdk_version: "29", 138 cflags: [ 139 "-Wall", 140 "-Werror", 141 ], 142 export_generated_headers: ["statslog_media.h"], 143 apex_available: [ 144 "com.android.media", 145 "test_com.android.media", 146 ], 147 shared_libs: [ 148 "libcutils", 149 "liblog", 150 "libstatssocket#30", 151 "libutils", 152 ], 153} 154 155genrule { 156 name: "statslog_media.h", 157 tools: ["stats-log-api-gen"], 158 cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_media.h --module media --namespace android,media,stats", 159 out: [ 160 "statslog_media.h", 161 ], 162} 163 164genrule { 165 name: "statslog_media.cpp", 166 tools: ["stats-log-api-gen"], 167 cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_media.cpp --module media --namespace android,media,stats --importHeader statslog_media.h", 168 out: [ 169 "statslog_media.cpp", 170 ], 171}