Skip to content

Commit

Permalink
ijkplayer-j4a: sync j4a by auto generate
Browse files Browse the repository at this point in the history
  • Loading branch information
raymond1012 committed May 3, 2017
1 parent 51ffa7d commit af5ff29
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Raymond Zheng <raymondzheng1412@gmail.com>
* Copyright (C) 2015 Zhang Rui <bbcallen@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,7 +29,6 @@ typedef struct J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO {
jmethodID method_seek;
jmethodID method_close;
} J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO;

static J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO class_J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO;

jint J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO__open(JNIEnv *env, jobject thiz, jstring url)
Expand All @@ -47,6 +46,46 @@ jint J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO__open__catchAll(JNIEnv *en
return ret_value;
}

jint J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO__open__withCString(JNIEnv *env, jobject thiz, const char *url_cstr__)
{
jint ret_value = 0;
jstring url = NULL;

url = (*env)->NewStringUTF(env, url_cstr__);
if (J4A_ExceptionCheck__throwAny(env) || !url)
goto fail;

ret_value = J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO__open(env, thiz, url);
if (J4A_ExceptionCheck__throwAny(env)) {
ret_value = 0;
goto fail;
}

fail:
J4A_DeleteLocalRef__p(env, &url);
return ret_value;
}

jint J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO__open__withCString__catchAll(JNIEnv *env, jobject thiz, const char *url_cstr__)
{
jint ret_value = 0;
jstring url = NULL;

url = (*env)->NewStringUTF(env, url_cstr__);
if (J4A_ExceptionCheck__catchAll(env) || !url)
goto fail;

ret_value = J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO__open__catchAll(env, thiz, url);
if (J4A_ExceptionCheck__catchAll(env)) {
ret_value = 0;
goto fail;
}

fail:
J4A_DeleteLocalRef__p(env, &url);
return ret_value;
}

jint J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO__read(JNIEnv *env, jobject thiz, jbyteArray buffer, jint size)
{
return (*env)->CallIntMethod(env, thiz, class_J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO.method_read, buffer, size);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016 Raymond Zheng <raymondzheng1412@gmail.com>
* Copyright (C) 2015 Zhang Rui <bbcallen@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,6 +26,8 @@

jint J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO__open(JNIEnv *env, jobject thiz, jstring url);
jint J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO__open__catchAll(JNIEnv *env, jobject thiz, jstring url);
jint J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO__open__withCString(JNIEnv *env, jobject thiz, const char *url_cstr__);
jint J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO__open__withCString__catchAll(JNIEnv *env, jobject thiz, const char *url_cstr__);
jint J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO__read(JNIEnv *env, jobject thiz, jbyteArray buffer, jint size);
jint J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO__read__catchAll(JNIEnv *env, jobject thiz, jbyteArray buffer, jint size);
jlong J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO__seek(JNIEnv *env, jobject thiz, jlong offset, jint whence);
Expand All @@ -38,6 +40,8 @@ int J4A_loadClass__J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO(JNIEnv *env)

#define J4AC_IAndroidIO__open J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO__open
#define J4AC_IAndroidIO__open__catchAll J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO__open__catchAll
#define J4AC_IAndroidIO__open__withCString J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO__open__withCString
#define J4AC_IAndroidIO__open__withCString__catchAll J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO__open__withCString__catchAll
#define J4AC_IAndroidIO__read J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO__read
#define J4AC_IAndroidIO__read__catchAll J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO__read__catchAll
#define J4AC_IAndroidIO__seek J4AC_tv_danmaku_ijk_media_player_misc_IAndroidIO__seek
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#include "j4a/class/tv/danmaku/ijk/media/player/misc/IAndroidIO.h"
#include "j4a/class/tv/danmaku/ijk/media/player/misc/IAndroidIO.h"
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
public class IjkMediaPlayer {
private long mNativeMediaPlayer;
private long mNativeMediaDataSource;
private long mNativeAndroidIO;

private static void postEventFromNative(Object weakThiz, int what, int arg1, int arg2, Object obj);
private static String onSelectCodec(Object weakThiz, String mimeType, int profile, int level);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

@SimpleCClassName
public interface IAndroidIO {
int open();
int open(String url);
int read(byte[] buffer, int size);
long seek(long offset, int whence);
int close();
Expand Down

0 comments on commit af5ff29

Please sign in to comment.