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

#include <mpegrecorder.h>

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

Public Member Functions

 MpegRecorder (TVRec *rec)
 
 ~MpegRecorder () override
 
void TeardownAll (void)
 
void SetOption (const QString &opt, int value) override
 handles the "wait_for_seqstart" option. More...
 
void SetOption (const QString &opt, const QString &value) override
 Set an specific option. More...
 
void SetVideoFilters (QString &) override
 Tells recorder which filters to use. More...
 
void SetOptionsFromProfile (RecordingProfile *profile, const QString &videodev, const QString &audiodev, const QString &vbidev) override
 Sets basic recorder options. More...
 
void Initialize (void) override
 This is called between SetOptionsFromProfile() and run() to initialize any devices, etc. More...
 
void run (void) override
 run() starts the recording process, and does not exit until the recording is complete. More...
 
void Reset (void) override
 Reset the recorder to the startup state. More...
 
void Pause (bool clear=true) override
 Pause tells recorder to pause, it should not block. More...
 
bool PauseAndWait (std::chrono::milliseconds timeout=100ms) override
 If m_requestPause is true, sets pause and blocks up to timeout milliseconds or until unpaused, whichever is sooner. More...
 
bool IsRecording (void) override
 Tells whether the StartRecorder() loop is running. More...
 
bool Open (void)
 
int GetVideoFd (void) override
 Returns file descriptor of recorder device. More...
 
bool ProcessTSPacket (const TSPacket &tspacket) override
 
void ReaderPaused (int) override
 
void PriorityEvent (int) override
 
- Public Member Functions inherited from V4LRecorder
 V4LRecorder (TVRec *rec)
 
 ~V4LRecorder () override
 
void StopRecording (void) override
 StopRecording() signals to the recorder that it should stop recording and exit cleanly. More...
 
void SetOption (const QString &name, const QString &value) override
 Set an specific option. More...
 
void SetOption (const QString &name, int value) override
 handles the "wait_for_seqstart" option. More...
 
- Public Member Functions inherited from DTVRecorder
 DTVRecorder (TVRec *rec)
 
 ~DTVRecorder () override
 
bool IsErrored (void) override
 Tells us whether an unrecoverable error has been encountered. More...
 
long long GetFramesWritten (void) override
 Returns number of frames written to disk. More...
 
virtual void SetStreamData (MPEGStreamData *data)
 
MPEGStreamDataGetStreamData (void) const
 
void ClearStatistics (void) override
 
RecordingQualityGetRecordingQuality (const RecordingInfo *r) const override
 Returns a report about the current recordings quality. More...
 
void HandlePAT (const ProgramAssociationTable *_pat) override
 
void HandleCAT (const ConditionalAccessTable *) override
 
void HandlePMT (uint progNum, const ProgramMapTable *_pmt) override
 
void HandleEncryptionStatus (uint, bool) override
 
void HandleSingleProgramPAT (ProgramAssociationTable *pat, bool insert) override
 
void HandleSingleProgramPMT (ProgramMapTable *pmt, bool insert) override
 
void HandleSTT (const SystemTimeTable *) override
 
void HandleVCT (uint, const VirtualChannelTable *) override
 
void HandleMGT (const MasterGuideTable *) override
 
void HandleTDT (const TimeDateTable *) override
 
void HandleNIT (const NetworkInformationTable *) override
 
void HandleSDT (uint, const ServiceDescriptionTable *) override
 
bool ProcessVideoTSPacket (const TSPacket &tspacket) override
 
bool ProcessAudioTSPacket (const TSPacket &tspacket) override
 
bool ProcessAVTSPacket (const TSPacket &tspacket)
 Common code for processing either audio or video packets. More...
 
- Public Member Functions inherited from RecorderBase
 RecorderBase (TVRec *rec)
 
 ~RecorderBase () override
 
void SetFrameRate (double rate)
 Sets the video frame rate. More...
 
void SetRecording (const RecordingInfo *pginfo)
 Changes the Recording from the one set initially with SetOptionsFromProfile(). More...
 
void SetRingBuffer (MythMediaBuffer *Buffer)
 Tells recorder to use an externally created ringbuffer. More...
 
void SetBoolOption (const QString &name, bool value)
 Set an specific boolean option. More...
 
void SetNextRecording (const RecordingInfo *ri, MythMediaBuffer *Buffer)
 Sets next recording info, to be applied as soon as practical. More...
 
long long GetKeyframePosition (long long desired) const
 Returns closest keyframe position before the desired frame. More...
 
bool GetKeyframePositions (long long start, long long end, frm_pos_map_t &map) const
 
bool GetKeyframeDurations (long long start, long long end, frm_pos_map_t &map) const
 
