发现一个新的ffdshow-tryout 项目,这个东西不错。集成了ffmpeg,h264等开源项目,又是跨平台的。而且还在不断的更行,我很喜欢这个项目。值得仔细品味研究一下。
- 可以用mingw 和vs2010编译。就像它的wiki上developer 描述的那样就可以。非常简单。
- 用vs2010加graphEdit联合可以进行调试。 grpahEdit is part of window sdk 7.0 /bin
- ffdshow.ax有个配置界面,通过它可以选择该fliter可以解码哪些格式的音视频。还可以打开调试
- 用winDbg可以收集到调试信息,或者直接用vs2010查看调试。
加载的入口:
TffdshowDecVideo::TffdshowDecVideo
下面慢慢讲述代码的结构,和其他开源ffmpeg的接口,以及跨平台的方面。
*** wait with pending attach
Symbol search path is: *** Invalid ***
****************************************************************************
* Symbol loading may be unreliable without a symbol search path. *
* Use .symfix to have the debugger choose a symbol path. *
* After setting your symbol path, use .reload to refresh symbol locations. *
****************************************************************************
Executable search path is:
ModLoad: 01000000 01044000 D:/DXSDK/Utilities/graphedt.exe
ModLoad: 7c900000 7c9b2000 C:/WINDOWS/system32/ntdll.dll
ModLoad: 7c800000 7c8f6000 C:/WINDOWS/system32/kernel32.dll
ModLoad: 73dd0000 73ec1000 C:/WINDOWS/system32/MFC42.DLL
ModLoad: 77c10000 77c68000 C:/WINDOWS/system32/msvcrt.dll
ModLoad: 77f10000 77f59000 C:/WINDOWS/system32/GDI32.dll
ModLoad: 7e410000 7e4a1000 C:/WINDOWS/system32/USER32.dll
ModLoad: 77dd0000 77e6b000 C:/WINDOWS/system32/ADVAPI32.dll
ModLoad: 77e70000 77f03000 C:/WINDOWS/system32/RPCRT4.dll
ModLoad: 77fe0000 77ff1000 C:/WINDOWS/system32/Secur32.dll
ModLoad: 774e0000 7761e000 C:/WINDOWS/system32/ole32.dll
ModLoad: 77120000 771ab000 C:/WINDOWS/system32/OLEAUT32.dll
ModLoad: 763b0000 763f9000 C:/WINDOWS/system32/comdlg32.dll
ModLoad: 5d090000 5d12a000 C:/WINDOWS/system32/COMCTL32.dll
ModLoad: 7c9c0000 7d1d7000 C:/WINDOWS/system32/SHELL32.dll
ModLoad: 77f60000 77fd6000 C:/WINDOWS/system32/SHLWAPI.dll
ModLoad: 77c00000 77c08000 C:/WINDOWS/system32/VERSION.dll
ModLoad: 74810000 7497e000 C:/WINDOWS/system32/QUARTZ.dll
ModLoad: 76b40000 76b6d000 C:/WINDOWS/system32/WINMM.dll
ModLoad: 76390000 763ad000 C:/WINDOWS/system32/IMM32.DLL
ModLoad: 629c0000 629c9000 C:/WINDOWS/system32/LPK.DLL
ModLoad: 74d90000 74dfb000 C:/WINDOWS/system32/USP10.dll
ModLoad: 773d0000 774d3000 C:/WINDOWS/WinSxS/x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.6028_x-ww_61e65202/comctl32.dll
ModLoad: 00930000 009a8000 C:/Program Files/360/360Safe/safemon/safemon.dll
ModLoad: 76380000 76385000 C:/WINDOWS/system32/MSIMG32.dll
ModLoad: 76080000 760e5000 C:/WINDOWS/system32/MSVCP60.dll
ModLoad: 771b0000 7725a000 C:/WINDOWS/system32/WININET.dll
ModLoad: 77a80000 77b15000 C:/WINDOWS/system32/CRYPT32.dll
ModLoad: 77b20000 77b32000 C:/WINDOWS/system32/MSASN1.dll
ModLoad: 76bf0000 76bfb000 C:/WINDOWS/system32/PSAPI.DLL
ModLoad: 71ab0000 71ac7000 C:/WINDOWS/system32/WS2_32.dll
ModLoad: 71aa0000 71aa8000 C:/WINDOWS/system32/WS2HELP.dll
ModLoad: 74720000 7476c000 C:/WINDOWS/system32/MSCTF.dll
ModLoad: 755c0000 755ee000 C:/WINDOWS/system32/msctfime.ime
ModLoad: 00b20000 00de5000 C:/WINDOWS/system32/xpsp2res.dll
ModLoad: 76fd0000 7704f000 C:/WINDOWS/system32/CLBCATQ.DLL
ModLoad: 77050000 77115000 C:/WINDOWS/system32/COMRes.dll
ModLoad: 10000000 10017000 C:/Program Files/Common Files/PPLiveNetwork/kernel/VAProxyD.dll
(454.1308): Break instruction exception - code 80000003 (first chance)
eax=7ffde000 ebx=00000001 ecx=00000002 edx=00000003 esi=00000004 edi=00000005
eip=7c90120e esp=00f2ffcc ebp=00f2fff4 iopl=0 nv up ei pl zr na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00000246
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:/WINDOWS/system32/ntdll.dll -
ntdll!DbgBreakPoint:
7c90120e cc int 3
0:005> g
ModLoad: 00fb0000 00fc4000 C:/Program Files/Dell/QuickSet/dadkeyb.dll
ModLoad: 00fd0000 00fe3000 C:/WINDOWS/system32/hccutils.DLL
ModLoad: 77b40000 77b62000 C:/WINDOWS/system32/appHelp.dll
ModLoad: 05960000 05978000 C:/Program Files/Common Files/TortoiseOverlays/TortoiseOverlays.dll
ModLoad: 05940000 0594e000 C:/Program Files/TortoiseSVN/bin/TortoiseStub.dll
ModLoad: 011c0000 0128a000 C:/Program Files/TortoiseSVN/bin/TortoiseSVN.dll
ModLoad: 76780000 76789000 C:/WINDOWS/system32/SHFOLDER.dll
ModLoad: 6eec0000 6eee2000 C:/Program Files/TortoiseSVN/bin/libapr_tsvn.dll
ModLoad: 71a50000 71a8f000 C:/WINDOWS/system32/MSWSOCK.dll
ModLoad: 78520000 785c3000 C:/WINDOWS/WinSxS/x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4974_x-ww_d889290f/MSVCR90.dll
ModLoad: 6ee60000 6ee8f000 C:/Program Files/TortoiseSVN/bin/libaprutil_tsvn.dll
ModLoad: 76f60000 76f8c000 C:/WINDOWS/system32/WLDAP32.dll
ModLoad: 012c0000 012d2000 C:/Program Files/TortoiseSVN/bin/intl3_tsvn.dll
ModLoad: 78480000 7850e000 C:/WINDOWS/WinSxS/x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4974_x-ww_d889290f/MSVCP90.dll
ModLoad: 77a20000 77a74000 C:/WINDOWS/System32/cscui.dll
ModLoad: 76600000 7661d000 C:/WINDOWS/System32/CSCDLL.dll
ModLoad: 75f80000 7607d000 C:/WINDOWS/system32/browseui.dll
ModLoad: 77920000 77a13000 C:/WINDOWS/system32/SETUPAPI.dll
ModLoad: 5ad70000 5ada8000 C:/WINDOWS/system32/UxTheme.dll
ModLoad: 769c0000 76a74000 C:/WINDOWS/system32/USERENV.dll
ModLoad: 76990000 769b5000 C:/WINDOWS/system32/ntshrui.dll
ModLoad: 76b20000 76b31000 C:/WINDOWS/system32/ATL.DLL
ModLoad: 5b860000 5b8b5000 C:/WINDOWS/system32/NETAPI32.dll
ModLoad: 7e290000 7e403000 C:/WINDOWS/system32/shdocvw.dll
ModLoad: 754d0000 75550000 C:/WINDOWS/system32/CRYPTUI.dll
ModLoad: 76c30000 76c5e000 C:/WINDOWS/system32/WINTRUST.dll
ModLoad: 76c90000 76cb8000 C:/WINDOWS/system32/IMAGEHLP.dll
ModLoad: 74e30000 74e9d000 C:/WINDOWS/system32/RichEd20.dll
ModLoad: 57fd0000 57ff7000 C:/WINDOWS/system32/mpg2splt.ax
ModLoad: 01cf0000 031a6000 D:/opensources/ffshow-tryouts/trunk/bin/ffdshow.ax
ModLoad: 72280000 722aa000 C:/WINDOWS/system32/DINPUT.dll
ModLoad: 4fdd0000 4ff76000 C:/WINDOWS/system32/d3d9.dll
ModLoad: 6d990000 6d996000 C:/WINDOWS/system32/d3d8thk.dll
TffdshowBase::Constructor
TffdshowDecVideo::Constructor
TffdshowDecVideoOutputPin::Constructor
Join filter graph
ModLoad: 73760000 737ab000 C:/WINDOWS/system32/DDRAW.dll
ModLoad: 73bc0000 73bc6000 C:/WINDOWS/system32/DCIMAN32.dll
ModLoad: 73940000 73a10000 C:/WINDOWS/system32/D3DIM700.DLL
TffdshowVideoInputPin::ReceiveConnection
TffdshowVideoInputPin::CheckMediaType: MPG2, 640, 480
TinputPin::SetMediaType
TffdshowDecVideo::SetMediaType Input
TffdshowVideoInputPin::init
TffdshowVideoInputPin::initVideo: MPG2, width:640, height:480, aspectX:4, aspectY:3
TffdshowVideoInputPin::initVideo Codec detected : libmpeg2
initPreset
ModLoad: 032b0000 0337b000 D:/opensources/ffshow-tryouts/trunk/bin/libmpeg2_ff.dll
TffdshowDecVideo::CompleteConnect input
TffdshowDecVideoOutputPin::Connect
TffdshowDecVideo::ConnectCompatibleFilter. Connect FFDShow
TffdshowDecVideo::CheckTransform
TffdshowDecVideo::CheckTransform
TffdshowDecVideo::SetMediaType Output
TffdshowDecVideo::setOutputMediaType
TffdshowDecVideo::setOutputMediaType: colorspace:YV12,adj, biWidth:640, dstStride:640, Bpp:1, dstSize:460800
TffdshowDecVideo::GetMediaType
ModLoad: 6fac0000 7022d000 D:/opensources/ffshow-tryouts/trunk/bin/libavcodec.dll
TffdshowDecVideo::GetMediaType
TffdshowDecVideo::GetMediaType
TffdshowDecVideo::GetMediaType
TffdshowDecVideo::GetMediaType
TffdshowDecVideo::GetMediaType
TffdshowDecVideo::GetMediaType
TffdshowDecVideo::GetMediaType
TffdshowDecVideo::GetMediaType
TffdshowDecVideoOutputPin::CompleteConnect
TffdshowDecVideoDXVA::CompleteConnect output
TffdshowDecVideo::DecideBufferSize
TffdshowDecVideo::CheckTransform
TffdshowDecVideo::CheckTransform
TffOutputQueue::Constructor
Connection succeeded
(454.1164): Break instruction exception - code 80000003 (first chance)
eax=7ffde000 ebx=00000001 ecx=00000002 edx=00000003 esi=00000004 edi=00000005
eip=7c90120e esp=014affcc ebp=014afff4 iopl=0 nv up ei pl zr na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00000246
ntdll!DbgBreakPoint:
7c90120e cc int 3
0:006> g
TffdshowDecVideo::Run thread=1908
TffdshowVideoInputPin::NewSegment
TffdshowDecVideo::NewSegment thread=4812
TffdshowDecVideoOutputPin::DeliverNewSegment tStart 0, tStop 922337203685478
m_Connected->NewSegment
ModLoad: 5e760000 5e76a000 C:/WINDOWS/system32/perfos.dll
Output format change /*means we must wait for a keyframe*/
TffdshowDecVideo::setOutputMediaType
TffdshowDecVideo::setOutputMediaType: colorspace:YV12,adj, biWidth:640, dstStride:640, Bpp:1, dstSize:460800
colorspace conversion: YV12,interlaced -> YV12,interlaced,adj (xvidImage_output)
TimgFilterOutput::process V-RAM access is Direct, t_indirect = 800000, t_direct = 450000
TffdshowDecVideo::Run thread=1908
TffdshowVideoInputPin::NewSegment
TffdshowDecVideo::NewSegment thread=4812
TffdshowDecVideoOutputPin::DeliverNewSegment tStart 0, tStop 922337203685478
m_Connected->NewSegment
TffdshowDecVideo::Run thread=1908
TffdshowVideoInputPin::NewSegment
TffdshowDecVideo::NewSegment thread=4812
TffdshowDecVideoOutputPin::DeliverNewSegment tStart 3933, tStop 922337203685478
m_Connected->NewSegment
TffdshowDecVideo::Run thread=1908
TffdshowVideoInputPin::NewSegment
TffdshowDecVideo::NewSegment thread=4812
TffdshowDecVideoOutputPin::DeliverNewSegment tStart 8537, tStop 922337203685478
m_Connected->NewSegment
TffdshowDecVideo::Run thread=1908
TffdshowVideoInputPin::NewSegment
TffdshowDecVideo::NewSegment thread=4812
TffdshowDecVideoOutputPin::DeliverNewSegment tStart 8537, tStop 922337203685478
m_Connected->NewSegment
TffdshowDecVideo::Run thread=1908
(454.774): C++ EH exception - code e06d7363 (first chance)
(454.774): C++ EH exception - code e06d7363 (first chance)
(454.774): C++ EH exception - code e06d7363 (first chance)
(454.774): C++ EH exception - code e06d7363 (first chance)
ModLoad: 1c800000 1c852000 D:/DXSDK/Utilities/proppage.dll
(454.774): C++ EH exception - code e06d7363 (first chance)
(454.774): C++ EH exception - code e06d7363 (first chance)
TffdshowDecVideo::Stop thread=1908
TffdshowDecVideoOutputPin::Inactive
Removed from filter graph
TffdshowDecVideo::Destructor
TffdshowDecVideoOutputPin::Destructor
eax=00000001 ebx=00000000 ecx=0006fcf8 edx=7c90e514 esi=7c90de6e edi=00000000
eip=7c90e514 esp=0006fde8 ebp=0006fee4 iopl=0 nv up ei pl zr na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000246
ntdll!KiFastSystemCallRet:
7c90e514 c3 ret