BDA Sample Generic Tuner Driver

SUMMARY

This sample is the source code for a generic tuner sample Broadcast Driver Architecture (BDA) driver for Windows® XP. It is provided as an example of a BDA device minidriver for the AVStream class of kernel streaming and to give hardware vendors assistance in writing their own BDA minidrivers. This sample does not have any associated hardware.  The driver is designed to work the sample BDA Capture driver.

BUILDING THE SAMPLE

To build the sample, open a DDK command window, change to the BDA directory, and use the build command. The build command gets instructions on how to build from the Sources file.

This sample can be built as either an ATSC sample or a DVB-S sample.  To select the flavor of sample simply uncomment the appropriate MACRO definition (ATSC_RECEIVER or DVBS_RECEIVER) in BDATuner.h.   Make sure only one of the receiver type MACROs is defined.  Building this sample produces one file: BDATuner.sys. Both free and checked versions can be built.

The best way to use the sample BDA tuner driver is to build both BDATuner.sys and BDACap.sys.  Copy these to a directory along with the sample BDA tuner INF (BDATuner.inf), sample BDA capture INF(BDACap.inf), and software receiver INF (BDASWRcv.inf).  Start the installation by right clicking BDASWRcv.inf and then left clicking Install.  Follow the direction to complete installation of both the sample BDA tuner and sample BDA capture drivers.

TOOLS

GraphEdit uses the BDA sample generic tuner driver to configure a filter for the driver in a filter graph. This BDA sample generic tuner filter does not perform any specific functions. You can connect the BDA ATSC or DVB-S network provider filters to the input pin of the generic filter. You can connect the BDA capture filter to the output pin of the BDA tuner filter.

The sample BDA capture appears under "BDA Receiver Components" as "Sample BDA Capture".  The sample BDA tuner appears under “BDA Source Filters” as “Sample BDA Tuner Filter”.  The ATSC Network Provider appears under “BDA Network Providers” as “Microsoft ATSC Network Provider”.  The DVB-S Network Provider appears under “BDA Network Providers” as “Microsoft DVBS Network Provider”.

Many properties can be set on your filter by right-clicking the Network Provider filter in GraphEdt and selecting Properties.  The displayed property pages allow for the creation and submission of tune requests that ultimately result in properties being set on your driver.  Note that, if you are testing a DVB-S driver, you should use the DVBS Network Provider property pages to create ad DVB-S tuning space called “MYDVB”. To access these properties you must first run Regsvr32 on PropPage.dll which is delivered in the Direct Show SDK.  You can also create a plugin to directly access and configure the BDA sample generic tuner filter.

RESOURCES

To get a logo for your device, consult the WHQL Web site for information and test suites.

Your device should support Plug and Play. Download Plug and Play specs from their Web site.

CODE TOUR

File Manifest

File                Description
 
Bdadebug.h     Contains macros that the driver uses for debugging
BdaTuner.htm   The documentation for this sample (this file)
Bdaguid.c      Includes header files used for defining GUIDs
BDATuner.h     Defines classes for filter, device, and filter I/O pins.
BDATuner.inf   Installation information for the sample
BDATuner.rc    Version information resource
Common.h       Includes necessary header files, like Bdasup.h
Device.cpp     Main code of BDA device, including driver-entry point
Filter.cpp     Implements methods of the filter class 
Inpin.cpp      Implements the class for the input pin
Makefile       The makefile for the project; do not edit.
ObjDesc.cpp    Defines automation and dispatch tables and template structures
Outpin.cpp     Implements the class for the output pin
Sources         DDK build instructions
Splmedia.h     Defines properties, methods, and events for 
                   the sample's nodes
Wdmdebug.h     Contains macros for WDM debugging
 

Programming Tour

The ObjDesc.cpp file contains definitions and templates that the network provider filter can use to determine topology, to configure and change a filter instance, and to manipulate the sample's nodes. The BDA sample software tuner driver registers these definitions and templates with the BDA support library so the library can handle most aspects of these operations. Other files of this sample define constants, structures, and classes and implement methods for those classes.

Sources File

The Sources file contains instructions on how to build the BDA sample software tuner driver. The following code shows the macros used in the Sources file along with comments that explain what those macros do.

 
        TARGETNAME=BDATuner  # Set driver's name
        TARGETTYPE=DRIVER    # Set type of file built, for example, program, DLL, or driver
                             # For BDA minidriver, set to DRIVER.
        TARGETPATH=obj$(BUILD_ALT_DIR)  # Set destination directory for the built file
         # Depending on whether your build environment is "free" or "checked",
         # the BUILD_ALT_DIR variable appends "fre" or "chk" to the \obj subdirectory.
        DRIVERTYPE=WDM  # Set type of driver, can be set to either WDM or VXD.
                        # For BDA, set to WDM.
 
        # Generate .SYM and .PDB (map) files.  These files map names to addresses. 
        # Required to debug on Win9x.
        USE_MAPSYM=1  
 
        # Point to the header files that the sample source requires. 
        INCLUDES=..\..\..\..\inc; \
          $(DDK_INC_PATH)\wdm; 
 
        # Point to the library files that the sample source requires. 
        TARGETLIBS=..\..\..\..\lib\ks.lib \
             ..\..\..\..\lib\ksguid.lib \
              ..\..\..\..\lib\BdaSup.lib
 
        # The following macros are used with the Soft-ICE debugging tool.
        !ifdef BUILD_SOFTICE_SYMBOLS
        TARGETPATHEX=$(TARGETPATH)\$(TARGET_DIRECTORY)
 
        NTTARGETFILES=$(TARGETPATH)\$(TARGETNAME).dbg
 
        NTTARGETFILES=$(TARGETPATHEX)\$(TARGETNAME).nms $(NTTARGETFILES)
        !endif
 
        # Sample source files that must be compiled.
        SOURCES= \
            ObjDesc.cpp     \
            inpin.cpp     \
            outpin.cpp    \
            Filter.cpp      \
            Device.cpp      \
            bdaguid.c       \
            BDATuner.rc

Top of page

 

© 2000 Microsoft Corporation