`
iihero
  • 浏览: 249501 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

自己动手编译播放器MPC-HC的源码

阅读更多

好久没有关注MPC(Media Player Classic)的源码了。几年前,暴风影音不带广告和捆绑插件时,曾经用过,感觉不错。可是现在这个影音绑了一堆无用的东西,总是不怎么干净。于是干脆自己下了源码,试着编译一下。把它放到了我的下载里头了。

http://iihero.download.csdn.net/ 里头应该能找到。

总共下了三份源码:

1. https://guliverkli.svn.sourceforge.net/svnroot/guliverkli

这个是最早的MPC源码了,作者gabest于 2006.04停止更新

编译顺序如下:

<!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:PunctuationKerning /> <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing> <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery> <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:SpaceForUL /> <w:BalanceSingleByteDoubleByteWidth /> <w:DoNotLeaveBackslashAlone /> <w:ULTrailSpace /> <w:DoNotExpandShiftReturn /> <w:AdjustLineHeightInTable /> <w:BreakWrappedTables /> <w:SnapToGridInCell /> <w:WrapTextWithPunct /> <w:UseAsianBreakRules /> <w:DontGrowAutofit /> <w:UseFELayout /> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]--><!-- /* Font Definitions */ @font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-alt:SimSun; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} @font-face {font-family:"\@宋体"; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; text-align:justify; text-justify:inter-ideograph; mso-pagination:none; font-size:10.5pt; mso-bidi-font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:宋体; mso-font-kerning:1.0pt;} /* Page Definitions */ @page {mso-page-border-surround-header:no; mso-page-border-surround-footer:no;} @page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:36.0pt; mso-footer-margin:36.0pt; mso-paper-source:0;} div.Section1 {page:Section1;} --><!--[if gte mso 10]> <mce:style><! /* Style Definitions */ table.MsoNormalTable {mso-style-name:普通表格; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} --> <!--[endif]-->

1. deccs

2. dsutil

3. ui

4. subpic

5. subtitles

6. filters (for mpc only build those configurations which output a lib, the rest outputs stand-alone filters)

7. apps\mplayerc

 

需要修改的内容:

1subtitles

guliverkli\src\subtitles\CCDecoder.cpp

' ','!','"','#','$','%','&','\'','(',')','?','+',',','-','.','/', //lsp

将 '? 全局替换成 '?' 。
源代码也要作若干改动。

俺使用的是2003版的DirectxSDKa9. 它的baseclass工程使用的是VC6代码格式,需要改动几个文件。

另外,

<!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:PunctuationKerning /> <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing> <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery> <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:SpaceForUL /> <w:BalanceSingleByteDoubleByteWidth /> <w:DoNotLeaveBackslashAlone /> <w:ULTrailSpace /> <w:DoNotExpandShiftReturn /> <w:AdjustLineHeightInTable /> <w:BreakWrappedTables /> <w:SnapToGridInCell /> <w:WrapTextWithPunct /> <w:UseAsianBreakRules /> <w:DontGrowAutofit /> <w:UseFELayout /> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]--> <!--[if gte mso 10]> <mce:style><! /* Style Definitions */ table.MsoNormalTable {mso-style-name:普通表格; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} --> <!--[endif]-->

(a) winnt.h

d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h

在该文件头部添加:

#define POINTER_64 __ptr64// add by peter lee

 

(b) vmr9.h

D:\DXSDK\Include\vmr9.h

MixerPref9_RenderTargetRGB = 0x1000,

MixerPref9_RenderTargetYUV = 0x00002000, //lsp add

 该份源码使用VS2005编译。基本还算顺利。

2. http://sourceforge.net/projects/guliverkli2/

这份代码是第1份的维护版本,编译起来相对方便。整个就一个大工程。先把baseclasses编译好,再编译余下的。

可是1和2编译出来的mpc,功能还是不全。连个flv文件都播放不了。于是我又尝试编译3。要准备的东西就多了。

3. https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk

我准备的有:

1. VS2008标准版

2. 重新下载了SDK for vista

http://www.microsoft.com/downloads/details.aspx?FamilyID=4377f86d-c913-4b5c-b87e-ef72e5b4e065

安装完以后,发觉并不完全可用。

3. DirectX9c (2007版)

http://www.microsoft.com/downloads/details.aspx?FamilyID=529f03be-1339-48c4-bd5a-8506e5acf571

弄完之后,header路径和lib路径也按要求设置完毕,编译就是死活过不去。

同样,按照上边的改改winnt.h。

最后,只差一点了,就是SDK for vista中缺少MDAC相关头文件,建议把VS2008自带的6.0a的sdk头文件中的mdac部分拷一部分过来。

另外,VS2008中缺少ATL_server相关头文件。可以从:

http://atlserver.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=3754

下一份。放到单独的目录里边,再设置好相应的header路径。

于是乎,build完毕。kao, sourceforge上或者源码里头的readme写得可是不够仔细。让人一顿摸索。建议学习或者摸索MPC相关源码的朋友把directx 从2003a到2009March的所有版本打包,platform_SDK从XP_sp2到SDK2008也都打包,放到一起,这样可以很方便的组合在一起。

搞了半天,我就是想弄个flash视频播放的东东。下边是flv视频的截图:




分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics