如何分辨滤波器中的输出引脚? [英] how to tell the output pins in a filter?

查看:127
本文介绍了如何分辨滤波器中的输出引脚?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我尝试将源过滤器连接到下一个过滤器,但遇到了问题.
源滤波器现在有两个输出引脚.我在graphedit中检查了它们,发现它们的类别全为零.但是类型(主要类型)有所不同.但是我不知道如何实现.
我偶然发现了一个帖子:

//------------------------------------------------ -----------------

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:

//-----------------------------------------------------------------

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



以及有关此方法的更多详细信息:
http://msdn.microsoft.com/en-us/library/ms787483(VS .85).aspx [ ^ ]



and more details about this method:
http://msdn.microsoft.com/en-us/library/ms787483(VS.85).aspx[^]

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:

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;
}
//--------------------------------------------------------------------


我怀疑天气能否在我的情况下起作用.

如果有人对此有任何想法或经验,请帮助我!

在此先感谢!

添加了< pre>代码示例代码-Code-o-mat [/EDIT]


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!

Added <pre> tags to the example code - Code-o-mat [/EDIT]

推荐答案

PIN_INFO PinInfo;
pout-> QueryPinInfo(&PinInfo);
PinInfo.achName;
//这可能与其他引脚不同.您可以获取图钉
//来自graphedit的名称!
//哇!
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 !


这篇关于如何分辨滤波器中的输出引脚?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