OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "media/mojo/services/utility_mojo_media_client.h" |
| 6 |
| 7 #include "base/threading/thread_task_runner_handle.h" |
| 8 #include "media/base/media.h" |
| 9 #include "media/base/video_decoder.h" |
| 10 #include "media/mojo/common/mojo_shared_buffer_video_frame.h" |
| 11 |
| 12 #if !defined(DISABLE_FFMPEG_VIDEO_DECODERS) |
| 13 #include "media/filters/ffmpeg_video_decoder.h" |
| 14 #endif |
| 15 |
| 16 namespace media { |
| 17 |
| 18 UtilityMojoMediaClient::UtilityMojoMediaClient() {} |
| 19 |
| 20 UtilityMojoMediaClient::~UtilityMojoMediaClient() {} |
| 21 |
| 22 void UtilityMojoMediaClient::Initialize() { |
| 23 InitializeMediaLibrary(); |
| 24 } |
| 25 |
| 26 std::unique_ptr<VideoDecoder> UtilityMojoMediaClient::CreateVideoDecoder( |
| 27 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { |
| 28 #if !defined(DISABLE_FFMPEG_VIDEO_DECODERS) |
| 29 std::unique_ptr<FFmpegVideoDecoder> decoder(new FFmpegVideoDecoder()); |
| 30 std::unique_ptr<VideoFramePoolDelegate> delegate( |
| 31 new MojoVideoFramePoolDelegate()); |
| 32 decoder->SetVideoFramePoolDelegate(std::move(delegate)); |
| 33 return std::move(decoder); |
| 34 #else |
| 35 return nullptr; |
| 36 #endif |
| 37 } |
| 38 |
| 39 } // namespace media |
OLD | NEW |