Changeset 172


Ignore:
Timestamp:
Feb 28, 2013, 4:02:02 AM (10 years ago)
Author:
roman
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Utilities/EnumerateVideoCaptureFilterCapabilities/EnumerateVideoCaptureFilterCapabilities.cpp

    r154 r172  
    9797                                                _ATLTRY
    9898                                                {
    99                                                         CComQIPtr<IAMStreamConfig> pAmStreamConfig = pPin;
     99                                                        PIN_INFO PinInformation;
     100                                                        __C(pPin->QueryPinInfo(&PinInformation));
     101                                                        reinterpret_cast<CComPtr<IBaseFilter>&>(PinInformation.pFilter) = NULL;
     102                                                        _tprintf(_T("  Pin: %s\n"), CString(PinInformation.achName));
     103                                                        #pragma region pKsPropertySet
     104                                                        const CComQIPtr<IKsPropertySet> pKsPropertySet = pPin;
     105                                                        if(pKsPropertySet)
     106                                                        {
     107                                                                GUID Category;
     108                                                                DWORD nCategorySize;
     109                                                                const HRESULT nGetResult = pKsPropertySet->Get(AMPROPSETID_Pin, AMPROPERTY_PIN_CATEGORY, NULL, 0, &Category, sizeof Category, &nCategorySize);
     110                                                                if(SUCCEEDED(nGetResult))
     111                                                                {
     112                                                                        if(nCategorySize == sizeof Category)
     113                                                                        {
     114                                                                                // NOTE: Pin Property Set (Windows) http://msdn.microsoft.com/en-us/library/windows/desktop/dd377429%28v=vs.85%29.aspx
     115                                                                                static const struct
     116                                                                                {
     117                                                                                        const GUID* pCategory;
     118                                                                                        LPCSTR pszName;
     119                                                                                } g_pMap[] =
     120                                                                                {
     121                                                                                        #define A(x) { &x, #x },
     122                                                                                        A(PIN_CATEGORY_CAPTURE)
     123                                                                                        A(PIN_CATEGORY_PREVIEW)
     124                                                                                        A(PIN_CATEGORY_ANALOGVIDEOIN)
     125                                                                                        A(PIN_CATEGORY_VBI)
     126                                                                                        A(PIN_CATEGORY_VIDEOPORT)
     127                                                                                        A(PIN_CATEGORY_NABTS)
     128                                                                                        A(PIN_CATEGORY_EDS)
     129                                                                                        A(PIN_CATEGORY_TELETEXT)
     130                                                                                        A(PIN_CATEGORY_CC)
     131                                                                                        A(PIN_CATEGORY_STILL)
     132                                                                                        A(PIN_CATEGORY_TIMECODE)
     133                                                                                        A(PIN_CATEGORY_VIDEOPORT_VBI)
     134                                                                                        #undef A
     135                                                                                };
     136                                                                                OLECHAR pszCategory[64] = { 0 };
     137                                                                                ATLVERIFY(StringFromGUID2(Category, pszCategory, _countof(pszCategory)));
     138                                                                                CString sCategory(pszCategory);
     139                                                                                for(SIZE_T nIndex = 0; nIndex < _countof(g_pMap); nIndex++)
     140                                                                                        if(*g_pMap[nIndex].pCategory == Category)
     141                                                                                        {
     142                                                                                                sCategory.AppendFormat(_T(" %hs"), g_pMap[nIndex].pszName);
     143                                                                                                break;
     144                                                                                        }
     145                                                                                _tprintf(_T("    AMPROPSETID_Pin, AMPROPERTY_PIN_CATEGORY: %s\n"), sCategory);
     146                                                                        } else
     147                                                                                _tprintf(_T("    AMPROPSETID_Pin, AMPROPERTY_PIN_CATEGORY: Failed to Get Pin Category 0x%08x, %d (expected %d)\n"), nGetResult, nCategorySize, sizeof Category);
     148                                                                } else
     149                                                                        _tprintf(_T("    AMPROPSETID_Pin, AMPROPERTY_PIN_CATEGORY: Failed to Get Pin Category 0x%08x\n"), nGetResult);
     150                                                        }
     151                                                        #pragma endregion
     152                                                        #pragma region IAMStreamConfig
     153                                                        const CComQIPtr<IAMStreamConfig> pAmStreamConfig = pPin;
    100154                                                        if(pAmStreamConfig)
    101155                                                        {
    102                                                                 PIN_INFO PinInformation;
    103                                                                 __C(pPin->QueryPinInfo(&PinInformation));
    104                                                                 reinterpret_cast<CComPtr<IBaseFilter>&>(PinInformation.pFilter) = NULL;
    105                                                                 _tprintf(_T("  Pin: %s\n"), CString(PinInformation.achName));
    106156                                                                INT nCapabilityCount = 0;
    107157                                                                INT nSize = 0;
     
    205255                                                                }
    206256                                                        }
     257                                                        #pragma endregion
    207258                                                }
    208259                                                _ATLCATCHALL()
Note: See TracChangeset for help on using the changeset viewer.