| 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_SINK_H_ |    5 #ifndef MEDIA_BASE_AUDIO_RENDERER_SINK_H_ | 
|    6 #define MEDIA_BASE_AUDIO_RENDERER_SINK_H_ |    6 #define MEDIA_BASE_AUDIO_RENDERER_SINK_H_ | 
|    7  |    7  | 
|    8 #include <stdint.h> |    8 #include <stdint.h> | 
|    9  |    9  | 
|   10 #include <string> |   10 #include <string> | 
| (...skipping 12 matching lines...) Expand all  Loading... | 
|   23 // periodically call Render() on a callback object. |   23 // periodically call Render() on a callback object. | 
|   24  |   24  | 
|   25 class AudioRendererSink |   25 class AudioRendererSink | 
|   26     : public base::RefCountedThreadSafe<media::AudioRendererSink> { |   26     : public base::RefCountedThreadSafe<media::AudioRendererSink> { | 
|   27  public: |   27  public: | 
|   28   class RenderCallback { |   28   class RenderCallback { | 
|   29    public: |   29    public: | 
|   30     // Attempts to completely fill all channels of |dest|, returns actual |   30     // Attempts to completely fill all channels of |dest|, returns actual | 
|   31     // number of frames filled. |frames_skipped| contains the number of frames |   31     // number of frames filled. |frames_skipped| contains the number of frames | 
|   32     // the consumer has skipped, if any. |   32     // the consumer has skipped, if any. | 
 |   33     // TODO(jameswest): Change to use the same signature as | 
 |   34     // AudioOutputStream::AudioSourceCallback::OnMoreData. | 
|   33     virtual int Render(AudioBus* dest, |   35     virtual int Render(AudioBus* dest, | 
|   34                        uint32_t frames_delayed, |   36                        uint32_t frames_delayed, | 
|   35                        uint32_t frames_skipped) = 0; |   37                        uint32_t frames_skipped) = 0; | 
|   36  |   38  | 
|   37     // Signals an error has occurred. |   39     // Signals an error has occurred. | 
|   38     virtual void OnRenderError() = 0; |   40     virtual void OnRenderError() = 0; | 
|   39  |   41  | 
|   40    protected: |   42    protected: | 
|   41     virtual ~RenderCallback() {} |   43     virtual ~RenderCallback() {} | 
|   42   }; |   44   }; | 
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  101                                   const url::Origin& security_origin, |  103                                   const url::Origin& security_origin, | 
|  102                                   const OutputDeviceStatusCB& callback) = 0; |  104                                   const OutputDeviceStatusCB& callback) = 0; | 
|  103  |  105  | 
|  104  protected: |  106  protected: | 
|  105   ~SwitchableAudioRendererSink() override {} |  107   ~SwitchableAudioRendererSink() override {} | 
|  106 }; |  108 }; | 
|  107  |  109  | 
|  108 }  // namespace media |  110 }  // namespace media | 
|  109  |  111  | 
|  110 #endif  // MEDIA_BASE_AUDIO_RENDERER_SINK_H_ |  112 #endif  // MEDIA_BASE_AUDIO_RENDERER_SINK_H_ | 
| OLD | NEW |