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_AUDIO_RENDERER_H_ | 5 #ifndef MEDIA_BASE_AUDIO_RENDERER_H_ |
6 #define MEDIA_BASE_AUDIO_RENDERER_H_ | 6 #define MEDIA_BASE_AUDIO_RENDERER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "media/base/buffering_state.h" | 10 #include "media/base/buffering_state.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 // |stream| is encrypted. | 32 // |stream| is encrypted. |
33 // | 33 // |
34 // |statistics_cb| is executed periodically with audio rendering stats. | 34 // |statistics_cb| is executed periodically with audio rendering stats. |
35 // | 35 // |
36 // |buffering_state_cb| is executed when audio rendering has either run out of | 36 // |buffering_state_cb| is executed when audio rendering has either run out of |
37 // data or has enough data to continue playback. | 37 // data or has enough data to continue playback. |
38 // | 38 // |
39 // |ended_cb| is executed when audio rendering has reached the end of stream. | 39 // |ended_cb| is executed when audio rendering has reached the end of stream. |
40 // | 40 // |
41 // |error_cb| is executed if an error was encountered after initialization. | 41 // |error_cb| is executed if an error was encountered after initialization. |
42 virtual void Initialize(DemuxerStream* stream, | 42 // |
43 const PipelineStatusCB& init_cb, | 43 // |waiting_for_decryption_key_cb| is called whenever the key needed to |
44 const SetDecryptorReadyCB& set_decryptor_ready_cb, | 44 // decrypt the stream is not available. |
45 const StatisticsCB& statistics_cb, | 45 virtual void Initialize( |
46 const BufferingStateCB& buffering_state_cb, | 46 DemuxerStream* stream, |
47 const base::Closure& ended_cb, | 47 const PipelineStatusCB& init_cb, |
48 const PipelineStatusCB& error_cb) = 0; | 48 const SetDecryptorReadyCB& set_decryptor_ready_cb, |
| 49 const StatisticsCB& statistics_cb, |
| 50 const BufferingStateCB& buffering_state_cb, |
| 51 const base::Closure& ended_cb, |
| 52 const PipelineStatusCB& error_cb, |
| 53 const base::Closure& waiting_for_decryption_key_cb) = 0; |
49 | 54 |
50 // Returns the TimeSource associated with audio rendering. | 55 // Returns the TimeSource associated with audio rendering. |
51 virtual TimeSource* GetTimeSource() = 0; | 56 virtual TimeSource* GetTimeSource() = 0; |
52 | 57 |
53 // Discard any audio data, executing |callback| when completed. | 58 // Discard any audio data, executing |callback| when completed. |
54 // | 59 // |
55 // Clients should expect |buffering_state_cb| to be called with | 60 // Clients should expect |buffering_state_cb| to be called with |
56 // BUFFERING_HAVE_NOTHING while flushing is in progress. | 61 // BUFFERING_HAVE_NOTHING while flushing is in progress. |
57 virtual void Flush(const base::Closure& callback) = 0; | 62 virtual void Flush(const base::Closure& callback) = 0; |
58 | 63 |
59 // Starts playback by reading from |stream| and decoding and rendering audio. | 64 // Starts playback by reading from |stream| and decoding and rendering audio. |
60 // | 65 // |
61 // Only valid to call after a successful Initialize() or Flush(). | 66 // Only valid to call after a successful Initialize() or Flush(). |
62 virtual void StartPlaying() = 0; | 67 virtual void StartPlaying() = 0; |
63 | 68 |
64 // Sets the output volume. | 69 // Sets the output volume. |
65 virtual void SetVolume(float volume) = 0; | 70 virtual void SetVolume(float volume) = 0; |
66 | 71 |
67 private: | 72 private: |
68 DISALLOW_COPY_AND_ASSIGN(AudioRenderer); | 73 DISALLOW_COPY_AND_ASSIGN(AudioRenderer); |
69 }; | 74 }; |
70 | 75 |
71 } // namespace media | 76 } // namespace media |
72 | 77 |
73 #endif // MEDIA_BASE_AUDIO_RENDERER_H_ | 78 #endif // MEDIA_BASE_AUDIO_RENDERER_H_ |
OLD | NEW |