MythTV
master
|
This is a specialization of DTVRecorder used to handle DVB and ATSC streams from a firewire input. More...
#include <libmythtv/recorders/firewirerecorder.h>
Public Member Functions | |
FirewireRecorder (TVRec *rec, FirewireChannel *chan) | |
~FirewireRecorder () override | |
bool | Open (void) |
void | Close (void) |
void | StartStreaming (void) |
void | StopStreaming (void) |
void | run (void) override |
run() starts the recording process, and does not exit until the recording is complete. More... | |
bool | PauseAndWait (std::chrono::milliseconds timeout=100ms) override |
If m_requestPause is true, sets pause and blocks up to timeout milliseconds or until unpaused, whichever is sooner. More... | |
void | AddData (const unsigned char *data, uint len) override |
Callback function to add MPEG2 TS data. More... | |
bool | ProcessTSPacket (const TSPacket &tspacket) override |
void | SetOptionsFromProfile ([[maybe_unused]] RecordingProfile *profile, [[maybe_unused]] const QString &videodev, [[maybe_unused]] const QString &audiodev, [[maybe_unused]] const QString &vbidev) override |
Public Member Functions inherited from DTVRecorder | |
DTVRecorder (TVRec *rec) | |
~DTVRecorder () override | |
void | SetOption (const QString &name, const QString &value) override |
Set an specific option. More... | |
void | SetOption (const QString &name, int value) override |
handles the "wait_for_seqstart" option. More... | |
void | SetOptionsFromProfile (RecordingProfile *profile, const QString &videodev, const QString &audiodev, const QString &vbidev) override |
Sets basic recorder options. More... | |
bool | IsErrored (void) override |
Tells us whether an unrecoverable error has been encountered. More... | |
long long | GetFramesWritten (void) override |
Returns number of frames written to disk. More... | |
void | SetVideoFilters (QString &) override |
Tells recorder which filters to use. More... | |
void | Initialize (void) override |
This is called between SetOptionsFromProfile() and run() to initialize any devices, etc. More... | |
int | GetVideoFd (void) override |
Returns file descriptor of recorder device. More... | |
virtual void | SetStreamData (MPEGStreamData *data) |
MPEGStreamData * | GetStreamData (void) const |
void | Reset (void) override |
Reset the recorder to the startup state. More... | |
void | ClearStatistics (void) override |
RecordingQuality * | GetRecordingQuality (const RecordingInfo *r) const override |
Returns a report about the current recordings quality. More... | |
void | HandlePAT (const ProgramAssociationTable *_pat) override |
void | HandleCAT (const ConditionalAccessTable *) override |
void | HandlePMT (uint progNum, const ProgramMapTable *_pmt) override |
void | HandleEncryptionStatus (uint, bool) override |
void | HandleSingleProgramPAT (ProgramAssociationTable *pat, bool insert) override |
void | HandleSingleProgramPMT (ProgramMapTable *pmt, bool insert) override |
void | HandleSTT (const SystemTimeTable *) override |
void | HandleVCT (uint, const VirtualChannelTable *) override |
void | HandleMGT (const MasterGuideTable *) override |
void | HandleTDT (const TimeDateTable *) override |
void | HandleNIT (const NetworkInformationTable *) override |
void | HandleSDT (uint, const ServiceDescriptionTable *) override |
bool | ProcessVideoTSPacket (const TSPacket &tspacket) override |
bool | ProcessAudioTSPacket (const TSPacket &tspacket) override |
bool | ProcessAVTSPacket (const TSPacket &tspacket) |
Common code for processing either audio or video packets. More... | |
Public Member Functions inherited from RecorderBase | |
RecorderBase (TVRec *rec) | |
~RecorderBase () override | |
void | SetFrameRate (double rate) |
Sets the video frame rate. More... | |
void | SetRecording (const RecordingInfo *pginfo) |
Changes the Recording from the one set initially with SetOptionsFromProfile(). More... | |
void | SetRingBuffer (MythMediaBuffer *Buffer) |
Tells recorder to use an externally created ringbuffer. More... | |
void | SetBoolOption (const QString &name, bool value) |
Set an specific boolean option. More... | |
void | SetNextRecording (const RecordingInfo *ri, MythMediaBuffer *Buffer) |
Sets next recording info, to be applied as soon as practical. More... | |
long long | GetKeyframePosition (long long desired) const |
Returns closest keyframe position before the desired frame. More... | |
bool | GetKeyframePositions (long long start, long long end, frm_pos_map_t &map) const |
bool | GetKeyframeDurations (long long start, long long end, frm_pos_map_t &map) const |
virtual void | StopRecording (void) |
StopRecording() signals to the recorder that it should stop recording and exit cleanly. More... | |
virtual bool | IsRecording (void) |
Tells whether the StartRecorder() loop is running. More... | |
virtual bool | IsRecordingRequested (void) |
Tells us if StopRecording() has been called. More... | |
virtual void | Pause (bool clear=true) |
Pause tells recorder to pause, it should not block. More... | |
virtual void | Unpause (void) |
Unpause tells recorder to unpause. More... | |
virtual bool | IsPaused (bool holding_lock=false) const |
Returns true iff recorder is paused. More... | |
virtual bool | WaitForPause (std::chrono::milliseconds timeout=1s) |
WaitForPause blocks until recorder is actually paused, or timeout milliseconds elapse. More... | |
double | GetFrameRate (void) const |
Returns the latest frame rate. More... | |
virtual bool | CheckForRingBufferSwitch (void) |
If requested, switch to new RingBuffer/ProgramInfo objects. More... | |
void | SavePositionMap (bool force=false, bool finished=false) |
Save the seektable to the DB. More... | |
Public Member Functions inherited from MPEGStreamListener | |
virtual void | HandleSplice (const SpliceInformationTable *) |
Protected Member Functions | |
void | InitStreamData (void) override |
FirewireRecorder (TVRec *rec) | |
Protected Member Functions inherited from DTVRecorder | |
void | FinishRecording (void) override |
Flushes the ringbuffer, and if this is not a live LiveTV recording saves the position map and filesize. More... | |
void | ResetForNewFile (void) override |
void | HandleKeyframe (int64_t extra) |
This save the current frame to the position maps and handles ringbuffer switching. More... | |
void | HandleTimestamps (int stream_id, int64_t pts, int64_t dts) |
void | UpdateFramesWritten (void) |
void | BufferedWrite (const TSPacket &tspacket, bool insert=false) |
bool | FindAudioKeyframes (const TSPacket *tspacket) |
bool | FindMPEG2Keyframes (const TSPacket *tspacket) |
Locates the keyframes and saves them to the position map. More... | |
bool | FindH2645Keyframes (const TSPacket *tspacket) |
void | HandleH2645Keyframe (void) |
This save the current frame to the position maps and handles ringbuffer switching. More... | |
void | FindPSKeyFrames (const uint8_t *buffer, uint len) override |
bool | FindOtherKeyframes (const TSPacket *tspacket) |
Non-Audio/Video data. More... | |
bool | CheckCC (uint pid, uint new_cnt) |
virtual QString | GetSIStandard (void) const |
virtual void | SetCAMPMT (const ProgramMapTable *) |
virtual void | UpdateCAMTimeOffset (void) |
Protected Member Functions inherited from RecorderBase | |
void | SetIntOption (RecordingProfile *profile, const QString &name) |
Convenience function used to set integer options from a profile. More... | |
void | SetStrOption (RecordingProfile *profile, const QString &name) |
Convenience function used to set QString options from a profile. More... | |
virtual void | SetRecordingStatus (RecStatus::Type status, const QString &file, int line) |
virtual void | StartNewFile (void) |
void | SetPositionMapType (MarkTypes type) |
Set seektable type. More... | |
void | AspectChange (uint aspect, long long frame) |
Note a change in aspect ratio in the recordedmark table. More... | |
void | ResolutionChange (uint width, uint height, long long frame) |
Note a change in video size in the recordedmark table. More... | |
void | FrameRateChange (uint framerate, uint64_t frame) |
Note a change in video frame rate in the recordedmark table. More... | |
void | VideoScanChange (SCAN_t scan, uint64_t frame) |
Note a change in video scan type in the recordedmark table. More... | |
void | VideoCodecChange (AVCodecID vCodec) |
Note a change in video codec. More... | |
void | AudioCodecChange (AVCodecID aCodec) |
Note a change in audio codec. More... | |
void | SetDuration (std::chrono::milliseconds duration) |
Note the total duration in the recordedmark table. More... | |
void | SetTotalFrames (uint64_t total_frames) |
Note the total frames in the recordedmark table. More... | |
void | TryWriteProgStartMark (const frm_pos_map_t &durationDeltaCopy) |
Protected Member Functions inherited from MPEGStreamListener | |
virtual | ~MPEGStreamListener ()=default |
Protected Member Functions inherited from MPEGSingleProgramStreamListener | |
virtual | ~MPEGSingleProgramStreamListener ()=default |
Protected Member Functions inherited from DVBMainStreamListener | |
virtual | ~DVBMainStreamListener ()=default |
Protected Member Functions inherited from ATSCMainStreamListener | |
virtual | ~ATSCMainStreamListener ()=default |
Protected Member Functions inherited from TSPacketListener | |
virtual | ~TSPacketListener ()=default |
Protected Member Functions inherited from TSPacketListenerAV | |
virtual | ~TSPacketListenerAV ()=default |
Protected Member Functions inherited from PSStreamListener | |
virtual | ~PSStreamListener ()=default |
Protected Member Functions inherited from TSDataListener | |
virtual | ~TSDataListener ()=default |
Private Attributes | |
FirewireChannel * | m_channel {nullptr} |
bool | m_isopen {false} |
std::vector< unsigned char > | m_buffer |
Friends | |
class | MPEGStreamData |
class | TSPacketProcessor |
This is a specialization of DTVRecorder used to handle DVB and ATSC streams from a firewire input.
Definition at line 24 of file firewirerecorder.h.
FirewireRecorder::FirewireRecorder | ( | TVRec * | rec, |
FirewireChannel * | chan | ||
) |
Definition at line 20 of file firewirerecorder.cpp.
|
override |
Definition at line 26 of file firewirerecorder.cpp.
|
explicitprotected |
bool FirewireRecorder::Open | ( | void | ) |
Definition at line 31 of file firewirerecorder.cpp.
Referenced by run().
void FirewireRecorder::Close | ( | void | ) |
Definition at line 41 of file firewirerecorder.cpp.
Referenced by ~FirewireRecorder().
void FirewireRecorder::StartStreaming | ( | void | ) |
Definition at line 50 of file firewirerecorder.cpp.
Referenced by PauseAndWait(), and run().
void FirewireRecorder::StopStreaming | ( | void | ) |
Definition at line 55 of file firewirerecorder.cpp.
Referenced by PauseAndWait(), and run().
|
overridevirtual |
run() starts the recording process, and does not exit until the recording is complete.
Implements RecorderBase.
Definition at line 60 of file firewirerecorder.cpp.
|
overridevirtual |
If m_requestPause is true, sets pause and blocks up to timeout milliseconds or until unpaused, whichever is sooner.
This is the where we actually do the pausing. For most recorders that need to do something special on pause, this is the method to overide.
timeout | number of milliseconds to wait defaults to 100. |
Reimplemented from RecorderBase.
Definition at line 177 of file firewirerecorder.cpp.
Referenced by run().
|
overridevirtual |
Callback function to add MPEG2 TS data.
Implements TSDataListener.
Definition at line 105 of file firewirerecorder.cpp.
Reimplemented from DTVRecorder.
Definition at line 145 of file firewirerecorder.cpp.
Referenced by AddData().
|
inlineoverride |
Definition at line 51 of file firewirerecorder.h.
|
overrideprotectedvirtual |
Reimplemented from DTVRecorder.
Definition at line 207 of file firewirerecorder.cpp.
|
friend |
Definition at line 28 of file firewirerecorder.h.
|
friend |
Definition at line 29 of file firewirerecorder.h.
|
private |
Definition at line 61 of file firewirerecorder.h.
Referenced by Close(), Open(), StartStreaming(), and StopStreaming().
Definition at line 62 of file firewirerecorder.h.
|
private |
Definition at line 63 of file firewirerecorder.h.
Referenced by AddData().