Click here to Skip to main content
15,915,172 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
hi all
i am try to connect a source filter to the next filter and i faced a problem.
the source filter now has two output pins. and i have checked them in the graphedit ,and i found their catagory are all zero . but there has a difference in type(major type).but i have no idea how to implement it.
and i stumble across a post:

//-----------------------------------------------------------------
SQL
Use IKsPropertySet Interface and see example code in section Pin Property Set.


and more details about this method:
http://msdn.microsoft.com/en-us/library/ms787483(VS.85).aspx[^]
SQL
Pin Property Set
The pin property set returns the pin category for a pin on a filter. The category is set by the filter when it creates the pin; the category indicates what type of data the pin is delivered or receives by this pin.


Example Code

The following code shows how to check whether a pin supports this property set, and if so, how to obtain the pin category:

C++
HRESULT GetPinCategory(IPin *pPin, GUID *pPinCategory)
{
    HRESULT hr;
    IKsPropertySet *pKs;
    hr = pPin->QueryInterface(IID_IKsPropertySet, (void **)&pKs);
    if (FAILED(hr))
    {
        // The pin does not support IKsPropertySet.
        return hr;
    }
    // Try to retrieve the pin category.
    DWORD cbReturned;
    hr = pKs->Get(AMPROPSETID_Pin, AMPROPERTY_PIN_CATEGORY, NULL, 0, 
        pPinCategory, sizeof(GUID), &cbReturned);

    // If this succeeded, pPinCategory now contains the category GUID.

    pKs->Release();
    return hr;
}
//--------------------------------------------------------------------

i doubt weather it can work in my situation.

if anyone have any ideas or have experiences in this .just help me !

thanks in advance!

[EDIT] Added <pre> tags to the example code - Code-o-mat [/EDIT]
Posted
Updated 5-May-12 6:04am
v2
Comments
Code-o-mat 5-May-12 16:57pm    
Can you tell me why you need the category?
lanhxg 6-May-12 11:21am    
exactly ,i need to connect two fillers by myself but the source filter have two output pins .i want to tell which can connect to Mpeg4s decoder DMO.
Code-o-mat 7-May-12 14:13pm    
Wouldn't simply trying to connect them work? If they can connect, they will, if they can't, they won't, right?

1 solution

PIN_INFO PinInfo ;
pout->QueryPinInfo(&PinInfo);
PinInfo.achName;
//it can be the difference to another pins. and you can get the pin
//name from graphedit!
//wow !
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900