本文介绍了引脚断开功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我断开引脚时,输入引脚的功能是什么?

MSDN:
CBasePin :: BreakConnect
备注
当无法建立与引脚的连接或调用CBasePin :: Disconnect时,将调用此成员函数.在这种情况下,必须撤消在连接过程中执行的所有操作.您可以重写此成员函数以释放对连接期间创建的接口的任何引用.

但是不调用此函数.这意味着
CBasePin :: Disconnect不被调用.

我在图形编辑中断开了引脚.我想在断开连接后删除大头针.当我连接引脚时,我会添加新的引脚,以连接其他流.我在3dtv.at立体声转换滤镜中看到了这一点.我使用函数CBasePin :: BreakConnect.但是,当我断开连接时,再次连接并断开引脚,就会出现异常.对于过滤器,情况相同.这是否意味着该问题现在在Graph编辑中?早期提到的过滤器效果很好.

这是代码:

HRESULT CTransformerVideoInputPin::BreakConnect(void){
    HRESULT hr = CBaseInputPin::BreakConnect();
    if (this->IsConnected())
    {
        m_pVideoTransformerFilter->InputCloseConnection(this);
    }
	m_pVideoTransformerFilter->InputDelete(this);
    return hr;
}

HRESULT CVideoTransformerFilter::InputDelete( CTransformerVideoInputPin* lpIpin )
{
    for(std::vector<CTransformerVideoInputPin*>::iterator local_iterator=m_Arrinputpin.begin();local_iterator!=m_Arrinputpin.end();local_iterator++)
    {
        if (*local_iterator==lpIpin)
        {
            m_Arrinputpin.erase(local_iterator);
//          delete lpIpin;
            break;
        }
    }
    return S_OK;
}



如何删除lpIpin?
一切正常,但删除固定对象.

解决方案


What function of input pin is called, when I disconnect pin?

MSDN:
CBasePin::BreakConnect
Remarks
This member function is called when a connection to the pin cannot be made or when CBasePin::Disconnect is called. In this case, it is necessary to undo anything performed during the connection process. You can override this member function to release any references to interfaces that were made during the connection.

But this function is not called. This means, that
CBasePin::Disconnect is not called.

I disconnect pin in Graph edit. I want to delete pin after disconnecting. When i connect pin, i add new pin, to connect additional stream. I saw this in 3dtv.at Stereo Transformation filter. I use function CBasePin::BreakConnect. But, when i disconnect, connect and disconnect pin again, i get exception. The same situation is with mensioned filter. Does it mean, that problem is now in Graph edit? Earlies mensioned filter worked fine.

Here is the code:

HRESULT CTransformerVideoInputPin::BreakConnect(void){
    HRESULT hr = CBaseInputPin::BreakConnect();
    if (this->IsConnected())
    {
        m_pVideoTransformerFilter->InputCloseConnection(this);
    }
	m_pVideoTransformerFilter->InputDelete(this);
    return hr;
}

HRESULT CVideoTransformerFilter::InputDelete( CTransformerVideoInputPin* lpIpin )
{
    for(std::vector<CTransformerVideoInputPin*>::iterator local_iterator=m_Arrinputpin.begin();local_iterator!=m_Arrinputpin.end();local_iterator++)
    {
        if (*local_iterator==lpIpin)
        {
            m_Arrinputpin.erase(local_iterator);
//          delete lpIpin;
            break;
        }
    }
    return S_OK;
}



How can i delete lpIpin?
Everything works, but deleting pin object.

解决方案



这篇关于引脚断开功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-13 02:27