00001 #ifndef FILEWRITERBASE_H 00002 #define FILEWRITERBASE_H 00003 00004 #include <QString> 00005 00006 #include "frame.h" 00007 00008 class MTV_PUBLIC FileWriterBase 00009 { 00010 public: 00011 FileWriterBase(); 00012 virtual ~FileWriterBase(); 00013 00014 virtual bool Init(void) { return true; } 00015 virtual bool OpenFile(void) { return true; } 00016 virtual bool CloseFile(void) { return true; } 00017 00018 virtual bool WriteVideoFrame(VideoFrame *frame); 00019 virtual bool WriteAudioFrame(unsigned char *buf, int fnum, int timecode); 00020 virtual bool WriteTextFrame(int vbimode, unsigned char *buf, int len, 00021 int timecode, int pagenr) { return true; } 00022 virtual bool WriteSeekTable(void) { return true; } 00023 00024 virtual bool SwitchToNextFile(void) { return false; } 00025 00026 void SetFilename(QString fname) { m_filename = fname; } 00027 void SetContainer(QString cont) { m_container = cont; } 00028 void SetVideoCodec(QString codec) { m_videoCodec = codec; } 00029 void SetVideoBitrate(int bitrate) { m_videoBitrate = bitrate; } 00030 void SetWidth(int width) { m_width = width; } 00031 void SetHeight(int height) { m_height = height; } 00032 void SetAspect(float aspect) { m_aspect = aspect; } 00033 void SetFramerate(double rate) { m_frameRate = rate; } 00034 void SetKeyFrameDist(int dist) { m_keyFrameDist = dist; } 00035 void SetAudioCodec(QString codec) { m_audioCodec = codec; } 00036 void SetAudioBitrate(int bitrate) { m_audioBitrate = bitrate; } 00037 void SetAudioChannels(int channels) { m_audioChannels = channels; } 00038 void SetAudioBits(int bits) { m_audioBits = bits; } 00039 void SetAudioSampleRate(int rate) { m_audioSampleRate = rate; } 00040 void SetAudioSampleBytes(int bps) { m_audioBytesPerSample = bps; } 00041 void SetThreadCount(int count) { m_encodingThreadCount = count; } 00042 void SetTimecodeOffset(long long o) { m_startingTimecodeOffset = o; } 00043 00044 long long GetFramesWritten(void) const { return m_framesWritten; } 00045 long long GetTimecodeOffset(void) const { return m_startingTimecodeOffset; } 00046 int GetAudioFrameSize(void) const { return m_audioFrameSize; } 00047 00048 protected: 00049 QString m_filename; 00050 QString m_container; 00051 QString m_videoCodec; 00052 int m_videoBitrate; 00053 int m_width; 00054 int m_height; 00055 float m_aspect; 00056 double m_frameRate; 00057 int m_keyFrameDist; 00058 QString m_audioCodec; 00059 int m_audioBitrate; 00060 int m_audioChannels; 00061 int m_audioBits; 00062 int m_audioSampleRate; 00063 int m_audioBytesPerSample; 00064 int m_audioFrameSize; 00065 int m_encodingThreadCount; 00066 long long m_framesWritten; 00067 long long m_startingTimecodeOffset; 00068 }; 00069 00070 #endif 00071 00072 /* vim: set expandtab tabstop=4 shiftwidth=4: */ 00073
1.6.3