From MythTV Official Wiki
Revision as of 02:03, 9 April 2013 by Danielk (talk | contribs) (Initial description of recorder architecture)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

General MythTV recorder architecture

The five most important classes in the recorder architecture are:

 * TVRec -- same for all recorders
 * RingBuffer -- same for all recorders
 * RecorderBase
 * SignalMonitor
 * ChannelBase


When either Scheduler or a TVPlay instance wants to start recording they call TVRec::StartRecording() with the ProgramInfo of the program they wish to record. Once the recording the Scheduler or TVPlay do not need to end the recording, TVRec takes care of ending the recording.

TVRec runs it's own event loop in TVRec::run(). This event loop predates the ability to run Qt event loops in any thread and is a custom to TVRec. It handles three things: state change commands initiated from TVRec::ChangeState(), tuning requests from the tuningRequests deque, and it handles ending in progress recordings.


This class provides the interface that RecorderBase uses to write data to disk. Internally it uses a ThreadedFileBuffer, but the most important thing to RecorderBase is that the RingBuffer::write() does not block for more than a few milliseconds at a time, unlike disk writes themselves which can block for a number of seconds on a system that is operating normally.


This class coordinates moving data from a device and getting it to a RingBuffer. This class is a QRunnable and is given it's own thread by TVRec.


This class handles changing channels.


This class is tells us if there is data coming in on our device that we can record.

Digital TV Recorders


* Explain {MPEG,DVB,ATSC,Scan}StreamData
* Explain StreamHandler classes
  + These are optional but they allow multiple recorders to access a data stream.
  + One per recording source (i.e. /dev/video0 or /dev/dvb/adapter0/frontend0).

IPTV Recorder Architecture


 * Explain how the lifetime of a StreamHandler is different in this recorder as compared with other recorders.
   + Each 'channel' is actually a recording source.
 * Explain the PacketBuffer, especially the RTPPacketBuffer.
 * Explain IPTVTuningData