I thought i might share what little i've on a DTV Plugin.
I've taken a different approach than i'd normally do and document what needs to be done rather than just try to code it. So far i've documented 3 functions:
Some BDA stuff might need to be ported from c++ directshow before this stuff get started, so i might need to look into how to do that.
If anyone wants to code any of this, please feel fre to do so. I bearly know c++ let alone c# so it might take me a while.
If anyone has any comments, suggestions etc, post it here.
Regards,
Bionic Donkey
I've taken a different approach than i'd normally do and document what needs to be done rather than just try to code it. So far i've documented 3 functions:
Code:
/// <summary>
/// This function is ued to setup the initial part of the graph.
/// A tune request must the sent before the Network Provider is connected to the other filters.
/// Just create a tune request, filling the frequency and bandwidth/symbol rate with -1.
/// </summary>
/// <returns>true if it's setup, false if it's not</returns>
public bool setupGraph() {
// BDA Network Provider
// Initialise Tuning Space (using the setupTuningSpace function)
// Create NP based on a network type
// Add NP to graph
// Submit Tune Request
// Tuner Device
// Create Tuner device from device selected in setup
// Add Tuner Device to the graph
// Start the graph to make sure the device is available
// Connect Network Provider to Tuner Device
// Capture Device
// Create Capture Device by matching it with the Tuner Device
// Add the Capture Device to the graph
// Connect the Tuner Device to the Capture Device
// Mpeg2 Demultiplexer
// Use CLSID_MPEG2Demultiplexer to create the demux
// Add the Demux to the graph
// Connect the Capture Device to the demux (which will setup the pins)
// Transport Information Filter
// Enumerate the KSCATEGORY_BDA_TRANSPORT_INFORMATION category
// Add the filter to the graph
// Try to connect to Pin 1 on the Demux
// Sections & Tables Filter
// Enumerate the KSCATEGORY_BDA_TRANSPORT_INFORMATION category
// Add the filter to the graph
// Try to connect to Pin 5 on the Demux
return false; // Change to true when function complete
}
/// <summary>
/// This is the function for setting up a local tuning space.
/// Funtion is based on code written by Nate from DigitalWatch.
/// It may be changed to use the Windows Registry. I have a C++ function for this.
/// </summary>
/// <returns>true if succeeded, fale if failed</returns>
private bool setupTuningSpace()
{
// Create instance of a tuning space using CLSID_DVBTuningSpace
// Interface IDVBTuningSpace2 with the tuning space created above
// Put the system type on the tuning space
// Put the network type on the tuning space
// Release the IDVBTuningSpace 2 interface from the main tuning space
return false; // Change to true when function complete
}
/// <summary>
/// Used to create a tune request and submit it to the tuner
/// </summary>
/// <param name="Frequency">Frequency</param>
/// <param name="Bandwidth">Bandwidth/Symbol Rate</param>
/// <param name="ONID">Original Network Identification</param>
/// <param name="TSID">Transport Stream Identification</param>
/// <param name="SID">Stream Identification (Program Number)</param>
/// <returns>true if succeeded, false if failed</returns>
public bool createTuneRequest(long Frequency, long Bandwidth, long ONID, long TSID, long SID)
{
// Create the Tune Request
// Interface IDVBTuningSpace2 with the TuningSpace
// Create new Tune Request using tuning space
// Interface IDVBTuneRequest with the Tune Request created above
// Create instance of network specific Locator
// Give frequency to the Locator (put_CarrierFrequency)
// Give the bandwidth to the Locator (put_SymbolRate)
// Give the DVB Tune Request the ONID (put_ONID)
// Give the DVB Tune Request the TSID (put_TSID)
// Give the DVB Tune Request the SID (put_SID)
// Bind the locator to the DVB Tune Request (put_Locator)
// Release the Locator and the DVB Tune Request
// Submit the Tune Request
// Create instance of ITuner
// Interface the instance of ITuner with the Network Provider
// Submit the Tune Request to the Tuner (put_TuneRequest)
// Release the instance of ITuner
// Release the Tune Request
return false; // Change to true when function complete
}
Some BDA stuff might need to be ported from c++ directshow before this stuff get started, so i might need to look into how to do that.
If anyone wants to code any of this, please feel fre to do so. I bearly know c++ let alone c# so it might take me a while.
If anyone has any comments, suggestions etc, post it here.
Regards,
Bionic Donkey