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

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

Issue 2568463003: media: Rename MediaKeys to ContentDecryptionModule (Closed)
Patch Set: comments addressed Created 4 years 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_RENDERER_SERVICE_H_ 5 #ifndef MEDIA_MOJO_SERVICES_MOJO_RENDERER_SERVICE_H_
6 #define MEDIA_MOJO_SERVICES_MOJO_RENDERER_SERVICE_H_ 6 #define MEDIA_MOJO_SERVICES_MOJO_RENDERER_SERVICE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <memory> 9 #include <memory>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "base/timer/timer.h" 16 #include "base/timer/timer.h"
17 #include "base/unguessable_token.h" 17 #include "base/unguessable_token.h"
18 #include "media/base/buffering_state.h" 18 #include "media/base/buffering_state.h"
19 #include "media/base/demuxer_stream_provider.h" 19 #include "media/base/demuxer_stream_provider.h"
20 #include "media/base/pipeline_status.h" 20 #include "media/base/pipeline_status.h"
21 #include "media/base/renderer_client.h" 21 #include "media/base/renderer_client.h"
22 #include "media/mojo/interfaces/renderer.mojom.h" 22 #include "media/mojo/interfaces/renderer.mojom.h"
23 #include "media/mojo/services/media_mojo_export.h" 23 #include "media/mojo/services/media_mojo_export.h"
24 #include "mojo/public/cpp/bindings/strong_binding.h" 24 #include "mojo/public/cpp/bindings/strong_binding.h"
25 25
26 namespace media { 26 namespace media {
27 27
28 class AudioRendererSink; 28 class AudioRendererSink;
29 class DemuxerStreamProviderShim; 29 class DemuxerStreamProviderShim;
30 class MediaKeys; 30 class ContentDecryptionModule;
31 class MojoCdmServiceContext; 31 class MojoCdmServiceContext;
32 class Renderer; 32 class Renderer;
33 class VideoRendererSink; 33 class VideoRendererSink;
34 34
35 // A mojom::Renderer implementation that use a media::Renderer to render 35 // A mojom::Renderer implementation that use a media::Renderer to render
36 // media streams. 36 // media streams.
37 class MEDIA_MOJO_EXPORT MojoRendererService 37 class MEDIA_MOJO_EXPORT MojoRendererService
38 : NON_EXPORTED_BASE(public mojom::Renderer), 38 : NON_EXPORTED_BASE(public mojom::Renderer),
39 public RendererClient { 39 public RendererClient {
40 public: 40 public:
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 // If |force| is true, the client is notified even if the time is unchanged. 112 // If |force| is true, the client is notified even if the time is unchanged.
113 // If |range| is true, an interpolation time range is reported. 113 // If |range| is true, an interpolation time range is reported.
114 void UpdateMediaTime(bool force); 114 void UpdateMediaTime(bool force);
115 void CancelPeriodicMediaTimeUpdates(); 115 void CancelPeriodicMediaTimeUpdates();
116 void SchedulePeriodicMediaTimeUpdates(); 116 void SchedulePeriodicMediaTimeUpdates();
117 117
118 // Callback executed once Flush() completes. 118 // Callback executed once Flush() completes.
119 void OnFlushCompleted(const FlushCallback& callback); 119 void OnFlushCompleted(const FlushCallback& callback);
120 120
121 // Callback executed once SetCdm() completes. 121 // Callback executed once SetCdm() completes.
122 void OnCdmAttached(scoped_refptr<MediaKeys> cdm, 122 void OnCdmAttached(scoped_refptr<ContentDecryptionModule> cdm,
123 const base::Callback<void(bool)>& callback, 123 const base::Callback<void(bool)>& callback,
124 bool success); 124 bool success);
125 125
126 base::WeakPtr<MojoCdmServiceContext> mojo_cdm_service_context_; 126 base::WeakPtr<MojoCdmServiceContext> mojo_cdm_service_context_;
127 127
128 State state_; 128 State state_;
129 double playback_rate_; 129 double playback_rate_;
130 130
131 std::unique_ptr<DemuxerStreamProvider> stream_provider_; 131 std::unique_ptr<DemuxerStreamProvider> stream_provider_;
132 132
133 base::RepeatingTimer time_update_timer_; 133 base::RepeatingTimer time_update_timer_;
134 base::TimeDelta last_media_time_; 134 base::TimeDelta last_media_time_;
135 135
136 mojom::RendererClientAssociatedPtr client_; 136 mojom::RendererClientAssociatedPtr client_;
137 137
138 // Hold a reference to the CDM set on the |renderer_| so that the CDM won't be 138 // Hold a reference to the CDM set on the |renderer_| so that the CDM won't be
139 // destructed while the |renderer_| is still using it. 139 // destructed while the |renderer_| is still using it.
140 scoped_refptr<MediaKeys> cdm_; 140 scoped_refptr<ContentDecryptionModule> cdm_;
141 141
142 // Audio and Video sinks. 142 // Audio and Video sinks.
143 // May be null if underlying |renderer_| does not use them. 143 // May be null if underlying |renderer_| does not use them.
144 scoped_refptr<AudioRendererSink> audio_sink_; 144 scoped_refptr<AudioRendererSink> audio_sink_;
145 std::unique_ptr<VideoRendererSink> video_sink_; 145 std::unique_ptr<VideoRendererSink> video_sink_;
146 146
147 // Note: Destroy |renderer_| first to avoid access violation into other 147 // Note: Destroy |renderer_| first to avoid access violation into other
148 // members, e.g. |stream_provider_|, |cdm_|, |audio_sink_|, and 148 // members, e.g. |stream_provider_|, |cdm_|, |audio_sink_|, and
149 // |video_sink_|. 149 // |video_sink_|.
150 // Must use "media::" because "Renderer" is ambiguous. 150 // Must use "media::" because "Renderer" is ambiguous.
(...skipping 10 matching lines...) Expand all
161 161
162 base::WeakPtr<MojoRendererService> weak_this_; 162 base::WeakPtr<MojoRendererService> weak_this_;
163 base::WeakPtrFactory<MojoRendererService> weak_factory_; 163 base::WeakPtrFactory<MojoRendererService> weak_factory_;
164 164
165 DISALLOW_COPY_AND_ASSIGN(MojoRendererService); 165 DISALLOW_COPY_AND_ASSIGN(MojoRendererService);
166 }; 166 };
167 167
168 } // namespace media 168 } // namespace media
169 169
170 #endif // MEDIA_MOJO_SERVICES_MOJO_RENDERER_SERVICE_H_ 170 #endif // MEDIA_MOJO_SERVICES_MOJO_RENDERER_SERVICE_H_
OLDNEW
« no previous file with comments | « media/mojo/services/mojo_decryptor_service.cc ('k') | media/mojo/services/mojo_renderer_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698