DVBRecorder Class Reference

#include <dvbrecorder.h>

Inheritance diagram for DVBRecorder:

ReaderPausedCB TSPacketListenerAV TSPacketListener ATSCMainStreamListener DVBMainStreamListener MPEGSingleProgramStreamListener MPEGStreamListener DTVRecorder

List of all members.


Detailed Description

This is a specialization of DTVRecorder used to handle streams from DVB drivers.

See also:
DTVRecorder

Definition at line 38 of file dvbrecorder.h.


Public Member Functions

 DVBRecorder (TVRec *rec, DVBChannel *dvbchannel)
 ~DVBRecorder ()
void SetOption (const QString &name, int value)
 handles the "wait_for_seqstart" and "pkt_buf_size" options.
void SetOptionsFromProfile (RecordingProfile *profile, const QString &videodev, const QString &audiodev, const QString &vbidev)
 Sets basic recorder options.
void StartRecording (void)
 StartRecording() starts the recording process, and does not exit until the recording is complete.
void ResetForNewFile (void)
void StopRecording (void)
 StopRecording() signals to the StartRecording() function that it should stop recording and exit cleanly.
bool Open (void)
 Open devices needed by recorder.
bool IsOpen (void) const
void Close (void)
void HandlePAT (const ProgramAssociationTable *)
void HandleCAT (const ConditionalAccessTable *)
void HandlePMT (uint pid, const ProgramMapTable *)
void HandleEncryptionStatus (uint, bool)
void HandleSingleProgramPAT (ProgramAssociationTable *pat)
void HandleSingleProgramPMT (ProgramMapTable *)
void HandleSTT (const SystemTimeTable *)
void HandleVCT (uint, const VirtualChannelTable *)
void HandleMGT (const MasterGuideTable *)
void HandleTDT (const TimeDateTable *)
void HandleNIT (const NetworkInformationTable *)
void HandleSDT (uint, const ServiceDescriptionTable *)
bool ProcessTSPacket (const TSPacket &tspacket)
bool ProcessVideoTSPacket (const TSPacket &tspacket)
bool ProcessAudioTSPacket (const TSPacket &tspacket)
bool ProcessAVTSPacket (const TSPacket &tspacket)
 Common code for processing either audio or video packets.
void SetStreamData (MPEGStreamData *)
MPEGStreamDataGetStreamData (void)
void BufferedWrite (const TSPacket &tspacket)

Private Member Functions

void TeardownAll (void)
bool CheckCC (uint pid, uint cc)
void ReaderPaused (int fd)
bool PauseAndWait (int timeout=100)
 If request_pause is true Paused and blocks up to timeout milliseconds.

Private Attributes

int _card_number_option
DVBChanneldvbchannel
DVBStreamHandler_stream_handler
MPEGStreamData_stream_data
QMutex _pid_lock
ProgramAssociationTable_input_pat
 PAT on input side.
ProgramMapTable_input_pmt
 PMT on input side.
bool _has_no_av
unsigned char _stream_id [0x1fff]
unsigned char _pid_status [0x1fff]
unsigned char _continuity_counter [0x1fff]
uint _continuity_error_count
uint _stream_overflow_count
uint _bad_packet_count

Static Private Attributes

static const int TSPACKETS_BETWEEN_PSIP_SYNC = 20000
static const int POLL_INTERVAL = 50
static const int POLL_WARNING_TIMEOUT = 500
static const unsigned char kPayloadStartSeen = 0x2

Constructor & Destructor Documentation

DVBRecorder::DVBRecorder ( TVRec rec,
DVBChannel dvbchannel 
)

Definition at line 95 of file dvbrecorder.cpp.

DVBRecorder::~DVBRecorder (  ) 

Definition at line 116 of file dvbrecorder.cpp.


Member Function Documentation

void DVBRecorder::SetOption ( const QString &  name,
int  value 
) [virtual]

handles the "wait_for_seqstart" and "pkt_buf_size" options.

Reimplemented from DTVRecorder.

Definition at line 148 of file dvbrecorder.cpp.

Referenced by SetOptionsFromProfile().

void DVBRecorder::SetOptionsFromProfile ( RecordingProfile profile,
const QString &  videodev,
const QString &  audiodev,
const QString &  vbidev 
) [virtual]

Sets basic recorder options.

SetOptionsFromProfile is used to tell the recorder about the recording profile as well as the devices to use.

Implements RecorderBase.

Definition at line 159 of file dvbrecorder.cpp.

