MythTV
master
|
Abstract base class for Video4Linux based recorders. More...
#include <libmythtv/recorders/v4lrecorder.h>
Public Member Functions | |
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 | |
void | SetOptionsFromProfile (RecordingProfile *profile, const QString &videodev, const QString &audiodev, const QString &vbidev) override |
Sets basic recorder options. More... | |
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... | |
void | SetVideoFilters (QString &) override |
Tells recorder which filters to use. More... | |
void | Initialize (void) override |
This is called between SetOptionsFromProfile() and run() to initialize any devices, etc. More... | |
int | GetVideoFd (void) override |
Returns file descriptor of recorder device. More... | |
virtual void | SetStreamData (MPEGStreamData *data) |
MPEGStreamData * | GetStreamData (void) const |
void | Reset (void) override |
Reset the recorder to the startup state. More... | |
void | ClearStatistics (void) override |
RecordingQuality * | GetRecordingQuality (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 | ProcessTSPacket (const TSPacket &tspacket) 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... | |
void | run (void) override=0 |
run() starts the recording process, and does not exit until the recording is complete. 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 | IsRecording (void) |
Tells whether the StartRecorder() loop is running. More... | |
virtual bool | IsRecordingRequested (void) |
Tells us if StopRecording() has been called. More... | |
virtual void | Pause (bool clear=true) |
Pause tells recorder to pause, it should not block. 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 *) |
Protected Member Functions | |
int | OpenVBIDevice (void) |
void | CloseVBIDevice (void) |
void | RunVBIDevice (void) |
virtual bool | IsHelperRequested (void) const |
virtual void | FormatTT (struct VBIData *) |
virtual void | FormatCC (uint, uint) |
Protected Member Functions inherited from DTVRecorder | |
virtual void | InitStreamData (void) |
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 bool | PauseAndWait (std::chrono::milliseconds timeout=100ms) |
If m_requestPause is true, sets pause and blocks up to timeout milliseconds or until unpaused, whichever is sooner. 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 |
Friends | |
class | VBIThread |
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 RecorderBase * | CreateRecorder (TVRec *tvrec, ChannelBase *channel, RecordingProfile &profile, const GeneralDBOptions &genOpt) |
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... | |
Abstract base class for Video4Linux based recorders.
Definition at line 25 of file v4lrecorder.h.
|
inlineexplicit |
Definition at line 29 of file v4lrecorder.h.
|
override |
Definition at line 26 of file v4lrecorder.cpp.
|
overridevirtual |
StopRecording() signals to the recorder that it should stop recording and exit cleanly.
This function should block until recorder has finished up.
Reimplemented from RecorderBase.
Definition at line 43 of file v4lrecorder.cpp.
Referenced by NuppelVideoRecorder::doWriteThread(), MpegRecorder::TeardownAll(), and VBIThread::~VBIThread().
|
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 56 of file v4lrecorder.cpp.
Referenced by V4L2encRecorder::SetIntOption(), MpegRecorder::SetOption(), NuppelVideoRecorder::SetOption(), V4L2encRecorder::SetOptionsFromProfile(), and V4L2encRecorder::SetStrOption().
|
inlineoverridevirtual |
handles the "wait_for_seqstart" option.
Reimplemented from DTVRecorder.
Definition at line 34 of file v4lrecorder.h.
|
protected |
Definition at line 94 of file v4lrecorder.cpp.
Referenced by NuppelVideoRecorder::run(), and MpegRecorder::SetVBIOptions().
|
protected |
Definition at line 202 of file v4lrecorder.cpp.
Referenced by NuppelVideoRecorder::KillChildren(), MpegRecorder::run(), and ~V4LRecorder().
|
protected |
Definition at line 223 of file v4lrecorder.cpp.
Referenced by VBIThread::run().
|
protectedvirtual |
Definition at line 50 of file v4lrecorder.cpp.
Referenced by NuppelVideoRecorder::doAudioThread(), NuppelVideoRecorder::doWriteThread(), NuppelVideoRecorder::run(), and RunVBIDevice().
|
inlineprotectedvirtual |
Reimplemented in NuppelVideoRecorder.
Definition at line 43 of file v4lrecorder.h.
Referenced by RunVBIDevice().
Reimplemented in NuppelVideoRecorder, and MpegRecorder.
Definition at line 44 of file v4lrecorder.h.
Referenced by RunVBIDevice().
|
friend |
Definition at line 27 of file v4lrecorder.h.
Referenced by MpegRecorder::OpenV4L2DeviceAsInput(), and NuppelVideoRecorder::run().
|
protected |
Definition at line 47 of file v4lrecorder.h.
Referenced by NuppelVideoRecorder::AudioInit(), NuppelVideoRecorder::doAudioThread(), SetOption(), and MpegRecorder::SetV4L2DeviceOptions().
|
protected |
Definition at line 48 of file v4lrecorder.h.
Referenced by OpenVBIDevice(), and SetOption().
|
protected |
Definition at line 49 of file v4lrecorder.h.
Referenced by OpenVBIDevice(), NuppelVideoRecorder::run(), RunVBIDevice(), SetOption(), MpegRecorder::SetVBIOptions(), and NuppelVideoRecorder::WriteText().
|
protected |
Definition at line 50 of file v4lrecorder.h.
Referenced by CloseVBIDevice(), OpenVBIDevice(), and RunVBIDevice().
|
protected |
Definition at line 51 of file v4lrecorder.h.
Referenced by CloseVBIDevice(), OpenVBIDevice(), and RunVBIDevice().
|
protected |
Definition at line 52 of file v4lrecorder.h.
Referenced by OpenVBIDevice(), and RunVBIDevice().
|
protected |
Definition at line 53 of file v4lrecorder.h.
Referenced by OpenVBIDevice(), and RunVBIDevice().
|
protected |
Definition at line 54 of file v4lrecorder.h.
Referenced by OpenVBIDevice(), and RunVBIDevice().
|
protected |
Definition at line 55 of file v4lrecorder.h.
Referenced by CloseVBIDevice(), OpenVBIDevice(), and RunVBIDevice().
|
protected |
Definition at line 56 of file v4lrecorder.h.
Referenced by NuppelVideoRecorder::KillChildren(), MpegRecorder::OpenV4L2DeviceAsInput(), MpegRecorder::run(), NuppelVideoRecorder::run(), StopRecording(), and ~V4LRecorder().
|
protected |
Definition at line 57 of file v4lrecorder.h.
|
protected |
Definition at line 58 of file v4lrecorder.h.
Referenced by CloseVBIDevice(), MpegRecorder::OpenV4L2DeviceAsInput(), OpenVBIDevice(), RunVBIDevice(), and MpegRecorder::SetVBIOptions().
Definition at line 59 of file v4lrecorder.h.
Referenced by IsHelperRequested(), NuppelVideoRecorder::KillChildren(), MpegRecorder::run(), NuppelVideoRecorder::run(), and ~V4LRecorder().