1 #ifndef AVFORMATWRITER_H_
2 #define AVFORMATWRITER_H_
8 #include "libmythbase/mythconfig.h"
13 #undef HAVE_AV_CONFIG_H
15 #include "libavcodec/avcodec.h"
16 #include "libavformat/avformat.h"
25 bool Init (
void)
override;
29 int WriteAudioFrame (
unsigned char *
Buffer,
int FrameNumber, std::chrono::milliseconds &Timecode)
override;
31 std::chrono::milliseconds Timecode,
int PageNumber)
override;
35 bool NextFrameIsKeyFrame (
void);
36 bool ReOpen (
const QString& Filename);
39 bool openFileHelper();
40 AVStream* AddVideoStream (
void);
41 bool OpenVideo (
void);
42 AVStream* AddAudioStream (
void);
43 bool OpenAudio (
void);
44 AVFrame* AllocPicture (
enum AVPixelFormat PixFmt);
46 AVRational GetCodecTimeBase (
void);
47 static bool FindAudioFormat (AVCodecContext *Ctx,
const AVCodec *Codec, AVSampleFormat
Format);
51 AVOutputFormat m_fmt { };
52 AVFormatContext *m_ctx {
nullptr };
54 AVStream *m_videoStream {
nullptr };
55 const AVCodec *m_avVideoCodec {
nullptr };
56 AVStream *m_audioStream {
nullptr };
57 const AVCodec *m_avAudioCodec {
nullptr };
60 unsigned char *m_audioInBuf {
nullptr };
61 unsigned char *m_audioInPBuf {
nullptr };