当前位置: 首页>>代码示例>>C++>>正文


C++ IFilterGraph::Reconnect方法代码示例

本文整理汇总了C++中IFilterGraph::Reconnect方法的典型用法代码示例。如果您正苦于以下问题:C++ IFilterGraph::Reconnect方法的具体用法?C++ IFilterGraph::Reconnect怎么用?C++ IFilterGraph::Reconnect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IFilterGraph的用法示例。


在下文中一共展示了IFilterGraph::Reconnect方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SetFormat

HRESULT STDMETHODCALLTYPE CVCamPin::SetFormat(AM_MEDIA_TYPE *pmt)
{
    DECLARE_PTR(VIDEOINFOHEADER, pvi, m_mt.pbFormat);
    m_mt = *pmt;
    IPin* pin; 
    ConnectedTo(&pin);
    if(pin)
    {
        IFilterGraph *pGraph = m_pParent->GetGraph();
        pGraph->Reconnect(this);
    }
    return S_OK;
}
开发者ID:my12doom,项目名称:personalProjects,代码行数:13,代码来源:Filter.cpp

示例2: SetFormat

HRESULT STDMETHODCALLTYPE CVCamStream::SetFormat(AM_MEDIA_TYPE *pmt)
{
	//m_mt is the media type of the pin (CMediaType)
	DECLARE_PTR(VIDEOINFOHEADER, pvi, m_mt.pbFormat); // Can probably change this to something more familiar
	m_mt = *pmt;
	IPin* pin;
	ConnectedTo(&pin);
	// if we are currently connected to a pin...
	if (pin)
	{
		IFilterGraph *pGraph = m_pParent->GetGraph(); // get the graph of the parent (What does that do?)
		pGraph->Reconnect(this); // connect the graph
	}
	return S_OK;
}
开发者ID:bsoetaer,项目名称:BBRemote,代码行数:15,代码来源:Filters.cpp

示例3: SetFormat

HRESULT STDMETHODCALLTYPE UVCamStream::SetFormat(AM_MEDIA_TYPE *pmt)
{
	if(!pmt) return E_POINTER;
	CAutoLock cAutoLock(m_pFilter->pStateLock());
	DECLARE_PTR(VIDEOINFOHEADER, pvi, m_mt.pbFormat);
	m_mt = *pmt;
	IPin* pin; 
	ConnectedTo(&pin);
	if(pin)
	{
		IFilterGraph *pGraph = m_pParent->GetGraph();
		pGraph->Reconnect(this);
	}
	return S_OK;
}
开发者ID:ephemeraleclipse,项目名称:ucanvcam,代码行数:15,代码来源:UVCam.cpp

示例4: SetFormat

HRESULT STDMETHODCALLTYPE CVCamStream::SetFormat(AM_MEDIA_TYPE *pmt)
{
	vcamLog(50, "CVCamStream::SetFormat");
    //DECLARE_PTR(VIDEOINFOHEADER, pvi, m_mt.pbFormat);
    m_mt = *pmt;
    IPin* pin; 
    ConnectedTo(&pin);
    if(pin)
    {
        IFilterGraph *pGraph = m_pParent->GetGraph();
        pGraph->Reconnect(this);
		vcamLog(50, "   CVCamStream::SetFormat returning S_OK (reconnected to graph)");
    } else {
		vcamLog(50, "   CVCamStream::SetFormat returning S_OK (pin not connected)");
	}
	SafeRelease(&pin);
    return S_OK;
}
开发者ID:cakiem,项目名称:MultiCam,代码行数:18,代码来源:Filters.cpp

示例5: SetFormat

HRESULT STDMETHODCALLTYPE XnVideoStream::SetFormat(AM_MEDIA_TYPE *pmt)
{
	XN_METHOD_START;

	XN_METHOD_CHECK_POINTER(pmt);
	if (pmt == NULL)
	{
		XN_METHOD_RETURN(E_INVALIDARG);
	}

	xnLogVerbose(XN_MASK_FILTER, "SetFormat was called");

	// check if this format is supported
	CMediaType mediaType(*pmt);
	int index = FindCapability(mediaType);
	if (index == -1)
	{
		XN_METHOD_RETURN(VFW_E_INVALIDMEDIATYPE);
	}

	// keep previous one (so we can rollback)
	int prevPreferred = m_nPreferredMode;

	// set the preferred mode
	m_nPreferredMode = index;

	// try to reconnect (if needed)
	IPin* pin; 
	ConnectedTo(&pin);
	if (pin)
	{
		IFilterGraph *pGraph = ((XnVideoSource*)m_pFilter)->GetGraph();
		HRESULT hr = pGraph->Reconnect(this);
		if (FAILED(hr))
		{
			// rollback
			m_nPreferredMode = prevPreferred;
			XN_METHOD_RETURN(hr);
		}
	}

	XN_METHOD_RETURN(S_OK);
}
开发者ID:Wessi,项目名称:OpenNI,代码行数:43,代码来源:XnVideoStream.cpp

