Skip to content

Commit

Permalink
Migrate to AndroidX Media
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxr1998 committed Dec 22, 2023
1 parent ee5bdf9 commit cd2bcf7
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/extension-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: ExoPlayer FFmpeg Extension / Build
on:
push:
branches:
- master
- androidx-media
pull_request:

env:
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/extension-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion ExoPlayer
Submodule ExoPlayer deleted from 5d4b70
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ buildscript {
}

allprojects {
group = "org.jellyfin.exoplayer"
group = "org.jellyfin.media3"
version = createVersion()

repositories {
Expand Down
10 changes: 5 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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[@]}"
2 changes: 1 addition & 1 deletion ffmpeg
Submodule ffmpeg updated from d7beb0 to 839f98
1 change: 1 addition & 0 deletions media
Submodule media added at c2cbb6
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -33,15 +33,15 @@ afterEvaluate {
// Specify release artifacts and apply POM
publishing.publications.create<MavenPublication>("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 {
Expand Down
8 changes: 4 additions & 4 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -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")

0 comments on commit cd2bcf7

Please sign in to comment.