Skip to content

Commit

Permalink
feat: start working on processing flow, change group to dev.silenium.…
Browse files Browse the repository at this point in the history
…multimedia
  • Loading branch information
silenium-dev committed Aug 2, 2024
1 parent 66c594e commit b038f0e
Show file tree
Hide file tree
Showing 78 changed files with 740 additions and 415 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ allprojects {
apply<MavenPublishPlugin>()
apply<BasePlugin>()

group = "dev.silenium.compose.av"
group = "dev.silenium.multimedia"
version = findProperty("deploy.version") as String? ?: "0.0.0-SNAPSHOT"

repositories {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
kotlin.code.style=official
kotlin.version=2.0.0
compose.version=1.6.11
skiko.egl=false
skiko.egl=true
3 changes: 3 additions & 0 deletions native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ set(SOURCES
src/cpp/helper/rationals.hpp
src/cpp/render/GLInteropImage.cpp
src/cpp/render/GLInteropImage.hpp
src/cpp/render/SoftwareGLInteropImage.cpp
src/cpp/render/SoftwareGLInteropImage.hpp
src/cpp/render/SoftwareGLRenderInterop.cpp
src/cpp/render/Swizzles.hpp
src/cpp/render/Swizzles.cpp
src/cpp/util/Errors.cpp
Expand Down
6 changes: 3 additions & 3 deletions native/src/cpp/data/AVCodecID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ static std::map<std::string, AVCodecID> codecNameMap{
{"AV_CODEC_ID_ANULL", AV_CODEC_ID_ANULL},
};

JNIEXPORT jint JNICALL Java_dev_silenium_compose_av_data_AVCodecIDKt_toIdN(
JNIEXPORT jint JNICALL Java_dev_silenium_multimedia_core_data_AVCodecIDKt_toIdN(
JNIEnv *env,
jobject thiz,
const jstring name
Expand All @@ -556,15 +556,15 @@ JNIEXPORT jint JNICALL Java_dev_silenium_compose_av_data_AVCodecIDKt_toIdN(
return result;
}

JNIEXPORT jint JNICALL Java_dev_silenium_compose_av_data_AVCodecIDKt_mediaTypeN(
JNIEXPORT jint JNICALL Java_dev_silenium_multimedia_core_data_AVCodecIDKt_mediaTypeN(
JNIEnv *env,
jobject thiz,
const jint id
) {
return avcodec_get_type(static_cast<AVCodecID>(id));
}

JNIEXPORT jstring JNICALL Java_dev_silenium_compose_av_data_AVCodecIDKt_descriptionN(
JNIEXPORT jstring JNICALL Java_dev_silenium_multimedia_core_data_AVCodecIDKt_descriptionN(
JNIEnv *env,
jobject thiz,
const jint id
Expand Down
2 changes: 1 addition & 1 deletion native/src/cpp/data/AVPixelFormat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ extern "C" {
#include <libavutil/pixfmt.h>
#include <libavutil/pixdesc.h>

JNIEXPORT jstring JNICALL Java_dev_silenium_compose_av_data_AVPixelFormatKt_descriptionN(
JNIEXPORT jstring JNICALL Java_dev_silenium_multimedia_core_data_AVPixelFormatKt_descriptionN(
JNIEnv *env,
jobject thiz,
const jint format
Expand Down
51 changes: 32 additions & 19 deletions native/src/cpp/data/Frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
extern "C" {
#include <libavformat/avformat.h>

JNIEXPORT void JNICALL Java_dev_silenium_compose_av_data_FrameKt_releaseFrameN(
JNIEXPORT void JNICALL Java_dev_silenium_multimedia_core_data_FrameKt_releaseFrameN(
JNIEnv *env,
jobject thiz,
const jlong frame
) {
auto avFrame = reinterpret_cast<AVFrame *>(frame);
av_frame_free(&avFrame);
}
JNIEXPORT jobject JNICALL Java_dev_silenium_compose_av_data_FrameKt_timeBaseN(
JNIEXPORT jobject JNICALL Java_dev_silenium_multimedia_core_data_FrameKt_timeBaseN(
JNIEnv *env,
jobject thiz,
const jlong frame
Expand All @@ -29,7 +29,7 @@ JNIEXPORT jobject JNICALL Java_dev_silenium_compose_av_data_FrameKt_timeBaseN(
return toJava(env, avFrame->time_base);
}

JNIEXPORT jint JNICALL Java_dev_silenium_compose_av_data_FrameKt_widthN(
JNIEXPORT jint JNICALL Java_dev_silenium_multimedia_core_data_FrameKt_widthN(
JNIEnv *env,
jobject thiz,
const jlong frame
Expand All @@ -38,7 +38,7 @@ JNIEXPORT jint JNICALL Java_dev_silenium_compose_av_data_FrameKt_widthN(
return avFrame->width;
}

JNIEXPORT jint JNICALL Java_dev_silenium_compose_av_data_FrameKt_heightN(
JNIEXPORT jint JNICALL Java_dev_silenium_multimedia_core_data_FrameKt_heightN(
JNIEnv *env,
jobject thiz,
const jlong frame
Expand All @@ -47,7 +47,7 @@ JNIEXPORT jint JNICALL Java_dev_silenium_compose_av_data_FrameKt_heightN(
return avFrame->height;
}

JNIEXPORT jint JNICALL Java_dev_silenium_compose_av_data_FrameKt_formatN(
JNIEXPORT jint JNICALL Java_dev_silenium_multimedia_core_data_FrameKt_formatN(
JNIEnv *env,
jobject thiz,
const jlong frame
Expand All @@ -56,7 +56,7 @@ JNIEXPORT jint JNICALL Java_dev_silenium_compose_av_data_FrameKt_formatN(
return avFrame->format;
}

JNIEXPORT jint JNICALL Java_dev_silenium_compose_av_data_FrameKt_colorSpaceN(
JNIEXPORT jint JNICALL Java_dev_silenium_multimedia_core_data_FrameKt_colorSpaceN(
JNIEnv *env,
jobject thiz,
const jlong frame
Expand All @@ -65,7 +65,7 @@ JNIEXPORT jint JNICALL Java_dev_silenium_compose_av_data_FrameKt_colorSpaceN(
return avFrame->colorspace;
}

JNIEXPORT jint JNICALL Java_dev_silenium_compose_av_data_FrameKt_colorRangeN(
JNIEXPORT jint JNICALL Java_dev_silenium_multimedia_core_data_FrameKt_colorRangeN(
JNIEnv *env,
jobject thiz,
const jlong frame
Expand All @@ -74,7 +74,7 @@ JNIEXPORT jint JNICALL Java_dev_silenium_compose_av_data_FrameKt_colorRangeN(
return avFrame->color_range;
}

JNIEXPORT jint JNICALL Java_dev_silenium_compose_av_data_FrameKt_colorPrimariesN(
JNIEXPORT jint JNICALL Java_dev_silenium_multimedia_core_data_FrameKt_colorPrimariesN(
JNIEnv *env,
jobject thiz,
const jlong frame
Expand All @@ -83,7 +83,7 @@ JNIEXPORT jint JNICALL Java_dev_silenium_compose_av_data_FrameKt_colorPrimariesN
return avFrame->color_primaries;
}

JNIEXPORT jint JNICALL Java_dev_silenium_compose_av_data_FrameKt_colorTrcN(
JNIEXPORT jint JNICALL Java_dev_silenium_multimedia_core_data_FrameKt_colorTrcN(
JNIEnv *env,
jobject thiz,
const jlong frame
Expand All @@ -92,7 +92,7 @@ JNIEXPORT jint JNICALL Java_dev_silenium_compose_av_data_FrameKt_colorTrcN(
return avFrame->color_trc;
}

JNIEXPORT jint JNICALL Java_dev_silenium_compose_av_data_FrameKt_swFormatN(
JNIEXPORT jint JNICALL Java_dev_silenium_multimedia_core_data_FrameKt_swFormatN(
JNIEnv *env,
jobject thiz,
const jlong frame
Expand All @@ -103,7 +103,7 @@ JNIEXPORT jint JNICALL Java_dev_silenium_compose_av_data_FrameKt_swFormatN(
return hwFramesCtx->sw_format;
}

JNIEXPORT jboolean JNICALL Java_dev_silenium_compose_av_data_FrameKt_keyFrameN(
JNIEXPORT jboolean JNICALL Java_dev_silenium_multimedia_core_data_FrameKt_keyFrameN(
JNIEnv *env,
jobject thiz,
const jlong frame
Expand All @@ -112,7 +112,7 @@ JNIEXPORT jboolean JNICALL Java_dev_silenium_compose_av_data_FrameKt_keyFrameN(
return (avFrame->flags & AV_FRAME_FLAG_KEY) > 0;
}

JNIEXPORT jlong JNICALL Java_dev_silenium_compose_av_data_FrameKt_ptsN(
JNIEXPORT jlong JNICALL Java_dev_silenium_multimedia_core_data_FrameKt_ptsN(
JNIEnv *env,
jobject thiz,
const jlong frame
Expand All @@ -121,7 +121,7 @@ JNIEXPORT jlong JNICALL Java_dev_silenium_compose_av_data_FrameKt_ptsN(
return avFrame->pts;
}

JNIEXPORT jlong JNICALL Java_dev_silenium_compose_av_data_FrameKt_bestEffortTimestampN(
JNIEXPORT jlong JNICALL Java_dev_silenium_multimedia_core_data_FrameKt_bestEffortTimestampN(
JNIEnv *env,
jobject thiz,
const jlong frame
Expand All @@ -130,7 +130,7 @@ JNIEXPORT jlong JNICALL Java_dev_silenium_compose_av_data_FrameKt_bestEffortTime
return avFrame->best_effort_timestamp;
}

JNIEXPORT jlong JNICALL Java_dev_silenium_compose_av_data_FrameKt_durationN(
JNIEXPORT jlong JNICALL Java_dev_silenium_multimedia_core_data_FrameKt_durationN(
JNIEnv *env,
jobject thiz,
const jlong frame
Expand All @@ -139,7 +139,7 @@ JNIEXPORT jlong JNICALL Java_dev_silenium_compose_av_data_FrameKt_durationN(
return avFrame->duration;
}

JNIEXPORT jboolean JNICALL Java_dev_silenium_compose_av_data_FrameKt_isHWN(
JNIEXPORT jboolean JNICALL Java_dev_silenium_multimedia_core_data_FrameKt_isHWN(
JNIEnv *env,
jobject thiz,
const jlong frame
Expand All @@ -148,7 +148,7 @@ JNIEXPORT jboolean JNICALL Java_dev_silenium_compose_av_data_FrameKt_isHWN(
return avFrame->hw_frames_ctx != nullptr;
}

JNIEXPORT jobjectArray JNICALL Java_dev_silenium_compose_av_data_FrameKt_dataN(
JNIEXPORT jobjectArray JNICALL Java_dev_silenium_multimedia_core_data_FrameKt_dataN(
JNIEnv *env,
jobject thiz,
const jlong frame
Expand All @@ -165,7 +165,7 @@ JNIEXPORT jobjectArray JNICALL Java_dev_silenium_compose_av_data_FrameKt_dataN(
return result;
}

JNIEXPORT jobjectArray JNICALL Java_dev_silenium_compose_av_data_FrameKt_rawDataN(
JNIEXPORT jobjectArray JNICALL Java_dev_silenium_multimedia_core_data_FrameKt_rawDataN(
JNIEnv *env,
jobject thiz,
const jlong frame
Expand All @@ -179,7 +179,7 @@ JNIEXPORT jobjectArray JNICALL Java_dev_silenium_compose_av_data_FrameKt_rawData
return result;
}

JNIEXPORT jobjectArray JNICALL Java_dev_silenium_compose_av_data_FrameKt_pitchN(
JNIEXPORT jobjectArray JNICALL Java_dev_silenium_multimedia_core_data_FrameKt_pitchN(
JNIEnv *env,
jobject thiz,
const jlong frame
Expand All @@ -196,7 +196,20 @@ JNIEXPORT jobjectArray JNICALL Java_dev_silenium_compose_av_data_FrameKt_pitchN(
return result;
}

JNIEXPORT jobject JNICALL Java_dev_silenium_compose_av_data_FrameKt_transferToSWN(
JNIEXPORT jobject JNICALL Java_dev_silenium_multimedia_core_data_FrameKt_cloneN(
JNIEnv *env,
jobject thiz,
const jlong frame
) {
const auto avFrame = reinterpret_cast<AVFrame *>(frame);
auto clone = av_frame_clone(avFrame);
if (clone == nullptr) {
return avResultFailure(env, "clone frame", AVERROR(ENOMEM));
}
return resultSuccess(env, reinterpret_cast<jlong>(clone));
}

JNIEXPORT jobject JNICALL Java_dev_silenium_multimedia_core_data_FrameKt_transferToSWN(
JNIEnv *env,
jobject thiz,
const jlong frame
Expand Down
6 changes: 3 additions & 3 deletions native/src/cpp/data/Packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
extern "C" {
#include <libavformat/avformat.h>

JNIEXPORT void JNICALL Java_dev_silenium_compose_av_data_PacketKt_releasePacketN(
JNIEXPORT void JNICALL Java_dev_silenium_multimedia_core_data_PacketKt_releasePacketN(
JNIEnv *env,
jobject thiz,
const jlong packet
Expand All @@ -17,7 +17,7 @@ JNIEXPORT void JNICALL Java_dev_silenium_compose_av_data_PacketKt_releasePacketN
av_packet_free(&avPacket);
}

JNIEXPORT jint JNICALL Java_dev_silenium_compose_av_data_PacketKt_sizeN(
JNIEXPORT jint JNICALL Java_dev_silenium_multimedia_core_data_PacketKt_sizeN(
JNIEnv *env,
jobject thiz,
const jlong packet
Expand All @@ -26,7 +26,7 @@ JNIEXPORT jint JNICALL Java_dev_silenium_compose_av_data_PacketKt_sizeN(
return avPacket->size;
}

JNIEXPORT jobject JNICALL Java_dev_silenium_compose_av_data_PacketKt_dataN(
JNIEXPORT jobject JNICALL Java_dev_silenium_multimedia_core_data_PacketKt_dataN(
JNIEnv *env,
jobject thiz,
const jlong packet,
Expand Down
6 changes: 3 additions & 3 deletions native/src/cpp/decode/Decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ extern "C" {
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>

JNIEXPORT void JNICALL Java_dev_silenium_compose_av_decode_DecoderKt_releaseDecoderN(
JNIEXPORT void JNICALL Java_dev_silenium_multimedia_core_decode_DecoderKt_releaseDecoderN(
JNIEnv *env,
jobject thiz,
const jlong codecContext
Expand All @@ -20,7 +20,7 @@ JNIEXPORT void JNICALL Java_dev_silenium_compose_av_decode_DecoderKt_releaseDeco
avcodec_free_context(&avCodecContext);
}

JNIEXPORT jint JNICALL Java_dev_silenium_compose_av_decode_DecoderKt_submitN(
JNIEXPORT jint JNICALL Java_dev_silenium_multimedia_core_decode_DecoderKt_submitN(
JNIEnv *env,
jobject thiz,
const jlong codecContext,
Expand All @@ -31,7 +31,7 @@ JNIEXPORT jint JNICALL Java_dev_silenium_compose_av_decode_DecoderKt_submitN(
return avcodec_send_packet(avCodecContext, avPacket);
}

JNIEXPORT jobject JNICALL Java_dev_silenium_compose_av_decode_DecoderKt_receiveN(
JNIEXPORT jobject JNICALL Java_dev_silenium_multimedia_core_decode_DecoderKt_receiveN(
JNIEnv *env,
jobject thiz,
const jlong codecContext
Expand Down
2 changes: 1 addition & 1 deletion native/src/cpp/decode/SoftwareDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extern "C" {
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>

JNIEXPORT jobject JNICALL Java_dev_silenium_compose_av_decode_SoftwareDecoderKt_createDecoderN(
JNIEXPORT jobject JNICALL Java_dev_silenium_multimedia_core_decode_SoftwareDecoderKt_createDecoderN(
JNIEnv *env,
jobject thiz,
const jlong stream
Expand Down
Loading

0 comments on commit b038f0e

Please sign in to comment.