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

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

Issue 935243002: Decryptors can report kNoKey to WebMediaPlayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_H_ 5 #ifndef MEDIA_BASE_PIPELINE_H_
6 #define MEDIA_BASE_PIPELINE_H_ 6 #define MEDIA_BASE_PIPELINE_H_
7 7
8 #include "base/gtest_prod_util.h" 8 #include "base/gtest_prod_util.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // |metadata_cb| will be executed when the content duration, container video 98 // |metadata_cb| will be executed when the content duration, container video
99 // size, start time, and whether the content has audio and/or 99 // size, start time, and whether the content has audio and/or
100 // video in supported formats are known. 100 // video in supported formats are known.
101 // |buffering_state_cb| will be executed whenever there are changes in the 101 // |buffering_state_cb| will be executed whenever there are changes in the
102 // overall buffering state of the pipeline. 102 // overall buffering state of the pipeline.
103 // |paint_cb| will be executed whenever there is a VideoFrame to be painted. 103 // |paint_cb| will be executed whenever there is a VideoFrame to be painted.
104 // It's safe to call this callback from any thread. 104 // It's safe to call this callback from any thread.
105 // |duration_change_cb| optional callback that will be executed whenever the 105 // |duration_change_cb| optional callback that will be executed whenever the
106 // presentation duration changes. 106 // presentation duration changes.
107 // |add_text_track_cb| will be executed whenever a text track is added. 107 // |add_text_track_cb| will be executed whenever a text track is added.
108 // |waiting_for_encryption_key_cb| will be executed whenever a stream needs
ddorwin 2015/02/19 05:33:17 dittos
jrummell 2015/02/23 22:06:32 Done.
109 // a new key provided in order to decrypt
110 // the stream.
108 // It is an error to call this method after the pipeline has already started. 111 // It is an error to call this method after the pipeline has already started.
109 void Start(Demuxer* demuxer, 112 void Start(Demuxer* demuxer,
110 scoped_ptr<Renderer> renderer, 113 scoped_ptr<Renderer> renderer,
111 const base::Closure& ended_cb, 114 const base::Closure& ended_cb,
112 const PipelineStatusCB& error_cb, 115 const PipelineStatusCB& error_cb,
113 const PipelineStatusCB& seek_cb, 116 const PipelineStatusCB& seek_cb,
114 const PipelineMetadataCB& metadata_cb, 117 const PipelineMetadataCB& metadata_cb,
115 const BufferingStateCB& buffering_state_cb, 118 const BufferingStateCB& buffering_state_cb,
116 const PaintCB& paint_cb, 119 const PaintCB& paint_cb,
117 const base::Closure& duration_change_cb, 120 const base::Closure& duration_change_cb,
118 const AddTextTrackCB& add_text_track_cb); 121 const AddTextTrackCB& add_text_track_cb,
122 const base::Closure& waiting_for_encryption_key_cb);
119 123
120 // Asynchronously stops the pipeline, executing |stop_cb| when the pipeline 124 // Asynchronously stops the pipeline, executing |stop_cb| when the pipeline
121 // teardown has completed. 125 // teardown has completed.
122 // 126 //
123 // Stop() must complete before destroying the pipeline. It it permissible to 127 // Stop() must complete before destroying the pipeline. It it permissible to
124 // call Stop() at any point during the lifetime of the pipeline. 128 // call Stop() at any point during the lifetime of the pipeline.
125 // 129 //
126 // It is safe to delete the pipeline during the execution of |stop_cb|. 130 // It is safe to delete the pipeline during the execution of |stop_cb|.
127 void Stop(const base::Closure& stop_cb); 131 void Stop(const base::Closure& stop_cb);
128 132
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 base::Closure stop_cb_; 357 base::Closure stop_cb_;
354 358
355 // Permanent callbacks passed in via Start(). 359 // Permanent callbacks passed in via Start().
356 base::Closure ended_cb_; 360 base::Closure ended_cb_;
357 PipelineStatusCB error_cb_; 361 PipelineStatusCB error_cb_;
358 PipelineMetadataCB metadata_cb_; 362 PipelineMetadataCB metadata_cb_;
359 BufferingStateCB buffering_state_cb_; 363 BufferingStateCB buffering_state_cb_;
360 PaintCB paint_cb_; 364 PaintCB paint_cb_;
361 base::Closure duration_change_cb_; 365 base::Closure duration_change_cb_;
362 AddTextTrackCB add_text_track_cb_; 366 AddTextTrackCB add_text_track_cb_;
367 base::Closure waiting_for_encryption_key_cb_;
363 368
364 // Holds the initialized demuxer. Used for seeking. Owned by client. 369 // Holds the initialized demuxer. Used for seeking. Owned by client.
365 Demuxer* demuxer_; 370 Demuxer* demuxer_;
366 371
367 // Holds the initialized renderers. Used for setting the volume, 372 // Holds the initialized renderers. Used for setting the volume,
368 // playback rate, and determining when playback has finished. 373 // playback rate, and determining when playback has finished.
369 scoped_ptr<Renderer> renderer_; 374 scoped_ptr<Renderer> renderer_;
370 scoped_ptr<TextRenderer> text_renderer_; 375 scoped_ptr<TextRenderer> text_renderer_;
371 376
372 PipelineStatistics statistics_; 377 PipelineStatistics statistics_;
373 378
374 scoped_ptr<SerialRunner> pending_callbacks_; 379 scoped_ptr<SerialRunner> pending_callbacks_;
375 380
376 // CdmContext to be used to decrypt (and decode) encrypted stream in this 381 // CdmContext to be used to decrypt (and decode) encrypted stream in this
377 // pipeline. Non-null only when SetCdm() is called and the pipeline has not 382 // pipeline. Non-null only when SetCdm() is called and the pipeline has not
378 // been started. Then during Start(), this value will be set on |renderer_|. 383 // been started. Then during Start(), this value will be set on |renderer_|.
379 CdmContext* pending_cdm_context_; 384 CdmContext* pending_cdm_context_;
380 385
381 base::ThreadChecker thread_checker_; 386 base::ThreadChecker thread_checker_;
382 387
383 // NOTE: Weak pointers must be invalidated before all other member variables. 388 // NOTE: Weak pointers must be invalidated before all other member variables.
384 base::WeakPtrFactory<Pipeline> weak_factory_; 389 base::WeakPtrFactory<Pipeline> weak_factory_;
385 390
386 DISALLOW_COPY_AND_ASSIGN(Pipeline); 391 DISALLOW_COPY_AND_ASSIGN(Pipeline);
387 }; 392 };
388 393
389 } // namespace media 394 } // namespace media
390 395
391 #endif // MEDIA_BASE_PIPELINE_H_ 396 #endif // MEDIA_BASE_PIPELINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698