virtual bool IsRecordingRequested (void)
 Tells us if StopRecording() has been called. More...
 
virtual void Unpause (void)
 Unpause tells recorder to unpause. More...
 
virtual bool IsPaused (bool holding_lock=false) const
 Returns true iff recorder is paused. More...
 
virtual bool WaitForPause (std::chrono::milliseconds timeout=1s)
 WaitForPause blocks until recorder is actually paused, or timeout milliseconds elapse. More...
 
double GetFrameRate (void) const
 Returns the latest frame rate. More...
 
virtual bool CheckForRingBufferSwitch (void)
 If requested, switch to new RingBuffer/ProgramInfo objects. More...
 
void SavePositionMap (bool force=false, bool finished=false)
 Save the seektable to the DB. More...
 
- Public Member Functions inherited from MPEGStreamListener
virtual void HandleSplice (const SpliceInformationTable *)
 

Private Member Functions

void InitStreamData (void) override
 
void SetIntOption (RecordingProfile *profile, const QString &name)
 
void SetStrOption (RecordingProfile *profile, const QString &name)
 
bool OpenMpegFileAsInput (void)
 
bool OpenV4L2DeviceAsInput (void)
 
bool SetV4L2DeviceOptions (int chanfd)
 
bool SetVideoCaptureFormat (int chanfd)
 
bool SetLanguageMode (int chanfd)
 Set audio language mode. More...
 
bool SetRecordingVolume (int chanfd)
 
bool SetVBIOptions (int chanfd)
 
uint GetFilteredStreamType (void) const
 
uint GetFilteredAudioSampleRate (void) const
 
uint GetFilteredAudioLayer (void) const
 
uint GetFilteredAudioBitRate (uint audio_layer) const
 
bool RestartEncoding (void)
 
bool StartEncoding (void)
 
void StopEncoding (void)
 
void SetBitrate (int bitrate, int maxbitrate, const QString &reason)
 
bool HandleResolutionChanges (void)
 
void FormatCC (uint code1, uint code2) override
 

Private Attributes

bool m_deviceIsMpegFile {false}
 
int m_bufferSize {0}
 
QString m_card
 
QString m_driver
 
uint32_t m_version {0}
 
bool m_supportsSlicedVbi {false}
 
QRecursiveMutex m_startStopEncodingLock
 
bool m_clearTimeOnPause {false}
 
int m_width {720}
 
int m_height {480}
 
int m_bitrate {4500}
 
int m_maxBitrate {6000}
 
int m_streamType {0}
 
int m_aspectRatio {2}
 
int m_audType {2}
 
int m_audSampleRate {48000}
 
int m_audBitrateL1 {14}
 
int m_audBitrateL2 {14}
 
int m_audBitrateL3 {10}
 
int m_audVolume {80}
 
unsigned int m_language {0}
 0 is Main Lang; 1 is SAP Lang; 2 is Dual More...
 
unsigned int m_lowMpeg4AvgBitrate { 4500}
 
unsigned int m_lowMpeg4PeakBitrate { 6000}
 
unsigned int m_mediumMpeg4AvgBitrate { 9000}
 
unsigned int m_mediumMpeg4PeakBitrate {13500}
 
unsigned int m_highMpeg4AvgBitrate {13500}
 
unsigned int m_highMpeg4PeakBitrate {20200}
 
int m_chanfd {-1}
 
int m_readfd {-1}
 
DeviceReadBufferm_deviceReadBuffer {nullptr}
 

Static Private Attributes

static const std::array< const int, 14 > kAudRateL1
 
static const std::array< const int, 14 > kAudRateL2
 
static const std::array< const int, 14 > kAudRateL3
 
static const std::array< const std::string, 15 > kStreamType
 
static const std::array< const std::string, 4 > kAspectRatio
 
static const unsigned int kBuildBufferMaxSize
 

Additional Inherited Members

- Public Types inherited from RecorderBase
enum  AspectRatio {
  ASPECT_UNKNOWN = 0x00, ASPECT_1_1 = 0x01, ASPECT_4_3 = 0x02, ASPECT_16_9 = 0x03,
  ASPECT_2_21_1 = 0x04, ASPECT_CUSTOM = 0x05
}
 
- Static Public Member Functions inherited from RecorderBase
static RecorderBaseCreateRecorder (TVRec *tvrec, ChannelBase *channel, RecordingProfile &profile, const GeneralDBOptions &genOpt)
 
- Protected Member Functions inherited from V4LRecorder
int OpenVBIDevice (void)
 
void CloseVBIDevice (void)
 
void RunVBIDevice (void)
 
virtual bool IsHelperRequested (void) const
 
virtual void FormatTT (struct VBIData *)
 
