16#define LOC QString("FireRecBase[%1](%2): ") \
17 .arg(m_tvrec ? m_tvrec->GetInputId() : -1) \
18 .arg(m_channel->GetDevice())
62 LOG(VB_RECORD, LOG_INFO,
LOC +
"run");
66 m_error =
"Failed to open firewire device";
122 for (
uint i = 0; (i < bufsz) && (sync_at < 0); i++)
147 const uint pid = tspacket.
PID();
182 LOG(VB_RECORD, LOG_INFO,
LOC +
183 QString(
"PauseAndWait(%1) -- pause").arg(
timeout.count()));
197 LOG(VB_RECORD, LOG_INFO,
LOC +
198 QString(
"PauseAndWait(%1) -- unpause").arg(
timeout.count()));
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...
bool ProcessAudioTSPacket(const TSPacket &tspacket) override
bool IsErrored(void) override
Tells us whether an unrecoverable error has been encountered.
void ResetForNewFile(void) override
void BufferedWrite(const TSPacket &tspacket, bool insert=false)
bool ProcessVideoTSPacket(const TSPacket &tspacket) override
MPEGStreamData * GetStreamData(void) const
MPEGStreamData * m_streamData
FirewireChannel Copyright (c) 2005 by Jim Westfall and Dave Abrahams Distributed as part of MythTV un...
virtual FirewireDevice * GetFirewireDevice(void)
virtual void AddListener(TSDataListener *listener)
virtual void RemoveListener(TSDataListener *listener)
virtual bool OpenPort(void)=0
virtual bool ClosePort(void)=0
bool ProcessTSPacket(const TSPacket &tspacket) 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,...
void StartStreaming(void)
void run(void) override
run() starts the recording process, and does not exit until the recording is complete.
void AddData(const unsigned char *data, uint len) override
Callback function to add MPEG2 TS data.
void InitStreamData(void) override
FirewireRecorder(TVRec *rec, FirewireChannel *chan)
FirewireChannel * m_channel
~FirewireRecorder() override
std::vector< unsigned char > m_buffer
void SetDesiredProgram(int p)
virtual void HandleTSTables(const TSPacket *tspacket)
Assembles PSIP packets and processes them.
void AddMPEGSPListener(MPEGSingleProgramStreamListener *val)
int DesiredProgram(void) const
void HandleAdaptationFieldControl(const TSPacket *tspacket)
virtual bool IsRecordingRequested(void)
Tells us if StopRecording() has been called.
bool m_recording
True while recording is actually being performed.
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
Used to access the data of a Transport Stream packet.
static constexpr unsigned int kSize
This is the coordinating class of the Recorder Subsystem.
void RecorderPaused(void)
This is a callback, called by the "recorder" instance when it has actually paused.
#define LOC
FirewireRecorder Copyright (c) 2005 by Jim Westfall and Dave Abrahams Distributed as part of MythTV u...
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
static constexpr uint8_t SYNC_BYTE