Commit 9450166c authored by halliwell's avatar halliwell Committed by Commit bot

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}
parent 456ef962
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "chromecast/common/platform_client_auth.h" #include "chromecast/common/platform_client_auth.h"
#include "chromecast/media/base/key_systems_common.h" #include "chromecast/media/base/key_systems_common.h"
#include "chromecast/net/connectivity_checker.h" #include "chromecast/net/connectivity_checker.h"
#include "chromecast/public/cast_media_shlib.h"
#include "chromecast/public/cast_sys_info.h" #include "chromecast/public/cast_sys_info.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/gpu_data_manager.h" #include "content/public/browser/gpu_data_manager.h"
...@@ -286,10 +287,10 @@ void CastBrowserMainParts::PreMainMessageLoopRun() { ...@@ -286,10 +287,10 @@ void CastBrowserMainParts::PreMainMessageLoopRun() {
cast_browser_process_->SetPrefService( cast_browser_process_->SetPrefService(
PrefServiceHelper::CreatePrefService(pref_registry.get())); PrefServiceHelper::CreatePrefService(pref_registry.get()));
const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
::media::SetMediaClientAndroid(new media::CastMediaClientAndroid()); ::media::SetMediaClientAndroid(new media::CastMediaClientAndroid());
#else #else
const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
if (cmd_line->HasSwitch(switches::kEnableCmaMediaPipeline)) if (cmd_line->HasSwitch(switches::kEnableCmaMediaPipeline))
::media::SetBrowserCdmFactory(new media::CastBrowserCdmFactory()); ::media::SetBrowserCdmFactory(new media::CastBrowserCdmFactory());
#endif // defined(OS_ANDROID) #endif // defined(OS_ANDROID)
...@@ -315,6 +316,8 @@ void CastBrowserMainParts::PreMainMessageLoopRun() { ...@@ -315,6 +316,8 @@ void CastBrowserMainParts::PreMainMessageLoopRun() {
cast_browser_process_->SetRemoteDebuggingServer( cast_browser_process_->SetRemoteDebuggingServer(
make_scoped_ptr(new RemoteDebuggingServer())); make_scoped_ptr(new RemoteDebuggingServer()));
media::CastMediaShlib::Initialize(cmd_line->argv());
cast_browser_process_->SetCastService(CastService::Create( cast_browser_process_->SetCastService(CastService::Create(
cast_browser_process_->browser_context(), cast_browser_process_->browser_context(),
cast_browser_process_->pref_service(), cast_browser_process_->pref_service(),
...@@ -372,6 +375,8 @@ void CastBrowserMainParts::PostMainMessageLoopRun() { ...@@ -372,6 +375,8 @@ void CastBrowserMainParts::PostMainMessageLoopRun() {
cast_browser_process_.reset(); cast_browser_process_.reset();
DeregisterKillOnAlarm(); DeregisterKillOnAlarm();
#endif #endif
media::CastMediaShlib::Finalize();
} }
} // namespace shell } // namespace shell
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
'sources': [ 'sources': [
'public/cast_egl_platform.h', 'public/cast_egl_platform.h',
'public/cast_egl_platform_shlib.h', 'public/cast_egl_platform_shlib.h',
'public/cast_media_shlib.h',
'public/cast_sys_info.h', 'public/cast_sys_info.h',
'public/chromecast_export.h', 'public/chromecast_export.h',
'public/graphics_properties_shlib.h', 'public/graphics_properties_shlib.h',
......
// 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
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
'variables': { 'variables': {
'chromium_code': 1, 'chromium_code': 1,
'chromecast_branding%': 'Chromium', 'chromecast_branding%': 'Chromium',
'libcast_media_gyp%': '',
'use_default_libcast_media%': 1,
}, },
'targets': [ 'targets': [
{ {
...@@ -15,6 +17,7 @@ ...@@ -15,6 +17,7 @@
'../../base/base.gyp:base', '../../base/base.gyp:base',
'../../crypto/crypto.gyp:crypto', '../../crypto/crypto.gyp:crypto',
'../../third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h', '../../third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h',
'<(libcast_media_gyp):libcast_media_1.0',
], ],
'sources': [ 'sources': [
'base/decrypt_context.cc', 'base/decrypt_context.cc',
...@@ -294,5 +297,24 @@ ...@@ -294,5 +297,24 @@
'cma/test/run_all_unittests.cc', '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',
],
}
]
}],
], ],
} }
// 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_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment