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

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

Issue 2643733002: Allow to use {FFmpeg/Vpx}VideoDecoder from a UtilityProcess (Closed)
Patch Set: Rebase Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/mojo/services/utility_mojo_media_client.h ('k') | media/renderers/default_renderer_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/utility_mojo_media_client.cc
diff --git a/media/mojo/services/utility_mojo_media_client.cc b/media/mojo/services/utility_mojo_media_client.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7d19e1e39ebf0f91f546d38c070d67cbf6cbe0fb
--- /dev/null
+++ b/media/mojo/services/utility_mojo_media_client.cc
@@ -0,0 +1,41 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "media/mojo/services/utility_mojo_media_client.h"
+
+#include "base/threading/thread_task_runner_handle.h"
+#include "media/base/media.h"
+#include "media/base/video_decoder.h"
+#include "media/mojo/common/mojo_shared_buffer_video_frame.h"
+#include "media/mojo/common/mojo_video_frame_provider.h"
+
+#if !defined(DISABLE_FFMPEG_VIDEO_DECODERS)
+#include "media/filters/ffmpeg_video_decoder.h"
+#endif
+
+namespace media {
+
+UtilityMojoMediaClient::UtilityMojoMediaClient() {}
+
+UtilityMojoMediaClient::~UtilityMojoMediaClient() {}
+
+void UtilityMojoMediaClient::Initialize(service_manager::Connector* connector) {
+ InitializeMediaLibrary();
+}
+
+std::unique_ptr<VideoDecoder> UtilityMojoMediaClient::CreateVideoDecoder(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner,
+ mojom::CommandBufferIdPtr command_buffer_id) {
+ std::unique_ptr<VideoDecoder> decoder;
+
+#if !defined(DISABLE_FFMPEG_VIDEO_DECODERS)
+ std::unique_ptr<MojoVideoFrameProvider> video_frame_provider(
+ new MojoVideoFrameProvider());
+ decoder.reset(new FFmpegVideoDecoder(std::move(video_frame_provider)));
+#endif
+
+ return decoder;
+}
+
+} // namespace media
« no previous file with comments | « media/mojo/services/utility_mojo_media_client.h ('k') | media/renderers/default_renderer_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698