2#ifndef AVFORMATDECODER_H_
3#define AVFORMATDECODER_H_
9#include "libavcodec/avcodec.h"
10#include "libavformat/avformat.h"
40 int original_ch,
int profile = 0) :
67 return QString(
"id(%1) %2Hz %3ch %4bps %5 (profile %6)")
87 void SetEof(
bool eof)
override;
92 void Reset(
bool reset_video_data,
bool seek_reset,
93 bool reset_file)
override;
125 bool DoRewind(
long long desiredFrame,
bool discardFrames =
true)
override;
126 bool DoFastForward(
long long desiredFrame,
bool discardFrames =
true)
override;
127 void SeekReset(
long long newkey,
uint skipFrames,
bool doFlush,
bool discardFrames)
override;
132 virtual std::chrono::milliseconds
NormalizeVideoTimecode(AVStream *st, std::chrono::milliseconds timecode);
136 QString
GetXDS(
const QString &Key)
const override;
166 const std::vector<int>&fs,
167 enum AVCodecID codecId = AV_CODEC_ID_NONE,
175 void InitVideoCodec(AVStream *stream, AVCodecContext *codecContext,
176 bool selectedStream =
false);
179 void MpegPreProcessPkt(AVCodecContext* codecContext, AVStream *stream, AVPacket *pkt);
180 int H264PreProcessPkt(AVCodecContext* codecContext, AVStream *stream, AVPacket *pkt);
182 virtual bool ProcessVideoPacket(AVCodecContext* codecContext, AVStream *stream, AVPacket *pkt,
bool &Retry);
184 bool ProcessAudioPacket(AVCodecContext* codecContext, AVStream *stream, AVPacket *pkt,
196 bool DoPassThrough(
const AVCodecParameters *par,
bool withProfile=
true);
203 void HandleGopStart(AVPacket *pkt,
bool can_reliably_parse_keyframes);
207 float GetVideoFrameRate(AVStream *Stream, AVCodecContext *Context,
bool Sanitise =
false);
209 bool OpenAVCodec(AVCodecContext *avctx,
const AVCodec *codec);
217 int DecodeAudio(AVCodecContext *ctx, uint8_t *buffer,
int &data_size,
220 virtual int ReadPacket(AVFormatContext *ctx, AVPacket *pkt,
bool &storePacket);
230 bool do_av_seek(
long long desiredFrame,
bool discardFrames,
int flags);
236 AVFormatContext *
m_ic {
nullptr};
void use_I_forKeyframes(bool val)
bool operator==(const AudioInfo &o) const
AudioInfo(AVCodecID id, AudioFormat fmt, int sr, int ch, bool passthru, int original_ch, int profile=0)
static int FormatToBits(AudioFormat format)
This is the interface between an MHEG engine and a MythTV TV object.
Holds information on recordings and videos.
std::vector< char > TestBufferVec
std::vector< StreamInfo > sinfo_vec_t