|
|
|
@ -3,21 +3,21 @@ |
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#include <jni.h> |
|
|
|
|
#include "ff_http_pusher.h" |
|
|
|
|
#include "ff_rtmp_pusher.h" |
|
|
|
|
|
|
|
|
|
PUSHER_FUNC(int, pushStream, jstring inputPath, jstring outputPath) { |
|
|
|
|
int ret; |
|
|
|
|
const char *input_path = env->GetStringUTFChars(inputPath, JNI_FALSE); |
|
|
|
|
const char *output_path = env->GetStringUTFChars(outputPath, JNI_FALSE); |
|
|
|
|
auto *httpPusher = new FFHttpPusher(); |
|
|
|
|
ret = httpPusher->open(input_path, output_path); |
|
|
|
|
auto *rtmpPusher = new FFRtmpPusher(); |
|
|
|
|
ret = rtmpPusher->open(input_path, output_path); |
|
|
|
|
if (ret < 0) { |
|
|
|
|
LOGE("HttpPusher", "open error=%d", ret); |
|
|
|
|
return ret; |
|
|
|
|
} |
|
|
|
|
ret = httpPusher->push(); |
|
|
|
|
ret = rtmpPusher->push(); |
|
|
|
|
|
|
|
|
|
httpPusher->close(); |
|
|
|
|
rtmpPusher->close(); |
|
|
|
|
env->ReleaseStringUTFChars(inputPath, input_path); |
|
|
|
|
env->ReleaseStringUTFChars(outputPath, output_path); |
|
|
|
|
|
|
|
|
|