无法枚举异步文件读取器中的putput引脚 [英] fail to enumerate putput pins in Async File Reader

查看:83
本文介绍了无法枚举异步文件读取器中的putput引脚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在图形上添加了源过滤器,现在我需要单独连接过滤器.
首先,我需要检索源滤波器的输出引脚.

我使用此功能来枚举该引脚,但在pEnum-> Next(1,& pPin,NULL)
pEnum返回S_FALSE.
但HRESULT hr = pFilter-> EnumPins(& pEnum); hr = S_OK.
我对此一无所知.在调用此功能之前,我可能会失去任何东西吗?
并且我在GetUnconnectedPin函数中尝试了另一个源过滤器(AVI/WAV文件源),但是它再次失败.

i have added a source filter to graph ,now i need to conect filters individually.
at first , i need to retrive the source filter output pins .

i used this funtion to enumerate the pin but at the pEnum->Next(1, &pPin, NULL)
the pEnum return S_FALSE.
but HRESULT hr = pFilter->EnumPins(&pEnum); the hr =S_OK.
i have no idea about this .may i have lose any thing before call this funtion
and i have tried another source filter (AVI/WAV File Source)in GetUnconnectedPin funtion but it fails again.

HRESULT GetUnconnectedPin(
    IBaseFilter *pFilter,   // Pointer to the filter.
    PIN_DIRECTION PinDir,   // Direction of the pin to find.
    IPin **ppPin)           // Receives a pointer to the pin.
{
    *ppPin = 0;
    IEnumPins *pEnum = 0;
    IPin *pPin = 0;
    HRESULT hr = pFilter->EnumPins(&pEnum);
    if (FAILED(hr))
    {
        return hr;
    }
   //it works very good untill here
    while (pEnum->Next(1, &pPin, NULL) == S_OK)//here ,pEnum return S_FALSE
    {
        PIN_DIRECTION ThisPinDir;
        pPin->QueryDirection(&ThisPinDir);
        if (ThisPinDir == PinDir)
        {
            IPin *pTmp = 0;
            hr = pPin->ConnectedTo(&pTmp);
            if (SUCCEEDED(hr))  // Already connected, not the pin we want.
            {
                pTmp->Release();
            }
            else  // Unconnected, this is the pin we want.
            {
                pEnum->Release();
                *ppPin = pPin;
                return S_OK;
            }
        }
        pPin->Release();
    }
    pEnum->Release();
    // Did not find a matching pin.
    return E_FAIL;
}



添加了预标记以提高可读性-Code-o-mat [/EDIT]



Added pre tags for better readability - Code-o-mat [/EDIT]

推荐答案

我想将此添加为注释,但是由于该功能似乎消失(我似乎无法弄清楚如何发送私人消息")...
您是否指定了过滤器的输入?如果不是,请尝试指定输入(例如URL或文件名或其他名称)并在此之后进行枚举,可能是没有输入的情况下,过滤器将不会暴露任何输出引脚.
I wanted to add this as a comment, but since that function seems to be gone (and i can''t seem to be able to figure out how to send a "private message")...
Did you specify the input for the filter? If not, try specifying the input (e.g. the URL or file name or whatever) and do the enumerating after that, it''s possible that without an input the filter won''t expose any output pins.


这篇关于无法枚举异步文件读取器中的putput引脚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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