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

Side by Side Diff: media/base/pipeline_impl.h

Issue 1815013002: Restore CDM context on Resume(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: base::Unretained Created 4 years, 9 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
« no previous file with comments | « no previous file | media/base/pipeline_impl.cc » ('j') | media/base/pipeline_impl.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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_BASE_PIPELINE_IMPL_H_ 5 #ifndef MEDIA_BASE_PIPELINE_IMPL_H_
6 #define MEDIA_BASE_PIPELINE_IMPL_H_ 6 #define MEDIA_BASE_PIPELINE_IMPL_H_
7 7
8 #include "base/gtest_prod_util.h" 8 #include "base/gtest_prod_util.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 184
185 // Carries out notifying filters that we are seeking to a new timestamp. 185 // Carries out notifying filters that we are seeking to a new timestamp.
186 void SeekTask(base::TimeDelta time, const PipelineStatusCB& seek_cb); 186 void SeekTask(base::TimeDelta time, const PipelineStatusCB& seek_cb);
187 187
188 // Carries out setting the |cdm_context| in |renderer_|, and then fires 188 // Carries out setting the |cdm_context| in |renderer_|, and then fires
189 // |cdm_attached_cb| with the result. If |renderer_| is null, 189 // |cdm_attached_cb| with the result. If |renderer_| is null,
190 // |cdm_attached_cb| will be fired immediately with true, and |cdm_context| 190 // |cdm_attached_cb| will be fired immediately with true, and |cdm_context|
191 // will be set in |renderer_| later when |renderer_| is created. 191 // will be set in |renderer_| later when |renderer_| is created.
192 void SetCdmTask(CdmContext* cdm_context, 192 void SetCdmTask(CdmContext* cdm_context,
193 const CdmAttachedCB& cdm_attached_cb); 193 const CdmAttachedCB& cdm_attached_cb);
194 void OnCdmAttached(const CdmAttachedCB& cdm_attached_cb,
195 CdmContext* cdm_context,
196 bool success);
194 197
195 // Callbacks executed when a renderer has ended. 198 // Callbacks executed when a renderer has ended.
196 void OnRendererEnded(); 199 void OnRendererEnded();
197 void OnTextRendererEnded(); 200 void OnTextRendererEnded();
198 void RunEndedCallbackIfNeeded(); 201 void RunEndedCallbackIfNeeded();
199 202
200 scoped_ptr<TextRenderer> CreateTextRenderer(); 203 scoped_ptr<TextRenderer> CreateTextRenderer();
201 204
202 // Carries out adding a new text stream to the text renderer. 205 // Carries out adding a new text stream to the text renderer.
203 void AddTextStreamTask(DemuxerStream* text_stream, 206 void AddTextStreamTask(DemuxerStream* text_stream,
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 312
310 // Holds the initialized renderers. Used for setting the volume, 313 // Holds the initialized renderers. Used for setting the volume,
311 // playback rate, and determining when playback has finished. 314 // playback rate, and determining when playback has finished.
312 scoped_ptr<Renderer> renderer_; 315 scoped_ptr<Renderer> renderer_;
313 scoped_ptr<TextRenderer> text_renderer_; 316 scoped_ptr<TextRenderer> text_renderer_;
314 317
315 PipelineStatistics statistics_; 318 PipelineStatistics statistics_;
316 319
317 scoped_ptr<SerialRunner> pending_callbacks_; 320 scoped_ptr<SerialRunner> pending_callbacks_;
318 321
319 // CdmContext to be used to decrypt (and decode) encrypted stream in this 322 // The CdmContext to be used to decrypt (and decode) encrypted stream in this
320 // pipeline. Non-null only when SetCdm() is called and the pipeline has not 323 // pipeline. It is set when SetCdm() succeeds on the renderer (or when
321 // been started. Then during Start(), this value will be set on |renderer_|. 324 // SetCdm() is called before Start()), after which it is guaranteed to outlive
322 CdmContext* pending_cdm_context_; 325 // this pipeline. The saved value will be used to configure new renderers,
326 // when starting or resuming.
327 CdmContext* cdm_context_;
323 328
324 base::ThreadChecker thread_checker_; 329 base::ThreadChecker thread_checker_;
325 330
326 // NOTE: Weak pointers must be invalidated before all other member variables. 331 // NOTE: Weak pointers must be invalidated before all other member variables.
327 base::WeakPtrFactory<PipelineImpl> weak_factory_; 332 base::WeakPtrFactory<PipelineImpl> weak_factory_;
328 333
329 DISALLOW_COPY_AND_ASSIGN(PipelineImpl); 334 DISALLOW_COPY_AND_ASSIGN(PipelineImpl);
330 }; 335 };
331 336
332 } // namespace media 337 } // namespace media
333 338
334 #endif // MEDIA_BASE_PIPELINE_IMPL_H_ 339 #endif // MEDIA_BASE_PIPELINE_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/pipeline_impl.cc » ('j') | media/base/pipeline_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698