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

Side by Side Diff: media/renderers/renderer_impl.h

Issue 1423163004: media: Replace DecryptorReadyCB with CdmReadyCB. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 5 years, 1 month 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
« no previous file with comments | « media/renderers/audio_renderer_impl_unittest.cc ('k') | media/renderers/renderer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_RENDERERS_RENDERER_IMPL_H_ 5 #ifndef MEDIA_RENDERERS_RENDERER_IMPL_H_
6 #define MEDIA_RENDERERS_RENDERER_IMPL_H_ 6 #define MEDIA_RENDERERS_RENDERER_IMPL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/cancelable_callback.h" 10 #include "base/cancelable_callback.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 STATE_UNINITIALIZED, 78 STATE_UNINITIALIZED,
79 STATE_INITIALIZING, 79 STATE_INITIALIZING,
80 STATE_FLUSHING, 80 STATE_FLUSHING,
81 STATE_PLAYING, 81 STATE_PLAYING,
82 STATE_ERROR 82 STATE_ERROR
83 }; 83 };
84 84
85 bool GetWallClockTimes(const std::vector<base::TimeDelta>& media_timestamps, 85 bool GetWallClockTimes(const std::vector<base::TimeDelta>& media_timestamps,
86 std::vector<base::TimeTicks>* wall_clock_times); 86 std::vector<base::TimeTicks>* wall_clock_times);
87 87
88 // Requests that this object notifies when a decryptor is ready through the 88 // Requests that this object notifies when a CDM is ready through the
89 // |decryptor_ready_cb| provided. 89 // |cdm_ready_cb| provided.
90 // If |decryptor_ready_cb| is null, the existing callback will be fired with 90 // If |cdm_ready_cb| is null, the existing callback will be fired with
91 // nullptr immediately and reset. 91 // nullptr immediately and reset.
92 void SetDecryptorReadyCallback(const DecryptorReadyCB& decryptor_ready_cb); 92 void SetCdmReadyCallback(const CdmReadyCB& cdm_ready_cb);
93 93
94 // Helper functions and callbacks for Initialize(). 94 // Helper functions and callbacks for Initialize().
95 void InitializeAudioRenderer(); 95 void InitializeAudioRenderer();
96 void OnAudioRendererInitializeDone(PipelineStatus status); 96 void OnAudioRendererInitializeDone(PipelineStatus status);
97 void InitializeVideoRenderer(); 97 void InitializeVideoRenderer();
98 void OnVideoRendererInitializeDone(PipelineStatus status); 98 void OnVideoRendererInitializeDone(PipelineStatus status);
99 99
100 // Helper functions and callbacks for Flush(). 100 // Helper functions and callbacks for Flush().
101 void FlushAudioRenderer(); 101 void FlushAudioRenderer();
102 void OnAudioRendererFlushDone(); 102 void OnAudioRendererFlushDone();
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 BufferingState audio_buffering_state_; 163 BufferingState audio_buffering_state_;
164 BufferingState video_buffering_state_; 164 BufferingState video_buffering_state_;
165 165
166 // Whether we've received the audio/video ended events. 166 // Whether we've received the audio/video ended events.
167 bool audio_ended_; 167 bool audio_ended_;
168 bool video_ended_; 168 bool video_ended_;
169 169
170 CdmContext* cdm_context_; 170 CdmContext* cdm_context_;
171 171
172 // Callback registered by filters (decoder or demuxer) to be informed of a 172 // Callback registered by filters (decoder or demuxer) to be informed of a
173 // Decryptor. 173 // CDM.
174 // Note: We could have multiple filters registering this callback. One 174 // Note: We could have multiple filters registering this callback. One
175 // callback is okay because: 175 // callback is okay because:
176 // 1, We always initialize filters in sequence. 176 // 1, We always initialize filters in sequence.
177 // 2, Filter initialization will not finish until this callback is satisfied. 177 // 2, Filter initialization will not finish until this callback is satisfied.
178 DecryptorReadyCB decryptor_ready_cb_; 178 CdmReadyCB cdm_ready_cb_;
179 179
180 bool underflow_disabled_for_testing_; 180 bool underflow_disabled_for_testing_;
181 bool clockless_video_playback_enabled_for_testing_; 181 bool clockless_video_playback_enabled_for_testing_;
182 182
183 // Used to defer underflow for video when audio is present. 183 // Used to defer underflow for video when audio is present.
184 base::CancelableClosure deferred_underflow_cb_; 184 base::CancelableClosure deferred_underflow_cb_;
185 185
186 // The amount of time to wait before declaring underflow if the video renderer 186 // The amount of time to wait before declaring underflow if the video renderer
187 // runs out of data but the audio renderer still has enough. 187 // runs out of data but the audio renderer still has enough.
188 base::TimeDelta video_underflow_threshold_; 188 base::TimeDelta video_underflow_threshold_;
189 189
190 base::WeakPtr<RendererImpl> weak_this_; 190 base::WeakPtr<RendererImpl> weak_this_;
191 base::WeakPtrFactory<RendererImpl> weak_factory_; 191 base::WeakPtrFactory<RendererImpl> weak_factory_;
192 192
193 DISALLOW_COPY_AND_ASSIGN(RendererImpl); 193 DISALLOW_COPY_AND_ASSIGN(RendererImpl);
194 }; 194 };
195 195
196 } // namespace media 196 } // namespace media
197 197
198 #endif // MEDIA_RENDERERS_RENDERER_IMPL_H_ 198 #endif // MEDIA_RENDERERS_RENDERER_IMPL_H_
OLDNEW
« no previous file with comments | « media/renderers/audio_renderer_impl_unittest.cc ('k') | media/renderers/renderer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698