How to add MP3 support from source compilation chromium (CEF3) on Windows

Source: Internet
Author: User


First, what is CEF


CEF, the chromium embeded Framework, is extended by Google's Open source browser project chromium, and can be easily embedded in other programs to get browser functionality.



CEF includes two versions of CEF1 and CEF3, and CEF1 has stopped updating. Because CEF supports only C and C + +, many third-party projects appear to provide support in other languages.



The. NET wrapper class library has CHROMIUMFX, Cefglue, Cefsharp, and other languages see https://bitbucket.org/chromiumembedded/cef# Markdown-header-external-projects.



CEF Version Number Description: 3.2357.1281.gd660177, CEF version number. Branch.Patch.Hash


Second, why to compile CEF


In the use of the CHROMIUMFX+CEF process found that does not support the mainstream MP3, MP4 format, after the search found that because these formats are not open format, for copyright considerations in the Chromium compilation configuration to remove the support for these formats. To add support you must modify the compiled configuration parameters. The online spread by copying the chrome directory under the Ffmpeg.dll replacement method has not been successful, so decided to build.


Third, compile prerequisites


1. Fast and stable VPN (not only FQ but also stable. Download WebKit Single file 4g+, once failed, need to download again



2.64-bit operating system, win7+



3. Hard disk space 40g+, memory 4g+



4. A lot of time (download five or six hours, compile two or three hours



5.vs2013 update4, win8.1 SDK (Express No, update5+ not tested


Iv. compilation process


1. Upgrade VS13 to Update4, install Microsoft Foundation Classes for C + + (MFC library, run vs Install package installation), install win8.1 SDK.



2. Set the system area to English (United States). (Control Panel-zone-manage-change system locale-English (United States)



3. Add Environment variables



Depot_tools_win_toolchain=0



Gyp_generators=ninja,msvs-ninja



gyp_msvs_version=2013



4. Create working directory, as simple as possible, without spaces special characters. Example: E:\ws



5. Download the unzip kit to the working directory and add it to the system environment variable path end. Example: E:\ws\depot_tools



Download: Depot_tools (Original page



6. Download the compilation script to the working directory



Download: automate-git.py



7. Create the source directory under the working directory. Example: E:\ws\source



8. run cmd as Administrator, switch to working directory, run Gclient


1 e: 2 CD E:\ws 3 gclient


Wait to install Python and git for about five or six minutes.



9. Continuation of the implementation


Python automate-git.py


Follow the prompts to select the appropriate configuration parameters



--download-dir Source Download Directory



--DEPOT-TOOLS-DIR Toolkit Catalog



--branch Source Branch (default trunk Main Branch



--CHECKOUT Specifies the patch version (the default most recent submission how to determine checkout is described below



--no-build download does not start the compilation automatically (we need to modify the compilation configuration



--no-update determine that the source code is downloaded and only used when recompiling



--force-build forced compilation (found that compilation does not execute when it is successfully compiled, you can add this



--no-debug-build compile only release version



--no-release-build Compiling Debug versions only


Python automate-git.py--download-dir=e:\ws\source--depot-tools-dir=e:\ws\depot_tools--branch= 2357


10. Wait for the download to complete. Have a sleep or stare at the screen for six hours.


Five, how to determine the--checkout value


If you are sure you want the latest version under the branch, skip this section.



1. Check the hash value of the target version from http://cefbuilds.com/. Example: gd660177 in 3.2357.1281.gd660177



2. Enter the target branch from the https://bitbucket.org/chromiumembedded/cef/branches/. Example: 2357



3. In the commits to retrieve the target hash, note that the version number of the hash is 8 bits, commits 7-bit, you can ignore the first search. Example: gd660177->d660177



4. Click on the corresponding commit to get the checkout value in the Address bar. Example: d66017718b0f0d44da42b706c3c2aa5c0c103852


Vi. Modifying the compilation configuration


1. Open the E:\ws\source\chromium\src\cef\cef.gypi,variables section and add the following to support MP3.


    ' Proprietary_codecs ': 1, ' ffmpeg_branding ': ' Chrome ',


You can also refer to http://blog.csdn.net/chromium_webkit/article/details/8575629 to add more format support .



2. Open the same directory under CEF.GYP, replace according to the following (--to be replaced, + + is replaced, actually this is a patch file, do not know how to manually replace the new version may already contain this patch)


@@ -7,7 +7,7 @@
     ‘pkg-config‘: ‘pkg-config‘,
     ‘chromium_code‘: 1,
     ‘grit_out_dir‘: ‘<(SHARED_INTERMEDIATE_DIR)/cef‘,
-    ‘about_credits_file‘: ‘<(SHARED_INTERMEDIATE_DIR)/about_credits.html‘,
+    ‘cef_about_credits_file‘: ‘<(SHARED_INTERMEDIATE_DIR)/cef_about_credits.html‘,
     ‘framework_name‘: ‘Chromium Embedded Framework‘,
     ‘revision‘: ‘<!(python tools/revision.py)‘,
     ‘chrome_version‘: ‘<!(python ../build/util/version.py -f ../chrome/VERSION -t "@[email protected]@[email protected]@[email protected]@[email protected]")‘,
@@ -659,26 +659,26 @@
       ],
     },
     {
-      ‘target_name‘: ‘about_credits‘,
+      ‘target_name‘: ‘cef_about_credits‘,
       ‘type‘: ‘none‘,
       ‘actions‘: [
         {
           ‘variables‘: {
             ‘generator_path‘: ‘../tools/licenses.py‘,
           },
-          ‘action_name‘: ‘generate_about_credits‘,
+          ‘action_name‘: ‘cef_generate_about_credits‘,
           ‘inputs‘: [
             # TODO(phajdan.jr): make licenses.py print inputs too.
             ‘<(generator_path)‘,
           ],
           ‘outputs‘: [
-            ‘<(about_credits_file)‘,
+            ‘<(cef_about_credits_file)‘,
           ],
           ‘hard_dependency‘: 1,
           ‘action‘: [‘python‘,
                      ‘<(generator_path)‘,
                      ‘credits‘,
-                     ‘<(about_credits_file)‘,
+                     ‘<(cef_about_credits_file)‘,
           ],
           ‘message‘: ‘Generating about:credits.‘,
         },
@@ -689,7 +689,7 @@
       ‘target_name‘: ‘cef_resources‘,
       ‘type‘: ‘none‘,
       ‘dependencies‘: [
-        ‘about_credits‘,
+        ‘cef_about_credits‘,
       ],
       ‘actions‘: [
         {
@@ -697,7 +697,7 @@
           ‘variables‘: {
             ‘grit_grd_file‘: ‘libcef/resources/cef_resources.grd‘,
             ‘grit_additional_defines‘: [
-              ‘-E‘, ‘about_credits_file=<(about_credits_file)‘,
+              ‘-E‘, ‘about_credits_file=<(cef_about_credits_file)‘,
             ],
           },
           ‘includes‘: [ ‘../build/grit_action.gypi‘ ],
VII. Start compilation Build
Python automate-git.py--download-dir=e:\ws\source--depot-tools-dir=e:\ws\depot_tools--branch= 2357 --checkout=d66017718b0f0d44da42b706c3c2aa5c0c103852--no-debug-build--force-build


Wait two or three hours for compilation to complete, accidental error exits are joined--no-update re-execution, will continue the last generation.





Viii. references


Https://bitbucket.org/chromiumfx/chromiumfx/overview



Https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding.md#markdown-header-automated-method



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



http://cefbuilds.com/



http://blog.csdn.net/chromium_webkit/article/details/8575629



















How to compile chromium (CEF3) from source on Windows to join MP3 support


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.