MythTV  master
Public Member Functions | Private Member Functions | Private Attributes | List of all members
AVFormatWriter Class Reference

#include <avformatwriter.h>

Inheritance diagram for AVFormatWriter:
Inheritance graph
[legend]
Collaboration diagram for AVFormatWriter:
Collaboration graph
[legend]

Public Member Functions

 AVFormatWriter ()
 
 ~AVFormatWriter ()
 
bool Init (void) override
 
bool OpenFile (void) override
 
bool CloseFile (void) override
 
int WriteVideoFrame (VideoFrame *frame) override
 
int WriteAudioFrame (unsigned char *buf, int fnum, long long &timecode) override
 
int WriteTextFrame (int vbimode, unsigned char *buf, int len, long long timecode, int pagenr) override
 
bool NextFrameIsKeyFrame (void)
 
bool ReOpen (const QString &filename)
 
- Public Member Functions inherited from FileWriterBase
 FileWriterBase ()=default
 
virtual ~FileWriterBase ()=default
 
virtual int WriteSeekTable (void)
 
virtual bool SwitchToNextFile (void)
 
void SetFilename (const QString &fname)
 
void SetContainer (const QString &cont)
 
void SetVideoCodec (const QString &codec)
 
void SetVideoBitrate (int bitrate)
 
void SetWidth (int width)
 
void SetHeight (int height)
 
void SetAspect (float aspect)
 
void SetFramerate (double rate)
 
void SetKeyFrameDist (int dist)
 
void SetAudioCodec (const QString &codec)
 
void SetAudioBitrate (int bitrate)
 
void SetAudioChannels (int channels)
 
void SetAudioFrameRate (int rate)
 
void SetAudioFormat (AudioFormat f)
 
void SetThreadCount (int count)
 
void SetTimecodeOffset (long long o)
 
void SetEncodingPreset (const QString &preset)
 
void SetEncodingTune (const QString &tune)
 
long long GetFramesWritten (void) const
 
long long GetTimecodeOffset (void) const
 
int GetAudioFrameSize (void) const
 number of audio samples (per channel) in an AVFrame More...
 

Private Member Functions

AVStream * AddVideoStream (void)
 
bool OpenVideo (void)
 
AVStream * AddAudioStream (void)
 
bool OpenAudio (void)
 
AVFrameAllocPicture (enum AVPixelFormat pix_fmt)
 
void Cleanup (void)
 
AVRational GetCodecTimeBase (void)
 
bool FindAudioFormat (AVCodecContext *ctx, AVCodec *c, AVSampleFormat format)
 

Private Attributes

AVFRingBufferm_avfRingBuffer {nullptr}
 
RingBufferm_ringBuffer {nullptr}
 
AVOutputFormat m_fmt
 
AVFormatContext * m_ctx {nullptr}
 
AVStream * m_videoStream {nullptr}
 
AVCodec * m_avVideoCodec {nullptr}
 
AVStream * m_audioStream {nullptr}
 
AVCodec * m_avAudioCodec {nullptr}
 
AVFramem_picture {nullptr}
 
AVFramem_audPicture {nullptr}
 
unsigned char * m_audioInBuf {nullptr}
 
unsigned char * m_audioInPBuf {nullptr}
 
QList< long long > m_bufferedVideoFrameTimes
 
QList< int > m_bufferedVideoFrameTypes
 
QList< long long > m_bufferedAudioFrameTimes
 

Additional Inherited Members

- Protected Attributes inherited from FileWriterBase
QString m_filename
 
QString m_container
 
QString m_videoCodec
 
int m_videoBitrate {800000}
 
int m_width {0}
 
int m_height {0}
 
float m_aspect {1.333333}
 
double m_frameRate {29.97}
 
int m_keyFrameDist {15}
 
QString m_audioCodec
 
int m_audioBitrate {0}
 
int m_audioChannels {2}
 
int m_audioFrameRate {48000}
 