void DVBRecorder::StartRecording ( void   )  [virtual]

StartRecording() starts the recording process, and does not exit until the recording is complete.

See also:
StopRecording()

Implements RecorderBase.

Definition at line 374 of file dvbrecorder.cpp.

void DVBRecorder::ResetForNewFile ( void   )  [virtual]

Reimplemented from DTVRecorder.

Definition at line 438 of file dvbrecorder.cpp.

void DVBRecorder::StopRecording ( void   )  [virtual]

StopRecording() signals to the StartRecording() function that it should stop recording and exit cleanly.

This function should block until StartRecording() has finished up.

Reimplemented from DTVRecorder.

Definition at line 447 of file dvbrecorder.cpp.

Referenced by TeardownAll().

bool DVBRecorder::Open ( void   )  [virtual]

Open devices needed by recorder.

This is usually called by StartRecording().

Returns:
true if device was successfully opened.

Implements RecorderBase.

Definition at line 313 of file dvbrecorder.cpp.

Referenced by StartRecording().

bool DVBRecorder::IsOpen ( void   )  const [inline]

Definition at line 64 of file dvbrecorder.h.

Referenced by Open(), and TeardownAll().

void DVBRecorder::Close ( void   ) 

Definition at line 336 of file dvbrecorder.cpp.

Referenced by StartRecording(), and TeardownAll().

void DVBRecorder::HandlePAT ( const ProgramAssociationTable _pat  )  [virtual]

Implements MPEGStreamListener.

Definition at line 242 of file dvbrecorder.cpp.

void DVBRecorder::HandleCAT ( const ConditionalAccessTable  )  [inline, virtual]

Implements MPEGStreamListener.

Definition at line 68 of file dvbrecorder.h.

void DVBRecorder::HandlePMT ( uint  pid,
const ProgramMapTable _pmt 
) [virtual]

Implements MPEGStreamListener.

Definition at line 278 of file dvbrecorder.cpp.

void DVBRecorder::HandleEncryptionStatus ( uint  ,
bool   
) [inline, virtual]

Implements MPEGStreamListener.

Definition at line 70 of file dvbrecorder.h.

void DVBRecorder::HandleSingleProgramPAT ( ProgramAssociationTable pat  )  [virtual]

Implements MPEGSingleProgramStreamListener.

Definition at line 168 of file dvbrecorder.cpp.

Referenced by StartRecording().

void DVBRecorder::HandleSingleProgramPMT ( ProgramMapTable pmt  )  [virtual]

Implements MPEGSingleProgramStreamListener.

Definition at line 202 of file dvbrecorder.cpp.

Referenced by StartRecording().

void DVBRecorder::HandleSTT ( const SystemTimeTable  )  [virtual]

Implements ATSCMainStreamListener.

Definition at line 303 of file dvbrecorder.cpp.

void DVBRecorder::HandleVCT ( uint  ,
const VirtualChannelTable  
) [inline, virtual]

Implements ATSCMainStreamListener.

Definition at line 78 of file dvbrecorder.h.

void DVBRecorder::HandleMGT ( const MasterGuideTable  )  [inline, virtual]

Implements ATSCMainStreamListener.

Definition at line 79 of file dvbrecorder.h.

void DVBRecorder::HandleTDT ( const TimeDateTable  )  [virtual]

Implements DVBMainStreamListener.

Definition at line 308 of file dvbrecorder.cpp.

void DVBRecorder::HandleNIT ( const NetworkInformationTable  )  [inline, virtual]

Implements DVBMainStreamListener.

Definition at line 83 of file dvbrecorder.h.

void DVBRecorder::HandleSDT ( uint  ,
const ServiceDescriptionTable  
) [inline, virtual]

Implements DVBMainStreamListener.

Definition at line 84 of file dvbrecorder.h.

bool DVBRecorder::ProcessTSPacket ( const TSPacket tspacket  )  [virtual]

Implements TSPacketListener.

Definition at line 550 of file dvbrecorder.cpp.

bool DVBRecorder::ProcessVideoTSPacket ( const TSPacket tspacket  )  [virtual]

Implements TSPacketListenerAV.

Definition at line 490 of file dvbrecorder.cpp.

bool DVBRecorder::ProcessAudioTSPacket ( const TSPacket tspacket  )  [virtual]

Implements TSPacketListenerAV.

Definition at line 509 of file dvbrecorder.cpp.

bool DVBRecorder::ProcessAVTSPacket ( const TSPacket tspacket  ) 

Common code for processing either audio or video packets.

