• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2019 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle"
15
16android {
17    defaultConfig {
18        externalNativeBuild {
19            cmake {
20                // Debug CMake build type causes video frames to drop,
21                // so native library should always use Release build type.
22                arguments "-DCMAKE_BUILD_TYPE=Release"
23                arguments "-DBUILD_TESTING=OFF"
24                targets "gav1JNI"
25            }
26        }
27    }
28}
29
30// Configure the native build only if libgav1 is present to avoid gradle sync
31// failures if libgav1 hasn't been built according to the README instructions.
32if (project.file('src/main/jni/libgav1').exists()) {
33    android.externalNativeBuild.cmake {
34        path = 'src/main/jni/CMakeLists.txt'
35        version = '3.7.1+'
36        if (project.hasProperty('externalNativeBuildDir')) {
37            if (!new File(externalNativeBuildDir).isAbsolute()) {
38                ext.externalNativeBuildDir =
39                        new File(rootDir, it.externalNativeBuildDir)
40            }
41            buildStagingDirectory = "${externalNativeBuildDir}/${project.name}"
42        }
43    }
44}
45
46dependencies {
47    implementation project(modulePrefix + 'library-decoder')
48    // TODO(b/203752526): Remove this dependency.
49    implementation project(modulePrefix + 'library-core')
50    implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion
51    compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
52}
53
54ext {
55    javadocTitle = 'AV1 extension'
56}
57apply from: '../../javadoc_library.gradle'
58