You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
TermApp/app/src/main/cpp/RtmpService.cpp

31 lines
592 B
C++

//
// Created by Matthew on 2025/1/27.
//
#include <jni.h>
#include <string>
#include <thread>
#include <stdlib.h>
extern "C" {
#include "rtmp/rtmpsuck.h"
}
extern STREAMING_SERVER *rtmpServer;
extern "C"
JNIEXPORT jlong JNICALL
Java_com_xypower_mpapp_RtmpService_startService(JNIEnv *env, jobject thiz) {
// TODO: implement startService()
RtmpSuckMain(0);
return (jlong)rtmpServer;
}
extern "C"
JNIEXPORT void JNICALL
Java_com_xypower_mpapp_RtmpService_stopService(JNIEnv *env, jobject thiz, jlong native_handle) {
stopStreaming(rtmpServer);
// free(rtmpServer);
}