Definition at line 516 of file dvbrecorder.cpp.

Referenced by ProcessAudioTSPacket(), and ProcessVideoTSPacket().

void DVBRecorder::SetStreamData ( MPEGStreamData data  )  [virtual]

Reimplemented from DTVRecorder.

Definition at line 345 of file dvbrecorder.cpp.

MPEGStreamData* DVBRecorder::GetStreamData ( void   )  [inline, virtual]

Reimplemented from DTVRecorder.

Definition at line 97 of file dvbrecorder.h.

Referenced by HandleSTT(), and HandleTDT().

void DVBRecorder::BufferedWrite ( const TSPacket tspacket  ) 

Reimplemented from DTVRecorder.

Definition at line 580 of file dvbrecorder.cpp.

Referenced by ProcessAVTSPacket(), and ProcessTSPacket().

void DVBRecorder::TeardownAll ( void   )  [private]

Definition at line 121 of file dvbrecorder.cpp.

Referenced by ~DVBRecorder().

bool DVBRecorder::CheckCC ( uint  pid,
uint  cc 
) [inline, private]

Definition at line 143 of file dvbrecorder.h.

Referenced by ProcessAVTSPacket(), and ProcessTSPacket().

void DVBRecorder::ReaderPaused ( int  fd  )  [private, virtual]

Implements ReaderPausedCB.

Definition at line 454 of file dvbrecorder.cpp.

bool DVBRecorder::PauseAndWait ( int  timeout = 100  )  [private, virtual]

If request_pause is true Paused and blocks up to timeout milliseconds.

Parameters:
timeout number of milliseconds to wait defaults to 100.
Returns:
true if recorder is paused.

Reimplemented from RecorderBase.

Definition at line 458 of file dvbrecorder.cpp.

Referenced by StartRecording().


Member Data Documentation

Definition at line 111 of file dvbrecorder.h.

Referenced by Open(), and SetOption().

Definition at line 114 of file dvbrecorder.h.

Referenced by HandlePMT(), HandleSTT(), HandleTDT(), and StartRecording().

Definition at line 115 of file dvbrecorder.h.

Referenced by Close(), Open(), PauseAndWait(), and StartRecording().

QMutex DVBRecorder::_pid_lock [mutable, private]

Definition at line 119 of file dvbrecorder.h.

Referenced by HandlePAT(), and HandlePMT().

PAT on input side.

Definition at line 120 of file dvbrecorder.h.

Referenced by HandlePAT(), and TeardownAll().

PMT on input side.

Definition at line 121 of file dvbrecorder.h.

Referenced by HandlePMT(), ProcessTSPacket(), StartRecording(), and TeardownAll().

Definition at line 122 of file dvbrecorder.h.

Referenced by HandlePMT(), and ProcessTSPacket().

unsigned char DVBRecorder::_stream_id[0x1fff] [private]

Definition at line 125 of file dvbrecorder.h.

Referenced by HandleSingleProgramPMT(), Open(), ProcessVideoTSPacket(), and ResetForNewFile().

unsigned char DVBRecorder::_pid_status[0x1fff] [private]

Definition at line 126 of file dvbrecorder.h.

Referenced by Open(), ProcessAVTSPacket(), and ResetForNewFile().

unsigned char DVBRecorder::_continuity_counter[0x1fff] [private]

Definition at line 127 of file dvbrecorder.h.

Referenced by CheckCC(), Open(), and ResetForNewFile().

Definition at line 130 of file dvbrecorder.h.

Referenced by ProcessAVTSPacket(), ProcessTSPacket(), and StartRecording().

Definition at line 131 of file dvbrecorder.h.

Referenced by StartRecording().

Definition at line 132 of file dvbrecorder.h.

const int DVBRecorder::TSPACKETS_BETWEEN_PSIP_SYNC = 20000 [static, private]

Definition at line 135 of file dvbrecorder.h.

const int DVBRecorder::POLL_INTERVAL = 50 [static, private]

Definition at line 136 of file dvbrecorder.h.

const int DVBRecorder::POLL_WARNING_TIMEOUT = 500 [static, private]

Definition at line 137 of file dvbrecorder.h.

const unsigned char DVBRecorder::kPayloadStartSeen = 0x2 [static, private]

Definition at line 139 of file dvbrecorder.h.

Referenced by ProcessAVTSPacket().


The documentation for this class was generated from the following files:

Generated on Sat Jul 31 05:18:36 2010 for MythTV by  doxygen 1.5.5