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

Side by Side Diff: media/mojo/services/mojo_media_client.h

Issue 1231623003: media: Support CdmFactory in MojoMediaClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months 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 unified diff | Download patch
OLDNEW
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 "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
11 #include "media/base/audio_decoder.h" 11 #include "media/base/audio_decoder.h"
12 #include "media/base/audio_hardware_config.h" 12 #include "media/base/audio_hardware_config.h"
13 #include "media/base/audio_renderer_sink.h" 13 #include "media/base/audio_renderer_sink.h"
14 #include "media/base/cdm_factory.h"
14 #include "media/base/media_log.h" 15 #include "media/base/media_log.h"
15 #include "media/base/renderer_factory.h" 16 #include "media/base/renderer_factory.h"
16 #include "media/base/video_decoder.h" 17 #include "media/base/video_decoder.h"
17 #include "media/base/video_renderer_sink.h" 18 #include "media/base/video_renderer_sink.h"
18 19
19 namespace media { 20 namespace media {
20 21
21 // Interface class which clients will extend to override (at compile time) the 22 // Interface class which clients will extend to override (at compile time) the
22 // default configurations for mojo media services. 23 // default configurations for mojo media services.
23 class PlatformMojoMediaClient { 24 class PlatformMojoMediaClient {
(...skipping 19 matching lines...) Expand all
43 const scoped_refptr<MediaLog>& media_log) = 0; 44 const scoped_refptr<MediaLog>& media_log) = 0;
44 45
45 // The output sink used for rendering audio or video respectively. 46 // The output sink used for rendering audio or video respectively.
46 virtual scoped_refptr<AudioRendererSink> GetAudioRendererSink() = 0; 47 virtual scoped_refptr<AudioRendererSink> GetAudioRendererSink() = 0;
47 virtual scoped_ptr<VideoRendererSink> GetVideoRendererSink( 48 virtual scoped_ptr<VideoRendererSink> GetVideoRendererSink(
48 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) = 0; 49 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) = 0;
49 50
50 // The platform's audio hardware configuration. Note, this must remain 51 // The platform's audio hardware configuration. Note, this must remain
51 // constant for the lifetime of the PlatformMojoMediaClient. 52 // constant for the lifetime of the PlatformMojoMediaClient.
52 virtual const AudioHardwareConfig& GetAudioHardwareConfig() = 0; 53 virtual const AudioHardwareConfig& GetAudioHardwareConfig() = 0;
54
55 // Returns the CdmFactory to be used by MojoCdmService.
ddorwin 2015/07/09 18:13:04 Ditto on creating a new instance.
xhwang 2015/07/09 21:16:31 Acknowledged.
56 virtual scoped_ptr<CdmFactory> GetCdmFactory() = 0;
53 }; 57 };
54 58
55 class MojoMediaClient { 59 class MojoMediaClient {
56 public: 60 public:
57 // Returns an instance of the MojoMediaClient object. Only one instance will 61 // Returns an instance of the MojoMediaClient object. Only one instance will
58 // exist per process. 62 // exist per process.
59 static MojoMediaClient* Get(); 63 static MojoMediaClient* Get();
60 64
61 // Copy of the PlatformMojoMediaClient interface. 65 // Copy of the PlatformMojoMediaClient interface.
62 scoped_ptr<RendererFactory> GetRendererFactory( 66 scoped_ptr<RendererFactory> GetRendererFactory(
63 const scoped_refptr<MediaLog>& media_log); 67 const scoped_refptr<MediaLog>& media_log);
64 ScopedVector<AudioDecoder> GetAudioDecoders( 68 ScopedVector<AudioDecoder> GetAudioDecoders(
65 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, 69 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner,
66 const scoped_refptr<MediaLog>& media_log); 70 const scoped_refptr<MediaLog>& media_log);
67 ScopedVector<VideoDecoder> GetVideoDecoders( 71 ScopedVector<VideoDecoder> GetVideoDecoders(
68 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, 72 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner,
69 const scoped_refptr<MediaLog>& media_log); 73 const scoped_refptr<MediaLog>& media_log);
70 scoped_refptr<AudioRendererSink> GetAudioRendererSink(); 74 scoped_refptr<AudioRendererSink> GetAudioRendererSink();
71 scoped_ptr<VideoRendererSink> GetVideoRendererSink( 75 scoped_ptr<VideoRendererSink> GetVideoRendererSink(
72 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); 76 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
73 const AudioHardwareConfig& GetAudioHardwareConfig(); 77 const AudioHardwareConfig& GetAudioHardwareConfig();
78 scoped_ptr<CdmFactory> GetCdmFactory();
74 79
75 private: 80 private:
76 friend struct base::DefaultLazyInstanceTraits<MojoMediaClient>; 81 friend struct base::DefaultLazyInstanceTraits<MojoMediaClient>;
77 82
78 MojoMediaClient(); 83 MojoMediaClient();
79 ~MojoMediaClient(); 84 ~MojoMediaClient();
80 85
81 scoped_ptr<PlatformMojoMediaClient> mojo_media_client_; 86 scoped_ptr<PlatformMojoMediaClient> mojo_media_client_;
82 87
83 DISALLOW_COPY_AND_ASSIGN(MojoMediaClient); 88 DISALLOW_COPY_AND_ASSIGN(MojoMediaClient);
84 }; 89 };
85 90
86 } // namespace media 91 } // namespace media
87 92
88 #endif // MEDIA_MOJO_SERVICES_MOJO_MEDIA_CLIENT_H_ 93 #endif // MEDIA_MOJO_SERVICES_MOJO_MEDIA_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698