用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;i<InputPinCount;i++)
{
pXBar1->get_CrossbarPinInfo(TRUE,i,&PinIndexRelated,&PhysicalType);
if(PhysConn_Video_Composite==PhysicalType)
{
inPort = i;
break;
}
}
for(int i =0;i<OutputPinCount;i++)
{
pXBar1->get_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);