| 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 CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ |
| 7 | 7 |
| 8 #include <string> |
| 9 |
| 8 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 9 #include "base/synchronization/lock.h" | 11 #include "base/synchronization/lock.h" |
| 10 #include "base/threading/non_thread_safe.h" | 12 #include "base/threading/non_thread_safe.h" |
| 11 #include "base/threading/thread_checker.h" | 13 #include "base/threading/thread_checker.h" |
| 12 #include "content/renderer/media/media_stream_audio_renderer.h" | 14 #include "content/renderer/media/media_stream_audio_renderer.h" |
| 13 #include "content/renderer/media/webrtc_audio_device_impl.h" | 15 #include "content/renderer/media/webrtc_audio_device_impl.h" |
| 14 #include "media/base/audio_decoder.h" | 16 #include "media/base/audio_decoder.h" |
| 15 #include "media/base/audio_pull_fifo.h" | 17 #include "media/base/audio_pull_fifo.h" |
| 16 #include "media/base/audio_renderer_sink.h" | 18 #include "media/base/audio_renderer_sink.h" |
| 17 #include "media/base/channel_layout.h" | 19 #include "media/base/channel_layout.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 109 |
| 108 private: | 110 private: |
| 109 // MediaStreamAudioRenderer implementation. This is private since we want | 111 // MediaStreamAudioRenderer implementation. This is private since we want |
| 110 // callers to use proxy objects. | 112 // callers to use proxy objects. |
| 111 // TODO(tommi): Make the MediaStreamAudioRenderer implementation a pimpl? | 113 // TODO(tommi): Make the MediaStreamAudioRenderer implementation a pimpl? |
| 112 void Start() override; | 114 void Start() override; |
| 113 void Play() override; | 115 void Play() override; |
| 114 void Pause() override; | 116 void Pause() override; |
| 115 void Stop() override; | 117 void Stop() override; |
| 116 void SetVolume(float volume) override; | 118 void SetVolume(float volume) override; |
| 119 void SwitchOutputDevice(const std::string& device_id, |
| 120 const GURL& security_origin, |
| 121 const base::Callback<void(int)>& callback) override; |
| 117 base::TimeDelta GetCurrentRenderTime() const override; | 122 base::TimeDelta GetCurrentRenderTime() const override; |
| 118 bool IsLocalRenderer() const override; | 123 bool IsLocalRenderer() const override; |
| 119 | 124 |
| 120 // Called when an audio renderer, either the main or a proxy, starts playing. | 125 // Called when an audio renderer, either the main or a proxy, starts playing. |
| 121 // Here we maintain a reference count of how many renderers are currently | 126 // Here we maintain a reference count of how many renderers are currently |
| 122 // playing so that the shared play state of all the streams can be reflected | 127 // playing so that the shared play state of all the streams can be reflected |
| 123 // correctly. | 128 // correctly. |
| 124 void EnterPlayState(); | 129 void EnterPlayState(); |
| 125 | 130 |
| 126 // Called when an audio renderer, either the main or a proxy, is paused. | 131 // Called when an audio renderer, either the main or a proxy, is paused. |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 // Used for triggering new UMA histogram. Counts number of render | 242 // Used for triggering new UMA histogram. Counts number of render |
| 238 // callbacks modulo |kNumCallbacksBetweenRenderTimeHistograms|. | 243 // callbacks modulo |kNumCallbacksBetweenRenderTimeHistograms|. |
| 239 int render_callback_count_; | 244 int render_callback_count_; |
| 240 | 245 |
| 241 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcAudioRenderer); | 246 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcAudioRenderer); |
| 242 }; | 247 }; |
| 243 | 248 |
| 244 } // namespace content | 249 } // namespace content |
| 245 | 250 |
| 246 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ | 251 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ |
| OLD | NEW |