AudioFormat m_audioFormat {FORMAT_S16}
 
int m_audioFrameSize {-1}
 
int m_encodingThreadCount {1}
 
long long m_framesWritten {0}
 
long long m_startingTimecodeOffset {-1}
 
QString m_encodingPreset
 
QString m_encodingTune
 

Detailed Description

Definition at line 16 of file avformatwriter.h.

Constructor & Destructor Documentation

◆ AVFormatWriter()

AVFormatWriter::AVFormatWriter ( )

Definition at line 41 of file avformatwriter.cpp.

◆ ~AVFormatWriter()

AVFormatWriter::~AVFormatWriter ( )

Definition at line 46 of file avformatwriter.cpp.

Member Function Documentation

◆ Init()

bool AVFormatWriter::Init ( void  )
overridevirtual

Reimplemented from FileWriterBase.

Definition at line 74 of file avformatwriter.cpp.

Referenced by Transcode::TranscodeFile().

◆ OpenFile()

bool AVFormatWriter::OpenFile ( void  )
overridevirtual

Reimplemented from FileWriterBase.

Definition at line 151 of file avformatwriter.cpp.

Referenced by Transcode::TranscodeFile().

◆ CloseFile()

bool AVFormatWriter::CloseFile ( void  )
overridevirtual

Reimplemented from FileWriterBase.

Definition at line 200 of file avformatwriter.cpp.

Referenced by Transcode::TranscodeFile().

◆ WriteVideoFrame()

int AVFormatWriter::WriteVideoFrame ( VideoFrame frame)
overridevirtual

Reimplemented from FileWriterBase.

Definition at line 222 of file avformatwriter.cpp.

Referenced by Transcode::TranscodeFile().

◆ WriteAudioFrame()

int AVFormatWriter::WriteAudioFrame ( unsigned char *  buf,
int  fnum,
long long &  timecode 
)
overridevirtual

Reimplemented from FileWriterBase.

Definition at line 308 of file avformatwriter.cpp.

Referenced by Transcode::TranscodeFile().

◆ WriteTextFrame()

int AVFormatWriter::WriteTextFrame ( int  vbimode,
unsigned char *  buf,
int  len,
long long  timecode,
int  pagenr 
)
overridevirtual

Reimplemented from FileWriterBase.

Definition at line 426 of file avformatwriter.cpp.

◆ NextFrameIsKeyFrame()

bool AVFormatWriter::NextFrameIsKeyFrame ( void  )

Definition at line 216 of file avformatwriter.cpp.

Referenced by Transcode::TranscodeFile().

◆ ReOpen()

bool AVFormatWriter::ReOpen ( const QString &  filename)

Definition at line 432 of file avformatwriter.cpp.

Referenced by Transcode::TranscodeFile().

◆ AddVideoStream()

AVStream * AVFormatWriter::AddVideoStream ( void  )
private

Definition at line 442 of file avformatwriter.cpp.

Referenced by Init().

◆ OpenVideo()

bool AVFormatWriter::OpenVideo ( void  )
private

Definition at line 574 of file avformatwriter.cpp.

Referenced by Init().

◆ AddAudioStream()

AVStream * AVFormatWriter::AddAudioStream ( void  )
private

Definition at line 608 of file avformatwriter.cpp.

Referenced by Init().

◆ OpenAudio()

bool AVFormatWriter::OpenAudio ( void  )
private

Definition at line 662 of file avformatwriter.cpp.

Referenced by Init().

◆ AllocPicture()

AVFrame * AVFormatWriter::AllocPicture ( enum AVPixelFormat  pix_fmt)
private

Definition at line 721 of file avformatwriter.cpp.

Referenced by OpenVideo().

◆ Cleanup()

void AVFormatWriter::Cleanup ( void  )
private

Definition at line 188 of file avformatwriter.cpp.

Referenced by OpenFile(), and ~AVFormatWriter().

◆ GetCodecTimeBase()

