MythTV
master
|
This is a specialization of DTVRecorder used to handle streams from V4L2 recorders. More...
#include <v4l2encrecorder.h>
Public Member Functions | |
V4L2encRecorder (TVRec *rec, V4LChannel *channel) | |
void | run (void) override |
run() starts the recording process, and does not exit until the recording is complete. More... | |
bool | Open (void) |
bool | IsOpen (void) const |
void | Close (void) |
void | StartNewFile (void) override |
bool | PauseAndWait (std::chrono::milliseconds timeout=500ms) override |
If m_requestPause is true, sets pause and blocks up to timeout milliseconds or until unpaused, whichever is sooner. More... | |
![]() | |
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... | |
![]() | |
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... | |
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... | |
![]() | |
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 | 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... | |
![]() | |
virtual void | HandleSplice (const SpliceInformationTable *) |
Protected Member Functions | |
bool | StartEncoding (void) |
bool | StopEncoding (void) |
void | SetIntOption (RecordingProfile *profile, const QString &name) |
void | SetStrOption (RecordingProfile *profile, const QString &name) |
void | SetOptionsFromProfile (RecordingProfile *profile, const QString &videodev, const QString &audiodev, const QString &vbidev) override |
Sets basic recorder options. More... | |
![]() | |
int | OpenVBIDevice (void) |
void | CloseVBIDevice (void) |
void | RunVBIDevice (void) |
virtual bool | IsHelperRequested (void) const |
virtual void | FormatTT (struct VBIData *) |
virtual void | FormatCC (uint, uint) |
![]() | |
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) |
![]() | |
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) |
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) |
![]() | |
virtual | ~MPEGStreamListener ()=default |
![]() | |
virtual | ~MPEGSingleProgramStreamListener ()=default |
![]() | |
virtual | ~DVBMainStreamListener ()=default |
![]() | |
virtual | ~ATSCMainStreamListener ()=default |
![]() | |
virtual | ~TSPacketListener ()=default |
![]() | |
virtual | ~TSPacketListenerAV ()=default |
![]() | |
virtual | ~PSStreamListener ()=default |
Private Attributes | |
V4LChannel * | m_channel {nullptr} |
V4L2encStreamHandler * | m_streamHandler {nullptr} |
This is a specialization of DTVRecorder used to handle streams from V4L2 recorders.
Note: make sure the v4l2 program is executable
Definition at line 29 of file v4l2encrecorder.h.
V4L2encRecorder::V4L2encRecorder | ( | TVRec * | rec, |
V4LChannel * | channel | ||
) |
Definition at line 40 of file v4l2encrecorder.cpp.
|
overridevirtual |
run() starts the recording process, and does not exit until the recording is complete.
Implements RecorderBase.
Definition at line 129 of file v4l2encrecorder.cpp.
bool V4L2encRecorder::Open | ( | void | ) |
Definition at line 233 of file v4l2encrecorder.cpp.
Referenced by V4L2encRecorder().
|
inline |
Definition at line 37 of file v4l2encrecorder.h.
void V4L2encRecorder::Close | ( | void | ) |
Definition at line 271 of file v4l2encrecorder.cpp.
Referenced by run().
|
overridevirtual |
Reimplemented from RecorderBase.
Definition at line 119 of file v4l2encrecorder.cpp.
Referenced by run().
|
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.
timeout | number of milliseconds to wait defaults to 100. |
Reimplemented from RecorderBase.
Definition at line 283 of file v4l2encrecorder.cpp.
Referenced by run().
|
protected |
Definition at line 318 of file v4l2encrecorder.cpp.
Referenced by PauseAndWait(), and run().
|
protected |
Definition at line 330 of file v4l2encrecorder.cpp.
Referenced by PauseAndWait(), and run().
|
protected |
Definition at line 52 of file v4l2encrecorder.cpp.
Referenced by SetOptionsFromProfile().
|
protected |
Definition at line 62 of file v4l2encrecorder.cpp.
Referenced by SetOptionsFromProfile().
|
overrideprotectedvirtual |
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 72 of file v4l2encrecorder.cpp.
|
private |
Definition at line 55 of file v4l2encrecorder.h.
|
private |
Definition at line 56 of file v4l2encrecorder.h.
Referenced by Close(), IsOpen(), Open(), run(), SetIntOption(), SetStrOption(), StartEncoding(), and StopEncoding().