- Protected Member Functions inherited from DTVRecorder
void FinishRecording (void) override
 Flushes the ringbuffer, and if this is not a live LiveTV recording saves the position map and filesize. More...
 
void ResetForNewFile (void) override
 
void HandleKeyframe (int64_t extra)
 This save the current frame to the position maps and handles ringbuffer switching. More...
 
void HandleTimestamps (int stream_id, int64_t pts, int64_t dts)
 
void UpdateFramesWritten (void)
 
void BufferedWrite (const TSPacket &tspacket, bool insert=false)
 
bool FindAudioKeyframes (const TSPacket *tspacket)
 
bool FindMPEG2Keyframes (const TSPacket *tspacket)
 Locates the keyframes and saves them to the position map. More...
 
bool FindH2645Keyframes (const TSPacket *tspacket)
 
void HandleH2645Keyframe (void)
 This save the current frame to the position maps and handles ringbuffer switching. More...
 
void FindPSKeyFrames (const uint8_t *buffer, uint len) override
 
bool FindOtherKeyframes (const TSPacket *tspacket)
 Non-Audio/Video data. More...
 
bool CheckCC (uint pid, uint new_cnt)
 
virtual QString GetSIStandard (void) const
 
virtual void SetCAMPMT (const ProgramMapTable *)
 
virtual void UpdateCAMTimeOffset (void)
 
- Protected Member Functions inherited from RecorderBase
void SetIntOption (RecordingProfile *profile, const QString &name)
 Convenience function used to set integer options from a profile. More...
 
void SetStrOption (RecordingProfile *profile, const QString &name)
 Convenience function used to set QString options from a profile. More...
 
virtual void SetRecordingStatus (RecStatus::Type status, const QString &file, int line)
 
virtual void StartNewFile (void)
 
void SetPositionMapType (MarkTypes type)
 Set seektable type. More...
 
void AspectChange (uint aspect, long long frame)
 Note a change in aspect ratio in the recordedmark table. More...
 
void ResolutionChange (uint width, uint height, long long frame)
 Note a change in video size in the recordedmark table. More...
 
void FrameRateChange (uint framerate, uint64_t frame)
 Note a change in video frame rate in the recordedmark table. More...
 
void VideoScanChange (SCAN_t scan, uint64_t frame)
 Note a change in video scan type in the recordedmark table. More...
 
void VideoCodecChange (AVCodecID vCodec)
 Note a change in video codec. More...
 
void AudioCodecChange (AVCodecID aCodec)
 Note a change in audio codec. More...
 
void SetDuration (std::chrono::milliseconds duration)
 Note the total duration in the recordedmark table. More...
 
void SetTotalFrames (uint64_t total_frames)
 Note the total frames in the recordedmark table. More...
 
void TryWriteProgStartMark (const frm_pos_map_t &durationDeltaCopy)
 
- Protected Member Functions inherited from MPEGStreamListener
virtual ~MPEGStreamListener ()=default
 
- Protected Member Functions inherited from MPEGSingleProgramStreamListener
virtual ~MPEGSingleProgramStreamListener ()=default
 
- Protected Member Functions inherited from DVBMainStreamListener
virtual ~DVBMainStreamListener ()=default
 
- Protected Member Functions inherited from ATSCMainStreamListener
virtual ~ATSCMainStreamListener ()=default
 
- Protected Member Functions inherited from TSPacketListener
virtual ~TSPacketListener ()=default
 
- Protected Member Functions inherited from TSPacketListenerAV
virtual ~TSPacketListenerAV ()=default
 
- Protected Member Functions inherited from PSStreamListener
virtual ~PSStreamListener ()=default
 
- Protected Member Functions inherited from DeviceReaderCB
virtual ~DeviceReaderCB ()=default
 
- Protected Attributes inherited from V4LRecorder
QString m_audioDeviceName
 
QString m_vbiDeviceName
 
int m_vbiMode {VBIMode::None}
 
struct VBIDatam_palVbiCb {nullptr}
 
struct vbim_palVbiTt {nullptr}
 
uint m_ntscVbiWidth {0}
 
uint m_ntscVbiStartLine {0}
 
uint m_ntscVbiLineCount {0}
 
VBI608Extractorm_vbi608 {nullptr}
 
VBIThreadm_vbiThread {nullptr}
 
QList< struct txtbuffertype * > m_textBuffer
 
int m_vbiFd {-1}
 
volatile bool m_requestHelper {false}
 
- Protected Attributes inherited from DTVRecorder
int m_streamFd {-1}
 
QString m_recordingType {"all"}
 
MythTimer m_pesTimer
 
QElapsedTimer m_audioTimer
 
uint32_t m_startCode {0xffffffff}
 
int m_firstKeyframe {-1}
 
