rtc_use_h264 flag (replacing use_third_party_h264 flag) for building OpenH264/FFmpeg, false by default but can be overridden in supplement.gypi and build_overrides/webrtc.gni.

BUG=468365
NOTRY=True

Review URL: https://codereview.webrtc.org/1601813005

Cr-Commit-Position: refs/heads/master@{#11333}
This commit is contained in:
hbos
2016-01-21 03:34:40 -08:00
committed by Commit bot
parent 0b98cf72c6
commit 902c03e724
4 changed files with 25 additions and 22 deletions

View File

@ -137,16 +137,14 @@
# Enabling this may break interop with Android clients that support H264. # Enabling this may break interop with Android clients that support H264.
'use_objc_h264%': 0, 'use_objc_h264%': 0,
# Enable this to build H.264 encoder/decoder using third party libraries. # Enable this to build OpenH264 encoder/FFmpeg decoder. This is supported on
# Encoding uses OpenH264 and decoding uses FFmpeg. Because of this, OpenH264 # all platforms except iOS. Because FFmpeg can be built with/without H.264
# and FFmpeg have to be correctly enabled separately. # support, |ffmpeg_branding| has to separately be set to a value that
# - use_openh264=1 is required for OpenH264 targets to be defined. # includes H.264, for example "Chrome". If FFmpeg is built without H.264,
# - ffmpeg_branding=Chrome is one way to support H.264 decoding in FFmpeg. # compilation succeeds but |H264DecoderImpl| fails to initialize.
# FFmpeg can be built with/without H.264 support, see 'ffmpeg_branding'.
# Without it, it compiles but H264DecoderImpl fails to initialize.
# CHECK THE OPENH264, FFMPEG AND H.264 LICENSES/PATENTS BEFORE BUILDING. # CHECK THE OPENH264, FFMPEG AND H.264 LICENSES/PATENTS BEFORE BUILDING.
# http://www.openh264.org, https://www.ffmpeg.org/ # 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': [ 'conditions': [
['build_with_chromium==1', { ['build_with_chromium==1', {

View File

@ -91,16 +91,14 @@ declare_args() {
# Enabling this may break interop with Android clients that support H264. # Enabling this may break interop with Android clients that support H264.
rtc_use_objc_h264 = false rtc_use_objc_h264 = false
# Enable this to build H.264 encoder/decoder using third party libraries. # Enable this to build OpenH264 encoder/FFmpeg decoder. This is supported on
# Encoding uses OpenH264 and decoding uses FFmpeg. Because of this, OpenH264 # all platforms except iOS. Because FFmpeg can be built with/without H.264
# and FFmpeg have to be correctly enabled separately. # support, |ffmpeg_branding| has to separately be set to a value that
# - use_openh264=true is required for OpenH264 targets to be defined. # includes H.264, for example "Chrome". If FFmpeg is built without H.264,
# - ffmpeg_branding="Chrome" is one way to support H.264 decoding in FFmpeg. # compilation succeeds but |H264DecoderImpl| fails to initialize.
# FFmpeg can be built with/without H.264 support, see 'ffmpeg_branding'.
# Without it, it compiles but H264DecoderImpl fails to initialize.
# CHECK THE OPENH264, FFMPEG AND H.264 LICENSES/PATENTS BEFORE BUILDING. # CHECK THE OPENH264, FFMPEG AND H.264 LICENSES/PATENTS BEFORE BUILDING.
# http://www.openh264.org, https://www.ffmpeg.org/ # 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 # A second declare_args block, so that declarations within it can

View File

@ -137,12 +137,11 @@ source_set("webrtc_h264") {
"../../system_wrappers", "../../system_wrappers",
] ]
if (use_third_party_h264) { if (rtc_use_h264) {
# Dependency added so that variables use_openh264 and ffmpeg_branding are # Dependency for sake of compiling and so that variables use_openh264 and
# recognized build arguments (avoid "Build argument has no effect" error). # ffmpeg_branding are recognized build arguments (avoid "Build argument has
# The variables and dependencies will be used for real as soon as # no effect" error). The variables and dependencies will be used for real as
# https://codereview.webrtc.org/1306813009/ lands. In the meantime, the # soon as https://codereview.webrtc.org/1306813009/ lands.
# build arguments are to be used by waterfall/trybots.
deps += [ deps += [
"//third_party/ffmpeg:ffmpeg", "//third_party/ffmpeg:ffmpeg",
"//third_party/openh264:encoder", "//third_party/openh264:encoder",

View File

@ -23,6 +23,14 @@
'h264_objc.mm', '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': [ 'sources': [
'h264.cc', 'h264.cc',