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)")
86 void SetEof(
bool eof)
override;
91 void Reset(
bool reset_video_data,
bool seek_reset,
92 bool reset_file)
override;
124 bool DoRewind(
long long desiredFrame,
bool discardFrames =
true)
override;
125 bool DoFastForward(
long long desiredFrame,
bool discardFrames =
true)
override;
130 virtual std::chrono::milliseconds
NormalizeVideoTimecode(AVStream *st, std::chrono::milliseconds timecode);
134 QString
GetXDS(
const QString &Key)
const override;
164 const std::vector<int>&fs,
165 enum AVCodecID codecId = AV_CODEC_ID_NONE,
173 void InitVideoCodec(AVStream *stream, AVCodecContext *codecContext,
174 bool selectedStream =
false);
177 void MpegPreProcessPkt(AVCodecContext* codecContext, AVStream *stream, AVPacket *pkt);
178 int H264PreProcessPkt(AVCodecContext* codecContext, AVStream *stream, AVPacket *pkt);
180 virtual bool ProcessVideoPacket(AVCodecContext* codecContext, AVStream *stream, AVPacket *pkt,
bool &Retry);
182 bool ProcessAudioPacket(AVCodecContext* codecContext, AVStream *stream, AVPacket *pkt,
193 void SeekReset(
long long newkey,
uint skipFrames,
bool doFlush,
bool discardFrames)
override;
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);
218 int DecodeAudio(AVCodecContext *ctx, uint8_t *buffer,
int &data_size,
221 virtual int ReadPacket(AVFormatContext *ctx, AVPacket *pkt,
bool &storePacket);
231 bool do_av_seek(
long long desiredFrame,
bool discardFrames,
int flags);
237 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