unsigned long long m_lastGopSeen {0}
 
unsigned long long m_lastSeqSeen {0}
 
unsigned long long m_lastKeyframeSeen {0}
 
unsigned int m_audioBytesRemaining {0}
 
unsigned int m_videoBytesRemaining {0}
 
unsigned int m_otherBytesRemaining {0}
 
int m_progressiveSequence {0}
 
int m_repeatPict {0}
 
bool m_pesSynced {false}
 
bool m_seenSps {false}
 
H2645Parserm_h2645Parser {nullptr}
 
bool m_waitForKeyframeOption {true}
 Wait for the a GOP/SEQ-start before sending data. More...
 
bool m_hasWrittenOtherKeyframe {false}
 
QString m_error
 non-empty iff irrecoverable recording error detected More...
 
MPEGStreamDatam_streamData {nullptr}
 
bool m_bufferPackets {false}
 
std::vector< unsigned char > m_payloadBuffer
 
QRecursiveMutex m_pidLock
 
ProgramAssociationTablem_inputPat {nullptr}
 PAT on input side. More...
 
ProgramMapTablem_inputPmt {nullptr}
 PMT on input side. More...
 
bool m_hasNoAV {false}
 
bool m_recordMpts {false}
 
bool m_recordMptsOnly {false}
 
MythTimer m_recordMptsTimer
 
std::array< uint8_t, 0x1fff+1 > m_streamId {0}
 
std::array< uint8_t, 0x1fff+1 > m_pidStatus {0}
 
std::array< uint8_t, 0x1fff+1 > m_continuityCounter {0}
 
std::vector< TSPacketm_scratch
 
int m_minimumRecordingQuality {95}
 
bool m_usePts {false}
 
std::array< uint64_t, 256 > m_tsCount {0}
 
std::array< int64_t, 256 > m_tsLast {}
 
std::array< int64_t, 256 > m_tsFirst {}
 
std::array< QDateTime, 256 > m_tsFirstDt {}
 
QAtomicInt m_packetCount {0}
 
QAtomicInt m_continuityErrorCount {0}
 
unsigned long long m_framesSeenCount {0}
 
unsigned long long m_framesWrittenCount {0}
 
double m_totalDuration {0.0}
 
double m_tdBase {0.0}
 
uint64_t m_tdTickCount {0}
 
FrameRate m_tdTickFramerate {0}
 
SCAN_t m_scanType {SCAN_t::UNKNOWN_SCAN}
 
bool m_musicChoice {false}
 
bool m_useIForKeyframe {true}
 
- Protected Attributes inherited from RecorderBase
TVRecm_tvrec {nullptr}
 
MythMediaBufferm_ringBuffer {nullptr}
 
bool m_weMadeBuffer {true}
 
AVContainer m_containerFormat {formatUnknown}
 
AVCodecID m_primaryVideoCodec {AV_CODEC_ID_NONE}
 
AVCodecID m_primaryAudioCodec {AV_CODEC_ID_NONE}
 
QString m_videocodec {"rtjpeg"}
 
QString m_videodevice
 
bool m_ntsc {true}
 
bool m_ntscFrameRate {true}
 
double m_videoFrameRate {29.97}
 
uint m_videoAspect {0}
 
uint m_videoHeight {0}
 
uint m_videoWidth {0}
 
FrameRate m_frameRate {0}
 
RecordingInfom_curRecording {nullptr}
 
QMutex m_pauseLock
 
bool m_requestPause {false}
 
bool m_paused {false}
 
QWaitCondition m_pauseWait
 
QWaitCondition m_unpauseWait
 
bool m_requestRecording {false}
 True if API call has requested a recording be [re]started. More...
 
bool m_recording {false}
 True while recording is actually being performed. More...
 
QWaitCondition m_recordingWait
 
QMutex m_nextRingBufferLock
 
MythMediaBufferm_nextRingBuffer {nullptr}
 
RecordingInfom_nextRecording {nullptr}
 
MythTimer m_ringBufferCheckTimer
 
MarkTypes m_positionMapType {MARK_GOP_BYFRAME}
 
QMutex m_positionMapLock
 
frm_pos_map_t m_positionMap
 
frm_pos_map_t m_positionMapDelta
 
frm_pos_map_t m_durationMap
 
frm_pos_map_t m_durationMapDelta
 
MythTimer m_positionMapTimer
 
qint64 m_estimatedProgStartMS {0}
 
long long m_lastSavedKeyframe {0}
 
long long m_lastSavedDuration {0}
 
QMutex m_statisticsLock
 
QAtomicInt m_timeOfFirstDataIsSet
 
QDateTime m_timeOfFirstData
 
QAtomicInt m_timeOfLatestDataCount
 
