-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor hw contexts, use kotlin-flow-graph library, extend Sof…
…twareGLRenderInterop, remove obsolete VAGLXRenderInterop (replaced by SoftwareGLRenderInterop)
- Loading branch information
1 parent
b74bc4c
commit 8e754b6
Showing
68 changed files
with
1,879 additions
and
1,088 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 | ||
kotlin.code.style=official | ||
kotlin.version=2.0.0 | ||
compose.version=1.6.11 | ||
skiko.egl=true | ||
skiko.egl=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// | ||
// Created by silenium-dev on 8/1/24. | ||
// | ||
|
||
#include <jni.h> | ||
|
||
extern "C" { | ||
#include <libavutil/buffer.h> | ||
|
||
JNIEXPORT void JNICALL Java_dev_silenium_multimedia_core_data_AVBufferRefKt_destroyAVBufferN( | ||
JNIEnv *env, | ||
jobject thiz, | ||
const jlong buffer) { | ||
auto avBuffer = reinterpret_cast<AVBufferRef *>(buffer); | ||
av_buffer_unref(&avBuffer); | ||
} | ||
|
||
JNIEXPORT jlong JNICALL Java_dev_silenium_multimedia_core_data_AVBufferRefKt_cloneAVBufferN( | ||
JNIEnv *env, | ||
jobject thiz, | ||
const jlong buffer) { | ||
const auto avBuffer = reinterpret_cast<AVBufferRef *>(buffer); | ||
return reinterpret_cast<jlong>(av_buffer_ref(avBuffer)); | ||
} | ||
|
||
JNIEXPORT jobject JNICALL Java_dev_silenium_multimedia_core_data_AVBufferRefKt_byteBufferN( | ||
JNIEnv *env, | ||
jobject thiz, | ||
const jlong buffer) { | ||
const auto avBuffer = reinterpret_cast<AVBufferRef *>(buffer); | ||
return env->NewDirectByteBuffer(avBuffer->data, static_cast<jlong>(avBuffer->size)); | ||
} | ||
|
||
JNIEXPORT jlong JNICALL Java_dev_silenium_multimedia_core_data_AVBufferRefKt_bufferSizeN( | ||
JNIEnv *env, | ||
jobject thiz, | ||
const jlong buffer) { | ||
const auto avBuffer = reinterpret_cast<AVBufferRef *>(buffer); | ||
return static_cast<jlong>(avBuffer->size); | ||
} | ||
|
||
JNIEXPORT jlong JNICALL Java_dev_silenium_multimedia_core_data_AVBufferRefKt_bufferDataPtrN( | ||
JNIEnv *env, | ||
jobject thiz, | ||
const jlong buffer) { | ||
const auto avBuffer = reinterpret_cast<AVBufferRef *>(buffer); | ||
return reinterpret_cast<jlong>(avBuffer->data); | ||
} | ||
|
||
JNIEXPORT jint JNICALL Java_dev_silenium_multimedia_core_data_AVBufferRefKt_refCountN( | ||
JNIEnv *env, | ||
jobject thiz, | ||
const jlong buffer) { | ||
const auto avBuffer = reinterpret_cast<AVBufferRef *>(buffer); | ||
return av_buffer_get_ref_count(avBuffer); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
// | ||
// Created by silenium-dev on 8/4/24. | ||
// | ||
|
||
#include "helper/rationals.hpp" | ||
#include <jni.h> | ||
|
||
extern "C" { | ||
#include <libavcodec/codec_par.h> | ||
|
||
JNIEXPORT jint JNICALL Java_dev_silenium_multimedia_core_data_AVCodecParametersKt_codecIdN( | ||
JNIEnv *env, | ||
jobject thiz, | ||
const jlong context) { | ||
const auto codecParameters = reinterpret_cast<AVCodecParameters *>(context); | ||
return codecParameters->codec_id; | ||
} | ||
|
||
JNIEXPORT jint JNICALL Java_dev_silenium_multimedia_core_data_AVCodecParametersKt_widthN( | ||
JNIEnv *env, | ||
jobject thiz, | ||
const jlong context) { | ||
const auto codecParameters = reinterpret_cast<AVCodecParameters *>(context); | ||
return codecParameters->width; | ||
} | ||
|
||
JNIEXPORT jint JNICALL Java_dev_silenium_multimedia_core_data_AVCodecParametersKt_heightN( | ||
JNIEnv *env, | ||
jobject thiz, | ||
const jlong context) { | ||
const auto codecParameters = reinterpret_cast<AVCodecParameters *>(context); | ||
return codecParameters->height; | ||
} | ||
|
||
JNIEXPORT jint JNICALL Java_dev_silenium_multimedia_core_data_AVCodecParametersKt_formatN( | ||
JNIEnv *env, | ||
jobject thiz, | ||
const jlong context) { | ||
const auto codecParameters = reinterpret_cast<AVCodecParameters *>(context); | ||
return codecParameters->format; | ||
} | ||
|
||
JNIEXPORT jint JNICALL Java_dev_silenium_multimedia_core_data_AVCodecParametersKt_colorSpaceN( | ||
JNIEnv *env, | ||
jobject thiz, | ||
const jlong context) { | ||
const auto codecParameters = reinterpret_cast<AVCodecParameters *>(context); | ||
return codecParameters->color_space; | ||
} | ||
|
||
JNIEXPORT jint JNICALL Java_dev_silenium_multimedia_core_data_AVCodecParametersKt_colorPrimariesN( | ||
JNIEnv *env, | ||
jobject thiz, | ||
const jlong context) { | ||
const auto codecParameters = reinterpret_cast<AVCodecParameters *>(context); | ||
return codecParameters->color_primaries; | ||
} | ||
|
||
JNIEXPORT jint JNICALL Java_dev_silenium_multimedia_core_data_AVCodecParametersKt_colorRangeN( | ||
JNIEnv *env, | ||
jobject thiz, | ||
const jlong context) { | ||
const auto codecParameters = reinterpret_cast<AVCodecParameters *>(context); | ||
return codecParameters->color_range; | ||
} | ||
|
||
JNIEXPORT jint JNICALL Java_dev_silenium_multimedia_core_data_AVCodecParametersKt_colorTrcN( | ||
JNIEnv *env, | ||
jobject thiz, | ||
const jlong context) { | ||
const auto codecParameters = reinterpret_cast<AVCodecParameters *>(context); | ||
return codecParameters->color_trc; | ||
} | ||
|
||
JNIEXPORT jobject JNICALL Java_dev_silenium_multimedia_core_data_AVCodecParametersKt_frameRateN( | ||
JNIEnv *env, | ||
jobject thiz, | ||
const jlong context) { | ||
const auto codecParameters = reinterpret_cast<AVCodecParameters *>(context); | ||
return toJava(env, codecParameters->framerate); | ||
} | ||
|
||
JNIEXPORT jlong JNICALL Java_dev_silenium_multimedia_core_data_AVCodecParametersKt_bitRateN( | ||
JNIEnv *env, | ||
jobject thiz, | ||
const jlong context) { | ||
const auto codecParameters = reinterpret_cast<AVCodecParameters *>(context); | ||
return codecParameters->bit_rate; | ||
} | ||
} |
Oops, something went wrong.