summaryrefslogtreecommitdiffstats
path: root/chromecast
diff options
context:
space:
mode:
authorhalliwell <halliwell@chromium.org>2015-05-13 11:53:12 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-13 18:53:18 +0000
commit9450166c8a88a866715256ec7e7e0362052be25a (patch)
treecf0deadbd4f436267fd92f11cdc82521a097f0b5 /chromecast
parent456ef962da09318e1e3b637d174c836583b7ac32 (diff)
downloadchromium_src-9450166c8a88a866715256ec7e7e0362052be25a.zip
chromium_src-9450166c8a88a866715256ec7e7e0362052be25a.tar.gz
chromium_src-9450166c8a88a866715256ec7e7e0362052be25a.tar.bz2
Adds new libcast_media shared library for cast_shell media
Starting with just the init/finalize functions. BUG= Review URL: https://codereview.chromium.org/1140583002 Cr-Commit-Position: refs/heads/master@{#329687}
Diffstat (limited to 'chromecast')
-rw-r--r--chromecast/browser/cast_browser_main_parts.cc7
-rw-r--r--chromecast/chromecast.gyp1
-rw-r--r--chromecast/media/base/cast_media_default.cc17
-rw-r--r--chromecast/media/media.gyp22
-rw-r--r--chromecast/public/cast_media_shlib.h31
5 files changed, 77 insertions, 1 deletions
diff --git a/chromecast/browser/cast_browser_main_parts.cc b/chromecast/browser/cast_browser_main_parts.cc
index 4678b55..cab3c61 100644
--- a/chromecast/browser/cast_browser_main_parts.cc
+++ b/chromecast/browser/cast_browser_main_parts.cc
@@ -33,6 +33,7 @@
#include "chromecast/common/platform_client_auth.h"
#include "chromecast/media/base/key_systems_common.h"
#include "chromecast/net/connectivity_checker.h"
+#include "chromecast/public/cast_media_shlib.h"
#include "chromecast/public/cast_sys_info.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/gpu_data_manager.h"
@@ -286,10 +287,10 @@ void CastBrowserMainParts::PreMainMessageLoopRun() {
cast_browser_process_->SetPrefService(
PrefServiceHelper::CreatePrefService(pref_registry.get()));
+ const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
#if defined(OS_ANDROID)
::media::SetMediaClientAndroid(new media::CastMediaClientAndroid());
#else
- const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
if (cmd_line->HasSwitch(switches::kEnableCmaMediaPipeline))
::media::SetBrowserCdmFactory(new media::CastBrowserCdmFactory());
#endif // defined(OS_ANDROID)
@@ -315,6 +316,8 @@ void CastBrowserMainParts::PreMainMessageLoopRun() {
cast_browser_process_->SetRemoteDebuggingServer(
make_scoped_ptr(new RemoteDebuggingServer()));
+ media::CastMediaShlib::Initialize(cmd_line->argv());
+
cast_browser_process_->SetCastService(CastService::Create(
cast_browser_process_->browser_context(),
cast_browser_process_->pref_service(),
@@ -372,6 +375,8 @@ void CastBrowserMainParts::PostMainMessageLoopRun() {
cast_browser_process_.reset();
DeregisterKillOnAlarm();
#endif
+
+ media::CastMediaShlib::Finalize();
}
} // namespace shell
diff --git a/chromecast/chromecast.gyp b/chromecast/chromecast.gyp
index bb8e6ec..ed82619 100644
--- a/chromecast/chromecast.gyp
+++ b/chromecast/chromecast.gyp
@@ -38,6 +38,7 @@
'sources': [
'public/cast_egl_platform.h',
'public/cast_egl_platform_shlib.h',
+ 'public/cast_media_shlib.h',
'public/cast_sys_info.h',
'public/chromecast_export.h',
'public/graphics_properties_shlib.h',
diff --git a/chromecast/media/base/cast_media_default.cc b/chromecast/media/base/cast_media_default.cc
new file mode 100644
index 0000000..0cc03d3
--- /dev/null
+++ b/chromecast/media/base/cast_media_default.cc
@@ -0,0 +1,17 @@
+// Copyright 2015 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 "chromecast/public/cast_media_shlib.h"
+
+namespace chromecast {
+namespace media {
+
+void CastMediaShlib::Initialize(const std::vector<std::string>& argv) {
+}
+
+void CastMediaShlib::Finalize() {
+}
+
+} // namespace media
+} // namespace chromecast
diff --git a/chromecast/media/media.gyp b/chromecast/media/media.gyp
index 7aa3d5b..20b1dc0c 100644
--- a/chromecast/media/media.gyp
+++ b/chromecast/media/media.gyp
@@ -6,6 +6,8 @@
'variables': {
'chromium_code': 1,
'chromecast_branding%': 'Chromium',
+ 'libcast_media_gyp%': '',
+ 'use_default_libcast_media%': 1,
},
'targets': [
{
@@ -15,6 +17,7 @@
'../../base/base.gyp:base',
'../../crypto/crypto.gyp:crypto',
'../../third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h',
+ '<(libcast_media_gyp):libcast_media_1.0',
],
'sources': [
'base/decrypt_context.cc',
@@ -294,5 +297,24 @@
'cma/test/run_all_unittests.cc',
],
},
+ ], # end of targets
+ 'conditions': [
+ ['use_default_libcast_media==1', {
+ 'targets': [
+ {
+ 'target_name': 'libcast_media_1.0',
+ 'type': 'shared_library',
+ 'dependencies': [
+ '../../chromecast/chromecast.gyp:cast_public_api'
+ ],
+ 'include_dirs': [
+ '../..',
+ ],
+ 'sources': [
+ 'base/cast_media_default.cc',
+ ],
+ }
+ ]
+ }],
],
}
diff --git a/chromecast/public/cast_media_shlib.h b/chromecast/public/cast_media_shlib.h
new file mode 100644
index 0000000..8429ca1
--- /dev/null
+++ b/chromecast/public/cast_media_shlib.h
@@ -0,0 +1,31 @@
+// Copyright 2015 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.
+
+#ifndef CHROMECAST_PUBLIC_CAST_MEDIA_SHLIB_H_
+#define CHROMECAST_PUBLIC_CAST_MEDIA_SHLIB_H_
+
+#include <string>
+#include <vector>
+
+#include "chromecast_export.h"
+
+namespace chromecast {
+namespace media {
+
+class CHROMECAST_EXPORT CastMediaShlib {
+ public:
+ // Performs platform-specific one-time initialization for media systems and
+ // hardware resources. Called at startup in browser process before main
+ // message loop begins.
+ static void Initialize(const std::vector<std::string>& argv);
+
+ // Performs platform-specific one-time teardown of media systems and hardware
+ // resources. Called at browser process exit.
+ static void Finalize();
+};
+
+} // namespace media
+} // namespace chromecast
+
+#endif // CHROMECAST_PUBLIC_CAST_MEDIA_SHLIB_H_