采集卡连摄像机选择模拟输入源

用AMCAP看,发现了两个输入源,默认的那个总是出不来数据,需要在DS采集模块里设置一下。

	IAMCrossbar *pXBar1 = NULL;
	hr = _dsInfo.GetCpatureGraphBuilder2Ptr()->FindInterface(&LOOK_UPSTREAM_ONLY, NULL,
		_captureFilter,IID_IAMCrossbar, (void**)&pXBar1);
	if(FAILED(hr))
	{
		WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id,
			"IAMCrossbar Failed to FindInterface.");
	}
	else
	{
		long OutputPinCount = 0;
		long InputPinCount = 0;
		long PinIndexRelated;
		long PhysicalType;
		long inPort = 0;
		long outPort = 0;
		pXBar1->get_PinCounts(&OutputPinCount,&InputPinCount);

		for(int i =0;iget_CrossbarPinInfo(TRUE,i,&PinIndexRelated,&PhysicalType);
			if(PhysConn_Video_Composite==PhysicalType)
			{
				inPort = i;
				break;
			}
		}
		for(int i =0;iget_CrossbarPinInfo(FALSE,i,&PinIndexRelated,&PhysicalType);
			if(PhysConn_Video_VideoDecoder==PhysicalType) 
			{
				outPort = i;
				break;
			}
		}
		if(S_OK==pXBar1->CanRoute(outPort,inPort))
		{
			hr = pXBar1->Route(outPort,inPort);
		}
		WEBRTC_TRACE(webrtc::kTraceStateInfo, webrtc::kTraceVideoCapture, _id,
			"IAMCrossbar Route hr = %d.", hr);
	}
	SAFE_RELEASE(pXBar1);

你可能感兴趣的:(Record)