Go to the documentation of this file.
32 #define LOC QString("ASIRec[%1](%2): ") \
33 .arg(m_tvrec ? m_tvrec->GetInputId() : -1) \
34 .arg(m_channel->GetDevice())
39 if (channel->
GetFormat().compare(
"MPTS") == 0)
42 LOG(VB_RECORD, LOG_INFO,
LOC +
"Using TSStreamData");
49 LOG(VB_RECORD, LOG_INFO,
LOC +
"Using MPEGStreamData");
58 const QString &videodev,
87 m_error =
"Failed to open device";
94 m_error =
"MPEGStreamData pointer has not been set";
143 LOG(VB_GENERAL, LOG_WARNING,
LOC +
144 "Recording will not commence until a PMT is set.");
151 m_error =
"Stream handler died unexpectedly.";
173 LOG(VB_GENERAL, LOG_WARNING,
LOC +
"Card already open");
183 LOG(VB_RECORD, LOG_INFO,
LOC +
"Opened successfully");
195 LOG(VB_RECORD, LOG_INFO,
LOC +
"Close() -- begin");
201 LOG(VB_RECORD, LOG_INFO,
LOC +
"Close() -- end");
void HandleSingleProgramPMT(ProgramMapTable *pmt, bool insert) override
uint ProgramPID(uint i) const
ProgramMapTable * m_inputPmt
PMT on input side.
void ResetForNewFile(void) override
void SetOptionsFromProfile(RecordingProfile *profile, const QString &videodev, const QString &audiodev, const QString &vbidev) override
Sets basic recorder options.
A PMT table maps a program described in the ProgramAssociationTable to various PID's which describe t...
virtual void SetStreamData(MPEGStreamData *data)
uint GetMinorChannel(void) const
Returns minor channel, 0 if unknown.
bool IsErrored(void) override
Tells us whether an unrecoverable error has been encountered.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
virtual bool AddNamedOutputFile(const QString &filename)
Called with _listener_lock locked just after adding new output file.
void FinishRecording(void) override
Flushes the ringbuffer, and if this is not a live LiveTV recording saves the position map and filesiz...
const ProgramMapTable * GetGeneratedPMT(void) const
const ProgramMapTable * PMTSingleProgram(void) const
virtual void RemoveListener(MPEGStreamData *data)
void run(void) override
run() starts the recording process, and does not exit until the recording is complete.
QWaitCondition m_recordingWait
uint GetInputId(void) const
Returns the inputid.
const ProgramAssociationTable * PATSingleProgram(void) const
void HandleSingleProgramPAT(ProgramAssociationTable *pat, bool insert) override
static ASIStreamHandler * Get(const QString &devname, int inputid)
uint ProgramNumber(uint i) const
virtual bool HandleTables(uint pid, const PSIPTable &psip)
Process PSIP packets.
ASIRecorder(TVRec *rec, ASIChannel *channel)
const ProgramAssociationTable * GetGeneratedPAT(void) const
Encapsulates data about MPEG stream and emits events for each table.
void RemoveWritingListener(TSPacketListener *val)
virtual bool IsRecordingRequested(void)
Tells us if StopRecording() has been called.
static void Return(ASIStreamHandler *&ref, int inputid)
QString GetDevice(void) const override
Returns String representing device, useful for debugging.
void AddListener(MPEGStreamData *data, bool=false, bool=false, const QString &output_file=QString()) override
void SetOption(const QString &name, const QString &value) override
Set an specific option.
This is a specialization of RecorderBase used to handle MPEG-2, MPEG-4, MPEG-4 AVC,...
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
The Program Association Table lists all the programs in a stream, and is always found on PID 0.
QString GetSIStandard(void) const
Returns PSIP table standard: MPEG, DVB, ATSC, or OpenCable.
MythMediaBuffer * m_ringBuffer
void AddAVListener(TSPacketListenerAV *val)
ASIStreamHandler * m_streamHandler
MPEGStreamData * m_streamData
void AddWritingListener(TSPacketListener *val)
QString m_error
non-empty iff irrecoverable recording error detected
This is the coordinating class of the Recorder Subsystem.
bool m_recording
True while recording is actually being performed.
int GetProgramNumber(void) const
Returns program number in PAT, -1 if unknown.
void StartNewFile(void) override
virtual void AddListeningPID(uint pid, PIDPriority priority=kPIDPriorityNormal)
bool HasGeneratedPAT(void) const
bool IsRunning(void) const
QWaitCondition m_unpauseWait
Specialized version of MPEGStreamData which is used to 'blindly' record the entire MPTS transport fro...
void RemoveAVListener(TSPacketListenerAV *val)
void SetListeningDisabled(bool lt)
virtual bool PauseAndWait(std::chrono::milliseconds timeout=100ms)
If m_requestPause is true, sets pause and blocks up to timeout milliseconds or until unpaused,...
QString GetSetting(const QString &key, const QString &defaultval="")
bool m_requestRecording
True if API call has requested a recording be [re]started.
void SetIntOption(RecordingProfile *profile, const QString &name)
Convenience function used to set integer options from a profile.