#ifndef REMUXER_FFMPEG #define REMUXER_FFMPEG #include #include #include #include #include namespace am { typedef void (*cb_remux_progress)(const char *, int, int); typedef void (*cb_remux_state)(const char *, int, int); typedef struct _REMUXER_PARAM { char src[260]; char dst[260]; int64_t src_size; std::atomic_bool running; cb_remux_progress cb_progress; cb_remux_state cb_state; } REMUXER_PARAM; typedef std::function thread_remuxing; typedef struct _REMUXER_HANDLE { REMUXER_PARAM param; std::thread fn; } REMUXER_HANDLE; class remuxer_ffmpeg { private: remuxer_ffmpeg() {} ~remuxer_ffmpeg() { destroy_remux(); } public: static remuxer_ffmpeg *instance(); static void release(); int create_remux(const REMUXER_PARAM ¶m); void remove_remux(std::string src); void destroy_remux(); private: std::map _handlers; }; } // namespace am #endif // !REMUXER_FFMPEG