OLD | NEW |
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 "media/base/demuxer.h" | 13 #include "media/base/demuxer.h" |
14 #include "media/base/download_rate_monitor.h" | 14 #include "media/base/download_rate_monitor.h" |
15 #include "media/base/filter_host.h" | 15 #include "media/base/filter_host.h" |
16 #include "media/base/media_export.h" | 16 #include "media/base/media_export.h" |
17 #include "media/base/pipeline_status.h" | 17 #include "media/base/pipeline_status.h" |
18 #include "media/base/preload.h" | |
19 #include "ui/gfx/size.h" | 18 #include "ui/gfx/size.h" |
20 | 19 |
21 class MessageLoop; | 20 class MessageLoop; |
22 | 21 |
23 namespace base { | 22 namespace base { |
24 class TimeDelta; | 23 class TimeDelta; |
25 } | 24 } |
26 | 25 |
27 namespace media { | 26 namespace media { |
28 | 27 |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 // Gets the current volume setting being used by the audio renderer. When | 197 // Gets the current volume setting being used by the audio renderer. When |
199 // the pipeline is started, this value will be 1.0f. Valid values range | 198 // the pipeline is started, this value will be 1.0f. Valid values range |
200 // from 0.0f to 1.0f. | 199 // from 0.0f to 1.0f. |
201 float GetVolume() const; | 200 float GetVolume() const; |
202 | 201 |
203 // Attempt to set the volume of the audio renderer. Valid values for volume | 202 // Attempt to set the volume of the audio renderer. Valid values for volume |
204 // range from 0.0f (muted) to 1.0f (full volume). This value affects all | 203 // range from 0.0f (muted) to 1.0f (full volume). This value affects all |
205 // channels proportionately for multi-channel audio streams. | 204 // channels proportionately for multi-channel audio streams. |
206 void SetVolume(float volume); | 205 void SetVolume(float volume); |
207 | 206 |
208 // Set the preload value for the pipeline. | |
209 void SetPreload(Preload preload); | |
210 | |
211 // Gets the current pipeline time. For a pipeline "time" progresses from 0 to | 207 // Gets the current pipeline time. For a pipeline "time" progresses from 0 to |
212 // the end of the media. | 208 // the end of the media. |
213 base::TimeDelta GetCurrentTime() const; | 209 base::TimeDelta GetCurrentTime() const; |
214 | 210 |
215 // Get the approximate amount of playable data buffered so far in micro- | 211 // Get the approximate amount of playable data buffered so far in micro- |
216 // seconds. | 212 // seconds. |
217 base::TimeDelta GetBufferedTime(); | 213 base::TimeDelta GetBufferedTime(); |
218 | 214 |
219 // Get the duration of the media in microseconds. If the duration has not | 215 // Get the duration of the media in microseconds. If the duration has not |
220 // been determined yet, then returns 0. | 216 // been determined yet, then returns 0. |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 // Carries out stopping and destroying all filters, placing the pipeline in | 367 // Carries out stopping and destroying all filters, placing the pipeline in |
372 // the kError state. | 368 // the kError state. |
373 void ErrorChangedTask(PipelineStatus error); | 369 void ErrorChangedTask(PipelineStatus error); |
374 | 370 |
375 // Carries out notifying filters that the playback rate has changed. | 371 // Carries out notifying filters that the playback rate has changed. |
376 void PlaybackRateChangedTask(float playback_rate); | 372 void PlaybackRateChangedTask(float playback_rate); |
377 | 373 |
378 // Carries out notifying filters that the volume has changed. | 374 // Carries out notifying filters that the volume has changed. |
379 void VolumeChangedTask(float volume); | 375 void VolumeChangedTask(float volume); |
380 | 376 |
381 // Returns media preload value. | |
382 virtual Preload GetPreload() const; | |
383 | |
384 // Carries out notifying filters that the preload value has changed. | |
385 void PreloadChangedTask(Preload preload); | |
386 | |
387 // Carries out notifying filters that we are seeking to a new timestamp. | 377 // Carries out notifying filters that we are seeking to a new timestamp. |
388 void SeekTask(base::TimeDelta time, const PipelineStatusCB& seek_cb); | 378 void SeekTask(base::TimeDelta time, const PipelineStatusCB& seek_cb); |
389 | 379 |
390 // Carries out handling a notification from a filter that it has ended. | 380 // Carries out handling a notification from a filter that it has ended. |
391 void NotifyEndedTask(); | 381 void NotifyEndedTask(); |
392 | 382 |
393 // Carries out handling a notification of network event. | 383 // Carries out handling a notification of network event. |
394 void NotifyNetworkEventTask(NetworkEvent type); | 384 void NotifyNetworkEventTask(NetworkEvent type); |
395 | 385 |
396 // Carries out disabling the audio renderer. | 386 // Carries out disabling the audio renderer. |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 | 509 |
520 // Indicates whether the data source is local, such as a local media file | 510 // Indicates whether the data source is local, such as a local media file |
521 // from disk or a local webcam stream. | 511 // from disk or a local webcam stream. |
522 bool local_source_; | 512 bool local_source_; |
523 | 513 |
524 // Current volume level (from 0.0f to 1.0f). This value is set immediately | 514 // Current volume level (from 0.0f to 1.0f). This value is set immediately |
525 // via SetVolume() and a task is dispatched on the message loop to notify the | 515 // via SetVolume() and a task is dispatched on the message loop to notify the |
526 // filters. | 516 // filters. |
527 float volume_; | 517 float volume_; |
528 | 518 |
529 // Current value of preload attribute. This value is set immediately via | |
530 // SetPreload() and a task is dispatched on the message loop to notify the | |
531 // filters. | |
532 Preload preload_; | |
533 | |
534 // Current playback rate (>= 0.0f). This value is set immediately via | 519 // Current playback rate (>= 0.0f). This value is set immediately via |
535 // SetPlaybackRate() and a task is dispatched on the message loop to notify | 520 // SetPlaybackRate() and a task is dispatched on the message loop to notify |
536 // the filters. | 521 // the filters. |
537 float playback_rate_; | 522 float playback_rate_; |
538 | 523 |
539 // Playback rate to set when the current seek has finished. | 524 // Playback rate to set when the current seek has finished. |
540 float pending_playback_rate_; | 525 float pending_playback_rate_; |
541 | 526 |
542 // Reference clock. Keeps track of current playback time. Uses system | 527 // Reference clock. Keeps track of current playback time. Uses system |
543 // clock and linear interpolation, but can have its time manually set | 528 // clock and linear interpolation, but can have its time manually set |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 | 617 |
633 // True if the pipeline is actively downloading bytes, false otherwise. | 618 // True if the pipeline is actively downloading bytes, false otherwise. |
634 bool is_downloading_data_; | 619 bool is_downloading_data_; |
635 | 620 |
636 DISALLOW_COPY_AND_ASSIGN(Pipeline); | 621 DISALLOW_COPY_AND_ASSIGN(Pipeline); |
637 }; | 622 }; |
638 | 623 |
639 } // namespace media | 624 } // namespace media |
640 | 625 |
641 #endif // MEDIA_BASE_PIPELINE_H_ | 626 #endif // MEDIA_BASE_PIPELINE_H_ |
OLD | NEW |