C# Class TvLibrary.Implementations.DVB.TvDvbChannel

Base class for all dvb channels
Inheritance: BaseSubChannel, ITeletextCallBack, IPMTCallback, ICACallback, ITvSubChannel, IVideoAudioObserver
显示文件 Open project: MediaPortal/MediaPortal-1 Class Usage Examples

Protected Properties

Property Type Description
_channelInfo TvLibrary.Implementations.DVB.Structures.ChannelInfo
_currentAudioStream TvLibrary.Implementations.DVB.DVBAudioStream
_eventPMT System.Threading.ManualResetEvent
_graphBuilder IFilterGraph2
_mdplugs TvLibrary.Implementations.DVB.MDPlugs
_pmtData byte[]
_pmtLength int
_pmtPid int
_pmtRequested bool
_pmtVersion int
_subChannelIndex int
_tsFilterInterface ITsFilter

Public Methods

Method Description
CancelTune ( ) : void

cancels the tune

GetStreamQualityCounters ( int &totalBytes, int &discontinuityCounter ) : void

Fetches the stream quality information

OnAfterTune ( ) : void

Should be called when the graph is tuned to the new channel resets the state

OnBeforeTune ( ) : void

Should be called before tuning to a new channel resets the state

OnCaReceived ( ) : int

Called when tswriter.ax has received a new ca section

OnGraphStart ( ) : void

Should be called when the graph is about to start Resets the state If graph is already running, starts the pmt grabber to grab the pmt for the new channel

OnGraphStarted ( ) : void

Should be called when the graph has been started. Sets up the PMT grabber to grab the PMT of the channel when the graph hasn't been running previously

OnGraphStop ( ) : void

Should be called when graph is about to stop. stops any timeshifting/recording on this channel

OnGraphStopped ( ) : void

should be called when graph has been stopped Resets the graph state

OnPMTReceived ( int pmtPid ) : int

Called when tswriter.ax has received a new pmt

TvDvbChannel ( ) : System

Initializes a new instance of the TvDvbChannel class.

TvDvbChannel ( IFilterGraph2 graphBuilder, TvLibrary.Implementations.DVB.ConditionalAccess ca, TvLibrary.Implementations.DVB.MDPlugs mdplugs, IBaseFilter tif, IBaseFilter tsWriter, int subChannelId, IChannel channel ) : System

Initializes a new instance of the TvDvbChannel class.

Protected Methods

Method Description
GraphRunning ( ) : bool

Checks if the graph is running

OnDecompose ( ) : void

disposes this channel

OnGetTimeShiftFilePosition ( System.Int64 &position, long &bufferId ) : void

Returns the position in the current timeshift file and the id of the current timeshift file

OnGrabTeletext ( ) : void

A derrived class should activate or deactivate the teletext grabbing on the tv card.

OnStartRecording ( string fileName ) : void

Starts recording

OnStartTimeShifting ( string fileName ) : bool

sets the filename used for timeshifting

OnStopRecording ( ) : void

Stop recording

OnStopTimeShifting ( ) : void

Stop recording

SendPmtToCam ( bool &updatePids, int &waitInterval ) : bool

Decodes the PMT and sends the PMT to cam.

SetMpegPidMapping ( ChannelInfo info ) : void

maps the correct pids to the TsFileSink filter and teletext pins

SetRecorderPids ( ) : void

Sets the pids for the recorder

SetTimeShiftPids ( ) : void

Sets the pids for the timeshifter

SetupPmtGrabber ( int pmtPid, int serviceId ) : bool

Instructs the ts analyzer filter to start grabbing the PMT

WaitForPMT ( ) : bool

Wait for PMT to be found in the transport stream.

Private Methods

Method Description
PersistPMTtoDataBase ( int pmtPid ) : void
ThrowExceptionIfTuneCancelled ( ) : void

Method Details

CancelTune() public method

cancels the tune
public CancelTune ( ) : void
return void

GetStreamQualityCounters() public method

Fetches the stream quality information
public GetStreamQualityCounters ( int &totalBytes, int &discontinuityCounter ) : void
totalBytes int Amount of packets processed
discontinuityCounter int Number of stream discontinuities
return void

GraphRunning() protected method

Checks if the graph is running
protected GraphRunning ( ) : bool
return bool

OnAfterTune() public method

Should be called when the graph is tuned to the new channel resets the state
public OnAfterTune ( ) : void
return void

OnBeforeTune() public method

Should be called before tuning to a new channel resets the state
public OnBeforeTune ( ) : void
return void

OnCaReceived() public method

Called when tswriter.ax has received a new ca section
public OnCaReceived ( ) : int
return int

OnDecompose() protected method

disposes this channel
protected OnDecompose ( ) : void
return void

OnGetTimeShiftFilePosition() protected method

Returns the position in the current timeshift file and the id of the current timeshift file
protected OnGetTimeShiftFilePosition ( System.Int64 &position, long &bufferId ) : void
position System.Int64 The position in the current timeshift buffer file
bufferId long The id of the current timeshift buffer file
return void

OnGrabTeletext() protected method

