diff --git a/webrtc/build/common.gypi b/webrtc/build/common.gypi index 14f7e9a4a3..d483f24a53 100644 --- a/webrtc/build/common.gypi +++ b/webrtc/build/common.gypi @@ -137,16 +137,14 @@ # Enabling this may break interop with Android clients that support H264. 'use_objc_h264%': 0, - # Enable this to build H.264 encoder/decoder using third party libraries. - # Encoding uses OpenH264 and decoding uses FFmpeg. Because of this, OpenH264 - # and FFmpeg have to be correctly enabled separately. - # - use_openh264=1 is required for OpenH264 targets to be defined. - # - ffmpeg_branding=Chrome is one way to support H.264 decoding in FFmpeg. - # FFmpeg can be built with/without H.264 support, see 'ffmpeg_branding'. - # Without it, it compiles but H264DecoderImpl fails to initialize. + # Enable this to build OpenH264 encoder/FFmpeg decoder. This is supported on + # all platforms except iOS. Because FFmpeg can be built with/without H.264 + # support, |ffmpeg_branding| has to separately be set to a value that + # includes H.264, for example "Chrome". If FFmpeg is built without H.264, + # compilation succeeds but |H264DecoderImpl| fails to initialize. # CHECK THE OPENH264, FFMPEG AND H.264 LICENSES/PATENTS BEFORE BUILDING. # http://www.openh264.org, https://www.ffmpeg.org/ - 'use_third_party_h264%': 0, # TODO(hbos): To be used in follow-up CL(s). + 'rtc_use_h264%': 0, # TODO(hbos): enc/dec in follow up CL(s). 'conditions': [ ['build_with_chromium==1', { diff --git a/webrtc/build/webrtc.gni b/webrtc/build/webrtc.gni index ed8894f3c9..f76aa36508 100644 --- a/webrtc/build/webrtc.gni +++ b/webrtc/build/webrtc.gni @@ -91,16 +91,14 @@ declare_args() { # Enabling this may break interop with Android clients that support H264. rtc_use_objc_h264 = false - # Enable this to build H.264 encoder/decoder using third party libraries. - # Encoding uses OpenH264 and decoding uses FFmpeg. Because of this, OpenH264 - # and FFmpeg have to be correctly enabled separately. - # - use_openh264=true is required for OpenH264 targets to be defined. - # - ffmpeg_branding="Chrome" is one way to support H.264 decoding in FFmpeg. - # FFmpeg can be built with/without H.264 support, see 'ffmpeg_branding'. - # Without it, it compiles but H264DecoderImpl fails to initialize. + # Enable this to build OpenH264 encoder/FFmpeg decoder. This is supported on + # all platforms except iOS. Because FFmpeg can be built with/without H.264 + # support, |ffmpeg_branding| has to separately be set to a value that + # includes H.264, for example "Chrome". If FFmpeg is built without H.264, + # compilation succeeds but |H264DecoderImpl| fails to initialize. # CHECK THE OPENH264, FFMPEG AND H.264 LICENSES/PATENTS BEFORE BUILDING. # http://www.openh264.org, https://www.ffmpeg.org/ - use_third_party_h264 = false # TODO(hbos): To be used in follow-up CL(s). + rtc_use_h264 = false # TODO(hbos): enc/dec in follow up CL(s). } # A second declare_args block, so that declarations within it can diff --git a/webrtc/modules/video_coding/BUILD.gn b/webrtc/modules/video_coding/BUILD.gn index 32ac627ed2..74d1979599 100644 --- a/webrtc/modules/video_coding/BUILD.gn +++ b/webrtc/modules/video_coding/BUILD.gn @@ -137,12 +137,11 @@ source_set("webrtc_h264") { "../../system_wrappers", ] - if (use_third_party_h264) { - # Dependency added so that variables use_openh264 and ffmpeg_branding are - # recognized build arguments (avoid "Build argument has no effect" error). - # The variables and dependencies will be used for real as soon as - # https://codereview.webrtc.org/1306813009/ lands. In the meantime, the - # build arguments are to be used by waterfall/trybots. + if (rtc_use_h264) { + # Dependency for sake of compiling and so that variables use_openh264 and + # ffmpeg_branding are recognized build arguments (avoid "Build argument has + # no effect" error). The variables and dependencies will be used for real as + # soon as https://codereview.webrtc.org/1306813009/ lands. deps += [ "//third_party/ffmpeg:ffmpeg", "//third_party/openh264:encoder", diff --git a/webrtc/modules/video_coding/codecs/h264/h264.gypi b/webrtc/modules/video_coding/codecs/h264/h264.gypi index a20865c3aa..e0c32de0f8 100644 --- a/webrtc/modules/video_coding/codecs/h264/h264.gypi +++ b/webrtc/modules/video_coding/codecs/h264/h264.gypi @@ -23,6 +23,14 @@ 'h264_objc.mm', ], }], + ['rtc_use_h264==1', { + # Dependency for sake of compiling The dependencies will be used for + # real as soon as https://codereview.webrtc.org/1306813009/ lands. + 'dependencies': [ + '<(DEPTH)/third_party/ffmpeg/ffmpeg.gyp:ffmpeg', + '<(DEPTH)/third_party/openh264/openh264.gyp:openh264_encoder', + ], + }], ], 'sources': [ 'h264.cc',