整理代码
This commit is contained in:
commit
c7b4e178ec
364 changed files with 59691 additions and 0 deletions
55
video/ffmpeg/DemuxHandler.h
Normal file
55
video/ffmpeg/DemuxHandler.h
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
#ifndef B6199A70_B55C_41FF_ABDD_96D9A657AA29
|
||||
#define B6199A70_B55C_41FF_ABDD_96D9A657AA29
|
||||
/*
|
||||
*******************************************************************************
|
||||
* INCLUDE
|
||||
*******************************************************************************
|
||||
*/
|
||||
#include "../core/Demuxer.h"
|
||||
extern "C"
|
||||
{
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include <libavcodec/bsf.h>
|
||||
#include <libavformat/avformat.h>
|
||||
#include <libavutil/pixdesc.h>
|
||||
}
|
||||
|
||||
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<bool>& 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<bool> _seekReqeust;
|
||||
int64_t _seekTo;
|
||||
|
||||
protected:
|
||||
static int interruptCallback(void* pCtx);
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue