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

Side by Side Diff: mojo/services/html_viewer/webmediaplayer_factory.cc

Issue 887873003: media: Add DefaultMediaPermission. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only Created 5 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 | « mojo/services/html_viewer/webmediaplayer_factory.h ('k') | no next file » | 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 "mojo/services/html_viewer/webmediaplayer_factory.h" 5 #include "mojo/services/html_viewer/webmediaplayer_factory.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 71 }
72 } 72 }
73 73
74 WebMediaPlayerFactory::~WebMediaPlayerFactory() { 74 WebMediaPlayerFactory::~WebMediaPlayerFactory() {
75 } 75 }
76 76
77 blink::WebMediaPlayer* WebMediaPlayerFactory::CreateMediaPlayer( 77 blink::WebMediaPlayer* WebMediaPlayerFactory::CreateMediaPlayer(
78 blink::WebLocalFrame* frame, 78 blink::WebLocalFrame* frame,
79 const blink::WebURL& url, 79 const blink::WebURL& url,
80 blink::WebMediaPlayerClient* client, 80 blink::WebMediaPlayerClient* client,
81 media::MediaPermission* media_permission,
81 blink::WebContentDecryptionModule* initial_cdm, 82 blink::WebContentDecryptionModule* initial_cdm,
82 mojo::Shell* shell) { 83 mojo::Shell* shell) {
83 #if defined(OS_ANDROID) 84 #if defined(OS_ANDROID)
84 return nullptr; 85 return nullptr;
85 #else 86 #else
86 scoped_refptr<media::MediaLog> media_log(new media::MediaLog()); 87 scoped_refptr<media::MediaLog> media_log(new media::MediaLog());
87 scoped_ptr<media::RendererFactory> media_renderer_factory; 88 scoped_ptr<media::RendererFactory> media_renderer_factory;
88 89
89 if (enable_mojo_media_renderer_) { 90 if (enable_mojo_media_renderer_) {
90 ServiceProviderPtr media_renderer_service_provider; 91 ServiceProviderPtr media_renderer_service_provider;
91 shell->ConnectToApplication( 92 shell->ConnectToApplication(
92 "mojo:media", GetProxy(&media_renderer_service_provider), nullptr); 93 "mojo:media", GetProxy(&media_renderer_service_provider), nullptr);
93 media_renderer_factory.reset(new media::MojoRendererFactory(make_scoped_ptr( 94 media_renderer_factory.reset(new media::MojoRendererFactory(make_scoped_ptr(
94 new RendererServiceProvider(media_renderer_service_provider.Pass())))); 95 new RendererServiceProvider(media_renderer_service_provider.Pass()))));
95 } else { 96 } else {
96 media_renderer_factory.reset( 97 media_renderer_factory.reset(
97 new media::DefaultRendererFactory(media_log, 98 new media::DefaultRendererFactory(media_log,
98 nullptr, // No GPU factory. 99 nullptr, // No GPU factory.
99 GetAudioHardwareConfig())); 100 GetAudioHardwareConfig()));
100 } 101 }
101 102
102 media::WebMediaPlayerParams params( 103 media::WebMediaPlayerParams params(
103 media::WebMediaPlayerParams::DeferLoadCB(), CreateAudioRendererSink(), 104 media::WebMediaPlayerParams::DeferLoadCB(), CreateAudioRendererSink(),
104 media_log, GetMediaThreadTaskRunner(), compositor_task_runner_, 105 media_log, GetMediaThreadTaskRunner(), compositor_task_runner_,
105 media::WebMediaPlayerParams::Context3DCB(), initial_cdm); 106 media::WebMediaPlayerParams::Context3DCB(), media_permission,
107 initial_cdm);
106 base::WeakPtr<media::WebMediaPlayerDelegate> delegate; 108 base::WeakPtr<media::WebMediaPlayerDelegate> delegate;
107 109
108 scoped_ptr<media::CdmFactory> cdm_factory(new media::DefaultCdmFactory()); 110 scoped_ptr<media::CdmFactory> cdm_factory(new media::DefaultCdmFactory());
109 111
110 return new media::WebMediaPlayerImpl(frame, client, delegate, 112 return new media::WebMediaPlayerImpl(frame, client, delegate,
111 media_renderer_factory.Pass(), 113 media_renderer_factory.Pass(),
112 cdm_factory.Pass(), params); 114 cdm_factory.Pass(), params);
113 #endif 115 #endif
114 } 116 }
115 117
(...skipping 11 matching lines...) Expand all
127 129
128 scoped_refptr<base::SingleThreadTaskRunner> 130 scoped_refptr<base::SingleThreadTaskRunner>
129 WebMediaPlayerFactory::GetMediaThreadTaskRunner() { 131 WebMediaPlayerFactory::GetMediaThreadTaskRunner() {
130 if (!media_thread_.IsRunning()) 132 if (!media_thread_.IsRunning())
131 media_thread_.Start(); 133 media_thread_.Start();
132 134
133 return media_thread_.message_loop_proxy(); 135 return media_thread_.message_loop_proxy();
134 } 136 }
135 137
136 } // namespace html_viewer 138 } // namespace html_viewer
OLDNEW
« no previous file with comments | « mojo/services/html_viewer/webmediaplayer_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698