| OLD | NEW | 
|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #ifndef MEDIA_MOJO_SERVICES_MOJO_MEDIA_CLIENT_H_ | 5 #ifndef MEDIA_MOJO_SERVICES_MOJO_MEDIA_CLIENT_H_ | 
| 6 #define MEDIA_MOJO_SERVICES_MOJO_MEDIA_CLIENT_H_ | 6 #define MEDIA_MOJO_SERVICES_MOJO_MEDIA_CLIENT_H_ | 
| 7 | 7 | 
| 8 #include <memory> | 8 #include <memory> | 
| 9 #include <string> | 9 #include <string> | 
| 10 | 10 | 
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" | 
| 12 #include "media/mojo/services/media_mojo_export.h" | 12 #include "media/mojo/services/media_mojo_export.h" | 
| 13 | 13 | 
| 14 namespace base { | 14 namespace base { | 
| 15 class SingleThreadTaskRunner; | 15 class SingleThreadTaskRunner; | 
| 16 } | 16 } | 
| 17 | 17 | 
| 18 namespace shell { | 18 namespace shell { | 
| 19 namespace mojom { | 19 namespace mojom { | 
| 20 class InterfaceProvider; | 20 class InterfaceProvider; | 
| 21 } | 21 } | 
| 22 } | 22 } | 
| 23 | 23 | 
| 24 namespace media { | 24 namespace media { | 
| 25 | 25 | 
| 26 class AudioDecoder; | 26 class AudioDecoder; | 
|  | 27 class AudioRendererSink; | 
| 27 class CdmFactory; | 28 class CdmFactory; | 
| 28 class MediaLog; | 29 class MediaLog; | 
| 29 class Renderer; | 30 class RendererFactory; | 
| 30 class VideoDecoder; | 31 class VideoDecoder; | 
|  | 32 class VideoRendererSink; | 
| 31 | 33 | 
| 32 class MEDIA_MOJO_EXPORT MojoMediaClient { | 34 class MEDIA_MOJO_EXPORT MojoMediaClient { | 
| 33  public: | 35  public: | 
| 34   virtual ~MojoMediaClient(); | 36   virtual ~MojoMediaClient(); | 
| 35 | 37 | 
| 36   // Called exactly once before any other method. | 38   // Called exactly once before any other method. | 
| 37   virtual void Initialize(); | 39   virtual void Initialize(); | 
| 38 | 40 | 
| 39   // Called before the host application is scheduled to quit. | 41   // Called before the host application is scheduled to quit. | 
| 40   // The application message loop is still valid at this point, so all clean | 42   // The application message loop is still valid at this point, so all clean | 
| 41   // up tasks requiring the message loop must be completed before returning. | 43   // up tasks requiring the message loop must be completed before returning. | 
| 42   virtual void WillQuit(); | 44   virtual void WillQuit(); | 
| 43 | 45 | 
| 44   virtual std::unique_ptr<AudioDecoder> CreateAudioDecoder( | 46   virtual std::unique_ptr<AudioDecoder> CreateAudioDecoder( | 
| 45       scoped_refptr<base::SingleThreadTaskRunner> task_runner); | 47       scoped_refptr<base::SingleThreadTaskRunner> task_runner); | 
| 46 | 48 | 
| 47   virtual std::unique_ptr<VideoDecoder> CreateVideoDecoder( | 49   virtual std::unique_ptr<VideoDecoder> CreateVideoDecoder( | 
| 48       scoped_refptr<base::SingleThreadTaskRunner> task_runner); | 50       scoped_refptr<base::SingleThreadTaskRunner> task_runner); | 
| 49 | 51 | 
| 50   // TODO(xhwang): Consider creating CDM directly in the client | 52   // Returns the output sink used for rendering audio on |audio_device_id|. | 
| 51   // instead of creating factories. See http://crbug.com/586211 | 53   // May be null if the RendererFactory doesn't need an audio sink. | 
|  | 54   virtual scoped_refptr<AudioRendererSink> CreateAudioRendererSink( | 
|  | 55       const std::string& audio_device_id); | 
| 52 | 56 | 
| 53   // Creates and returns a Renderer. | 57   // Returns the output sink used for rendering video. | 
| 54   virtual std::unique_ptr<Renderer> CreateRenderer( | 58   // May be null if the RendererFactory doesn't need a video sink. | 
| 55       scoped_refptr<base::SingleThreadTaskRunner> media_task_runner, | 59   virtual std::unique_ptr<VideoRendererSink> CreateVideoRendererSink( | 
| 56       scoped_refptr<MediaLog> media_log, | 60       const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); | 
| 57       const std::string& audio_device_id); | 61 | 
|  | 62   // Returns the RendererFactory to be used by MojoRendererService. | 
|  | 63   virtual std::unique_ptr<RendererFactory> CreateRendererFactory( | 
|  | 64       const scoped_refptr<MediaLog>& media_log); | 
| 58 | 65 | 
| 59   // Returns the CdmFactory to be used by MojoCdmService. | 66   // Returns the CdmFactory to be used by MojoCdmService. | 
| 60   virtual std::unique_ptr<CdmFactory> CreateCdmFactory( | 67   virtual std::unique_ptr<CdmFactory> CreateCdmFactory( | 
| 61       shell::mojom::InterfaceProvider* interface_provider); | 68       shell::mojom::InterfaceProvider* interface_provider); | 
| 62 | 69 | 
| 63  protected: | 70  protected: | 
| 64   MojoMediaClient(); | 71   MojoMediaClient(); | 
| 65 }; | 72 }; | 
| 66 | 73 | 
| 67 }  // namespace media | 74 }  // namespace media | 
| 68 | 75 | 
| 69 #endif  // MEDIA_MOJO_SERVICES_MOJO_MEDIA_CLIENT_H_ | 76 #endif  // MEDIA_MOJO_SERVICES_MOJO_MEDIA_CLIENT_H_ | 
| OLD | NEW | 
|---|