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

Side by Side Diff: components/html_viewer/media_factory.cc

Issue 1679573002: Move shell interfaces into the shell.mojom namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@delegate
Patch Set: . Created 4 years, 10 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 | « components/html_viewer/media_factory.h ('k') | components/mus/android_loader.h » ('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 "components/html_viewer/media_factory.h" 5 #include "components/html_viewer/media_factory.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // platform. 49 // platform.
50 return false; 50 return false;
51 } 51 }
52 52
53 void OnGotRemoteIDs(uint32_t remote_id, uint32_t content_handler_id) {} 53 void OnGotRemoteIDs(uint32_t remote_id, uint32_t content_handler_id) {}
54 54
55 } // namespace 55 } // namespace
56 56
57 MediaFactory::MediaFactory( 57 MediaFactory::MediaFactory(
58 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, 58 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner,
59 mojo::Shell* shell) 59 mojo::shell::mojom::Shell* shell)
60 : 60 :
61 #if !defined(OS_ANDROID) 61 #if !defined(OS_ANDROID)
62 media_thread_("Media"), 62 media_thread_("Media"),
63 audio_manager_(media::AudioManager::Create(&fake_audio_log_factory_)), 63 audio_manager_(media::AudioManager::Create(&fake_audio_log_factory_)),
64 audio_hardware_config_( 64 audio_hardware_config_(
65 audio_manager_->GetInputStreamParameters( 65 audio_manager_->GetInputStreamParameters(
66 media::AudioManagerBase::kDefaultDeviceId), 66 media::AudioManagerBase::kDefaultDeviceId),
67 audio_manager_->GetDefaultOutputStreamParameters()), 67 audio_manager_->GetDefaultOutputStreamParameters()),
68 #endif 68 #endif
69 enable_mojo_media_renderer_(base::CommandLine::ForCurrentProcess() 69 enable_mojo_media_renderer_(base::CommandLine::ForCurrentProcess()
70 ->HasSwitch(kEnableMojoMediaRenderer)), 70 ->HasSwitch(kEnableMojoMediaRenderer)),
71 compositor_task_runner_(compositor_task_runner), 71 compositor_task_runner_(compositor_task_runner),
72 shell_(shell) { 72 shell_(shell) {
73 media::InitializeMediaLibrary(); 73 media::InitializeMediaLibrary();
74 } 74 }
75 75
76 MediaFactory::~MediaFactory() { 76 MediaFactory::~MediaFactory() {
77 } 77 }
78 78
79 blink::WebMediaPlayer* MediaFactory::CreateMediaPlayer( 79 blink::WebMediaPlayer* MediaFactory::CreateMediaPlayer(
80 blink::WebLocalFrame* frame, 80 blink::WebLocalFrame* frame,
81 const blink::WebURL& url, 81 const blink::WebURL& url,
82 blink::WebMediaPlayerClient* client, 82 blink::WebMediaPlayerClient* client,
83 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client, 83 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client,
84 blink::WebContentDecryptionModule* initial_cdm, 84 blink::WebContentDecryptionModule* initial_cdm,
85 mojo::Shell* shell) { 85 mojo::shell::mojom::Shell* shell) {
86 #if defined(OS_ANDROID) 86 #if defined(OS_ANDROID)
87 // TODO(xhwang): Get CreateMediaPlayer working on android. 87 // TODO(xhwang): Get CreateMediaPlayer working on android.
88 return nullptr; 88 return nullptr;
89 #else 89 #else
90 scoped_refptr<media::MediaLog> media_log(new media::MediaLog()); 90 scoped_refptr<media::MediaLog> media_log(new media::MediaLog());
91 scoped_ptr<media::RendererFactory> media_renderer_factory; 91 scoped_ptr<media::RendererFactory> media_renderer_factory;
92 92
93 if (enable_mojo_media_renderer_) { 93 if (enable_mojo_media_renderer_) {
94 media_renderer_factory.reset( 94 media_renderer_factory.reset(
95 new media::MojoRendererFactory(GetMediaServiceFactory())); 95 new media::MojoRendererFactory(GetMediaServiceFactory()));
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 scoped_refptr<base::SingleThreadTaskRunner> 178 scoped_refptr<base::SingleThreadTaskRunner>
179 MediaFactory::GetMediaThreadTaskRunner() { 179 MediaFactory::GetMediaThreadTaskRunner() {
180 if (!media_thread_.IsRunning()) 180 if (!media_thread_.IsRunning())
181 media_thread_.Start(); 181 media_thread_.Start();
182 182
183 return media_thread_.task_runner(); 183 return media_thread_.task_runner();
184 } 184 }
185 #endif // !defined(OS_ANDROID) 185 #endif // !defined(OS_ANDROID)
186 186
187 } // namespace html_viewer 187 } // namespace html_viewer
OLDNEW
« no previous file with comments | « components/html_viewer/media_factory.h ('k') | components/mus/android_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698