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

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

Issue 2115603002: Use FFmpegVideoDecoder from a UtilityProcess (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build error on win Created 4 years 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
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..6ae5d0e33b0b9fad5ce2959d3cd36823f8bfa518
--- /dev/null
+++ b/media/mojo/services/utility_mojo_media_client.cc
@@ -0,0 +1,39 @@
+// Copyright 2016 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"
+
+#if !defined(DISABLE_FFMPEG_VIDEO_DECODERS)
+#include "media/filters/ffmpeg_video_decoder.h"
+#endif
+
+namespace media {
+
+UtilityMojoMediaClient::UtilityMojoMediaClient() {}
+
+UtilityMojoMediaClient::~UtilityMojoMediaClient() {}
+
+void UtilityMojoMediaClient::Initialize() {
+ InitializeMediaLibrary();
+}
+
+std::unique_ptr<VideoDecoder> UtilityMojoMediaClient::CreateVideoDecoder(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
+#if !defined(DISABLE_FFMPEG_VIDEO_DECODERS)
+ std::unique_ptr<FFmpegVideoDecoder> decoder(new FFmpegVideoDecoder());
+ std::unique_ptr<VideoFramePoolDelegate> delegate(
+ new MojoVideoFramePoolDelegate());
+ decoder->SetVideoFramePoolDelegate(std::move(delegate));
+ return std::move(decoder);
+#else
+ return nullptr;
+#endif
+}
+
+} // namespace media

Powered by Google App Engine
This is Rietveld 408576698