add native method: pushVideoNew

add native method: pushVideoNew
pull/107/head
xufulong 5 years ago
parent 94518f18e4
commit ea23d5377d
  1. 16
      Live/src/main/cpp/RtmpPusher.cpp

@ -187,6 +187,22 @@ Java_com_frank_live_LivePusherNew_native_1pushVideo(JNIEnv *env, jobject instanc
env->ReleaseByteArrayElements(data_, data, 0); env->ReleaseByteArrayElements(data_, data, 0);
} }
extern "C"
JNIEXPORT void JNICALL
Java_com_frank_live_LivePusherNew_native_1pushVideoNew(JNIEnv *env, jobject instance,
jbyteArray y, jbyteArray u, jbyteArray v) {
if (!videoStream || !readyPushing) {
return;
}
jbyte *y_plane = env->GetByteArrayElements(y, NULL);
jbyte *u_plane = env->GetByteArrayElements(u, NULL);
jbyte *v_plane = env->GetByteArrayElements(v, NULL);
videoStream->encodeDataNew(y_plane, u_plane, v_plane);
env->ReleaseByteArrayElements(y, y_plane, 0);
env->ReleaseByteArrayElements(u, u_plane, 0);
env->ReleaseByteArrayElements(v, v_plane, 0);
}
extern "C" extern "C"
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_com_frank_live_LivePusherNew_native_1setAudioCodecInfo(JNIEnv *env, jobject instance, Java_com_frank_live_LivePusherNew_native_1setAudioCodecInfo(JNIEnv *env, jobject instance,

Loading…
Cancel
Save