QAtomicInt m_timeOfLatestDataPacketInterval
 
QDateTime m_timeOfLatestData
 
MythTimer m_timeOfLatestDataTimer
 
RecordingGaps m_recordingGaps
 
- Static Protected Attributes inherited from DTVRecorder
static const uint kMaxKeyFrameDistance = 80
 If the number of regular frames detected since the last detected keyframe exceeds this value, then we begin marking random regular frames as keyframes. More...
 
static const unsigned char kPayloadStartSeen = 0x2
 
- Static Protected Attributes inherited from RecorderBase
static constexpr std::chrono::milliseconds kTimeOfLatestDataIntervalTarget { 5s }
 timeOfLatest update interval target in milliseconds. More...
 

Detailed Description

Definition at line 14 of file mpegrecorder.h.

Constructor & Destructor Documentation

◆ MpegRecorder()

MpegRecorder::MpegRecorder ( TVRec rec)
inlineexplicit

Definition at line 18 of file mpegrecorder.h.

◆ ~MpegRecorder()

MpegRecorder::~MpegRecorder ( )
inlineoverride

Definition at line 20 of file mpegrecorder.h.

Member Function Documentation

◆ TeardownAll()

void MpegRecorder::TeardownAll ( void  )

Definition at line 66 of file mpegrecorder.cpp.

Referenced by ~MpegRecorder().

◆ SetOption() [1/2]

void MpegRecorder::SetOption ( const QString &  name,
int  value 
)
overridevirtual

handles the "wait_for_seqstart" option.

Reimplemented from DTVRecorder.

Definition at line 103 of file mpegrecorder.cpp.

Referenced by SetIntOption(), SetOptionsFromProfile(), and SetStrOption().

◆ SetOption() [2/2]

void MpegRecorder::SetOption ( const QString &  name,
const QString &  value 
)
overridevirtual

Set an specific option.

Base options include: codec, videodevice, tvformat (ntsc,ntsc-jp,pal-m), vbiformat ("none","pal teletext","ntsc").

Reimplemented from DTVRecorder.

Definition at line 176 of file mpegrecorder.cpp.

◆ SetVideoFilters()

void MpegRecorder::SetVideoFilters ( QString &  filters)
inlineoverridevirtual

Tells recorder which filters to use.

These filters are used by frame grabber encoders to lower the bitrate while keeping quality good. They must execute quickly so that frames are not lost by the recorder.

Reimplemented from DTVRecorder.

Definition at line 25 of file mpegrecorder.h.

◆ SetOptionsFromProfile()

void MpegRecorder::SetOptionsFromProfile ( RecordingProfile profile,
const QString &  videodev,
const QString &  audiodev,
const QString &  vbidev 
)
overridevirtual

Sets basic recorder options.

SetOptionsFromProfile is used to tell the recorder about the recording profile as well as the devices to use.

Reimplemented from DTVRecorder.

Definition at line 268 of file mpegrecorder.cpp.

◆ Initialize()

void MpegRecorder::Initialize ( void  )
inlineoverridevirtual

This is called between SetOptionsFromProfile() and run() to initialize any devices, etc.

Reimplemented from DTVRecorder.

Definition at line 32 of file mpegrecorder.h.

◆ run()

void MpegRecorder::run ( void  )
overridevirtual

run() starts the recording process, and does not exit until the recording is complete.

See also
StopRecording()

Implements RecorderBase.

Definition at line 903 of file mpegrecorder.cpp.

◆ Reset()

void MpegRecorder::Reset ( void  )
overridevirtual

Reset the recorder to the startup state.

This is used after Pause(bool), WaitForPause() and after the RingBuffer's StopReads() method has been called.

Reimplemented from DTVRecorder.

Definition at line 1213 of file mpegrecorder.cpp.

◆ Pause()

void MpegRecorder::Pause ( bool  clear = true)
overridevirtual

Pause tells recorder to pause, it should not block.

Once paused the recorder calls m_tvrec->RecorderPaused().

Parameters
clearif true any generated timecodes should be reset.
See also
Unpause(), WaitForPause()

Reimplemented from RecorderBase.

Definition at line 1231 of file mpegrecorder.cpp.

◆ PauseAndWait()

bool MpegRecorder::PauseAndWait ( std::chrono::milliseconds  timeout = 100ms)
overridevirtual

If m_requestPause is true, sets pause and blocks up to timeout milliseconds or until unpaused, whichever is sooner.

This is the where we actually do the pausing. For most recorders that need to do something special on pause, this is the method to overide.

Parameters
timeoutnumber of milliseconds to wait defaults to 100.
Returns
true if recorder is paused.

Reimplemented from RecorderBase.

Definition at line 1239 of file mpegrecorder.cpp.

Referenced by run().

◆ IsRecording()

bool MpegRecorder::IsRecording ( void  )
inlineoverridevirtual

Tells whether the StartRecorder() loop is running.

Reimplemented from RecorderBase.

Definition at line 39 of file mpegrecorder.h.

◆ Open()

bool MpegRecorder::Open ( void  )

Definition at line 897 of file mpegrecorder.cpp.

Referenced by run().

◆ GetVideoFd()

int MpegRecorder::GetVideoFd ( void  )
inlineoverridevirtual

Returns file descriptor of recorder device.

This is used by channel when only one open file descriptor is allowed on a device node. This is the case with video4linux devices and similar devices in BSD. It is not needed by newer drivers, such as those used for DVB.

Reimplemented from DTVRecorder.

Definition at line 43 of file mpegrecorder.h.

◆ ProcessTSPacket()

bool MpegRecorder::ProcessTSPacket ( const TSPacket tspacket)
overridevirtual

Reimplemented from DTVRecorder.

Definition at line 1190 of file mpegrecorder.cpp.

◆ ReaderPaused()

void MpegRecorder::ReaderPaused ( int  )
inlineoverridevirtual

Implements DeviceReaderCB.

Definition at line 50 of file mpegrecorder.h.

◆ PriorityEvent()

void MpegRecorder::PriorityEvent ( int  )
inlineoverridevirtual

Implements DeviceReaderCB.

Definition at line 52 of file mpegrecorder.h.

◆ InitStreamData()

void MpegRecorder::InitStreamData ( void  )
overrideprivatevirtual

Reimplemented from DTVRecorder.

Definition at line 1439 of file mpegrecorder.cpp.

◆ SetIntOption()

void MpegRecorder::SetIntOption ( RecordingProfile profile,
const QString &  name 
)
private

Definition at line 319 of file mpegrecorder.cpp.

Referenced by SetOptionsFromProfile().

◆ SetStrOption()

void MpegRecorder::SetStrOption ( RecordingProfile profile,
const QString &  name 
)
private

Definition at line 327 of file mpegrecorder.cpp.

Referenced by SetOptionsFromProfile().

◆ OpenMpegFileAsInput()

bool MpegRecorder::OpenMpegFileAsInput ( void  )
private

Definition at line 334 of file mpegrecorder.cpp.

Referenced by Open().

◆ OpenV4L2DeviceAsInput()

bool MpegRecorder::OpenV4L2DeviceAsInput ( void  )
private

Definition at line 350 of file mpegrecorder.cpp.

Referenced by Open().

◆ SetV4L2DeviceOptions()

bool MpegRecorder::SetV4L2DeviceOptions ( int  chanfd)
private

Definition at line 729 of file mpegrecorder.cpp.

Referenced by OpenV4L2DeviceAsInput(), PauseAndWait(), and RestartEncoding().

◆ SetVideoCaptureFormat()

bool MpegRecorder::SetVideoCaptureFormat ( int  chanfd)
private

Definition at line 466 of file mpegrecorder.cpp.

Referenced by OpenV4L2DeviceAsInput().

◆ SetLanguageMode()

bool MpegRecorder::SetLanguageMode ( int  chanfd)
private

Set audio language mode.

Definition at line 496 of file mpegrecorder.cpp.

Referenced by OpenV4L2DeviceAsInput().

◆ SetRecordingVolume()

bool MpegRecorder::SetRecordingVolume ( int  chanfd)
private

Definition at line 540 of file mpegrecorder.cpp.

Referenced by OpenV4L2DeviceAsInput().

◆ SetVBIOptions()

bool MpegRecorder::SetVBIOptions ( int  chanfd)
private

Definition at line 822 of file mpegrecorder.cpp.

Referenced by OpenV4L2DeviceAsInput().

◆ GetFilteredStreamType()

uint MpegRecorder::GetFilteredStreamType ( void  ) const
private

Definition at line 572 of file mpegrecorder.cpp.

Referenced by SetV4L2DeviceOptions().

◆ GetFilteredAudioSampleRate()

uint MpegRecorder::GetFilteredAudioSampleRate ( void  ) const
private

Definition at line 603 of file mpegrecorder.cpp.

Referenced by SetV4L2DeviceOptions().

◆ GetFilteredAudioLayer()

uint MpegRecorder::GetFilteredAudioLayer ( void  ) const
private

Definition at line 626 of file mpegrecorder.cpp.

Referenced by SetLanguageMode(), and SetV4L2DeviceOptions().

◆ GetFilteredAudioBitRate()

uint MpegRecorder::GetFilteredAudioBitRate ( uint  audio_layer) const
private

Definition at line 645 of file mpegrecorder.cpp.

