package com.wdkl.gstreamer.demo; import android.util.Log; public class MyGstream { //c 调用 protected native void nativeInit(String serverUri); // Initialize native code, build pipeline, etc protected native void nativeFinalize(); // Destroy pipeline and shutdown native code protected native void nativePlay(); // Set pipeline to PLAYING protected native void nativePause(); // Set pipeline to PAUSED protected static native boolean nativeClassInit(); // Initialize native class: cache Method IDs for callbacks protected long native_custom_data; // Native code will use this to keep private data // 必须实现此方法。给 c 调用,用于输出状态 protected void setMessage(final String message) { Log.d("Streamer", "onMessage: " + message); } // 必须实现此方法。给 c 调用,用于判断是否加载完成,才能执行命令 protected void onGStreamerInitialized () { Log.d("Streamer", "onGStreamerInitialized"); } //初始化 c 库 static { //System.loadLibrary("gstreamer_android"); System.loadLibrary("wdkl-broadcast"); nativeClassInit(); } }