diff --git a/ffcodecs/build.gradle.kts b/ffcodecs/build.gradle.kts index f67f7dd..e9b4489 100644 --- a/ffcodecs/build.gradle.kts +++ b/ffcodecs/build.gradle.kts @@ -68,7 +68,7 @@ afterEvaluate { publishing { publications { create("mavenJava") { - groupId = "com.github.anilbeesetti" + groupId = "io.github.anilbeesetti" artifactId = "nextlib" version = "1.0" diff --git a/ffcodecs/src/main/cpp/ffaudio.cpp b/ffcodecs/src/main/cpp/ffaudio.cpp index 75cb180..0b58280 100644 --- a/ffcodecs/src/main/cpp/ffaudio.cpp +++ b/ffcodecs/src/main/cpp/ffaudio.cpp @@ -183,7 +183,7 @@ int transformError(int errorNumber) { extern "C" JNIEXPORT jlong JNICALL -Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegAudioDecoder_ffmpegInitialize(JNIEnv *env, +Java_io_github_anilbeesetti_nextlib_ffcodecs_FfmpegAudioDecoder_ffmpegInitialize(JNIEnv *env, jobject thiz, jstring codec_name, jbyteArray extra_data, @@ -201,7 +201,7 @@ Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegAudioDecoder_ffmpegInitializ extern "C" JNIEXPORT jint JNICALL -Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegAudioDecoder_ffmpegDecode(JNIEnv *env, +Java_io_github_anilbeesetti_nextlib_ffcodecs_FfmpegAudioDecoder_ffmpegDecode(JNIEnv *env, jobject thiz, jlong context, jobject input_data, @@ -244,7 +244,7 @@ Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegAudioDecoder_ffmpegDecode(JN extern "C" JNIEXPORT jint JNICALL -Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegAudioDecoder_ffmpegGetChannelCount( +Java_io_github_anilbeesetti_nextlib_ffcodecs_FfmpegAudioDecoder_ffmpegGetChannelCount( JNIEnv *env, jobject thiz, jlong context) { if (!context) { LOGE("Context must be non-NULL."); @@ -255,7 +255,7 @@ Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegAudioDecoder_ffmpegGetChanne extern "C" JNIEXPORT jint JNICALL -Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegAudioDecoder_ffmpegGetSampleRate(JNIEnv *env, +Java_io_github_anilbeesetti_nextlib_ffcodecs_FfmpegAudioDecoder_ffmpegGetSampleRate(JNIEnv *env, jobject thiz, jlong context) { if (!context) { @@ -267,7 +267,7 @@ Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegAudioDecoder_ffmpegGetSample extern "C" JNIEXPORT jlong JNICALL -Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegAudioDecoder_ffmpegReset(JNIEnv *env, +Java_io_github_anilbeesetti_nextlib_ffcodecs_FfmpegAudioDecoder_ffmpegReset(JNIEnv *env, jobject thiz, jlong jContext, jbyteArray extra_data) { @@ -300,7 +300,7 @@ Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegAudioDecoder_ffmpegReset(JNI extern "C" JNIEXPORT void JNICALL -Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegAudioDecoder_ffmpegRelease(JNIEnv *env, +Java_io_github_anilbeesetti_nextlib_ffcodecs_FfmpegAudioDecoder_ffmpegRelease(JNIEnv *env, jobject thiz, jlong context) { if (context) { diff --git a/ffcodecs/src/main/cpp/ffmain.cpp b/ffcodecs/src/main/cpp/ffmain.cpp index a89cd8d..9017fa7 100644 --- a/ffcodecs/src/main/cpp/ffmain.cpp +++ b/ffcodecs/src/main/cpp/ffmain.cpp @@ -14,21 +14,21 @@ jint JNI_OnLoad(JavaVM *vm, void *reserved) { extern "C" JNIEXPORT jstring JNICALL -Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegLibrary_ffmpegGetVersion(JNIEnv *env, +Java_io_github_anilbeesetti_nextlib_ffcodecs_FfmpegLibrary_ffmpegGetVersion(JNIEnv *env, jclass clazz) { return env->NewStringUTF(LIBAVCODEC_IDENT); } extern "C" JNIEXPORT jint JNICALL -Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegLibrary_ffmpegGetInputBufferPaddingSize( +Java_io_github_anilbeesetti_nextlib_ffcodecs_FfmpegLibrary_ffmpegGetInputBufferPaddingSize( JNIEnv *env, jclass clazz) { return (jint) AV_INPUT_BUFFER_PADDING_SIZE; } extern "C" JNIEXPORT jboolean JNICALL -Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegLibrary_ffmpegHasDecoder(JNIEnv *env, +Java_io_github_anilbeesetti_nextlib_ffcodecs_FfmpegLibrary_ffmpegHasDecoder(JNIEnv *env, jclass clazz, jstring codec_name) { return getCodecByName(env, codec_name) != nullptr; diff --git a/ffcodecs/src/main/cpp/ffvideo.cpp b/ffcodecs/src/main/cpp/ffvideo.cpp index 0e211f6..a597b4a 100644 --- a/ffcodecs/src/main/cpp/ffvideo.cpp +++ b/ffcodecs/src/main/cpp/ffvideo.cpp @@ -136,7 +136,7 @@ JniContext *createVideoContext(JNIEnv *env, extern "C" JNIEXPORT jlong JNICALL -Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegVideoDecoder_ffmpegInitialize(JNIEnv *env, +Java_io_github_anilbeesetti_nextlib_ffcodecs_FfmpegVideoDecoder_ffmpegInitialize(JNIEnv *env, jobject thiz, jstring codec_name, jbyteArray extra_data, @@ -152,7 +152,7 @@ Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegVideoDecoder_ffmpegInitializ extern "C" JNIEXPORT jlong JNICALL -Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegVideoDecoder_ffmpegReset(JNIEnv *env, jobject thiz, +Java_io_github_anilbeesetti_nextlib_ffcodecs_FfmpegVideoDecoder_ffmpegReset(JNIEnv *env, jobject thiz, jlong jContext) { auto *const jniContext = reinterpret_cast(jContext); AVCodecContext *context = jniContext->codecContext; @@ -167,7 +167,7 @@ Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegVideoDecoder_ffmpegReset(JNI extern "C" JNIEXPORT void JNICALL -Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegVideoDecoder_ffmpegRelease(JNIEnv *env, jobject thiz, +Java_io_github_anilbeesetti_nextlib_ffcodecs_FfmpegVideoDecoder_ffmpegRelease(JNIEnv *env, jobject thiz, jlong jContext) { auto *const jniContext = reinterpret_cast(jContext); AVCodecContext *context = jniContext->codecContext; @@ -179,7 +179,7 @@ Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegVideoDecoder_ffmpegRelease(J extern "C" JNIEXPORT jint JNICALL -Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegVideoDecoder_ffmpegRenderFrame(JNIEnv *env, +Java_io_github_anilbeesetti_nextlib_ffcodecs_FfmpegVideoDecoder_ffmpegRenderFrame(JNIEnv *env, jobject thiz, jlong jContext, jobject surface, @@ -298,7 +298,7 @@ Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegVideoDecoder_ffmpegRenderFra extern "C" JNIEXPORT jint JNICALL -Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegVideoDecoder_ffmpegSendPacket(JNIEnv *env, +Java_io_github_anilbeesetti_nextlib_ffcodecs_FfmpegVideoDecoder_ffmpegSendPacket(JNIEnv *env, jobject thiz, jlong jContext, jobject encoded_data, @@ -332,7 +332,7 @@ Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegVideoDecoder_ffmpegSendPacke extern "C" JNIEXPORT jint JNICALL -Java_com_github_anilbeesetti_nextlib_ffcodecs_FfmpegVideoDecoder_ffmpegReceiveFrame(JNIEnv *env, +Java_io_github_anilbeesetti_nextlib_ffcodecs_FfmpegVideoDecoder_ffmpegReceiveFrame(JNIEnv *env, jobject thiz, jlong jContext, jint output_mode, diff --git a/ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/FfmpegDecoderException.java b/ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/FfmpegDecoderException.java deleted file mode 100644 index 8373c51..0000000 --- a/ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/FfmpegDecoderException.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.github.anilbeesetti.nextlib.ffcodecs; - -import androidx.media3.common.util.UnstableApi; -import androidx.media3.decoder.DecoderException; - -/** Thrown when an FFmpeg decoder error occurs. */ -@UnstableApi -public final class FfmpegDecoderException extends DecoderException { - - /* package */ FfmpegDecoderException(String message) { - super(message); - } - - /* package */ FfmpegDecoderException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/package-info.java b/ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/package-info.java deleted file mode 100644 index d04e046..0000000 --- a/ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/package-info.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (C) 2019 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -@NonNullApi -package com.github.anilbeesetti.nextlib.ffcodecs; - -import androidx.media3.common.util.NonNullApi; diff --git a/ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/FFmpegOnlyRenderersFactory.java b/ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/FFmpegOnlyRenderersFactory.java similarity index 96% rename from ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/FFmpegOnlyRenderersFactory.java rename to ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/FFmpegOnlyRenderersFactory.java index 82d585f..237a11a 100644 --- a/ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/FFmpegOnlyRenderersFactory.java +++ b/ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/FFmpegOnlyRenderersFactory.java @@ -1,4 +1,4 @@ -package com.github.anilbeesetti.nextlib.ffcodecs; +package io.github.anilbeesetti.nextlib.ffcodecs; import android.content.Context; import android.os.Handler; diff --git a/ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/FfmpegAudioDecoder.java b/ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/FfmpegAudioDecoder.java similarity index 92% rename from ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/FfmpegAudioDecoder.java rename to ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/FfmpegAudioDecoder.java index e87240f..8135b66 100644 --- a/ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/FfmpegAudioDecoder.java +++ b/ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/FfmpegAudioDecoder.java @@ -1,19 +1,4 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.github.anilbeesetti.nextlib.ffcodecs; +package io.github.anilbeesetti.nextlib.ffcodecs; import android.annotation.SuppressLint; diff --git a/ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/FfmpegAudioRenderer.java b/ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/FfmpegAudioRenderer.java similarity index 89% rename from ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/FfmpegAudioRenderer.java rename to ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/FfmpegAudioRenderer.java index 319b7da..661d6a0 100644 --- a/ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/FfmpegAudioRenderer.java +++ b/ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/FfmpegAudioRenderer.java @@ -1,19 +1,4 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.github.anilbeesetti.nextlib.ffcodecs; +package io.github.anilbeesetti.nextlib.ffcodecs; import static androidx.media3.exoplayer.audio.AudioSink.SINK_FORMAT_SUPPORTED_DIRECTLY; import static androidx.media3.exoplayer.audio.AudioSink.SINK_FORMAT_SUPPORTED_WITH_TRANSCODING; diff --git a/ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/FfmpegDecoderException.java b/ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/FfmpegDecoderException.java new file mode 100644 index 0000000..3bfeea9 --- /dev/null +++ b/ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/FfmpegDecoderException.java @@ -0,0 +1,17 @@ +package io.github.anilbeesetti.nextlib.ffcodecs; + +import androidx.media3.common.util.UnstableApi; +import androidx.media3.decoder.DecoderException; + +/** Thrown when an FFmpeg decoder error occurs. */ +@UnstableApi +public final class FfmpegDecoderException extends DecoderException { + + /* package */ FfmpegDecoderException(String message) { + super(message); + } + + /* package */ FfmpegDecoderException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/FfmpegLibrary.java b/ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/FfmpegLibrary.java similarity index 86% rename from ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/FfmpegLibrary.java rename to ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/FfmpegLibrary.java index 6bb40ae..1e04e97 100644 --- a/ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/FfmpegLibrary.java +++ b/ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/FfmpegLibrary.java @@ -1,19 +1,4 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.github.anilbeesetti.nextlib.ffcodecs; +package io.github.anilbeesetti.nextlib.ffcodecs; import androidx.annotation.Nullable; import androidx.media3.common.C; diff --git a/ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/FfmpegVideoDecoder.java b/ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/FfmpegVideoDecoder.java similarity index 99% rename from ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/FfmpegVideoDecoder.java rename to ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/FfmpegVideoDecoder.java index abcbef5..ccb989e 100644 --- a/ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/FfmpegVideoDecoder.java +++ b/ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/FfmpegVideoDecoder.java @@ -1,4 +1,4 @@ -package com.github.anilbeesetti.nextlib.ffcodecs; +package io.github.anilbeesetti.nextlib.ffcodecs; import android.util.Log; import android.view.Surface; diff --git a/ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/FfmpegVideoRenderer.java b/ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/FfmpegVideoRenderer.java similarity index 99% rename from ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/FfmpegVideoRenderer.java rename to ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/FfmpegVideoRenderer.java index 7be009b..dff0baf 100644 --- a/ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/FfmpegVideoRenderer.java +++ b/ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/FfmpegVideoRenderer.java @@ -1,4 +1,4 @@ -package com.github.anilbeesetti.nextlib.ffcodecs; +package io.github.anilbeesetti.nextlib.ffcodecs; import static java.lang.Runtime.getRuntime; diff --git a/ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/NextRenderersFactory.java b/ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/NextRenderersFactory.java similarity index 98% rename from ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/NextRenderersFactory.java rename to ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/NextRenderersFactory.java index be07577..0f55acd 100644 --- a/ffcodecs/src/main/java/com/github/anilbeesetti/nextlib/ffcodecs/NextRenderersFactory.java +++ b/ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/NextRenderersFactory.java @@ -1,4 +1,4 @@ -package com.github.anilbeesetti.nextlib.ffcodecs; +package io.github.anilbeesetti.nextlib.ffcodecs; import android.content.Context; import android.os.Handler; diff --git a/ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/package-info.java b/ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/package-info.java new file mode 100644 index 0000000..1f86999 --- /dev/null +++ b/ffcodecs/src/main/java/io/github/anilbeesetti/nextlib/ffcodecs/package-info.java @@ -0,0 +1,4 @@ +@NonNullApi +package io.github.anilbeesetti.nextlib.ffcodecs; + +import androidx.media3.common.util.NonNullApi;