1,183
社区成员
发帖
与我相关
我的任务
分享
g_pCapture.FindPin(aSrcFilter.BaseFilter, PINDIR_OUTPUT, @PIN_CATEGORY_CAPTURE, @MEDIATYPE_Video, true, 0, pPinOut);
pPinOut.QueryInterface(IID_IAMStreamConfig,pStreamConfig);
GetMem(pSrcType,SizeOf(TAMMediaType));
if pStreamConfig.GetFormat(pSrcType)=S_OK then begin
pSrcType.majortype:=MEDIATYPE_Video;
pSrcType.subtype:=MEDIASUBTYPE_UYVY;
pSrcType.formattype:=FORMAT_VideoInfo;
pSrcType.bFixedSizeSamples:=true;
pSrctype.bTemporalCompression:=false;
pSrcType.lSampleSize:=MyProfile.ImageWidth*MyProfile.ImageHeight*3;
PVideoInfoHeader(pSrcType.pbFormat).rcSource:=Rect(0,0,MyProfile.ImageWidth,MyProfile.ImageHeight);
PVideoInfoHeader(pSrcType.pbFormat).rcTarget:=Rect(0,0,MyProfile.ImageWidth,MyProfile.ImageHeight);
PVideoInfoHeader(pSrcType.pbFormat).dwBitRate:=1000000;
PVideoInfoHeader(pSrcType.pbFormat).dwBitErrorRate:=0;
//PVideoInfoHeader(pSrcType.pbFormat).AvgTimePerFrame:=Round(10000000 / FileFps);
PVideoInfoHeader(pSrcType.pbFormat).AvgTimePerFrame:=theAvgTimePerFrame;
PVideoInfoHeader(pSrcType.pbFormat).bmiHeader.biWidth:=MyProfile.ImageWidth;
PVideoInfoHeader(pSrcType.pbFormat).bmiHeader.biHeight:=MyProfile.ImageHeight;
PVideoInfoHeader(pSrcType.pbFormat).bmiHeader.biSizeImage:=MyProfile.ImageWidth*MyProfile.ImageHeight*3;
PVideoInfoHeader(pSrcType.pbFormat).bmiHeader.biCompression:=MKFOURCC('U','Y','V','Y');
pStreamConfig.SetFormat(TAMMediaType(pSrcType^));
end;
g_pCapture.FindPin(aSrcFilter.BaseFilter, PINDIR_OUTPUT, @PIN_CATEGORY_CAPTURE, @MEDIATYPE_Video, true, 0, pPinOut);
pPinOut.QueryInterface(IID_IAMStreamConfig,pStreamConfig);
GetMem(pSrcType,SizeOf(TAMMediaType));
if pStreamConfig.GetFormat(pSrcType)=S_OK then begin
pSrcType.majortype:=MEDIATYPE_Video;
pSrcType.subtype:=MEDIASUBTYPE_UYVY;
pSrcType.formattype:=FORMAT_VideoInfo;
pSrcType.bFixedSizeSamples:=true;
pSrctype.bTemporalCompression:=false;
pSrcType.lSampleSize:=MyProfile.ImageWidth*MyProfile.ImageHeight*3;
PVideoInfoHeader(pSrcType.pbFormat).rcSource:=Rect(0,0,MyProfile.ImageWidth,MyProfile.ImageHeight);
PVideoInfoHeader(pSrcType.pbFormat).rcTarget:=Rect(0,0,MyProfile.ImageWidth,MyProfile.ImageHeight);
PVideoInfoHeader(pSrcType.pbFormat).dwBitRate:=1000000;
PVideoInfoHeader(pSrcType.pbFormat).dwBitErrorRate:=0;
//PVideoInfoHeader(pSrcType.pbFormat).AvgTimePerFrame:=Round(10000000 / FileFps);
PVideoInfoHeader(pSrcType.pbFormat).AvgTimePerFrame:=theAvgTimePerFrame;
PVideoInfoHeader(pSrcType.pbFormat).bmiHeader.biWidth:=MyProfile.ImageWidth;
PVideoInfoHeader(pSrcType.pbFormat).bmiHeader.biHeight:=MyProfile.ImageHeight;
PVideoInfoHeader(pSrcType.pbFormat).bmiHeader.biSizeImage:=MyProfile.ImageWidth*MyProfile.ImageHeight*3;
PVideoInfoHeader(pSrcType.pbFormat).bmiHeader.biCompression:=MKFOURCC('U','Y','V','Y');
pStreamConfig.SetFormat(TAMMediaType(pSrcType^));
end;