다음을 통해 공유


BDA 미니드라이버 초기화

BDA 미니드라이버가 다른 AVStream 미니드라이버와 유사하게 초기화됩니다. BDA 미니드라이버의 DriverEntry 함수는 AVStream KsInitializeDriver 함수를 호출하여 BDA 미니드라이버의 드라이버 개체를 초기화합니다. 이 호출에서 BDA 미니 드라이버는 다음을 포함할 수 있는 디바이스의 특성을 지정하는 KSDEVICE_DESCRIPTOR 구조에 포인터를 전달합니다.

  • BDA 디바이스에 대한 디스패치 테이블을 포함하는 KSDEVICE_DISPATCH 구조체에 대한 포인터입니다. 최소한 BDA 미니드라이버에서는 디바이스를 만들고 시작하고 KSDEVICE_DISPATCH 구조의 추가시작 멤버에서 이러한 루틴을 지정하는 루틴을 제공해야 합니다. BDA 미니드라이버의 만들기 루틴은 디바이스 클래스에 대한 메모리를 할당하고 BDA 디바이스의 KSDEVICE 구조에 대한 포인터를 이 디바이스 클래스에 참조해야 합니다. BDA 미니드라이버의 시작 루틴은 레지스트리에서 디바이스에 대한 정보를 얻고, 디바이스에 대한 정보를 설정한 다음, BDA 지원 라이브러리에 정적 템플릿 구조 그룹을 등록해야 합니다. 자세한 내용은 BDA 미니드라이버 시작을 참조하세요.

  • 이 디바이스에서 지원하는 개별 필터 형식에 대한 KSFILTER_DESCRIPTOR 구조의 배열입니다. 이 구조체 형식은 지정된 필터 팩터리에서 만든 필터의 특성을 설명합니다. BDA 지원 라이브러리(Bdasup.lib)를 사용하여 BDA 미니드라이버의 속성 및 메서드 집합을 처리하지 않도록 BDA 미니드라이버를 만드는 경우 이 배열에서 이 형식의 구조체 멤버를 지정해야 합니다. BDA 지원 라이브러리를 사용하도록 BDA 미니드라이버를 만드는 경우 BDA 미니드라이버가 BdaCreateFilterFactory 지원 함수를 호출하여 디바이스에 대한 필터 팩터리 설명자(KSFILTER_DESCRIPTOR 구조)를 추가해야 합니다. 자세한 내용은 BDA 미니드라이버 시작을 참조하세요.

다음 코드 조각은 필터 설명자 배열, BDA 디바이스에 대한 디스패치 테이블 및 BDA 디바이스에 대한 설명자의 예를 보여 줍니다.

//
//  Array containing descriptors for all filter factories
//  available on the device.
//
//  Note!  Only used when dynamic topology is not used (that is, 
//         only when filters and pins are fixed). Typically, this 
//         is when the network provider is not present.
//
DEFINE_KSFILTER_DESCRIPTOR_TABLE(FilterDescriptors)
{
    &TemplateTunerFilterDescriptor
};
//
//  Device Dispatch Table
//
//  Lists the dispatch routines for the major events related to 
//  the underlying device.
//
extern
const
KSDEVICE_DISPATCH
DeviceDispatch =
{
    CDevice::Create,    // Add
    CDevice::Start,     // Start
    NULL,               // PostStart
    NULL,               // QueryStop
    NULL,               // CancelStop
    NULL,               // Stop
    NULL,               // QueryRemove
    NULL,               // CancelRemove
    NULL,               // Remove
    NULL,               // QueryCapabilities
    NULL,               // SurpriseRemoval
    NULL,               // QueryPower
    NULL                // SetPower
};
//
//  Device Descriptor
//
//  Brings together the data structures that define the device and
//  the initial filter factories that can be created on it.
//  Note that because template topology structures are specific 
//  to BDA, the device descriptor does not include them.
//  Note also that if BDA dynamic topology is used, the device 
//  descriptor does not specify a list of filter factory descriptors.
//  If BDA dynamic topology is used, the BDA minidriver calls 
//  BdaCreateFilterFactory to add filter factory descriptors. 
extern
const
KSDEVICE_DESCRIPTOR
DeviceDescriptor =
{
    &DeviceDispatch,    // Dispatch
#ifdef DYNAMIC_TOPOLOGY // network provider is present
    0,    // FilterDescriptorsCount
    NULL, // FilterDescriptors
#else     // network provider is not present
    SIZEOF_ARRAY( FilterDescriptors), // FilterDescriptorsCount
    FilterDescriptors                 // FilterDescriptors
#endif // DYNAMIC_TOPOLOGY