MythTV
master
|
This is a specialization of DTVRecorder used to handle streams from External 'blackbox' recorders. More...
#include <libmythtv/recorders/ExternalRecorder.h>
Public Member Functions | |
ExternalRecorder (TVRec *rec, ExternalChannel *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=100ms) override |
If m_requestPause is true, sets pause and blocks up to timeout milliseconds or until unpaused, whichever is sooner. More... | |
Public Member Functions inherited from DTVRecorder | |
DTVRecorder (TVRec *rec) | |
~DTVRecorder () override | |
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... | |
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... | |
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 void | StopRecording (void) |
StopRecording() signals to the recorder that it should stop recording and exit cleanly. More... | |
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 | |
bool | StartStreaming (void) |
bool | StopStreaming (void) |
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 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) |
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 |
Private Attributes | |
ExternalChannel * | m_channel {nullptr} |
ExternalStreamHandler * | m_streamHandler {nullptr} |
This is a specialization of DTVRecorder used to handle streams from External 'blackbox' recorders.
Note: make sure the external program is executable
Definition at line 30 of file ExternalRecorder.h.
|
inline |
Definition at line 33 of file ExternalRecorder.h.
|
overridevirtual |
run() starts the recording process, and does not exit until the recording is complete.
Implements RecorderBase.
Definition at line 43 of file ExternalRecorder.cpp.
bool ExternalRecorder::Open | ( | void | ) |
Definition at line 132 of file ExternalRecorder.cpp.
Referenced by run().
|
inline |
Definition at line 39 of file ExternalRecorder.h.
void ExternalRecorder::Close | ( | void | ) |
Definition at line 165 of file ExternalRecorder.cpp.
|
overridevirtual |
Reimplemented from RecorderBase.
Definition at line 35 of file ExternalRecorder.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 176 of file ExternalRecorder.cpp.
Referenced by run().
|
protected |
Definition at line 218 of file ExternalRecorder.cpp.
Referenced by PauseAndWait(), and run().
|
protected |
Definition at line 224 of file ExternalRecorder.cpp.
Referenced by PauseAndWait(), and run().
|
private |
Definition at line 50 of file ExternalRecorder.h.
|
private |
Definition at line 51 of file ExternalRecorder.h.
Referenced by Close(), IsOpen(), Open(), PauseAndWait(), run(), StartStreaming(), and StopStreaming().