Referenced by SetV4L2DeviceOptions().

◆ RestartEncoding()

bool MpegRecorder::RestartEncoding ( void  )
private

Definition at line 1281 of file mpegrecorder.cpp.

Referenced by run().

◆ StartEncoding()

bool MpegRecorder::StartEncoding ( void  )
private

Definition at line 1305 of file mpegrecorder.cpp.

Referenced by PauseAndWait(), RestartEncoding(), and run().

◆ StopEncoding()

void MpegRecorder::StopEncoding ( void  )
private

Definition at line 1397 of file mpegrecorder.cpp.

Referenced by PauseAndWait(), RestartEncoding(), and run().

◆ SetBitrate()

void MpegRecorder::SetBitrate ( int  bitrate,
int  maxbitrate,
const QString &  reason 
)
private

Definition at line 1445 of file mpegrecorder.cpp.

Referenced by HandleResolutionChanges().

◆ HandleResolutionChanges()

bool MpegRecorder::HandleResolutionChanges ( void  )
private

Definition at line 1474 of file mpegrecorder.cpp.

Referenced by StartEncoding().

◆ FormatCC()

void MpegRecorder::FormatCC ( uint  code1,
uint  code2 
)
overrideprivatevirtual

Reimplemented from V4LRecorder.

Definition at line 1532 of file mpegrecorder.cpp.

Member Data Documentation

◆ m_deviceIsMpegFile

bool MpegRecorder::m_deviceIsMpegFile {false}
private

Definition at line 80 of file mpegrecorder.h.

Referenced by Open(), run(), and SetOptionsFromProfile().

◆ m_bufferSize

int MpegRecorder::m_bufferSize {0}
private

Definition at line 81 of file mpegrecorder.h.

Referenced by OpenV4L2DeviceAsInput(), run(), and SetOptionsFromProfile().

◆ m_card

QString MpegRecorder::m_card
private

Definition at line 84 of file mpegrecorder.h.

Referenced by OpenV4L2DeviceAsInput().

◆ m_driver

QString MpegRecorder::m_driver
private

◆ m_version

uint32_t MpegRecorder::m_version {0}
private

Definition at line 86 of file mpegrecorder.h.

Referenced by OpenV4L2DeviceAsInput().

◆ m_supportsSlicedVbi

bool MpegRecorder::m_supportsSlicedVbi {false}
private

Definition at line 87 of file mpegrecorder.h.

Referenced by OpenV4L2DeviceAsInput(), and SetVBIOptions().

◆ m_startStopEncodingLock

QRecursiveMutex MpegRecorder::m_startStopEncodingLock
mutableprivate

Definition at line 90 of file mpegrecorder.h.

Referenced by OpenV4L2DeviceAsInput(), RestartEncoding(), StartEncoding(), and StopEncoding().

◆ m_clearTimeOnPause

bool MpegRecorder::m_clearTimeOnPause {false}
private

Definition at line 93 of file mpegrecorder.h.

Referenced by Pause().

◆ m_width

int MpegRecorder::m_width {720}
private

Definition at line 96 of file mpegrecorder.h.

Referenced by SetOption(), and SetVideoCaptureFormat().

◆ m_height

int MpegRecorder::m_height {480}
private

Definition at line 97 of file mpegrecorder.h.

Referenced by SetOption(), and SetVideoCaptureFormat().

◆ m_bitrate

int MpegRecorder::m_bitrate {4500}
private

Definition at line 98 of file mpegrecorder.h.

Referenced by HandleResolutionChanges(), SetOption(), and SetV4L2DeviceOptions().

◆ m_maxBitrate

int MpegRecorder::m_maxBitrate {6000}
private

Definition at line 99 of file mpegrecorder.h.

Referenced by HandleResolutionChanges(), SetOption(), and SetV4L2DeviceOptions().

◆ m_streamType

int MpegRecorder::m_streamType {0}
private

Definition at line 100 of file mpegrecorder.h.

Referenced by GetFilteredStreamType(), and SetOption().

◆ m_aspectRatio

int MpegRecorder::m_aspectRatio {2}
private

Definition at line 101 of file mpegrecorder.h.

Referenced by SetOption(), and SetV4L2DeviceOptions().

◆ m_audType

int MpegRecorder::m_audType {2}
private

Definition at line 102 of file mpegrecorder.h.

Referenced by GetFilteredAudioLayer(), SetOption(), and SetV4L2DeviceOptions().

◆ m_audSampleRate

int MpegRecorder::m_audSampleRate {48000}
private

Definition at line 103 of file mpegrecorder.h.

Referenced by GetFilteredAudioSampleRate(), and SetOption().

◆ m_audBitrateL1

int MpegRecorder::m_audBitrateL1 {14}
private

