Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is best handled by DirectShow.</p> <p>DirectShow is currently a part of the platform SDK.</p> <pre><code>HRESULT extractFriendlyName( IMoniker* pMk, std::wstring&amp; str ) { assert( pMk != 0 ); IPropertyBag* pBag = 0; HRESULT hr = pMk-&gt;BindToStorage(0, 0, IID_IPropertyBag, (void **)&amp;pBag ); if( FAILED( hr ) || pBag == 0 ) { return hr; } VARIANT var; var.vt = VT_BSTR; hr = pBag-&gt;Read(L"FriendlyName", &amp;var, NULL); if( SUCCEEDED( hr ) &amp;&amp; var.bstrVal != 0 ) { str = reinterpret_cast&lt;wchar_t*&gt;( var.bstrVal ); SysFreeString(var.bstrVal); } pBag-&gt;Release(); return hr; } HRESULT enumerateDShowFilterList( const CLSID&amp; category ) { HRESULT rval = S_OK; HRESULT hr; ICreateDevEnum* pCreateDevEnum = 0; // volatile, will be destroyed at the end hr = ::CoCreateInstance( CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, IID_ICreateDevEnum, reinterpret_cast&lt;void**&gt;( &amp;pCreateDevEnum ) ); assert( SUCCEEDED( hr ) &amp;&amp; pCreateDevEnum != 0 ); if( FAILED( hr ) || pCreateDevEnum == 0 ) { return hr; } IEnumMoniker* pEm = 0; hr = pCreateDevEnum-&gt;CreateClassEnumerator( category, &amp;pEm, 0 ); // If hr == S_FALSE, no error is occured. In this case pEm is NULL, because // a filter does not exist e.g no video capture devives are connected to // the computer or no codecs are installed. assert( SUCCEEDED( hr ) &amp;&amp; ((hr == S_OK &amp;&amp; pEm != 0 ) || hr == S_FALSE) ); if( FAILED( hr ) ) { pCreateDevEnum-&gt;Release(); return hr; } if( hr == S_OK &amp;&amp; pEm != 0 ) // In this case pEm is != NULL { pEm-&gt;Reset(); ULONG cFetched; IMoniker* pM = 0; while( pEm-&gt;Next(1, &amp;pM, &amp;cFetched) == S_OK &amp;&amp; pM != 0 ) { std::wstring str; if( SUCCEEDED( extractFriendlyName( pM, str ) ) { // str contains the friendly name of the filter // pM-&gt;BindToObject creates the filter std::wcout &lt;&lt; str &lt;&lt; std::endl; } pM-&gt;Release(); } pEm-&gt;Release(); } pCreateDevEnum-&gt;Release(); return rval; } </code></pre> <p>The following call enumerates all video compressors to the console :</p> <pre><code>enumerateDShowFilterList( CLSID_VideoCompressorCategory ); </code></pre> <p>The MSDN page <a href="http://msdn.microsoft.com/en-us/library/ms783347(VS.85).aspx" rel="nofollow noreferrer">Filter Categories</a> lists all other 'official' categories.</p> <p>I hope that is a good starting point for you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload