Skip to content

Commit

Permalink
Linux: fix build with disabled libpvx support in media.
Browse files Browse the repository at this point in the history
- rename gyp variables use_libvpx, use_ffmpeg to media_use_libvpx, media_use_ffmpeg so that their scope is clear (matter of hygiene)

- fix build with media_use_libvpx=0 - it excluded some files from the build but other files were still referring to it

Not using e.g. compile_test.py because explicit is better than implicit. compile_test.py was designed for a very specific use case and is a last resort, also not to be used as part of Google Chrome build process. Here it is fixing an existing build option.

BUG=174287

Review URL: https://codereview.chromium.org/12320041

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184981 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
[email protected] committed Feb 27, 2013
1 parent f599f44 commit ca86cc9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
25 changes: 15 additions & 10 deletions media/media.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
'conditions': [
['OS == "android" or OS == "ios"', {
# Android and iOS don't use ffmpeg.
'use_ffmpeg%': 0,
'media_use_ffmpeg%': 0,
# Android and iOS don't use libvpx.
'use_libvpx%': 0,
'media_use_libvpx%': 0,
}, { # 'OS != "android" and OS != "ios"'
'use_ffmpeg%': 1,
'use_libvpx%': 1,
'media_use_ffmpeg%': 1,
'media_use_libvpx%': 1,
}],
# Screen capturer works only on Windows, OSX and Linux.
['OS=="win" or OS=="mac" or OS=="linux"', {
Expand Down Expand Up @@ -434,11 +434,11 @@
'yuv_convert',
],
}],
['use_ffmpeg == 1', {
['media_use_ffmpeg == 1', {
'dependencies': [
'../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
],
}, { # use_ffmpeg == 0
}, { # media_use_ffmpeg == 0
# Exclude the sources that depend on ffmpeg.
'sources!': [
'base/media_posix.cc',
Expand Down Expand Up @@ -466,11 +466,16 @@
'webm/webm_stream_parser.h',
],
}],
['use_libvpx == 1', {
['media_use_libvpx == 1', {
'dependencies': [
'<(DEPTH)/third_party/libvpx/libvpx.gyp:libvpx',
],
}, { # use_libvpx == 0
}, { # media_use_libvpx == 0
'direct_dependent_settings': {
'defines': [
'MEDIA_DISABLE_LIBVPX',
],
},
# Exclude the sources that depend on libvpx.
'sources!': [
'filters/vpx_video_decoder.cc',
Expand Down Expand Up @@ -943,7 +948,7 @@
'yuv_convert',
],
}],
['use_ffmpeg == 1', {
['media_use_ffmpeg == 1', {
'dependencies': [
'../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
],
Expand Down Expand Up @@ -1457,7 +1462,7 @@

],
}],
['use_ffmpeg == 1', {
['media_use_ffmpeg == 1', {
'targets': [
{
'target_name': 'ffmpeg_unittests',
Expand Down
4 changes: 4 additions & 0 deletions webkit/media/filter_helpers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,15 @@ static void AddDefaultDecodersToCollection(
new media::FFmpegVideoDecoder(message_loop);
filter_collection->GetVideoDecoders()->push_back(ffmpeg_video_decoder);

// TODO(phajdan.jr): Remove ifdefs when libvpx with vp9 support is released
// (http://crbug.com/174287) .
#if !defined(MEDIA_DISABLE_LIBVPX)
if (cmd_line->HasSwitch(switches::kEnableVp9Playback)) {
scoped_refptr<media::VpxVideoDecoder> vpx_video_decoder =
new media::VpxVideoDecoder(message_loop);
filter_collection->GetVideoDecoders()->push_back(vpx_video_decoder);
}
#endif // defined(MEDIA_USE_LIBVPX)
}

bool BuildMediaStreamCollection(
Expand Down
1 change: 1 addition & 0 deletions webkit/media/webkit_media.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'dependencies': [
'<(DEPTH)/base/base.gyp:base',
'<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'<(DEPTH)/media/media.gyp:media',
'<(DEPTH)/media/media.gyp:shared_memory_support',
'<(DEPTH)/media/media.gyp:yuv_convert',
'<(DEPTH)/skia/skia.gyp:skia',
Expand Down

0 comments on commit ca86cc9

Please sign in to comment.