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

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

Issue 11492003: Encrypted Media: Support Audio Decrypt-Only. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments mostly resolved (I believe); need to add/update tests if this looks good Created 8 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 | Annotate | Revision Log
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 <string> 8 #include <string>
9 9
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
11 #include "base/synchronization/condition_variable.h" 11 #include "base/synchronization/condition_variable.h"
12 #include "base/synchronization/lock.h" 12 #include "base/synchronization/lock.h"
13 #include "base/threading/thread_checker.h" 13 #include "base/threading/thread_checker.h"
14 #include "media/base/audio_renderer.h" 14 #include "media/base/audio_renderer.h"
15 #include "media/base/decryptor.h"
15 #include "media/base/demuxer.h" 16 #include "media/base/demuxer.h"
16 #include "media/base/media_export.h" 17 #include "media/base/media_export.h"
17 #include "media/base/pipeline_status.h" 18 #include "media/base/pipeline_status.h"
18 #include "media/base/ranges.h" 19 #include "media/base/ranges.h"
19 #include "media/base/serial_runner.h" 20 #include "media/base/serial_runner.h"
20 #include "ui/gfx/size.h" 21 #include "ui/gfx/size.h"
21 22
22 class MessageLoop; 23 class MessageLoop;
23 24
24 namespace base { 25 namespace base {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 // |filter_collection| must be a complete collection containing a demuxer, 121 // |filter_collection| must be a complete collection containing a demuxer,
121 // audio/video decoders, and audio/video renderers. Failing to do so will 122 // audio/video decoders, and audio/video renderers. Failing to do so will
122 // result in a crash. 123 // result in a crash.
123 // 124 //
124 // The following permanent callbacks will be executed as follows up until 125 // The following permanent callbacks will be executed as follows up until
125 // Stop() has completed: 126 // Stop() has completed:
126 // |ended_cb| will be executed whenever the media reaches the end. 127 // |ended_cb| will be executed whenever the media reaches the end.
127 // |error_cb| will be executed whenever an error occurs but hasn't 128 // |error_cb| will be executed whenever an error occurs but hasn't
128 // been reported already through another callback. 129 // been reported already through another callback.
129 // |buffering_state_cb| Optional callback that will be executed whenever the 130 // |buffering_state_cb| Optional callback that will be executed whenever the
130 // pipeline's buffering state changes. 131 // pipeline's buffering state changes.
ddorwin 2012/12/13 05:08:25 add comment for new param?
xhwang 2012/12/13 11:24:36 Pipeline will not be used to pass the SetDecryptor
131 // It is an error to call this method after the pipeline has already started. 132 // It is an error to call this method after the pipeline has already started.
132 void Start(scoped_ptr<FilterCollection> filter_collection, 133 void Start(scoped_ptr<FilterCollection> filter_collection,
133 const PipelineStatusCB& ended_cb, 134 const PipelineStatusCB& ended_cb,
134 const PipelineStatusCB& error_cb, 135 const PipelineStatusCB& error_cb,
135 const PipelineStatusCB& seek_cb, 136 const PipelineStatusCB& seek_cb,
136 const BufferingStateCB& buffering_state_cb); 137 const BufferingStateCB& buffering_state_cb,
138 const SetDecryptorReadyCB& set_decryptor_ready_cb);
137 139
138 // Asynchronously stops the pipeline, executing |stop_cb| when the pipeline 140 // Asynchronously stops the pipeline, executing |stop_cb| when the pipeline
139 // teardown has completed. 141 // teardown has completed.
140 // 142 //
141 // Stop() must complete before destroying the pipeline. It it permissible to 143 // Stop() must complete before destroying the pipeline. It it permissible to
142 // call Stop() at any point during the lifetime of the pipeline. 144 // call Stop() at any point during the lifetime of the pipeline.
143 void Stop(const base::Closure& stop_cb); 145 void Stop(const base::Closure& stop_cb);
144 146
145 // Attempt to seek to the position specified by time. |seek_cb| will be 147 // Attempt to seek to the position specified by time. |seek_cb| will be
146 // executed when the all filters in the pipeline have processed the seek. 148 // executed when the all filters in the pipeline have processed the seek.
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 // Callback executed by video renderer to update clock time. 287 // Callback executed by video renderer to update clock time.
286 void OnVideoTimeUpdate(base::TimeDelta max_time); 288 void OnVideoTimeUpdate(base::TimeDelta max_time);
287 289
288 // The following "task" methods correspond to the public methods, but these 290 // The following "task" methods correspond to the public methods, but these
289 // methods are run as the result of posting a task to the PipelineInternal's 291 // methods are run as the result of posting a task to the PipelineInternal's
290 // message loop. 292 // message loop.
291 void StartTask(scoped_ptr<FilterCollection> filter_collection, 293 void StartTask(scoped_ptr<FilterCollection> filter_collection,
292 const PipelineStatusCB& ended_cb, 294 const PipelineStatusCB& ended_cb,
293 const PipelineStatusCB& error_cb, 295 const PipelineStatusCB& error_cb,
294 const PipelineStatusCB& seek_cb, 296 const PipelineStatusCB& seek_cb,
295 const BufferingStateCB& buffering_state_cb); 297 const BufferingStateCB& buffering_state_cb,
298 const SetDecryptorReadyCB& set_decryptor_ready_cb);
296 299
297 // Stops and destroys all filters, placing the pipeline in the kStopped state. 300 // Stops and destroys all filters, placing the pipeline in the kStopped state.
298 void StopTask(const base::Closure& stop_cb); 301 void StopTask(const base::Closure& stop_cb);
299 302
300 // Carries out stopping and destroying all filters, placing the pipeline in 303 // Carries out stopping and destroying all filters, placing the pipeline in
301 // the kStopped state. 304 // the kStopped state.
302 void ErrorChangedTask(PipelineStatus error); 305 void ErrorChangedTask(PipelineStatus error);
303 306
304 // Carries out notifying filters that the playback rate has changed. 307 // Carries out notifying filters that the playback rate has changed.
305 void PlaybackRateChangedTask(float playback_rate); 308 void PlaybackRateChangedTask(float playback_rate);
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 // Temporary callback used for Start() and Seek(). 444 // Temporary callback used for Start() and Seek().
442 PipelineStatusCB seek_cb_; 445 PipelineStatusCB seek_cb_;
443 446
444 // Temporary callback used for Stop(). 447 // Temporary callback used for Stop().
445 base::Closure stop_cb_; 448 base::Closure stop_cb_;
446 449
447 // Permanent callbacks passed in via Start(). 450 // Permanent callbacks passed in via Start().
448 PipelineStatusCB ended_cb_; 451 PipelineStatusCB ended_cb_;
449 PipelineStatusCB error_cb_; 452 PipelineStatusCB error_cb_;
450 BufferingStateCB buffering_state_cb_; 453 BufferingStateCB buffering_state_cb_;
454 SetDecryptorReadyCB set_decryptor_ready_cb_;
451 455
452 // Renderer references used for setting the volume, playback rate, and 456 // Renderer references used for setting the volume, playback rate, and
453 // determining when playback has finished. 457 // determining when playback has finished.
454 scoped_refptr<AudioRenderer> audio_renderer_; 458 scoped_refptr<AudioRenderer> audio_renderer_;
455 scoped_refptr<VideoRenderer> video_renderer_; 459 scoped_refptr<VideoRenderer> video_renderer_;
456 460
457 // Demuxer reference used for setting the preload value. 461 // Demuxer reference used for setting the preload value.
458 scoped_refptr<Demuxer> demuxer_; 462 scoped_refptr<Demuxer> demuxer_;
459 463
460 PipelineStatistics statistics_; 464 PipelineStatistics statistics_;
461 465
462 // Time of pipeline creation; is non-zero only until the pipeline first 466 // Time of pipeline creation; is non-zero only until the pipeline first
463 // reaches "kStarted", at which point it is used & zeroed out. 467 // reaches "kStarted", at which point it is used & zeroed out.
464 base::Time creation_time_; 468 base::Time creation_time_;
465 469
466 scoped_ptr<SerialRunner> pending_callbacks_; 470 scoped_ptr<SerialRunner> pending_callbacks_;
467 471
468 base::ThreadChecker thread_checker_; 472 base::ThreadChecker thread_checker_;
469 473
470 DISALLOW_COPY_AND_ASSIGN(Pipeline); 474 DISALLOW_COPY_AND_ASSIGN(Pipeline);
471 }; 475 };
472 476
473 } // namespace media 477 } // namespace media
474 478
475 #endif // MEDIA_BASE_PIPELINE_H_ 479 #endif // MEDIA_BASE_PIPELINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698