AVRational AVFormatWriter::GetCodecTimeBase ( void  )
private

Definition at line 747 of file avformatwriter.cpp.

Referenced by AddAudioStream(), and AddVideoStream().

◆ FindAudioFormat()

bool AVFormatWriter::FindAudioFormat ( AVCodecContext *  ctx,
AVCodec *  c,
AVSampleFormat  format 
)
private

Definition at line 646 of file avformatwriter.cpp.

Referenced by OpenAudio().

Member Data Documentation

◆ m_avfRingBuffer

AVFRingBuffer* AVFormatWriter::m_avfRingBuffer {nullptr}
private

Definition at line 45 of file avformatwriter.h.

Referenced by Cleanup(), and OpenFile().

◆ m_ringBuffer

RingBuffer* AVFormatWriter::m_ringBuffer {nullptr}
private

Definition at line 46 of file avformatwriter.h.

Referenced by Cleanup(), OpenFile(), and ReOpen().

◆ m_fmt

AVOutputFormat AVFormatWriter::m_fmt
private

Definition at line 48 of file avformatwriter.h.

Referenced by AVFormatWriter(), Init(), and OpenFile().

◆ m_ctx

AVFormatContext* AVFormatWriter::m_ctx {nullptr}
private

◆ m_videoStream

AVStream* AVFormatWriter::m_videoStream {nullptr}
private

Definition at line 50 of file avformatwriter.h.

Referenced by Init(), OpenVideo(), WriteAudioFrame(), and WriteVideoFrame().

◆ m_avVideoCodec

AVCodec* AVFormatWriter::m_avVideoCodec {nullptr}
private

Definition at line 51 of file avformatwriter.h.

Referenced by AddAudioStream(), GetCodecTimeBase(), Init(), and WriteAudioFrame().

◆ m_audioStream

AVStream* AVFormatWriter::m_audioStream {nullptr}
private

Definition at line 52 of file avformatwriter.h.

Referenced by Init(), OpenAudio(), and WriteAudioFrame().

◆ m_avAudioCodec

AVCodec* AVFormatWriter::m_avAudioCodec {nullptr}
private

Definition at line 53 of file avformatwriter.h.

Referenced by Init().

◆ m_picture

AVFrame* AVFormatWriter::m_picture {nullptr}
private

Definition at line 54 of file avformatwriter.h.

Referenced by OpenVideo(), WriteVideoFrame(), and ~AVFormatWriter().

◆ m_audPicture

AVFrame* AVFormatWriter::m_audPicture {nullptr}
private

Definition at line 55 of file avformatwriter.h.

Referenced by OpenAudio(), WriteAudioFrame(), and ~AVFormatWriter().

◆ m_audioInBuf

unsigned char* AVFormatWriter::m_audioInBuf {nullptr}
private

Definition at line 56 of file avformatwriter.h.

Referenced by OpenAudio(), WriteAudioFrame(), and ~AVFormatWriter().

◆ m_audioInPBuf

unsigned char* AVFormatWriter::m_audioInPBuf {nullptr}
private

Definition at line 57 of file avformatwriter.h.

Referenced by OpenAudio(), WriteAudioFrame(), and ~AVFormatWriter().

◆ m_bufferedVideoFrameTimes

QList<long long> AVFormatWriter::m_bufferedVideoFrameTimes
private

Definition at line 59 of file avformatwriter.h.

Referenced by WriteVideoFrame().

◆ m_bufferedVideoFrameTypes

QList<int> AVFormatWriter::m_bufferedVideoFrameTypes
private

Definition at line 60 of file avformatwriter.h.

Referenced by NextFrameIsKeyFrame(), and WriteVideoFrame().

◆ m_bufferedAudioFrameTimes

QList<long long> AVFormatWriter::m_bufferedAudioFrameTimes
private

Definition at line 61 of file avformatwriter.h.

Referenced by WriteAudioFrame().


The documentation for this class was generated from the following files: