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