⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bdatunerfilter.h

📁 完整的基于Conxant平台的USB电视棒的WIN驱动程序。
💻 H
字号:
/*+++ *******************************************************************\ 
* 
*  Copyright and Disclaimer: 
*  
*     --------------------------------------------------------------- 
*     This software is provided "AS IS" without warranty of any kind, 
*     either expressed or implied, including but not limited to the 
*     implied warranties of noninfringement, merchantability and/or 
*     fitness for a particular purpose.
*     --------------------------------------------------------------- 
*   
*     Copyright (c) 2008 Conexant Systems, Inc. 
*     All rights reserved. 
*
\******************************************************************* ---*/ 

#ifndef _BDA_TUNER_FILTER_H_
#define _BDA_TUNER_FILTER_H_

extern "C" 
{
    #include <wdm.h>
}

#include <windef.h>
#include <ks.h>
#include <ksmedia.h>
#include <bdatypes.h>
#include <bdamedia.h>
#include <bdasup.h>

class Device;
class IBdaTuner;

typedef struct _BDA_TUNER_FREQ
{
    DWORD   frequency;
    DWORD   frequency_multiplier; 
    DWORD   channel_bandwidth;    //unused
}BDA_TUNER_FREQ, *PBDA_TUNER_FREQ;

typedef enum _TUNER_DEMOD_TYPE
{
    TUNER_DEMOD_TYPE_PHILIPS_TUV1236D           = 0,
    TUNER_DEMOD_TYPE_ZARLINK_XCEIVE             = 1,
    TUNER_DEMOD_TYPE_ALTAIR_SIDEWINDER          = 2,
    TUNER_DEMOD_TYPE_GEMINI2_XCEIVE             = 3,
    TUNER_DEMOD_TYPE_GEMINI2_MxL5005            = 4,
    TUNER_DEMOD_TYPE_GEMINI3_SIDEWINDER         = 5
}TUNER_DEMOD_TYPE;

class BdaTunerFilter
{
public:
    BdaTunerFilter(Device* p_device);
    ~BdaTunerFilter();

    //Filter dispatch functions
    static NTSTATUS static_Create(
        PKSFILTER  p_ks_filter, 
        PIRP       p_irp);

    static NTSTATUS static_Close(
        PKSFILTER  p_ks_filter, 
        PIRP       p_irp);

    //Functions to implement methods in the automation table.
    // (BDA changes methods)
    static NTSTATUS static_BdaStartChanges(
        PIRP        p_irp,
        PKSMETHOD   p_ks_method,
        PVOID       p_ignored);

    static NTSTATUS static_BdaCommitChanges(
        PIRP        p_irp,
        PKSMETHOD   p_ks_method,
        PVOID       p_ignored);

    static NTSTATUS static_BdaGetChangeState(
        PIRP        p_irp,
        PKSMETHOD   p_ks_method,
        PULONG      p_change_state);

    static NTSTATUS static_BdaCheckChanges(
        PIRP        p_irp,
        PKSMETHOD   p_ks_method,
        PVOID       p_ignored);


    //Retreive the current frequency settings (For BdaTunerProp to get the information 
    // to pass back.)
    BDA_TUNER_FREQ* getCurrentFrequencySetting(){return &_current_freq;}
    
    VOID setPendingFrequency(ULONG frequency);
    VOID setPendingFrequencyMultiplier(ULONG frequency_multiplier);
    VOID setPendingChannelBandwidth(ULONG channel_bandwidth);

    //Retrieve information about rather or not the tuner is locked on a signal.
    BOOL isTunerLocked();
    DWORD getSignalStrength();

    //Create the filter factory and register the filter
    static NTSTATUS static_CreateFilterFactory(
        KSDEVICE* p_ks_device, 
        DWORD medium_id, 
        DWORD bda_demod_tuner_type,
        PVOID *   pp_filter_template);

    // reset Digital Frequency
    void resetFrequency();
    
    // get Demod type ATSC / DVB-T
    DWORD getDemodType();

	DWORD getDemodSignalQuality() ;

protected:
    static NTSTATUS static_RegisterFilter(KSDEVICE* p_ks_device, DWORD medium_id);

    static NTSTATUS AllocateFilterDescriptorForMediums(
                IN KSFILTER_DESCRIPTOR FilterDescriptor,
                IN KSOBJECT_BAG ObjectBag,
                IN DWORD medium_id,
                OUT PKSFILTER_DESCRIPTOR *ppFilterDescriptor
                );

    BOOL commitChanges();

    VOID  InitBdaDevices();

private:

    //Tuner object
    IBdaTuner*              _p_tuner;

    //Save the current change state.  This will be pending if we have
    // changes outstanding.
    BDA_CHANGE_STATE        _bda_change_state;


    //Save a current and a pending setting for the tuner frequency.
    // The user will set the "pending frequency" through the property sets,
    // and then tell us to "commit changes" and apply it.  At any time,
    // we need to be able to discard the pending changes.
    BDA_TUNER_FREQ          _current_freq;
    BDA_TUNER_FREQ          _pending_freq;

    BOOL                    _tuner_is_initialized;

	BOOL					_freq_initialized;

    Device*                 _p_device;
};

/////////////////////////////////////////////////////////////////////////////////////////
//Intersect handler functions for the filters input and output pins.

NTSTATUS BdaInPin_IntersectRange(PVOID        p_context,
                                 PIRP         p_irp,
                                 PKSP_PIN     p_pin,
                                 PKSDATARANGE p_ks_data_range,
                                 PKSDATARANGE p_ks_matching_data_range,
                                 ULONG        data_buffer_size,
                                 PVOID        p_data,
                                 PULONG       p_data_size);

NTSTATUS BdaTransportPin_IntersectRange(PVOID        p_context,
                                        PIRP         p_irp,
                                        PKSP_PIN     p_pin,
                                        PKSDATARANGE p_ks_data_range,
                                        PKSDATARANGE p_ks_matching_data_range,
                                        ULONG        data_buffer_size,
                                        PVOID        p_data,
                                        PULONG       p_data_size);


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -