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

Unified Diff: media/mojo/services/service_factory_impl.cc

Issue 1810763002: Connect Mojo AudioDecoder service to the Mojo service factory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@spitzer-audio-service-stub
Patch Set: Passed scoped_refptr by value instead of const ref Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/mojo/services/service_factory_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/service_factory_impl.cc
diff --git a/media/mojo/services/service_factory_impl.cc b/media/mojo/services/service_factory_impl.cc
index 28832be769b3046c43e8def0eec7269b57bfb4cd..21c5274054d74d9c364214507448a88638e43bc8 100644
--- a/media/mojo/services/service_factory_impl.cc
+++ b/media/mojo/services/service_factory_impl.cc
@@ -8,6 +8,7 @@
#include "media/base/cdm_factory.h"
#include "media/base/media_log.h"
#include "media/base/renderer_factory.h"
+#include "media/mojo/services/mojo_audio_decoder_service.h"
#include "media/mojo/services/mojo_cdm_service.h"
#include "media/mojo/services/mojo_media_client.h"
#include "media/mojo/services/mojo_renderer_service.h"
@@ -34,6 +35,22 @@ ServiceFactoryImpl::~ServiceFactoryImpl() {
}
// interfaces::ServiceFactory implementation.
+
+void ServiceFactoryImpl::CreateAudioDecoder(
+ mojo::InterfaceRequest<interfaces::AudioDecoder> request) {
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner(
+ base::MessageLoop::current()->task_runner());
+
+ scoped_ptr<AudioDecoder> audio_decoder =
+ mojo_media_client_->CreateAudioDecoder(task_runner);
+ if (!audio_decoder) {
+ LOG(ERROR) << "AudioDecoder creation failed.";
+ return;
+ }
+
+ new MojoAudioDecoderService(std::move(audio_decoder), std::move(request));
+}
+
void ServiceFactoryImpl::CreateRenderer(
mojo::InterfaceRequest<interfaces::Renderer> request) {
// The created object is owned by the pipe.
« no previous file with comments | « media/mojo/services/service_factory_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698