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:\ws\source\chromium\src\cef\cef.gypi,variables節下添加如下即可支持mp3。

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

問題:

1.屏蔽編譯時的警告,編譯的時候出現警告會暫停編譯

在src\build\common.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:\ws\source\chromium\src\third_party\swiftshader\include\egl\eglext.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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM