Go to the documentation of this file.
31 #define LOC QString("ExternalRec[%1](%2): ") \
32 .arg(m_channel->GetInputID()) \
33 .arg(m_channel->GetDescription())
47 m_error =
"Failed to open device";
54 m_error =
"MPEGStreamData pointer has not been set";
74 LOG(VB_GENERAL, LOG_INFO,
LOC +
"PMT set");
95 LOG(VB_GENERAL, LOG_WARNING,
LOC +
96 "Recording will not commence until a PMT is set.");
103 m_error =
"Stream handler died unexpectedly.";
109 LOG(VB_GENERAL, LOG_INFO,
LOC +
110 QString(
"Recording is damaged. Setting status to %1")
136 LOG(VB_GENERAL, LOG_WARNING,
LOC +
"Card already open");
149 LOG(VB_RECORD, LOG_INFO,
LOC +
"Opened successfully");
161 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Open failed");
167 LOG(VB_RECORD, LOG_INFO,
LOC +
"Close() -- begin");
173 LOG(VB_RECORD, LOG_INFO,
LOC +
"Close() -- end");
183 LOG(VB_RECORD, LOG_INFO,
LOC +
"PauseAndWait pause");
197 LOG(VB_RECORD, LOG_INFO,
LOC +
"PauseAndWait unpause");
220 LOG(VB_RECORD, LOG_INFO,
LOC +
"StartStreaming");
void HandleSingleProgramPMT(ProgramMapTable *pmt, bool insert) override
uint ProgramPID(uint i) const
ProgramMapTable * m_inputPmt
PMT on input side.
void ResetForNewFile(void) override
A PMT table maps a program described in the ProgramAssociationTable to various PID's which describe t...
void run(void) override
run() starts the recording process, and does not exit until the recording is complete.
bool IsDamaged(void) const
bool IsErrored(void) override
Tells us whether an unrecoverable error has been encountered.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
void FinishRecording(void) override
Flushes the ringbuffer, and if this is not a live LiveTV recording saves the position map and filesiz...
ExternalChannel * m_channel
const ProgramMapTable * GetGeneratedPMT(void) const
const ProgramMapTable * PMTSingleProgram(void) const
virtual void RemoveListener(MPEGStreamData *data)
static QString toString(RecStatus::Type recstatus, uint id)
Converts "recstatus" into a short (unreadable) string.
void StartNewFile(void) override
QWaitCondition m_recordingWait
void RecorderPaused(void)
This is a callback, called by the "recorder" instance when it has actually paused.
QString GetDevice(void) const override
Returns String representing device, useful for debugging.
uint GetInputId(void) const
Returns the inputid.
const ProgramAssociationTable * PATSingleProgram(void) const
void HandleSingleProgramPAT(ProgramAssociationTable *pat, bool insert) override
uint ProgramNumber(uint i) const
virtual bool HandleTables(uint pid, const PSIPTable &psip)
Process PSIP packets.
const ProgramAssociationTable * GetGeneratedPAT(void) const
bool PauseAndWait(std::chrono::milliseconds timeout=100ms) override
If m_requestPause is true, sets pause and blocks up to timeout milliseconds or until unpaused,...
bool StartStreaming(void)
void RemoveWritingListener(TSPacketListener *val)
virtual bool IsRecordingRequested(void)
Tells us if StopRecording() has been called.
H2645Parser * m_h2645Parser
static ExternalStreamHandler * Get(const QString &devname, int inputid, int majorid)
The Program Association Table lists all the programs in a stream, and is always found on PID 0.
bool StartStreaming(void)
QWaitCondition m_pauseWait
void AddAVListener(TSPacketListenerAV *val)
bool m_waitForKeyframeOption
Wait for the a GOP/SEQ-start before sending data.
virtual void SetRecordingStatus(RecStatus::Type status, const QString &file, int line)
MPEGStreamData * m_streamData
void AddWritingListener(TSPacketListener *val)
int DesiredProgram(void) const
QString m_error
non-empty iff irrecoverable recording error detected
bool m_recording
True while recording is actually being performed.
virtual int GetInputID(void) const
virtual void AddListener(MPEGStreamData *data, bool allow_section_reader=false, bool needs_buffering=false, const QString &output_file=QString())
bool HasGeneratedPAT(void) const
bool IsRunning(void) const
QWaitCondition m_unpauseWait
void RemoveAVListener(TSPacketListenerAV *val)
static void Return(ExternalStreamHandler *&ref, int inputid)
virtual bool IsPaused(bool holding_lock=false) const
Returns true iff recorder is paused.
bool m_requestRecording
True if API call has requested a recording be [re]started.
ExternalStreamHandler * m_streamHandler