Files
armorpaint/base/sources/backends/android_video.c
T

107 lines
3.0 KiB
C
Raw Normal View History

2025-02-26 18:46:36 +01:00
// #include <iron_video.h>
2025-03-09 17:02:12 +01:00
// #include <iron_audio.h>
2025-02-26 18:46:36 +01:00
// #include <iron_gpu.h>
// #include <iron_file.h>
// #include <iron_system.h>
// #include <android_native_app_glue.h>
// #include <stdio.h>
// #include <stdlib.h>
// #include <string.h>
// #include <assert.h>
// #include <jni.h>
2025-03-07 11:30:51 +01:00
// #include <backends/android.h>
2025-02-26 18:46:36 +01:00
// #include <pthread.h>
2025-03-09 17:02:12 +01:00
// void iron_video_sound_stream_impl_init(iron_internal_video_sound_stream_t *stream, int channel_count, int frequency) {
2025-02-26 18:46:36 +01:00
// stream->bufferSize = 1;
// stream->bufferReadPosition = 0;
// stream->bufferWritePosition = 0;
// stream->read = 0;
// stream->written = 0;
// }
2025-03-09 17:02:12 +01:00
// void iron_video_sound_stream_impl_destroy(iron_internal_video_sound_stream_t *stream) {}
2025-02-26 18:46:36 +01:00
2025-03-09 17:02:12 +01:00
// void iron_video_sound_stream_impl_insert_data(iron_internal_video_sound_stream_t *stream, float *data, int sample_count) {}
2025-02-26 18:46:36 +01:00
// static float samples[2] = {0};
2025-03-09 17:02:12 +01:00
// float *iron_internal_video_sound_stream_next_frame(iron_internal_video_sound_stream_t *stream) {
2025-02-26 18:46:36 +01:00
// return samples;
// }
2025-03-09 17:02:12 +01:00
// bool iron_internal_video_sound_stream_ended(iron_internal_video_sound_stream_t *stream) {
2025-02-26 18:46:36 +01:00
// return false;
// }
2025-03-09 17:02:12 +01:00
// JNIEXPORT void JNICALL Java_org_armory3d_IronMoviePlayer_nativeCreate(JNIEnv *env, jobject jobj, jstring jpath, jobject surface, jint id) {
2025-02-26 18:46:36 +01:00
// }
2025-03-09 17:02:12 +01:00
// void IronAndroidVideoInit() {
2025-02-26 18:46:36 +01:00
// JNIEnv *env;
2025-03-09 17:02:12 +01:00
// (*iron_android_get_activity()->vm)->AttachCurrentThread(iron_android_get_activity()->vm, &env, NULL);
2025-02-26 18:46:36 +01:00
2025-03-09 17:02:12 +01:00
// jclass clazz = iron_android_find_class(env, "org.armory3d.IronMoviePlayer");
2025-02-26 18:46:36 +01:00
// // String path, Surface surface, int id
2025-03-09 17:02:12 +01:00
// JNINativeMethod methodTable[] = {{"nativeCreate", "(Ljava/lang/String;Landroid/view/Surface;I)V", (void *)Java_org_armory3d_IronMoviePlayer_nativeCreate}};
2025-02-26 18:46:36 +01:00
// int methodTableSize = sizeof(methodTable) / sizeof(methodTable[0]);
// int failure = (*env)->RegisterNatives(env, clazz, methodTable, methodTableSize);
// if (failure != 0) {
2025-03-09 17:02:12 +01:00
// iron_log("Failed to register IronMoviePlayer.nativeCreate");
2025-02-26 18:46:36 +01:00
// }
2025-03-09 17:02:12 +01:00
// (*iron_android_get_activity()->vm)->DetachCurrentThread(iron_android_get_activity()->vm);
2025-02-26 18:46:36 +01:00
// }
2025-03-09 17:02:12 +01:00
// void iron_video_init(iron_video_t *video, const char *filename) {
2025-02-26 18:46:36 +01:00
// video->impl.playing = false;
// video->impl.sound = NULL;
// }
2025-03-09 17:02:12 +01:00
// void iron_video_destroy(iron_video_t *video) {
2025-02-26 18:46:36 +01:00
// }
2025-03-09 17:02:12 +01:00
// void iron_video_play(iron_video_t *video, bool loop) {
2025-02-26 18:46:36 +01:00
// }
2025-03-09 17:02:12 +01:00
// void iron_video_pause(iron_video_t *video) {
2025-02-26 18:46:36 +01:00
// }
2025-03-09 17:02:12 +01:00
// void iron_video_stop(iron_video_t *video) {
2025-02-26 18:46:36 +01:00
// }
2025-03-09 17:02:12 +01:00
// void iron_video_update(iron_video_t *video, double time) {}
2025-02-26 18:46:36 +01:00
2025-03-09 17:02:12 +01:00
// int iron_video_width(iron_video_t *video) {
2025-02-26 18:46:36 +01:00
// return 512;
// }
2025-03-09 17:02:12 +01:00
// int iron_video_height(iron_video_t *video) {
2025-02-26 18:46:36 +01:00
// return 512;
// }
2025-06-19 19:55:16 +02:00
// gpu_texture_t *iron_video_current_image(iron_video_t *video) {
2025-02-26 18:46:36 +01:00
// return NULL;
// }
2025-03-09 17:02:12 +01:00
// double iron_video_duration(iron_video_t *video) {
2025-02-26 18:46:36 +01:00
// return 0.0;
// }
2025-03-09 17:02:12 +01:00
// double iron_video_position(iron_video_t *video) {
2025-02-26 18:46:36 +01:00
// return 0.0;
// }
2025-03-09 17:02:12 +01:00
// bool iron_video_finished(iron_video_t *video) {
2025-02-26 18:46:36 +01:00
// return false;
// }
2025-03-09 17:02:12 +01:00
// bool iron_video_paused(iron_video_t *video) {
2025-02-26 18:46:36 +01:00
// return !video->impl.playing;
// }