#pragma once #include "IVrFFMediaPusher.h" #include #include #include // ffmedia 头(仅在 Linux/RK3588 平台真正可用) #if !defined(FFMEDIA_PLATFORM_DUMMY) #include "module/vi/module_memReader.hpp" #include "module/vp/module_mppenc.hpp" #include "module/vo/module_rtspServer.hpp" #include "module/vp/module_rga.hpp" #endif class CVrFFMediaPusher : public IVrFFMediaPusher { public: CVrFFMediaPusher(); ~CVrFFMediaPusher() override; int Init(const VrFFPushConfig& config) override; int Start() override; int PushFrame(const void* data, size_t size, int64_t ptsUs = 0) override; int Stop() override; int UnInit() override; std::string GetRtspUrl(const std::string& localIp) const override; private: VrFFPushConfig m_config; std::atomic m_bStarted{false}; std::atomic m_bInited{false}; std::mutex m_mutex; int64_t m_lastPtsUs{0}; #if !defined(FFMEDIA_PLATFORM_DUMMY) std::shared_ptr m_memReader; std::shared_ptr m_rga; // 输入格式转 NV12(若非 NV12) std::shared_ptr m_encoder; std::shared_ptr m_rtspServer; #endif };