Definition at line 104 of file mpegrecorder.h.

Referenced by GetFilteredAudioBitRate(), and SetOption().

◆ m_audBitrateL2

int MpegRecorder::m_audBitrateL2 {14}
private

Definition at line 105 of file mpegrecorder.h.

Referenced by GetFilteredAudioBitRate(), and SetOption().

◆ m_audBitrateL3

int MpegRecorder::m_audBitrateL3 {10}
private

Definition at line 106 of file mpegrecorder.h.

Referenced by GetFilteredAudioBitRate(), and SetOption().

◆ m_audVolume

int MpegRecorder::m_audVolume {80}
private

Definition at line 107 of file mpegrecorder.h.

Referenced by SetOption(), and SetRecordingVolume().

◆ m_language

unsigned int MpegRecorder::m_language {0}
private

0 is Main Lang; 1 is SAP Lang; 2 is Dual

Definition at line 109 of file mpegrecorder.h.

Referenced by SetLanguageMode(), and SetOption().

◆ m_lowMpeg4AvgBitrate

unsigned int MpegRecorder::m_lowMpeg4AvgBitrate { 4500}
private

Definition at line 110 of file mpegrecorder.h.

Referenced by HandleResolutionChanges(), and SetOption().

◆ m_lowMpeg4PeakBitrate

unsigned int MpegRecorder::m_lowMpeg4PeakBitrate { 6000}
private

Definition at line 111 of file mpegrecorder.h.

Referenced by HandleResolutionChanges(), and SetOption().

◆ m_mediumMpeg4AvgBitrate

unsigned int MpegRecorder::m_mediumMpeg4AvgBitrate { 9000}
private

Definition at line 112 of file mpegrecorder.h.

Referenced by HandleResolutionChanges(), and SetOption().

◆ m_mediumMpeg4PeakBitrate

unsigned int MpegRecorder::m_mediumMpeg4PeakBitrate {13500}
private

Definition at line 113 of file mpegrecorder.h.

Referenced by HandleResolutionChanges(), and SetOption().

◆ m_highMpeg4AvgBitrate

unsigned int MpegRecorder::m_highMpeg4AvgBitrate {13500}
private

Definition at line 114 of file mpegrecorder.h.

Referenced by HandleResolutionChanges(), SetOption(), and SetV4L2DeviceOptions().

◆ m_highMpeg4PeakBitrate

unsigned int MpegRecorder::m_highMpeg4PeakBitrate {20200}
private

Definition at line 115 of file mpegrecorder.h.

Referenced by HandleResolutionChanges(), SetOption(), and SetV4L2DeviceOptions().

◆ m_chanfd

int MpegRecorder::m_chanfd {-1}
private

◆ m_readfd

int MpegRecorder::m_readfd {-1}
private

◆ kAudRateL1

const std::array< const int, 14 > MpegRecorder::kAudRateL1
staticprivate
Initial value:
{
32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448
}

Definition at line 121 of file mpegrecorder.h.

Referenced by SetOption().

◆ kAudRateL2

const std::array< const int, 14 > MpegRecorder::kAudRateL2
staticprivate
Initial value:
{
32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384
}

Definition at line 122 of file mpegrecorder.h.

Referenced by SetOption().

◆ kAudRateL3

const std::array< const int, 14 > MpegRecorder::kAudRateL3
staticprivate
Initial value:
{
32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320
}

Definition at line 123 of file mpegrecorder.h.

Referenced by SetOption().

◆ kStreamType

const std::array< const std::string, 15 > MpegRecorder::kStreamType
staticprivate
Initial value:
{
"MPEG-2 PS", "MPEG-2 TS", "MPEG-1 VCD", "PES AV",
"", "PES V", "", "PES A",
"", "", "DVD", "VCD",
"SVCD", "DVD-Special 1", "DVD-Special 2"
}

Definition at line 124 of file mpegrecorder.h.

Referenced by GetFilteredStreamType(), and SetOption().

◆ kAspectRatio

const std::array< const std::string, 4 > MpegRecorder::kAspectRatio
staticprivate
Initial value:
{
"Square", "4:3", "16:9", "2.21:1"
}

Definition at line 125 of file mpegrecorder.h.

Referenced by SetOption().

◆ kBuildBufferMaxSize

const unsigned int MpegRecorder::kBuildBufferMaxSize
staticprivate

Definition at line 126 of file mpegrecorder.h.

◆ m_deviceReadBuffer

DeviceReadBuffer* MpegRecorder::m_deviceReadBuffer {nullptr}
private

Definition at line 129 of file mpegrecorder.h.

Referenced by OpenV4L2DeviceAsInput(), run(), StartEncoding(), StopEncoding(), and TeardownAll().


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