Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(607)

Side by Side Diff: chromecast/browser/cast_browser_main_parts.cc

Issue 1140583002: Adds new libcast_media shared library for cast_shell media (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move to media namespace Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chromecast/chromecast.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromecast/browser/cast_browser_main_parts.h" 5 #include "chromecast/browser/cast_browser_main_parts.h"
6 6
7 #include <string> 7 #include <string>
8 #if !defined(OS_ANDROID) 8 #if !defined(OS_ANDROID)
9 #include <signal.h> 9 #include <signal.h>
10 #include <sys/prctl.h> 10 #include <sys/prctl.h>
(...skipping 15 matching lines...) Expand all
26 #include "chromecast/browser/devtools/remote_debugging_server.h" 26 #include "chromecast/browser/devtools/remote_debugging_server.h"
27 #include "chromecast/browser/metrics/cast_metrics_prefs.h" 27 #include "chromecast/browser/metrics/cast_metrics_prefs.h"
28 #include "chromecast/browser/metrics/cast_metrics_service_client.h" 28 #include "chromecast/browser/metrics/cast_metrics_service_client.h"
29 #include "chromecast/browser/pref_service_helper.h" 29 #include "chromecast/browser/pref_service_helper.h"
30 #include "chromecast/browser/service/cast_service.h" 30 #include "chromecast/browser/service/cast_service.h"
31 #include "chromecast/browser/url_request_context_factory.h" 31 #include "chromecast/browser/url_request_context_factory.h"
32 #include "chromecast/common/chromecast_switches.h" 32 #include "chromecast/common/chromecast_switches.h"
33 #include "chromecast/common/platform_client_auth.h" 33 #include "chromecast/common/platform_client_auth.h"
34 #include "chromecast/media/base/key_systems_common.h" 34 #include "chromecast/media/base/key_systems_common.h"
35 #include "chromecast/net/connectivity_checker.h" 35 #include "chromecast/net/connectivity_checker.h"
36 #include "chromecast/public/cast_media_shlib.h"
36 #include "chromecast/public/cast_sys_info.h" 37 #include "chromecast/public/cast_sys_info.h"
37 #include "content/public/browser/browser_thread.h" 38 #include "content/public/browser/browser_thread.h"
38 #include "content/public/browser/gpu_data_manager.h" 39 #include "content/public/browser/gpu_data_manager.h"
39 #include "content/public/common/content_switches.h" 40 #include "content/public/common/content_switches.h"
40 #include "media/audio/audio_manager.h" 41 #include "media/audio/audio_manager.h"
41 #include "media/audio/audio_manager_factory.h" 42 #include "media/audio/audio_manager_factory.h"
42 #include "media/base/browser_cdm_factory.h" 43 #include "media/base/browser_cdm_factory.h"
43 #include "media/base/media_switches.h" 44 #include "media/base/media_switches.h"
44 45
45 #if defined(OS_ANDROID) 46 #if defined(OS_ANDROID)
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 scoped_ptr<CastSysInfo> sys_info = CreateSysInfo(); 276 scoped_ptr<CastSysInfo> sys_info = CreateSysInfo();
276 content::GpuDataManager::GetInstance()->SetGLStrings( 277 content::GpuDataManager::GetInstance()->SetGLStrings(
277 sys_info->GetGlVendor(), sys_info->GetGlRenderer(), 278 sys_info->GetGlVendor(), sys_info->GetGlRenderer(),
278 sys_info->GetGlVersion()); 279 sys_info->GetGlVersion());
279 280
280 scoped_refptr<PrefRegistrySimple> pref_registry(new PrefRegistrySimple()); 281 scoped_refptr<PrefRegistrySimple> pref_registry(new PrefRegistrySimple());
281 metrics::RegisterPrefs(pref_registry.get()); 282 metrics::RegisterPrefs(pref_registry.get());
282 cast_browser_process_->SetPrefService( 283 cast_browser_process_->SetPrefService(
283 PrefServiceHelper::CreatePrefService(pref_registry.get())); 284 PrefServiceHelper::CreatePrefService(pref_registry.get()));
284 285
286 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
285 #if defined(OS_ANDROID) 287 #if defined(OS_ANDROID)
286 ::media::SetMediaClientAndroid(new media::CastMediaClientAndroid()); 288 ::media::SetMediaClientAndroid(new media::CastMediaClientAndroid());
287 #else 289 #else
288 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
289 if (cmd_line->HasSwitch(switches::kEnableCmaMediaPipeline)) 290 if (cmd_line->HasSwitch(switches::kEnableCmaMediaPipeline))
290 ::media::SetBrowserCdmFactory(new media::CastBrowserCdmFactory()); 291 ::media::SetBrowserCdmFactory(new media::CastBrowserCdmFactory());
291 #endif // defined(OS_ANDROID) 292 #endif // defined(OS_ANDROID)
292 293
293 cast_browser_process_->SetConnectivityChecker( 294 cast_browser_process_->SetConnectivityChecker(
294 make_scoped_refptr(new ConnectivityChecker( 295 make_scoped_refptr(new ConnectivityChecker(
295 content::BrowserThread::GetMessageLoopProxyForThread( 296 content::BrowserThread::GetMessageLoopProxyForThread(
296 content::BrowserThread::IO)))); 297 content::BrowserThread::IO))));
297 298
298 url_request_context_factory_->InitializeOnUIThread(); 299 url_request_context_factory_->InitializeOnUIThread();
299 300
300 cast_browser_process_->SetBrowserContext( 301 cast_browser_process_->SetBrowserContext(
301 make_scoped_ptr(new CastBrowserContext(url_request_context_factory_))); 302 make_scoped_ptr(new CastBrowserContext(url_request_context_factory_)));
302 cast_browser_process_->SetMetricsServiceClient( 303 cast_browser_process_->SetMetricsServiceClient(
303 metrics::CastMetricsServiceClient::Create( 304 metrics::CastMetricsServiceClient::Create(
304 content::BrowserThread::GetBlockingPool(), 305 content::BrowserThread::GetBlockingPool(),
305 cast_browser_process_->pref_service(), 306 cast_browser_process_->pref_service(),
306 cast_browser_process_->browser_context()->GetRequestContext())); 307 cast_browser_process_->browser_context()->GetRequestContext()));
307 308
308 if (!PlatformClientAuth::Initialize()) 309 if (!PlatformClientAuth::Initialize())
309 LOG(ERROR) << "PlatformClientAuth::Initialize failed."; 310 LOG(ERROR) << "PlatformClientAuth::Initialize failed.";
310 311
311 cast_browser_process_->SetRemoteDebuggingServer( 312 cast_browser_process_->SetRemoteDebuggingServer(
312 make_scoped_ptr(new RemoteDebuggingServer())); 313 make_scoped_ptr(new RemoteDebuggingServer()));
313 314
315 media::CastMediaShlib::Initialize(cmd_line->argv());
316
314 cast_browser_process_->SetCastService(CastService::Create( 317 cast_browser_process_->SetCastService(CastService::Create(
315 cast_browser_process_->browser_context(), 318 cast_browser_process_->browser_context(),
316 cast_browser_process_->pref_service(), 319 cast_browser_process_->pref_service(),
317 cast_browser_process_->metrics_service_client(), 320 cast_browser_process_->metrics_service_client(),
318 url_request_context_factory_->GetSystemGetter())); 321 url_request_context_factory_->GetSystemGetter()));
319 cast_browser_process_->cast_service()->Initialize(); 322 cast_browser_process_->cast_service()->Initialize();
320 323
321 // Initializing metrics service and network delegates must happen after cast 324 // Initializing metrics service and network delegates must happen after cast
322 // service is intialized because CastMetricsServiceClient and 325 // service is intialized because CastMetricsServiceClient and
323 // CastNetworkDelegate may use components initialized by cast service. 326 // CastNetworkDelegate may use components initialized by cast service.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 void CastBrowserMainParts::PostMainMessageLoopRun() { 364 void CastBrowserMainParts::PostMainMessageLoopRun() {
362 #if defined(OS_ANDROID) 365 #if defined(OS_ANDROID)
363 // Android does not use native main MessageLoop. 366 // Android does not use native main MessageLoop.
364 NOTREACHED(); 367 NOTREACHED();
365 #else 368 #else
366 cast_browser_process_->cast_service()->Finalize(); 369 cast_browser_process_->cast_service()->Finalize();
367 cast_browser_process_->metrics_service_client()->Finalize(); 370 cast_browser_process_->metrics_service_client()->Finalize();
368 cast_browser_process_.reset(); 371 cast_browser_process_.reset();
369 DeregisterKillOnAlarm(); 372 DeregisterKillOnAlarm();
370 #endif 373 #endif
374
375 media::CastMediaShlib::Finalize();
371 } 376 }
372 377
373 } // namespace shell 378 } // namespace shell
374 } // namespace chromecast 379 } // namespace chromecast
OLDNEW
« no previous file with comments | « no previous file | chromecast/chromecast.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698