summaryrefslogtreecommitdiffstats
path: root/content/app
diff options
context:
space:
mode:
authorvrk@chromium.org <vrk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-07 20:33:39 +0000
committervrk@chromium.org <vrk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-07 20:33:39 +0000
commit433df47a83b4a3bf948d2e7234a7748e7b6b87b4 (patch)
treef447143a255feeced823a7320a72e221ac796a85 /content/app
parent10658cb60e12130ceef08c62d966dccac4e6b2f1 (diff)
downloadchromium_src-433df47a83b4a3bf948d2e7234a7748e7b6b87b4.zip
chromium_src-433df47a83b4a3bf948d2e7234a7748e7b6b87b4.tar.gz
chromium_src-433df47a83b4a3bf948d2e7234a7748e7b6b87b4.tar.bz2
Enable audio/video tag in content_shell
Some media initialization work needed to be added to the shell in order for the ffmpeg stubs to be loaded and for the media tags to be recognized. AudioManager also needed to be added to the shell, as the Chromium-equivalent lives in BrowserProcessImpl, and the media code should not assume the MediaInternals has been created. BUG=112043,116906 TEST=content_shell builds and can play the videos in the bug above Review URL: http://codereview.chromium.org/9316077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125442 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/app')
-rw-r--r--content/app/DEPS1
-rw-r--r--content/app/content_main_runner.cc13
2 files changed, 13 insertions, 1 deletions
diff --git a/content/app/DEPS b/content/app/DEPS
index 60dbcf4..321c9ff 100644
--- a/content/app/DEPS
+++ b/content/app/DEPS
@@ -1,3 +1,4 @@
include_rules = [
"+content",
+ "+media/base", # For initializing media library.
]
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc
index 64a0dbb..8d360c3 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -8,10 +8,12 @@
#include "base/command_line.h"
#include "base/debug/debugger.h"
#include "base/debug/trace_event.h"
+#include "base/file_path.h"
#include "base/i18n/icu_util.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/metrics/stats_table.h"
+#include "base/path_service.h"
#include "base/process_util.h"
#include "base/stringprintf.h"
#include "base/string_number_conversions.h"
@@ -27,6 +29,7 @@
#include "content/public/common/sandbox_init.h"
#include "crypto/nss_util.h"
#include "ipc/ipc_switches.h"
+#include "media/base/media.h"
#include "sandbox/src/sandbox_types.h"
#include "ui/base/ui_base_switches.h"
#include "ui/base/ui_base_paths.h"
@@ -197,7 +200,15 @@ int RunZygote(const content::MainFunctionParams& main_function_params,
};
scoped_ptr<content::ZygoteForkDelegate> zygote_fork_delegate;
- if (delegate) zygote_fork_delegate.reset(delegate->ZygoteStarting());
+ if (delegate) {
+ zygote_fork_delegate.reset(delegate->ZygoteStarting());
+ // Each Renderer we spawn will re-attempt initialization of the media
+ // libraries, at which point failure will be detected and handled, so
+ // we do not need to cope with initialization failures here.
+ FilePath media_path;
+ if (PathService::Get(content::DIR_MEDIA_LIBS, &media_path))
+ media::InitializeMediaLibrary(media_path);
+ }
// This function call can return multiple times, once per fork().
if (!ZygoteMain(main_function_params, zygote_fork_delegate.get()))