示例6: SetFormat

HRESULT STDMETHODCALLTYPE CVCamStream::SetFormat(AM_MEDIA_TYPE *pmt)
{
	// this is them saying you "must" use this type from now on...unless pmt is NULL that "means" reset...LODO handle it someday...
	if(!pmt) {
	  return S_OK; // *sure* we reset..yeah...sure we did...
	}
	
   if(CheckMediaType((CMediaType *) pmt) != S_OK) {
	return E_FAIL; // just in case :P [FME...]
   }
	
	m_mt = *pmt;

	IPin* pin; 
	ConnectedTo(&pin);
	if(pin)
	{
		IFilterGraph *pGraph = m_pParent->GetGraph();
		pGraph->Reconnect(this);
	}

    return S_OK;
}
开发者ID:taqattack,项目名称:virtual-audio-capture-grabber-device,代码行数:23,代码来源:directshow_stuff.cpp

示例7: SetFormat

// sets fps, size, (etc.) maybe, or maybe just saves it away for later use...
HRESULT STDMETHODCALLTYPE CPushPinDesktop::SetFormat(AM_MEDIA_TYPE *pmt)
{
    CAutoLock cAutoLock(m_pFilter->pStateLock());

	// I *think* it can go back and forth, then.  You can call GetStreamCaps to enumerate, then call
	// SetFormat, then later calls to GetMediaType/GetStreamCaps/EnumMediatypes will all "have" to just give this one
	// though theoretically they could also call EnumMediaTypes, then SetMediaType, and not call SetFormat
	// does flash call both? what order for flash/ffmpeg/vlc calling both?
	// LODO update msdn

	// "they" [can] call this...see msdn for SetFormat

	// NULL means reset to default type...
	if(pmt != NULL)
	{
		if(pmt->formattype != FORMAT_VideoInfo)  // same as {CLSID_KsDataTypeHandlerVideo} 
			return E_FAIL;
	
		// LODO I should do more here...http://msdn.microsoft.com/en-us/library/dd319788.aspx I guess [meh]
	    // LODO should fail if we're already streaming... [?]

		VIDEOINFOHEADER *pvi = (VIDEOINFOHEADER *) pmt->pbFormat;

		if(CheckMediaType((CMediaType *) pmt) != S_OK) {
			return E_FAIL; // just in case :P [did skype get here once?]
		}
		
        // for FMLE's benefit, only accept a setFormat of our "final" width [force setting via registry I guess, otherwise it only shows 80x60 whoa!]	    
		// flash media live encoder uses setFormat to determine widths [?] and then only displays the smallest? oh man that is messed up
        if( pvi->bmiHeader.biWidth != getCaptureDesiredFinalWidth() || 
           pvi->bmiHeader.biHeight != getCaptureDesiredFinalHeight())
        {
          return E_INVALIDARG;
        }

		// ignore other things like cropping requests for now...

		// now save it away...for being able to re-offer it later. We could use SetMediaType but we're just being lazy and re-using m_mt for many things I guess
	    m_mt = *pmt;  

		// The frame rate at which your filter should produce data is determined by the AvgTimePerFrame field of VIDEOINFOHEADER
	    if(pvi->AvgTimePerFrame)
	      m_rtFrameLength = pvi->AvgTimePerFrame; // allow them to set whatever fps they request, i.e. if it's less than the max default.  VLC command line can specify this, for instance...
	    // also setup scaling here, as WFMLE and ffplay and VLC all get here...
	    m_rScreen.right = m_rScreen.left + pvi->bmiHeader.biWidth; // allow them to set whatever "scaling size" they want [set m_rScreen is negotiated right here]
	    m_rScreen.bottom = m_rScreen.top + pvi->bmiHeader.biHeight;
	}

    IPin* pin;
    ConnectedTo(&pin);
    if(pin)
    {
        IFilterGraph *pGraph = m_pParent->GetGraph();
        HRESULT res = pGraph->Reconnect(this);
		if(res != S_OK) // LODO check first, and then just re-use the old one?
		  return res; // else return early...not really sure how to handle this...since we already set m_mt...but it's a pretty rare case I think...
		// plus ours is a weird case...
    } else {
		// graph hasn't been built yet...
		// so we're ok with "whatever" format they pass us, we're just in the setup phase...
	}
	


	// success of some type
	if(pmt == NULL) {		
		m_bFormatAlreadySet = false;
	} else {
		m_bFormatAlreadySet = true;
	}

    return S_OK;
}
开发者ID:dkaminski,项目名称:screen-capture-recorder-to-video-windows-free,代码行数:74,代码来源:PushSourceDesktopAccessories.cpp


注:本文中的IFilterGraph::Reconnect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。