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 #ifndef MEDIA_MOJO_SERVICES_GPU_MOJO_MEDIA_CLIENT_H_ |
| 6 #define MEDIA_MOJO_SERVICES_GPU_MOJO_MEDIA_CLIENT_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/single_thread_task_runner.h" |
| 14 #include "media/mojo/services/mojo_media_client.h" |
| 15 |
| 16 namespace media { |
| 17 |
| 18 class MediaGpuChannelManager; |
| 19 |
| 20 class GpuMojoMediaClient : public MojoMediaClient { |
| 21 public: |
| 22 // |media_gpu_channel_manager| must only be used on |gpu_task_runner|, which |
| 23 // is expected to be the GPU main thread task runner. |
| 24 GpuMojoMediaClient( |
| 25 scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner, |
| 26 base::WeakPtr<MediaGpuChannelManager> media_gpu_channel_manager); |
| 27 ~GpuMojoMediaClient() final; |
| 28 |
| 29 // MojoMediaClient implementation. |
| 30 std::unique_ptr<AudioDecoder> CreateAudioDecoder( |
| 31 scoped_refptr<base::SingleThreadTaskRunner> task_runner) final; |
| 32 std::unique_ptr<VideoDecoder> CreateVideoDecoder( |
| 33 scoped_refptr<base::SingleThreadTaskRunner> task_runner) final; |
| 34 std::unique_ptr<CdmFactory> CreateCdmFactory( |
| 35 service_manager::mojom::InterfaceProvider* interface_provider) final; |
| 36 |
| 37 private: |
| 38 scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner_; |
| 39 base::WeakPtr<MediaGpuChannelManager> media_gpu_channel_manager_; |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(GpuMojoMediaClient); |
| 42 }; |
| 43 |
| 44 } // namespace media |
| 45 |
| 46 #endif // MEDIA_MOJO_SERVICES_GPU_MOJO_MEDIA_CLIENT_H_ |
OLD | NEW |