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 |