#ifndef B6199A70_B55C_41FF_ABDD_96D9A657AA29 #define B6199A70_B55C_41FF_ABDD_96D9A657AA29 /* ******************************************************************************* * INCLUDE ******************************************************************************* */ #include "../core/Demuxer.h" extern "C" { #include #include #include #include } namespace Video { namespace FFmpeg { /* ******************************************************************************* * CLASS DECLARE ******************************************************************************* */ class DemuxHandler: public Core::DemuxHandler { public: DemuxHandler(const std::string& url); ~DemuxHandler(); public: void run(Core::VideoEncoder::Ptr pVideoEncoder, Core::AudioEncoder::Ptr pAudioEncoder, const Post& post, std::atomic& isCancelled) override; protected: PROPERTY_DECLARE(AnchorTime, uint64_t, 0, protected, protected) protected: int openCodec(AVMediaType type, int& index, AVCodecContext** pCodecCtx); void adjustTimestamp(AVPacket* pPacket, AVRational& timebase); void updateTimeline(uint64_t ts); void seek(uint64_t) override; private: AVFormatContext* _pFormatCtx; std::atomic _seekReqeust; int64_t _seekTo; protected: static int interruptCallback(void* pCtx); }; } } #endif