android_video.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. // #include <iron_video.h>
  2. // #include <iron_audio.h>
  3. // #include <iron_gpu.h>
  4. // #include <iron_file.h>
  5. // #include <iron_system.h>
  6. // #include <android_native_app_glue.h>
  7. // #include <stdio.h>
  8. // #include <stdlib.h>
  9. // #include <string.h>
  10. // #include <assert.h>
  11. // #include <jni.h>
  12. // #include <backends/android.h>
  13. // #include <pthread.h>
  14. // void iron_video_sound_stream_impl_init(iron_internal_video_sound_stream_t *stream, int channel_count, int frequency) {
  15. // stream->bufferSize = 1;
  16. // stream->bufferReadPosition = 0;
  17. // stream->bufferWritePosition = 0;
  18. // stream->read = 0;
  19. // stream->written = 0;
  20. // }
  21. // void iron_video_sound_stream_impl_destroy(iron_internal_video_sound_stream_t *stream) {}
  22. // void iron_video_sound_stream_impl_insert_data(iron_internal_video_sound_stream_t *stream, float *data, int sample_count) {}
  23. // static float samples[2] = {0};
  24. // float *iron_internal_video_sound_stream_next_frame(iron_internal_video_sound_stream_t *stream) {
  25. // return samples;
  26. // }
  27. // bool iron_internal_video_sound_stream_ended(iron_internal_video_sound_stream_t *stream) {
  28. // return false;
  29. // }
  30. // JNIEXPORT void JNICALL Java_org_armory3d_IronMoviePlayer_nativeCreate(JNIEnv *env, jobject jobj, jstring jpath, jobject surface, jint id) {
  31. // }
  32. // void IronAndroidVideoInit() {
  33. // JNIEnv *env;
  34. // (*iron_android_get_activity()->vm)->AttachCurrentThread(iron_android_get_activity()->vm, &env, NULL);
  35. // jclass clazz = iron_android_find_class(env, "org.armory3d.IronMoviePlayer");
  36. // // String path, Surface surface, int id
  37. // JNINativeMethod methodTable[] = {{"nativeCreate", "(Ljava/lang/String;Landroid/view/Surface;I)V", (void *)Java_org_armory3d_IronMoviePlayer_nativeCreate}};
  38. // int methodTableSize = sizeof(methodTable) / sizeof(methodTable[0]);
  39. // int failure = (*env)->RegisterNatives(env, clazz, methodTable, methodTableSize);
  40. // if (failure != 0) {
  41. // iron_log("Failed to register IronMoviePlayer.nativeCreate");
  42. // }
  43. // (*iron_android_get_activity()->vm)->DetachCurrentThread(iron_android_get_activity()->vm);
  44. // }
  45. // void iron_video_init(iron_video_t *video, const char *filename) {
  46. // video->impl.playing = false;
  47. // video->impl.sound = NULL;
  48. // }
  49. // void iron_video_destroy(iron_video_t *video) {
  50. // }
  51. // void iron_video_play(iron_video_t *video, bool loop) {
  52. // }
  53. // void iron_video_pause(iron_video_t *video) {
  54. // }
  55. // void iron_video_stop(iron_video_t *video) {
  56. // }
  57. // void iron_video_update(iron_video_t *video, double time) {}
  58. // int iron_video_width(iron_video_t *video) {
  59. // return 512;
  60. // }
  61. // int iron_video_height(iron_video_t *video) {
  62. // return 512;
  63. // }
  64. // gpu_texture_t *iron_video_current_image(iron_video_t *video) {
  65. // return NULL;
  66. // }
  67. // double iron_video_duration(iron_video_t *video) {
  68. // return 0.0;
  69. // }
  70. // double iron_video_position(iron_video_t *video) {
  71. // return 0.0;
  72. // }
  73. // bool iron_video_finished(iron_video_t *video) {
  74. // return false;
  75. // }
  76. // bool iron_video_paused(iron_video_t *video) {
  77. // return !video->impl.playing;
  78. // }