A derrived class should activate or deactivate the teletext grabbing on the tv card.
protected OnGrabTeletext ( ) : void
return void

OnGraphStart() public method

Should be called when the graph is about to start Resets the state If graph is already running, starts the pmt grabber to grab the pmt for the new channel
public OnGraphStart ( ) : void
return void

OnGraphStarted() public method

Should be called when the graph has been started. Sets up the PMT grabber to grab the PMT of the channel when the graph hasn't been running previously
public OnGraphStarted ( ) : void
return void

OnGraphStop() public method

Should be called when graph is about to stop. stops any timeshifting/recording on this channel
public OnGraphStop ( ) : void
return void

OnGraphStopped() public method

should be called when graph has been stopped Resets the graph state
public OnGraphStopped ( ) : void
return void

OnPMTReceived() public method

Called when tswriter.ax has received a new pmt
public OnPMTReceived ( int pmtPid ) : int
pmtPid int
return int

OnStartRecording() protected method

Starts recording
protected OnStartRecording ( string fileName ) : void
fileName string filename to which to recording should be saved
return void

OnStartTimeShifting() protected method

sets the filename used for timeshifting
protected OnStartTimeShifting ( string fileName ) : bool
fileName string timeshifting filename
return bool

OnStopRecording() protected method

Stop recording
protected OnStopRecording ( ) : void
return void

OnStopTimeShifting() protected method

Stop recording
protected OnStopTimeShifting ( ) : void
return void

SendPmtToCam() protected method

Decodes the PMT and sends the PMT to cam.
protected SendPmtToCam ( bool &updatePids, int &waitInterval ) : bool
updatePids bool
waitInterval int
return bool

SetMpegPidMapping() protected method

maps the correct pids to the TsFileSink filter and teletext pins
protected SetMpegPidMapping ( ChannelInfo info ) : void
info TvLibrary.Implementations.DVB.Structures.ChannelInfo
return void

SetRecorderPids() protected method

Sets the pids for the recorder
protected SetRecorderPids ( ) : void
return void

SetTimeShiftPids() protected method

Sets the pids for the timeshifter
protected SetTimeShiftPids ( ) : void
return void

SetupPmtGrabber() protected method

Instructs the ts analyzer filter to start grabbing the PMT
protected SetupPmtGrabber ( int pmtPid, int serviceId ) : bool
pmtPid int pid of the PMT
serviceId int The service id.
return bool

TvDvbChannel() public method

Initializes a new instance of the TvDvbChannel class.
public TvDvbChannel ( ) : System
return System

TvDvbChannel() public method

Initializes a new instance of the TvDvbChannel class.
public TvDvbChannel ( IFilterGraph2 graphBuilder, TvLibrary.Implementations.DVB.ConditionalAccess ca, TvLibrary.Implementations.DVB.MDPlugs mdplugs, IBaseFilter tif, IBaseFilter tsWriter, int subChannelId, IChannel channel ) : System
graphBuilder IFilterGraph2 The graph builder.
ca TvLibrary.Implementations.DVB.ConditionalAccess The ca.
mdplugs TvLibrary.Implementations.DVB.MDPlugs The mdplugs class.
tif IBaseFilter The tif filter.
tsWriter IBaseFilter The ts writer filter.
subChannelId int The subchannel id
channel IChannel The corresponding channel
return System

WaitForPMT() protected method

Wait for PMT to be found in the transport stream.
protected WaitForPMT ( ) : bool
return bool

Property Details

_channelInfo protected_oe property

Channel Info
protected ChannelInfo,TvLibrary.Implementations.DVB.Structures _channelInfo
return TvLibrary.Implementations.DVB.Structures.ChannelInfo

_currentAudioStream protected_oe property

Current audio stream
protected DVBAudioStream,TvLibrary.Implementations.DVB _currentAudioStream
return TvLibrary.Implementations.DVB.DVBAudioStream

_eventPMT protected_oe property

Event that gets signaled when PMT arrives.
protected ManualResetEvent,System.Threading _eventPMT
return System.Threading.ManualResetEvent

_graphBuilder protected_oe property

The graph builder for the capture card graph.
protected IFilterGraph2 _graphBuilder
return IFilterGraph2

_mdplugs protected_oe property

MD Plugs
protected MDPlugs,TvLibrary.Implementations.DVB _mdplugs
return TvLibrary.Implementations.DVB.MDPlugs

_pmtData protected_oe property

PMT data
protected byte[] _pmtData
return byte[]

_pmtLength protected_oe property

PMT data length
protected int _pmtLength
return int

_pmtPid protected_oe property

PMT Pid
protected int _pmtPid
return int

_pmtRequested protected_oe property

Indicates that PMT was grabbed true : requested false: not requested
protected bool _pmtRequested
return bool

_pmtVersion protected_oe property

PMT version
protected int _pmtVersion
return int

_subChannelIndex protected_oe property

SubChannel index
protected int _subChannelIndex
return int

_tsFilterInterface protected_oe property

Ts filter instance
protected ITsFilter _tsFilterInterface
return ITsFilter