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

Side by Side Diff: content/renderer/media/media_interface_provider.cc

Issue 2016053003: Add audio_device_id in mojo media ServiceFactory CreateRenderer api. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Minor change based on the comment Created 4 years, 5 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "content/renderer/media/media_interface_provider.h" 5 #include "content/renderer/media/media_interface_provider.h"
6 6
7 #include <string>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "media/mojo/interfaces/content_decryption_module.mojom.h" 10 #include "media/mojo/interfaces/content_decryption_module.mojom.h"
9 #include "media/mojo/interfaces/renderer.mojom.h" 11 #include "media/mojo/interfaces/renderer.mojom.h"
10 #include "mojo/public/cpp/bindings/interface_request.h" 12 #include "mojo/public/cpp/bindings/interface_request.h"
11 #include "services/shell/public/cpp/connect.h" 13 #include "services/shell/public/cpp/connect.h"
12 14
13 namespace content { 15 namespace content {
14 16
15 MediaInterfaceProvider::MediaInterfaceProvider( 17 MediaInterfaceProvider::MediaInterfaceProvider(
16 const ConnectToApplicationCB& connect_to_app_cb) 18 const ConnectToApplicationCB& connect_to_app_cb)
17 : connect_to_app_cb_(connect_to_app_cb) { 19 : connect_to_app_cb_(connect_to_app_cb) {
18 DCHECK(!connect_to_app_cb_.is_null()); 20 DCHECK(!connect_to_app_cb_.is_null());
19 } 21 }
20 22
21 MediaInterfaceProvider::~MediaInterfaceProvider() { 23 MediaInterfaceProvider::~MediaInterfaceProvider() {
22 DCHECK(thread_checker_.CalledOnValidThread()); 24 DCHECK(thread_checker_.CalledOnValidThread());
23 } 25 }
24 26
25 void MediaInterfaceProvider::GetInterface(const mojo::String& interface_name, 27 void MediaInterfaceProvider::GetInterface(const mojo::String& interface_name,
26 mojo::ScopedMessagePipeHandle pipe) { 28 mojo::ScopedMessagePipeHandle pipe) {
27 DVLOG(1) << __FUNCTION__; 29 DVLOG(1) << __FUNCTION__;
28 DCHECK(thread_checker_.CalledOnValidThread()); 30 DCHECK(thread_checker_.CalledOnValidThread());
29 31
30 if (interface_name == media::mojom::ContentDecryptionModule::Name_) { 32 if (interface_name == media::mojom::ContentDecryptionModule::Name_) {
31 GetMediaServiceFactory()->CreateCdm( 33 GetMediaServiceFactory()->CreateCdm(
32 mojo::MakeRequest<media::mojom::ContentDecryptionModule>( 34 mojo::MakeRequest<media::mojom::ContentDecryptionModule>(
33 std::move(pipe))); 35 std::move(pipe)));
34 } else if (interface_name == media::mojom::Renderer::Name_) { 36 } else if (interface_name == media::mojom::Renderer::Name_) {
35 GetMediaServiceFactory()->CreateRenderer( 37 GetMediaServiceFactory()->CreateRenderer(
38 std::string(),
36 mojo::MakeRequest<media::mojom::Renderer>(std::move(pipe))); 39 mojo::MakeRequest<media::mojom::Renderer>(std::move(pipe)));
37 } else if (interface_name == media::mojom::AudioDecoder::Name_) { 40 } else if (interface_name == media::mojom::AudioDecoder::Name_) {
38 GetMediaServiceFactory()->CreateAudioDecoder( 41 GetMediaServiceFactory()->CreateAudioDecoder(
39 mojo::MakeRequest<media::mojom::AudioDecoder>(std::move(pipe))); 42 mojo::MakeRequest<media::mojom::AudioDecoder>(std::move(pipe)));
40 } else if (interface_name == media::mojom::VideoDecoder::Name_) { 43 } else if (interface_name == media::mojom::VideoDecoder::Name_) {
41 GetMediaServiceFactory()->CreateVideoDecoder( 44 GetMediaServiceFactory()->CreateVideoDecoder(
42 mojo::MakeRequest<media::mojom::VideoDecoder>(std::move(pipe))); 45 mojo::MakeRequest<media::mojom::VideoDecoder>(std::move(pipe)));
43 } else { 46 } else {
44 NOTREACHED(); 47 NOTREACHED();
45 } 48 }
(...skipping 15 matching lines...) Expand all
61 } 64 }
62 65
63 void MediaInterfaceProvider::OnConnectionError() { 66 void MediaInterfaceProvider::OnConnectionError() {
64 DVLOG(1) << __FUNCTION__; 67 DVLOG(1) << __FUNCTION__;
65 DCHECK(thread_checker_.CalledOnValidThread()); 68 DCHECK(thread_checker_.CalledOnValidThread());
66 69
67 media_service_factory_.reset(); 70 media_service_factory_.reset();
68 } 71 }
69 72
70 } // namespace content 73 } // namespace content
OLDNEW
« no previous file with comments | « chromecast/browser/media/media_pipeline_host.cc ('k') | media/mojo/interfaces/service_factory.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698