window 下编译cef 内核 加入mp3/mp4 支持

下载 depot_tools 解压,加入到环境变量

进入cmd(管理员)运行 gclient 获取 python和git,svn,设置python环境变量

创建新文件夹

mkdir chromium && cd chromium

把 automate-git.py 保存到文件夹根目录

然后运行命令:

set GYP_GENERATORS=ninja,msvs-ninja
set GYP_MSVS_VERSION=2013 
set GYP_DEFINES=proprietary_codecs=1 ffmpeg_branding=Chrome
python automate
-git.py --download-dir=chromium --depot-tools-dir=depot_tools路径 --branch=2623 --no-debug-build --force-build --no-update

* GYP_MSVS_VERSION是vs 的版本 2013/2015

* 如果是获取主分支可以去掉 --branch参数

可以用set GYP_DEFINES=proprietary_codecs=1 ffmpeg_branding=Chrome 这种方式设置支持MP3、MP4也可以用修改文件的方法:

打开e:wssourcechromiumsrccefcef.gypi,variables节下添加如下即可支持mp3。

'proprietary_codecs': 1,
'ffmpeg_branding': 'Chrome',

问题:

1.屏蔽编译时的警告,编译的时候出现警告会暂停编译

在srcuildcommon.gypi文件中:(不存在的加入进去)

msvs_disabled_warnings': 

          4091,4127,4351,4355,4503,4589,4611,4100,4121,4244, 4505,4510,4512,4610, 4838, 4995, 4996,
          4334,4819,4396, 4125,4130,4131,4189, 4201, 4238,4245,4310,4428, 4481,4530, 4701, 4702,4706,
     4067,4800,4251,4702,4456, 4457, 4458, 4459,4312,

],

2.gl_bindings_skia_in_process.cc(684) : error C2679: binary '=' : no operator found which takes a right-hand operand of ty

pe 'overloaded-function' (or there is no acceptable conversion)
解决:gl_bindings_skia_in_process.cc和 gl_bindings_skia_in_process.hh已经死代码了。

ui/gl/BUILD.gn和gl.gyp去除这两个引用详见https://codereview.chromium.org/1673323002

3.egl语法/类型错误

#解决egl语法错误
#修改h:wssourcechromiumsrc hird_partyswiftshaderincludeegleglext.h
#在62行后加入
typedef EGLAttribKHR EGLAttrib; 

已经生成的一个:

内核版本:49 分支2623

http://pan.baidu.com/s/1o7QmQKi

cefsharp版本:49

https://github.com/cefsharp/CefSharp/tree/cefsharp/49

参考链接:

http://blog.csdn.net/ljm198745/article/details/40502599

https://gist.github.com/apla/f7ca2aeda6f15b41f60d2d1f29be1de0

https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md

https://github.com/cefsharp/cef-binary/wiki/Building-Cef-from-source

http://www.cnblogs.com/lonelyonline/p/4404844.html

http://blog.csdn.net/qsy2000/article/details/52845895

原文地址:https://www.cnblogs.com/longxiang92/p/6141653.html