summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorblundell@chromium.org <blundell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-05 18:53:51 +0000
committerblundell@chromium.org <blundell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-05 18:53:51 +0000
commit3ce214b707d1eee460ff0c187c0b03b135e57e28 (patch)
tree82388ad5264df880604c1f6dc6fc0276c1cc03f0
parent54f3ef56528d34bb89eac89b36b57cd40245d3b8 (diff)
downloadchromium_src-3ce214b707d1eee460ff0c187c0b03b135e57e28.zip
chromium_src-3ce214b707d1eee460ff0c187c0b03b135e57e28.tar.gz
chromium_src-3ce214b707d1eee460ff0c187c0b03b135e57e28.tar.bz2
Build supported media targets on iOS.
Makes the changes required to get media and media_unittests to build successfully for iOS, building only the limited set of files that iOS requires. BUG=None Review URL: https://chromiumcodereview.appspot.com/10919092 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154996 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--build/all.gyp2
-rw-r--r--media/base/media_stub.cc (renamed from media/base/media_android.cc)9
-rw-r--r--media/media.gyp91
3 files changed, 82 insertions, 20 deletions
diff --git a/build/all.gyp b/build/all.gyp
index ce2b014..71c0454 100644
--- a/build/all.gyp
+++ b/build/all.gyp
@@ -12,6 +12,7 @@
'some.gyp:*',
'../base/base.gyp:*',
'../crypto/crypto.gyp:*',
+ '../media/media.gyp:*',
'../net/net.gyp:*',
'../sql/sql.gyp:*',
'../testing/gtest.gyp:*',
@@ -38,7 +39,6 @@
'../gpu/tools/tools.gyp:*',
'../ipc/ipc.gyp:*',
'../jingle/jingle.gyp:*',
- '../media/media.gyp:*',
'../ppapi/ppapi.gyp:*',
'../ppapi/ppapi_internal.gyp:*',
'../printing/printing.gyp:*',
diff --git a/media/base/media_android.cc b/media/base/media_stub.cc
index fcfa90a..a42bbf9 100644
--- a/media/base/media_android.cc
+++ b/media/base/media_stub.cc
@@ -1,18 +1,21 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "media/base/media.h"
+
#include "base/logging.h"
+// This file is intended for platforms that don't need to load any media
+// libraries (e.g., Android and iOS).
namespace media {
bool InitializeMediaLibrary(const FilePath& module_dir) {
- // Android doesn't require any additional media libraries.
return true;
}
-void InitializeMediaLibraryForTesting() {}
+void InitializeMediaLibraryForTesting() {
+}
bool IsMediaLibraryInitialized() {
return true;
diff --git a/media/media.gyp b/media/media.gyp
index a830de9..aed11d3 100644
--- a/media/media.gyp
+++ b/media/media.gyp
@@ -9,6 +9,14 @@
'use_pulseaudio%': 0,
# Override to dynamically link the cras (ChromeOS audio) library.
'use_cras%': 0,
+ 'conditions': [
+ ['OS == "android" or OS == "ios"', {
+ # Android and iOS don't use ffmpeg.
+ 'use_ffmpeg%': 0,
+ }, { # 'OS != "android" and OS != "ios"'
+ 'use_ffmpeg%': 1,
+ }],
+ ],
},
'targets': [
{
@@ -16,12 +24,9 @@
'type': '<(component)',
'dependencies': [
'../base/base.gyp:base',
- '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'../build/temp_gyp/googleurl.gyp:googleurl',
'../crypto/crypto.gyp:crypto',
- 'shared_memory_support',
'../ui/ui.gyp:ui',
- 'yuv_convert',
],
'defines': [
'MEDIA_IMPLEMENTATION',
@@ -175,7 +180,6 @@
'base/filter_collection.cc',
'base/filter_collection.h',
'base/media.h',
- 'base/media_android.cc',
'base/media_log.cc',
'base/media_log.h',
'base/media_log_event.h',
@@ -308,14 +312,19 @@
],
},
'conditions': [
- # Android doesn't use ffmpeg, so make the dependency conditional
- # and exclude the sources which depend on ffmpeg.
- ['OS != "android"', {
+ ['OS != "ios"', {
'dependencies': [
- '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
+ '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
+ 'shared_memory_support',
+ 'yuv_convert',
],
}],
- ['OS == "android"', {
+ ['use_ffmpeg == 1', {
+ 'dependencies': [
+ '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
+ ],
+ }, { # use_ffmpeg == 0
+ # Exclude the sources that depend on ffmpeg.
'sources!': [
'base/media_posix.cc',
'ffmpeg/ffmpeg_common.cc',
@@ -345,7 +354,44 @@
'webm/webm_stream_parser.h',
],
}],
+ ['OS == "ios"', {
+ 'includes': [
+ # For shared_memory_support_sources variable.
+ 'shared_memory_support.gypi',
+ ],
+ 'sources': [
+ 'base/media_stub.cc',
+ # These sources are normally built via a dependency on the
+ # shared_memory_support target, but that target is not built on iOS.
+ # Instead, directly build only the files that are needed for iOS.
+ '<@(shared_memory_support_sources)',
+ ],
+ 'sources/': [
+ # iOS support is limited to audio input only.
+ ['exclude', '.*'],
+ ['include', '^audio/audio_buffers_state\\.'],
+ ['include', '^audio/audio_input_controller\\.'],
+ ['include', '^audio/audio_io\\.h$'],
+ ['include', '^audio/audio_manager\\.'],
+ ['include', '^audio/audio_manager_base\\.'],
+ ['include', '^audio/audio_parameters\\.'],
+ ['include', '^audio/fake_audio_input_stream\\.'],
+ ['include', '^audio/fake_audio_output_stream\\.'],
+ ['include', '^base/channel_layout\\.'],
+ ['include', '^base/media\\.h$'],
+ ['include', '^base/media_stub\\.cc$'],
+ ],
+ 'link_settings': {
+ 'libraries': [
+ '$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework',
+ '$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework',
+ ],
+ },
+ }],
['OS == "android"', {
+ 'sources': [
+ 'base/media_stub.cc',
+ ],
'link_settings': {
'libraries': [
'-lOpenSLES',
@@ -498,8 +544,6 @@
'dependencies': [
'media',
'media_test_support',
- 'shared_memory_support',
- 'yuv_convert',
'../base/base.gyp:base',
'../base/base.gyp:base_i18n',
'../base/base.gyp:test_support_base',
@@ -576,7 +620,18 @@
'webm/webm_parser_unittest.cc',
],
'conditions': [
- ['os_posix==1 and OS!="mac"', {
+ ['OS != "ios"', {
+ 'dependencies': [
+ 'shared_memory_support',
+ 'yuv_convert',
+ ],
+ }],
+ ['use_ffmpeg == 1', {
+ 'dependencies': [
+ '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
+ ],
+ }],
+ ['os_posix==1 and OS!="mac" and OS!="ios"', {
'conditions': [
['linux_use_tcmalloc==1', {
'dependencies': [
@@ -585,6 +640,14 @@
}],
],
}],
+ ['OS == "ios"', {
+ 'sources/': [
+ ['exclude', '.*'],
+ ['include', '^audio/audio_parameters_unittest\\.cc$'],
+ ['include', '^base/mock_reader\\.h$'],
+ ['include', '^base/run_all_unittests\\.cc$'],
+ ],
+ }],
['OS=="android"', {
'sources!': [
'audio/audio_input_volume_unittest.cc',
@@ -609,10 +672,6 @@
],
}],
],
- }, { # OS!=android
- 'dependencies': [
- '../third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
- ],
}],
['OS == "linux"', {
'conditions': [