B2C2, Inc. - Software Development Kit |
Windows | |||||
Audio/Video Handling | |||||
IP Data Handling | |||||
Raw Transport Stream Handling | |||||
Linux | |||||
Signal Flow | |||||
This document provides information for developers interested in creating application-level software for implementing B2C2's broadband device (Broadband4PC devices Sky2PC, Cable4PC, Air2PC versions) on Windows and Linux operating systems. To create software for controlling Broadband4PC, write the software using the SDK methods and compile it with the header files provided. In this document methods for each filter interface or instantiated member are listed on its associated page. (See the Link Menu in the left pane.) Many methods for Windows filter interfaces and Linux instantiated members are functionally identical. Code for initial instantiation, tuner control, and setting PIDs is identical and can be shared across Windows and Linux operating systems. However, Windows uses DirectX source filter B2C2MPEG2Filter to send the streams to the user application, while Linux uses a callback to the user's custom driver to accomplish the same. For detailed sample applications see the Code Samples directory. WindowsIn Windows, the implementation involves B2C2MPEG2Filter, a DirectShow compatible filter (COM object) that allows access to B2C2 hardware tuners (such as Air2PC, Sky2PC and Cable4PC) and the setting of PID/MAC information. Windows applications control Broadband4PC tuning and media flow via the filter's main interfaces: IB2C2MPEG2TunerCtrl2, IB2C2MPEG2AVCtrl2, and IB2C2MPEG2DataCtrl4. An optional helper class called B2C2MPEG2Adapter provides initialization functions and provides USB device plug-in/removal notification support. In Windows, B2C2MPEG2Adapter methods are used to instantiate all necessary filters and interfaces. For example, after Initialize is called, methods GetTunerControl, GetAvControl, and GetDataControl are called in order to initialize the IB2C2MPEG2TunerCtrl2, IB2C2MPEG2AVCtrl2, and IB2C2MPEG2DataCtrl4 filter interfaces. The methods of these B2C2 interfaces then become available. Audio/Video Handling (Windows) B2C2MPEG2Filter is a COM object that can act as the media source filter for a DirectX filter graph. Use of Microsoft's DirectX SDK is recommended to create a DirectShow-based user application that accesses B2C2MPEG2Filter's Audio and Video output pins via the filter graph. B2C2MPEG2Adapter methods are used to instantiate all necessary filters and interfaces. IB2C2TunerCtrl2 methods tune to the correct channel. IB2C2AvCtrl2 methods set the PIDs for filtering selected Audio and Video streams. The filtered streams exit B2C2MPEG2Filter's Audio and Video output pins. Once in the filter graph, the flow of the Audio and Video streams can be controlled by the DirectX-compatible media application. B2C2MPEG2Adapter methods are used to instantiate tuner interface IB2C2TunerCtrl2 and data interface IB2C2DataCtrl3. IB2C2TunerCtrl2 methods tune to the correct channel. IB2C2DataCtrl3 methods set the PIDs for filtering IP data streams. The filtered IP streams exit directly to the network stack. Raw Transport Stream Handling (Windows) Raw Transport Stream Handling can be used to handle any type of data (IP data, Audio, or Video) still carried in raw transport stream packets exiting the B2C2MPEG2Filter's Raw TS output pins. B2C2MPEG2Adapter methods are used to instantiate all necessary filters and interfaces. IB2C2TunerCtrl2 methods tune to the correct channel. IB2C2DataCtrl3 methods set the PIDs for filtering the selected Raw TS. The filtered Raw TS exit B2C2MPEG2Filter's Raw TS output pins. The Raw TS output pins may be connected to a custom filter which may or may not be based on DirectShow base class IBaseFilter. The custom filter processes or enders the data contained within the Raw TS, or the custom filter may be part of a filter graph that processes the data. B2C2MPEG2Adapter methods are used to connect the filters, which dump to a file or a to user application. LinuxIn Linux, the implementation involves B2C2MPEG2Adapter, the overall class for controlling B2C2's broadband device (such as Air2PC, Sky2PC and Cable4PC). Linux applications control B2C2's broadband device through B2C2MPEG2Adapter's instantiated members: IB2C2MPEG2TunerCtrl2, IB2C2MPEG2AVCtrl2, and IB2C2MPEG2DataCtrl4. Additionally, a customized driver module can be created using the DDK (Driver Development Kit) documentation. In Linux, B2C2MPEG2Adapter methods are used to instantiate all necessary classes. For example, after Initialize is called, methods GetTunerControl, GetAvControl, and GetDataControl are called in order to initialize the IB2C2MPEG2TunerCtrl2, IB2C2MPEG2AVCtrl2, and IB2C2MPEG2DataCtrl4 member classes. IB2C2TunerCtrl2 methods tune to the correct channel. IB2C2DataCtrl3 methods set the PIDs for filtering IP data streams, which exit directly to the network stack. IB2C2DataCtrl3 methods set the PIDs for filtering the selected Raw Transport Streams for callback, and IB2C2AvCtrl2 methods set the PIDs for filtering selected Audio and Video streams for callback. For the actual handling of received Audio, Video, and Raw Transport streams, a customized driver module must first be created using the DDK. When Audio, Video, or Raw TS packets are received, the B2C2 driver uses a callback structure to inform custom driver module custom.o of the data size and location on a ring buffer for pick up. What happens next to the data depends entirely on the custom driver module. |
The SDK allows an application to control the tuner and set PIDs in order to route received information to the correct place; the PID-setting method determines the pathway. Setting a PID as an IP PID (AddIpPIDs method) ensures the received, selected IP stream is passed directly to the operating system via IP stack and socket. Setting a PID as an Audio or Video PID (SetAudioVideoPIDs method) ensures the selected Audio or Video stream will pass to the user application. Streams can also be selected and received without regard to content; setting a PID as a Raw Transport Stream PID (AddPIDsToPin method for Windows or AddTsPIDs method for Linux) ensures that the selected stream will pass to the user application as a raw transport stream. In Windows the desired Audio/Video/Raw TS stream is output to the software application from the MPEG-2 Filter at the Video pin, Audio pin, or the Raw TS pin that was designated by AddPIDsToPin. On the other hand the IP stream designated by AddIpPIDs bypasses the MPEG-2 filter and goes to the socket. In Linux a callback is used. In the callback, pointers indicating the arrival of Audio, Video, or Raw TS packets, respectively, are passed to a Linux custom driver created using the DDK (Driver Development Kit); the application is informed of the length and location of the data to be picked up. On the other hand the IP stream designated by AddIpPIDs bypasses the MPEG-2 filter and goes to the socket. In the SDK there are three main functional categories of control: Tuner control and tuner module monitoring; Audio/Video stream control, and; IP Data/MAC control and monitoring. These are represented by three respective interfaces: IB2C2MPEG2TunerCtrl2, IB2C2MPEG2AVCtrl2, and IB2C2MPEG2DataCtrl4. In addition, B2C2MPEG2Adapter provides initialization functions and optional Windows USB device plug-in/removal notification support. |
Copyright © 1998-2002 B2C2, Inc. Proprietary and Confidential