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

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

Issue 10837206: Rewrite media::Pipeline state transition machinery and simplify shutdown. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: one more time Created 8 years, 3 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 | 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"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // machine to perform asynchronous initialization, pausing, seeking and playing. 65 // machine to perform asynchronous initialization, pausing, seeking and playing.
66 // 66 //
67 // Here's a state diagram that describes the lifetime of this object. 67 // Here's a state diagram that describes the lifetime of this object.
68 // 68 //
69 // [ *Created ] [ Stopped ] 69 // [ *Created ] [ Stopped ]
70 // | Start() ^ 70 // | Start() ^
71 // V SetError() | 71 // V SetError() |
72 // [ InitXXX (for each filter) ] -------->[ Stopping (for each filter) ] 72 // [ InitXXX (for each filter) ] -------->[ Stopping (for each filter) ]
73 // | ^ 73 // | ^
74 // V | if Stop 74 // V | if Stop
75 // [ Seeking (for each filter) ] <--------[ Flushing (for each filter) ] 75 // [ Seeking (for each filter) ] <--------[ Flushing (for each filter) ]
acolwell GONE FROM CHROMIUM 2012/09/05 13:22:22 Needs updating
scherkus (not reviewing) 2012/09/05 15:04:17 Done -- feel free to suggest further improvements.
76 // | if Seek ^ 76 // | if Seek ^
77 // V | 77 // V |
78 // [ Starting (for each filter) ] | 78 // [ Starting (for each filter) ] |
79 // | | 79 // | |
80 // V Seek()/Stop() | 80 // V Seek()/Stop() |
81 // [ Started ] -------------------------> [ Pausing (for each filter) ] 81 // [ Started ] -------------------------> [ Pausing (for each filter) ]
82 // ^ SetError() 82 // ^ SetError()
83 // | 83 // |
84 // [ Any State Other Than InitXXX ] 84 // [ Any State Other Than InitXXX ]
85 // 85 //
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 friend class base::RefCountedThreadSafe<Pipeline>; 225 friend class base::RefCountedThreadSafe<Pipeline>;
226 virtual ~Pipeline(); 226 virtual ~Pipeline();
227 227
228 // Pipeline states, as described above. 228 // Pipeline states, as described above.
229 enum State { 229 enum State {
230 kCreated, 230 kCreated,
231 kInitDemuxer, 231 kInitDemuxer,
232 kInitAudioDecoder, 232 kInitAudioDecoder,
233 kInitAudioRenderer, 233 kInitAudioRenderer,
234 kInitVideoRenderer, 234 kInitVideoRenderer,
235 kPausing, 235 kInitPrerolling,
236 kSeeking, 236 kSeeking,
237 kFlushing,
238 kStarting, 237 kStarting,
239 kStarted, 238 kStarted,
240 kStopping, 239 kStopping,
241 kStopped, 240 kStopped,
242 }; 241 };
243 242
244 // Updates |state_|. All state transitions should use this call. 243 // Updates |state_|. All state transitions should use this call.
245 void SetState(State next_state); 244 void SetState(State next_state);
246 245
247 // Simple method used to make sure the pipeline is running normally. 246 static const char* GetStateString(State state);
248 bool IsPipelineOk(); 247 State GetNextState() const;
249
250 // Helper method to tell whether we are in transition to seek state.
251 bool IsPipelineSeeking();
252 248
253 // Helper method that runs & resets |seek_cb_| and resets |seek_timestamp_| 249 // Helper method that runs & resets |seek_cb_| and resets |seek_timestamp_|
254 // and |seek_pending_|. 250 // and |seek_pending_|.
255 void FinishSeek(); 251 void FinishSeek();
256 252
257 // Returns true if the given state is one that transitions to a new state
258 // after iterating through each filter.
259 static bool TransientState(State state);
260
261 // Given the current state, returns the next state.
262 State FindNextState(State current);
263
264 // DataSourceHost (by way of DemuxerHost) implementation. 253 // DataSourceHost (by way of DemuxerHost) implementation.
265 virtual void SetTotalBytes(int64 total_bytes) OVERRIDE; 254 virtual void SetTotalBytes(int64 total_bytes) OVERRIDE;
266 virtual void AddBufferedByteRange(int64 start, int64 end) OVERRIDE; 255 virtual void AddBufferedByteRange(int64 start, int64 end) OVERRIDE;
267 virtual void AddBufferedTimeRange(base::TimeDelta start, 256 virtual void AddBufferedTimeRange(base::TimeDelta start,
268 base::TimeDelta end) OVERRIDE; 257 base::TimeDelta end) OVERRIDE;
269 258
270 // DemuxerHost implementaion. 259 // DemuxerHost implementaion.
271 virtual void SetDuration(base::TimeDelta duration) OVERRIDE; 260 virtual void SetDuration(base::TimeDelta duration) OVERRIDE;
272 virtual void OnDemuxerError(PipelineStatus error) OVERRIDE; 261 virtual void OnDemuxerError(PipelineStatus error) OVERRIDE;
273 262
274 // Initiates teardown sequence in response to a runtime error. 263 // Initiates teardown sequence in response to a runtime error.
275 // 264 //
276 // Safe to call from any thread. 265 // Safe to call from any thread.
277 void SetError(PipelineStatus error); 266 void SetError(PipelineStatus error);
278 267
279 // Callback executed when the natural size of the video has changed. 268 // Callback executed when the natural size of the video has changed.
280 void OnNaturalVideoSizeChanged(const gfx::Size& size); 269 void OnNaturalVideoSizeChanged(const gfx::Size& size);
281 270
282 // Callbacks executed when a renderer has ended. 271 // Callbacks executed when a renderer has ended.
283 void OnAudioRendererEnded(); 272 void OnAudioRendererEnded();
284 void OnVideoRendererEnded(); 273 void OnVideoRendererEnded();
285 274
286 // Callbacks executed by filters upon completing initialization.
287 void OnFilterInitialize(PipelineStatus status);
288
289 // Callback executed by filters upon completing Play(), Pause(), Flush(),
290 // Seek() or Stop().
291 void OnFilterStateTransition(PipelineStatus status);
292
293 // Callback executed by filters when completing teardown operations.
294 void OnTeardownStateTransition(PipelineStatus status);
295
296 // Callback executed by filters to update statistics. 275 // Callback executed by filters to update statistics.
297 void OnUpdateStatistics(const PipelineStatistics& stats); 276 void OnUpdateStatistics(const PipelineStatistics& stats);
298 277
299 // Callback executed by audio renderer when it has been disabled. 278 // Callback executed by audio renderer when it has been disabled.
300 void OnAudioDisabled(); 279 void OnAudioDisabled();
301 280
302 // Callback executed by audio renderer to update clock time. 281 // Callback executed by audio renderer to update clock time.
303 void OnAudioTimeUpdate(base::TimeDelta time, base::TimeDelta max_time); 282 void OnAudioTimeUpdate(base::TimeDelta time, base::TimeDelta max_time);
304 283
305 // Callback executed by video renderer to update clock time. 284 // Callback executed by video renderer to update clock time.
306 void OnVideoTimeUpdate(base::TimeDelta max_time); 285 void OnVideoTimeUpdate(base::TimeDelta max_time);
307 286
308 // The following "task" methods correspond to the public methods, but these 287 // The following "task" methods correspond to the public methods, but these
309 // methods are run as the result of posting a task to the PipelineInternal's 288 // methods are run as the result of posting a task to the PipelineInternal's
310 // message loop. 289 // message loop.
311 void StartTask(scoped_ptr<FilterCollection> filter_collection, 290 void StartTask(scoped_ptr<FilterCollection> filter_collection,
312 const PipelineStatusCB& ended_cb, 291 const PipelineStatusCB& ended_cb,
313 const PipelineStatusCB& error_cb, 292 const PipelineStatusCB& error_cb,
314 const PipelineStatusCB& seek_cb, 293 const PipelineStatusCB& seek_cb,
315 const BufferingStateCB& buffering_state_cb); 294 const BufferingStateCB& buffering_state_cb);
316 295
317 // InitializeTask() performs initialization in multiple passes. It is executed
318 // as a result of calling Start() or InitializationComplete() that advances
319 // initialization to the next state. It works as a hub of state transition for
320 // initialization. One stage communicates its status to the next through
321 // |last_stage_status|.
322 void InitializeTask(PipelineStatus last_stage_status);
323
324 // Stops and destroys all filters, placing the pipeline in the kStopped state. 296 // Stops and destroys all filters, placing the pipeline in the kStopped state.
325 void StopTask(const base::Closure& stop_cb); 297 void StopTask(const base::Closure& stop_cb);
326 298
327 // Carries out stopping and destroying all filters, placing the pipeline in 299 // Carries out stopping and destroying all filters, placing the pipeline in
328 // the kStopped state. 300 // the kStopped state.
329 void ErrorChangedTask(PipelineStatus error); 301 void ErrorChangedTask(PipelineStatus error);
330 302
331 // Carries out notifying filters that the playback rate has changed. 303 // Carries out notifying filters that the playback rate has changed.
332 void PlaybackRateChangedTask(float playback_rate); 304 void PlaybackRateChangedTask(float playback_rate);
333 305
334 // Carries out notifying filters that the volume has changed. 306 // Carries out notifying filters that the volume has changed.
335 void VolumeChangedTask(float volume); 307 void VolumeChangedTask(float volume);
336 308
337 // Carries out notifying filters that we are seeking to a new timestamp. 309 // Carries out notifying filters that we are seeking to a new timestamp.
338 void SeekTask(base::TimeDelta time, const PipelineStatusCB& seek_cb); 310 void SeekTask(base::TimeDelta time, const PipelineStatusCB& seek_cb);
339 311
340 // Handles audio/video ended logic and running |ended_cb_|. 312 // Handles audio/video ended logic and running |ended_cb_|.
341 void DoAudioRendererEnded(); 313 void DoAudioRendererEnded();
342 void DoVideoRendererEnded(); 314 void DoVideoRendererEnded();
343 void RunEndedCallbackIfNeeded(); 315 void RunEndedCallbackIfNeeded();
344 316
345 // Carries out disabling the audio renderer. 317 // Carries out disabling the audio renderer.
346 void AudioDisabledTask(); 318 void AudioDisabledTask();
347 319
348 // Carries out advancing to the next filter during Play()/Pause()/Seek(). 320 // Kicks off initialization for each media object, executing |done_cb| with
349 void FilterStateTransitionTask(); 321 // the result when completed.
350 322 void InitializeDemuxer(const PipelineStatusCB& done_cb);
351 // Carries out advancing to the next teardown operation. 323 void InitializeAudioDecoder(const PipelineStatusCB& done_cb);
352 void TeardownStateTransitionTask(); 324 void InitializeAudioRenderer(const PipelineStatusCB& done_cb);
353 325 void InitializeVideoRenderer(const PipelineStatusCB& done_cb);
354 // Carries out stopping filter threads, deleting filters, running
355 // appropriate callbacks, and setting the appropriate pipeline state
356 // depending on whether we performing Stop() or SetError().
357 // Called after all filters have been stopped.
358 void FinishDestroyingFiltersTask();
359
360 // Internal methods used in the implementation of the pipeline thread. All
361 // of these methods are only called on the pipeline thread.
362
363 // The following initialize methods are used to select a specific type of
364 // object from FilterCollection and initialize it asynchronously.
365 void InitializeDemuxer();
366 void OnDemuxerInitialized(PipelineStatus status);
367
368 // Returns true if the asynchronous action of creating decoder has started.
369 // Returns false if this method did nothing because the corresponding
370 // audio stream does not exist.
371 bool InitializeAudioDecoder(const scoped_refptr<Demuxer>& demuxer);
372
373 // Initializes a renderer and connects it with decoder. Returns true if the
374 // asynchronous action of creating renderer has started. Returns
375 // false if this method did nothing because the corresponding audio/video
376 // stream does not exist.
377 bool InitializeAudioRenderer(const scoped_refptr<AudioDecoder>& decoder);
378 bool InitializeVideoRenderer(
379 const scoped_refptr<DemuxerStream>& stream);
380 326
381 // Kicks off destroying filters. Called by StopTask() and ErrorChangedTask(). 327 // Kicks off destroying filters. Called by StopTask() and ErrorChangedTask().
382 // When we start to tear down the pipeline, we will consider two cases: 328 // When we start to tear down the pipeline, we will consider two cases:
383 // 1. when pipeline has not been initialized, we will transit to stopping 329 // 1. when pipeline has not been initialized, we will transit to stopping
384 // state first. 330 // state first.
385 // 2. when pipeline has been initialized, we will first transit to pausing 331 // 2. when pipeline has been initialized, we will first transit to pausing
386 // => flushing => stopping => stopped state. 332 // => flushing => stopping => stopped state.
387 // This will remove the race condition during stop between filters. 333 // This will remove the race condition during stop between filters.
388 void TearDownPipeline(); 334 void TearDownPipeline();
389 335
390 // Compute the time corresponding to a byte offset. 336 // Compute the time corresponding to a byte offset.
391 base::TimeDelta TimeForByteOffset_Locked(int64 byte_offset) const; 337 base::TimeDelta TimeForByteOffset_Locked(int64 byte_offset) const;
392 338
393 // Initiates an asynchronous Pause/Seek/Play/Stop() call sequence executing 339 void OnStateTransition(PipelineStatus status);
394 // |done_cb| when completed. 340 void DoStateTransition(PipelineStatus status);
395 void DoPause(const PipelineStatusCB& done_cb);
396 void DoFlush(const PipelineStatusCB& done_cb);
397 void DoPlay(const PipelineStatusCB& done_cb);
398 void DoStop(const PipelineStatusCB& done_cb);
399 341
400 // Initiates an asynchronous Seek() and preroll call sequence executing 342 // Initiates an asynchronous preroll call sequence executing |done_cb|
401 // |done_cb| with the final status when completed. If |skip_demuxer_seek| is 343 // with the final status when completed.
402 // true then only renderers will attempt to preroll. 344 void DoInitialPreroll(const base::TimeDelta& seek_timestamp,
Ami GONE FROM CHROMIUM 2012/09/02 20:29:29 "initial" and "seek_timestamp" seem at odds to me.
scherkus (not reviewing) 2012/09/05 15:04:17 Done.
345 const PipelineStatusCB& done_cb);
346
347 // Initiates an asynchronous pause-flush-seek-preroll call sequence
348 // executing |done_cb| with the final status when completed.
403 // 349 //
404 // TODO(scherkus): Prerolling should be separate from seeking so we can report 350 // TODO(scherkus): Prerolling should be separate from seeking so we can report
405 // finer grained ready states (HAVE_CURRENT_DATA vs. HAVE_FUTURE_DATA) 351 // finer grained ready states (HAVE_CURRENT_DATA vs. HAVE_FUTURE_DATA)
406 // indepentent from seeking. 352 // indepentent from seeking.
407 void DoSeek(base::TimeDelta seek_timestamp, bool skip_demuxer_seek, 353 void DoSeek(const base::TimeDelta& seek_timestamp,
Ami GONE FROM CHROMIUM 2012/09/02 20:29:29 this is an int64; why pass-by-ref?
scherkus (not reviewing) 2012/09/05 15:04:17 Habit with non-POD-types, I suppose. Done.
408 const PipelineStatusCB& done_cb); 354 const PipelineStatusCB& done_cb);
409 355
356 // Updates playback rate and volume and initiates an asynchronous play call
357 // sequence executing |done_cb| with the final status when completed.
358 void DoPlay(const PipelineStatusCB& done_cb);
359
360 // Initiates an asynchronous pause-flush-stop call sequence executing
361 // |done_cb| when completed.
362 void DoStop(const PipelineStatusCB& done_cb);
363 void OnStopCompleted(PipelineStatus status);
364
410 void OnAudioUnderflow(); 365 void OnAudioUnderflow();
411 366
412 void StartClockIfWaitingForTimeUpdate_Locked(); 367 void StartClockIfWaitingForTimeUpdate_Locked();
413 368
414 // Report pipeline |status| through |cb| avoiding duplicate error reporting.
415 void ReportStatus(const PipelineStatusCB& cb, PipelineStatus status);
Ami GONE FROM CHROMIUM 2012/09/02 20:29:29 I fear this removal, but I don't think there's a b
scherkus (not reviewing) 2012/09/05 15:04:17 There isn't. Promise ;)
416
417 // Message loop used to execute pipeline tasks. 369 // Message loop used to execute pipeline tasks.
418 scoped_refptr<base::MessageLoopProxy> message_loop_; 370 scoped_refptr<base::MessageLoopProxy> message_loop_;
419 371
420 // MediaLog to which to log events. 372 // MediaLog to which to log events.
421 scoped_refptr<MediaLog> media_log_; 373 scoped_refptr<MediaLog> media_log_;
422 374
423 // Lock used to serialize access for the following data members. 375 // Lock used to serialize access for the following data members.
424 mutable base::Lock lock_; 376 mutable base::Lock lock_;
425 377
426 // Whether or not the pipeline is running. 378 // Whether or not the pipeline is running.
427 bool running_; 379 bool running_;
428 380
429 // Whether or not the pipeline is in transition for a seek operation.
430 bool seek_pending_;
431
432 // Whether or not the pipeline is perform a stop operation.
433 bool tearing_down_;
434
435 // Whether or not a playback rate change should be done once seeking is done.
436 bool playback_rate_change_pending_;
437
438 // Amount of available buffered data. Set by filters. 381 // Amount of available buffered data. Set by filters.
439 Ranges<int64> buffered_byte_ranges_; 382 Ranges<int64> buffered_byte_ranges_;
440 Ranges<base::TimeDelta> buffered_time_ranges_; 383 Ranges<base::TimeDelta> buffered_time_ranges_;
441 384
442 // True when AddBufferedByteRange() has been called more recently than 385 // True when AddBufferedByteRange() has been called more recently than
443 // DidLoadingProgress(). 386 // DidLoadingProgress().
444 mutable bool did_loading_progress_; 387 mutable bool did_loading_progress_;
445 388
446 // Total size of the media. Set by filters. 389 // Total size of the media. Set by filters.
447 int64 total_bytes_; 390 int64 total_bytes_;
448 391
449 // Video's natural width and height. Set by filters. 392 // Video's natural width and height. Set by filters.
450 gfx::Size natural_size_; 393 gfx::Size natural_size_;
451 394
452 // Current volume level (from 0.0f to 1.0f). This value is set immediately 395 // Current volume level (from 0.0f to 1.0f). This value is set immediately
453 // via SetVolume() and a task is dispatched on the message loop to notify the 396 // via SetVolume() and a task is dispatched on the message loop to notify the
454 // filters. 397 // filters.
455 float volume_; 398 float volume_;
456 399
457 // Current playback rate (>= 0.0f). This value is set immediately via 400 // Current playback rate (>= 0.0f). This value is set immediately via
458 // SetPlaybackRate() and a task is dispatched on the message loop to notify 401 // SetPlaybackRate() and a task is dispatched on the message loop to notify
459 // the filters. 402 // the filters.
460 float playback_rate_; 403 float playback_rate_;
461 404
462 // Playback rate to set when the current seek has finished.
463 float pending_playback_rate_;
464
465 // Reference clock. Keeps track of current playback time. Uses system 405 // Reference clock. Keeps track of current playback time. Uses system
466 // clock and linear interpolation, but can have its time manually set 406 // clock and linear interpolation, but can have its time manually set
467 // by filters. 407 // by filters.
468 scoped_ptr<Clock> clock_; 408 scoped_ptr<Clock> clock_;
469 409
470 // If this value is set to true, then |clock_| is paused and we are waiting 410 // If this value is set to true, then |clock_| is paused and we are waiting
471 // for an update of the clock greater than or equal to the elapsed time to 411 // for an update of the clock greater than or equal to the elapsed time to
472 // start the clock. 412 // start the clock.
473 bool waiting_for_clock_update_; 413 bool waiting_for_clock_update_;
474 414
475 // Status of the pipeline. Initialized to PIPELINE_OK which indicates that 415 // Status of the pipeline. Initialized to PIPELINE_OK which indicates that
476 // the pipeline is operating correctly. Any other value indicates that the 416 // the pipeline is operating correctly. Any other value indicates that the
477 // pipeline is stopped or is stopping. Clients can call the Stop() method to 417 // pipeline is stopped or is stopping. Clients can call the Stop() method to
478 // reset the pipeline state, and restore this to PIPELINE_OK. 418 // reset the pipeline state, and restore this to PIPELINE_OK.
479 PipelineStatus status_; 419 PipelineStatus status_;
480 420
481 // Whether the media contains rendered audio and video streams. 421 // Whether the media contains rendered audio and video streams.
482 // TODO(fischman,scherkus): replace these with checks for 422 // TODO(fischman,scherkus): replace these with checks for
483 // {audio,video}_decoder_ once extraction of {Audio,Video}Decoder from the 423 // {audio,video}_decoder_ once extraction of {Audio,Video}Decoder from the
484 // Filter heirarchy is done. 424 // Filter heirarchy is done.
485 bool has_audio_; 425 bool has_audio_;
486 bool has_video_; 426 bool has_video_;
487 427
488 // The following data members are only accessed by tasks posted to 428 // The following data members are only accessed by tasks posted to
489 // |message_loop_|. 429 // |message_loop_|.
490 430
491 // Member that tracks the current state. 431 // Member that tracks the current state.
492 State state_; 432 State state_;
493 433
494 // For kSeeking we need to remember where we're seeking between filter
495 // replies.
496 base::TimeDelta seek_timestamp_;
497
498 // Whether we've received the audio/video ended events. 434 // Whether we've received the audio/video ended events.
499 bool audio_ended_; 435 bool audio_ended_;
500 bool video_ended_; 436 bool video_ended_;
501 437
502 // Set to true in DisableAudioRendererTask(). 438 // Set to true in DisableAudioRendererTask().
503 bool audio_disabled_; 439 bool audio_disabled_;
504 440
505 // Filter collection as passed in by Start().
506 scoped_ptr<FilterCollection> filter_collection_; 441 scoped_ptr<FilterCollection> filter_collection_;
507 442
508 // Callbacks for various pipeline operations. 443 // Temporary callback used for Start() and Seek().
509 PipelineStatusCB seek_cb_; 444 PipelineStatusCB seek_cb_;
445
446 // Temporary callback used for Stop().
510 base::Closure stop_cb_; 447 base::Closure stop_cb_;
448
449 // Permanent callbacks passed in via Start().
511 PipelineStatusCB ended_cb_; 450 PipelineStatusCB ended_cb_;
512 PipelineStatusCB error_cb_; 451 PipelineStatusCB error_cb_;
513 BufferingStateCB buffering_state_cb_; 452 BufferingStateCB buffering_state_cb_;
514 453
515 // Audio renderer reference used for setting the volume and determining 454 // Audio renderer reference used for setting the volume and determining
516 // when playback has finished. 455 // when playback has finished.
517 scoped_refptr<AudioRenderer> audio_renderer_; 456 scoped_refptr<AudioRenderer> audio_renderer_;
518 457
519 // Video Renderer reference used for determining when playback has finished 458 // Video Renderer reference used for determining when playback has finished
520 // and for signalling imminent shutdown. 459 // and for signalling imminent shutdown.
521 // The signalling imminent shutdown is a HACK necessary because 460 // The signalling imminent shutdown is a HACK necessary because
522 // WebMediaPlayerImpl::Destroy() holds the render thread loop hostage 461 // WebMediaPlayerImpl::Destroy() holds the render thread loop hostage
523 // until PipelineImpl::Stop() calls its callback. 462 // until PipelineImpl::Stop() calls its callback.
524 // http://crbug.com/110228 tracks removing this hack. 463 // http://crbug.com/110228 tracks removing this hack.
525 scoped_refptr<VideoRenderer> video_renderer_; 464 scoped_refptr<VideoRenderer> video_renderer_;
526 465
527 // Demuxer reference used for setting the preload value. 466 // Demuxer reference used for setting the preload value.
528 scoped_refptr<Demuxer> demuxer_; 467 scoped_refptr<Demuxer> demuxer_;
529 468
530 // Helper class that stores filter references during pipeline 469 // Audio decoder reference used during initialization.
531 // initialization. 470 //
532 struct PipelineInitState; 471 // TODO(scherkus): Remove after renderers do initialization, see
533 scoped_ptr<PipelineInitState> pipeline_init_state_; 472 // http://crbug.com/145635
473 scoped_refptr<AudioDecoder> audio_decoder_;
534 474
535 // Statistics.
536 PipelineStatistics statistics_; 475 PipelineStatistics statistics_;
476
537 // Time of pipeline creation; is non-zero only until the pipeline first 477 // Time of pipeline creation; is non-zero only until the pipeline first
538 // reaches "kStarted", at which point it is used & zeroed out. 478 // reaches "kStarted", at which point it is used & zeroed out.
539 base::Time creation_time_; 479 base::Time creation_time_;
540 480
541 scoped_ptr<SerialRunner> pending_callbacks_; 481 scoped_ptr<SerialRunner> pending_callbacks_;
542 482
543 DISALLOW_COPY_AND_ASSIGN(Pipeline); 483 DISALLOW_COPY_AND_ASSIGN(Pipeline);
544 }; 484 };
545 485
546 } // namespace media 486 } // namespace media
547 487
548 #endif // MEDIA_BASE_PIPELINE_H_ 488 #endif // MEDIA_BASE_PIPELINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698