From cd2bcf7fe4bc647dc8cadcdc87d4d7bb8a33ffd9 Mon Sep 17 00:00:00 2001 From: Maxr1998 Date: Wed, 28 Dec 2022 18:51:40 +0100 Subject: [PATCH] Migrate to AndroidX Media --- .github/workflows/extension-build.yaml | 4 ++-- .github/workflows/extension-publish.yaml | 2 +- .gitmodules | 8 ++++---- ExoPlayer | 1 - build.gradle.kts | 2 +- build.sh | 10 +++++----- ffmpeg | 2 +- media | 1 + .../build.gradle.kts | 12 ++++++------ settings.gradle.kts | 8 ++++---- 10 files changed, 25 insertions(+), 25 deletions(-) delete mode 160000 ExoPlayer create mode 160000 media rename {exoplayer-ffmpeg-extension => media3-ffmpeg-decoder}/build.gradle.kts (86%) diff --git a/.github/workflows/extension-build.yaml b/.github/workflows/extension-build.yaml index 4d729b8..63dd003 100644 --- a/.github/workflows/extension-build.yaml +++ b/.github/workflows/extension-build.yaml @@ -3,7 +3,7 @@ name: ExoPlayer FFmpeg Extension / Build on: push: branches: - - master + - androidx-media pull_request: env: @@ -35,4 +35,4 @@ jobs: - name: Build ffmpeg run: ./build.sh - name: Build extension and publish library locally - run: ./gradlew :exoplayer-ffmpeg-extension:publishToMavenLocal + run: ./gradlew :media3-ffmpeg-decoder:publishToMavenLocal diff --git a/.github/workflows/extension-publish.yaml b/.github/workflows/extension-publish.yaml index e3d4d22..b35d51c 100644 --- a/.github/workflows/extension-publish.yaml +++ b/.github/workflows/extension-publish.yaml @@ -41,7 +41,7 @@ jobs: if: ${{ startsWith(github.ref, 'refs/tags/v') }} run: echo "JELLYFIN_VERSION=$(echo ${GITHUB_REF#refs/tags/v} | tr / -)" >> $GITHUB_ENV - name: Build extension and publish library - run: ./gradlew :exoplayer-ffmpeg-extension:publish closeAndReleaseSonatypeStagingRepository + run: ./gradlew :media3-ffmpeg-decoder:publish closeAndReleaseSonatypeStagingRepository env: SIGNING_KEY: ${{ secrets.SIGNING_KEY }} OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} diff --git a/.gitmodules b/.gitmodules index 7af56f0..cf1abbf 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ -[submodule "ExoPlayer"] - path = ExoPlayer - url = https://github.com/google/ExoPlayer.git - branch = release-v2 +[submodule "media"] + path = media + url = https://github.com/androidx/media.git + branch = release [submodule "ffmpeg"] path = ffmpeg url = https://git.ffmpeg.org/ffmpeg.git diff --git a/ExoPlayer b/ExoPlayer deleted file mode 160000 index 5d4b706..0000000 --- a/ExoPlayer +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5d4b70666f26273fbd4c3f6dccb18ccd91093d83 diff --git a/build.gradle.kts b/build.gradle.kts index 7d7d134..8eea79a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -15,7 +15,7 @@ buildscript { } allprojects { - group = "org.jellyfin.exoplayer" + group = "org.jellyfin.media3" version = createVersion() repositories { diff --git a/build.sh b/build.sh index c3f5adc..7493960 100755 --- a/build.sh +++ b/build.sh @@ -6,14 +6,14 @@ export ANDROID_NDK_PATH=$ANDROID_HOME/ndk/21.4.7075529 [[ -z "$ANDROID_NDK_PATH" ]] && echo "No NDK found, quitting…" && exit 1 # Setup environment -export EXOPLAYER_ROOT="${PWD}/ExoPlayer" -export FFMPEG_EXT_PATH="${EXOPLAYER_ROOT}/extensions/ffmpeg/src/main" +export ANDROIDX_MEDIA_ROOT="${PWD}/media" +export FFMPEG_MOD_PATH="${ANDROIDX_MEDIA_ROOT}/libraries/decoder_ffmpeg/src/main" export FFMPEG_PATH="${PWD}/ffmpeg" export ENABLED_DECODERS=(flac alac pcm_mulaw pcm_alaw mp3 aac ac3 eac3 dca mlp truehd) # Create softlink to ffmpeg -ln -sf "${FFMPEG_PATH}" "${FFMPEG_EXT_PATH}/jni/ffmpeg" +ln -sf "${FFMPEG_PATH}" "${FFMPEG_MOD_PATH}/jni/ffmpeg" # Start build -cd "${FFMPEG_EXT_PATH}/jni" -./build_ffmpeg.sh "${FFMPEG_EXT_PATH}" "${ANDROID_NDK_PATH}" "linux-x86_64" "${ENABLED_DECODERS[@]}" +cd "${FFMPEG_MOD_PATH}/jni" +./build_ffmpeg.sh "${FFMPEG_MOD_PATH}" "${ANDROID_NDK_PATH}" "linux-x86_64" "${ENABLED_DECODERS[@]}" diff --git a/ffmpeg b/ffmpeg index d7beb0c..839f98f 160000 --- a/ffmpeg +++ b/ffmpeg @@ -1 +1 @@ -Subproject commit d7beb0c61fd1e027e40c6b7e8b18fd6cdbbee430 +Subproject commit 839f98ff6719cf2db0cbd88cd787a1b19b9cbf47 diff --git a/media b/media new file mode 160000 index 0000000..c2cbb63 --- /dev/null +++ b/media @@ -0,0 +1 @@ +Subproject commit c2cbb6370a265efc93661b659e70b2679506e995 diff --git a/exoplayer-ffmpeg-extension/build.gradle.kts b/media3-ffmpeg-decoder/build.gradle.kts similarity index 86% rename from exoplayer-ffmpeg-extension/build.gradle.kts rename to media3-ffmpeg-decoder/build.gradle.kts index 8ab3e4c..9342d10 100644 --- a/exoplayer-ffmpeg-extension/build.gradle.kts +++ b/media3-ffmpeg-decoder/build.gradle.kts @@ -5,11 +5,11 @@ plugins { signing } -val exoplayerProject = project(":exoplayer-extension-ffmpeg") -val android = exoplayerProject.extensions.findByType(LibraryExtension::class.java) +val decoderProject = project(":androidx-media-lib-decoder-ffmpeg") +val android = decoderProject.extensions.findByType(LibraryExtension::class.java) ?: error("Could not find android extension") -val generateJavadoc by exoplayerProject.tasks.getting(Javadoc::class) +val generateJavadoc by decoderProject.tasks.getting(Javadoc::class) generateJavadoc.isFailOnError = false val javadocJar by tasks.creating(Jar::class) { @@ -33,15 +33,15 @@ afterEvaluate { // Specify release artifacts and apply POM publishing.publications.create("default") { // Repackage release artifacts of extension - from(exoplayerProject.components["release"]) + from(decoderProject.components["release"]) // Add JavaDocs and sources artifact(javadocJar) artifact(sourcesJar) pom { - name.set("Jellyfin ExoPlayer libraries - $artifactId") - description.set("ExoPlayer FFmpeg extension used in the Jellyfin project") + name.set("Jellyfin AndroidX Media3 libraries - $artifactId") + description.set("AndroidX Media3 FFmpeg decoder used in the Jellyfin project") url.set("https://github.com/jellyfin/jellyfin-exoplayer-ffmpeg-extension") scm { diff --git a/settings.gradle.kts b/settings.gradle.kts index b742fb5..66eac5a 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,9 +1,9 @@ // See https://github.com/google/ExoPlayer/issues/6339 if (gradle is ExtensionAware) { val extension = gradle as ExtensionAware - extension.extra["exoplayerRoot"] = file("ExoPlayer").absolutePath - extension.extra["exoplayerModulePrefix"] = "exoplayer-" - apply(from = File(extension.extra["exoplayerRoot"].toString(), "core_settings.gradle")) + val mediaRoot = file("media") + extension.extra["androidxMediaModulePrefix"] = "androidx-media-" + apply(from = File(mediaRoot, "core_settings.gradle")) } -include(":exoplayer-ffmpeg-extension") +include(":media3-ffmpeg-decoder")