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

📄 main.cpp

📁 完整的基于Conxant平台的USB电视棒的WIN驱动程序。
💻 CPP
字号:
/*+++ *******************************************************************\ 
* 
*  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. 
*
\******************************************************************* ---*/ 

#pragma warning(disable : 4996)
#include <streams.h>
#pragma warning(default : 4996)
#include "guiids.h"
#include "y8filter.h"


// Input pin media types
#define NUM_INPUT_MEDIA_TYPES 2
const AMOVIESETUP_MEDIATYPE g_input_pin_media_types[NUM_INPUT_MEDIA_TYPES] =
{ 
    { &MEDIATYPE_Video, &MEDIASUBTYPE_CXY8},
    { &MEDIATYPE_Video, &MEDIASUBTYPE_UYVY}
};  // clsMinorType

// Output pin media types
#define NUM_OUTPUT_MEDIA_TYPES 1
const AMOVIESETUP_MEDIATYPE g_output_pin_media_types[NUM_OUTPUT_MEDIA_TYPES] =
{ 
    { &MEDIATYPE_Video, &MEDIASUBTYPE_YUY2}
};  // clsMinorType


const AMOVIESETUP_PIN g_pin_descriptors[NUM_PINS] =
{
    // Output Pin
    { 
        L"",                        // Obsolete
        FALSE,                      // Is this pin rendered?
        TRUE,                       // Is it an output pin?
        FALSE,                      // Can the filter create zero instances?
        FALSE,                      // Does the filter create multiple instances?
        &GUID_NULL,                 // Obsolete
        NULL,                       // Obsolete
        NUM_OUTPUT_MEDIA_TYPES,     // Number of media types
        g_output_pin_media_types    // Media types 
    },
    
    //Input Pin
    { 
        L"",                        // Obsolete
        TRUE,                       // Is this pin rendered?
        FALSE,                      // Is it an output pin?
        FALSE,                      // Can the filter create zero instances?
        FALSE,                      // Does the filter create multiple instances?
        &GUID_NULL,                 // Obsolete
        NULL,                       // Obsolete
        NUM_INPUT_MEDIA_TYPES,      // Number of Media types
        g_input_pin_media_types     // Media Types
    }   
};

const AMOVIESETUP_FILTER g_filter_descriptor =
{ 
    &Y8_FILTER_GUID,                  // clsID
    L"Conexant Y8 Color Format Converter", // strName
    MERIT_PREFERRED,                    // dwMerit - make it preferred over the AVI decompressor
    2,							        // nPins
    g_pin_descriptors                   // lpPin
};               

// COM global table of objects available in this dll
CFactoryTemplate g_Templates[] = 
{
    { 
        L"Conexant Y8 Color Format Converter",
        &Y8_FILTER_GUID,
        CY8Filter::CreateInstance,
        NULL,
        &g_filter_descriptor 
    }
};

int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);


//**********************************************************************
// exported entry points for registration and
// unregistration (in this case they only call
// through to default implmentations).
//**********************************************************************

STDAPI DllRegisterServer()
{
    return AMovieDllRegisterServer2(TRUE);
}

STDAPI DllUnregisterServer()
{
    return AMovieDllRegisterServer2(FALSE);
}

extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID); 
extern "C" BOOL WINAPI DllMain(HINSTANCE hInst, DWORD dwReason, LPVOID pReserved) 
{ 
    return DllEntryPoint(hInst, dwReason, pReserved); 
}

⌨️ 快捷键说明

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