Rtspvideoplugin ^new^ Info

extern "C" __declspec(dllexport) void* CreateRTSPPlayer() return new FFmpegRTSPDecoder();

class RTSPVideoPlugin public: using FrameCallback = std::function<void(uint8_t* data, int width, int height, int stride)>;

public class RTSPVideoSource : MonoBehaviour [DllImport("RTSPPlugin")] private static extern System.IntPtr CreateRTSPPlayer(); [DllImport("RTSPPlugin")] private static extern bool OpenStream(System.IntPtr player, string url); private System.IntPtr player; private Texture2D videoTexture; rtspvideoplugin

def get_frame(self): return self.frame

extern "C" #include <libavcodec/avcodec.h> #include <libavformat/avformat.h> #include <libswscale/swscale.h> private System.IntPtr player

AVCodec* codec = avcodec_find_decoder(m_fmtCtx->streams[videoStream]->codecpar->codec_id); m_codecCtx = avcodec_alloc_context3(codec); avcodec_parameters_to_context(m_codecCtx, m_fmtCtx->streams[videoStream]->codecpar); avcodec_open2(m_codecCtx, codec, nullptr);

add_library(rtsp_plugin SHARED src/plugin.cpp) target_include_directories(rtsp_plugin PRIVATE $FFMPEG_INCLUDE_DIRS) target_link_libraries(rtsp_plugin $FFMPEG_LIBRARIES) target_compile_definitions(rtsp_plugin PRIVATE -DPLUGIN_EXPORTS) private Texture2D videoTexture

if(UNITY_BUILD) set_target_properties(rtsp_plugin PROPERTIES SUFFIX ".bundle") endif()