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

Unified 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: Embarassing typo. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/base/pipeline_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/pipeline_impl.h
diff --git a/media/base/pipeline_impl.h b/media/base/pipeline_impl.h
index 8a55ed72bc944e9977af006b88a6ab5cfe90a128..7a6da3a7b5115974ad31e0ddf7066c0b53b1a4b4 100644
--- a/media/base/pipeline_impl.h
+++ b/media/base/pipeline_impl.h
@@ -191,6 +191,9 @@ class MEDIA_EXPORT PipelineImpl : public Pipeline, public DemuxerHost {
// will be set in |renderer_| later when |renderer_| is created.
void SetCdmTask(CdmContext* cdm_context,
const CdmAttachedCB& cdm_attached_cb);
+ void OnCdmAttached(const CdmAttachedCB& cdm_attached_cb,
+ CdmContext* cdm_context,
+ bool success);
// Callbacks executed when a renderer has ended.
void OnRendererEnded();
@@ -316,14 +319,23 @@ class MEDIA_EXPORT PipelineImpl : public Pipeline, public DemuxerHost {
scoped_ptr<SerialRunner> pending_callbacks_;
- // CdmContext to be used to decrypt (and decode) encrypted stream in this
- // pipeline. Non-null only when SetCdm() is called and the pipeline has not
- // been started. Then during Start(), this value will be set on |renderer_|.
- CdmContext* pending_cdm_context_;
+ // The CdmContext to be used to decrypt (and decode) encrypted stream in this
+ // pipeline. It is set when SetCdm() succeeds on the renderer (or when
+ // SetCdm() is called before Start()), after which it is guaranteed to outlive
+ // this pipeline. The saved value will be used to configure new renderers,
+ // when starting or resuming.
+ CdmContext* cdm_context_;
base::ThreadChecker thread_checker_;
- // NOTE: Weak pointers must be invalidated before all other member variables.
+ // A weak pointer that can be safely copied on the media thread.
+ base::WeakPtr<PipelineImpl> weak_this_;
+
+ // Weak pointers must be created on the main thread, and must be dereferenced
+ // on the media thread.
+ //
+ // Declared last so that weak pointers will be invalidated before all other
+ // member variables.
base::WeakPtrFactory<PipelineImpl> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(PipelineImpl);
« no previous file with comments | « no previous file | media/base/pipeline_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698