35#define LOC QString("ASIRec[%1](%2): ") \
36 .arg(m_tvrec ? m_tvrec->GetInputId() : -1) \
37 .arg(m_channel->GetDevice())
42 if (channel->
GetFormat().compare(
"MPTS") == 0)
45 LOG(VB_RECORD, LOG_INFO,
LOC +
"Using TSStreamData");
52 LOG(VB_RECORD, LOG_INFO,
LOC +
"Using MPEGStreamData");
61 const QString &videodev,
90 m_error =
"Failed to open device";
97 m_error =
"MPEGStreamData pointer has not been set";
146 LOG(VB_GENERAL, LOG_WARNING,
LOC +
147 "Recording will not commence until a PMT is set.");
154 m_error =
"Stream handler died unexpectedly.";
176 LOG(VB_GENERAL, LOG_WARNING,
LOC +
"Card already open");
186 LOG(VB_RECORD, LOG_INFO,
LOC +
"Opened successfully");
198 LOG(VB_RECORD, LOG_INFO,
LOC +
"Close() -- begin");
204 LOG(VB_RECORD, LOG_INFO,
LOC +
"Close() -- end");
QString GetDevice(void) const override
Returns String representing device, useful for debugging.
void StartNewFile(void) override
void SetOptionsFromProfile(RecordingProfile *profile, const QString &videodev, const QString &audiodev, const QString &vbidev) override
Sets basic recorder options.
ASIStreamHandler * m_streamHandler
ASIRecorder(TVRec *rec, ASIChannel *channel)
void run(void) override
run() starts the recording process, and does not exit until the recording is complete.
static ASIStreamHandler * Get(const QString &devname, int inputid)
void AddListener(MPEGStreamData *data, bool=false, bool=false, const QString &output_file=QString()) override
static void Return(ASIStreamHandler *&ref, int inputid)
int GetProgramNumber(void) const
Returns program number in PAT, -1 if unknown.
QString GetSIStandard(void) const
Returns PSIP table standard: MPEG, DVB, ATSC, or OpenCable.
uint GetMinorChannel(void) const
Returns minor channel, 0 if unknown.
bool HasGeneratedPAT(void) const
const ProgramMapTable * GetGeneratedPMT(void) const
const ProgramAssociationTable * GetGeneratedPAT(void) const
This is a specialization of RecorderBase used to handle MPEG-2, MPEG-4, MPEG-4 AVC,...
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
void HandleSingleProgramPAT(ProgramAssociationTable *pat, bool insert) override
MPEGStreamData * m_streamData
void SetOption(const QString &name, const QString &value) override
Set an specific option.
virtual void SetStreamData(MPEGStreamData *data)
void HandleSingleProgramPMT(ProgramMapTable *pmt, bool insert) override
Encapsulates data about MPEG stream and emits events for each table.
const ProgramMapTable * PMTSingleProgram(void) const
void AddWritingListener(TSPacketListener *val)
void RemoveWritingListener(TSPacketListener *val)
const ProgramAssociationTable * PATSingleProgram(void) const
void RemoveAVListener(TSPacketListenerAV *val)
virtual void AddListeningPID(uint pid, PIDPriority priority=kPIDPriorityNormal)
void SetListeningDisabled(bool lt)
virtual bool HandleTables(uint pid, const PSIPTable &psip)
Process PSIP packets.
void AddAVListener(TSPacketListenerAV *val)
QString GetSetting(const QString &key, const QString &defaultval="")
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...
virtual bool IsRecordingRequested(void)
Tells us if StopRecording() has been called.
virtual bool PauseAndWait(std::chrono::milliseconds timeout=100ms)
If m_requestPause is true, sets pause and blocks up to timeout milliseconds or until unpaused,...
bool m_recording
True while recording is actually being performed.
MythMediaBuffer * m_ringBuffer
bool m_requestRecording
True if API call has requested a recording be [re]started.
QWaitCondition m_unpauseWait
QWaitCondition m_recordingWait
void SetIntOption(RecordingProfile *profile, const QString &name)
Convenience function used to set integer options from a profile.
virtual bool AddNamedOutputFile(const QString &filename)
Called with _listener_lock locked just after adding new output file.
bool IsRunning(void) const
virtual void RemoveListener(MPEGStreamData *data)
Specialized version of MPEGStreamData which is used to 'blindly' record the entire MPTS transport fro...
This is the coordinating class of the Recorder Subsystem.
uint GetInputId(void) const
Returns the inputid.
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)