| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_CAPTURER_SINK_OWNER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_CAPTURER_SINK_OWNER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_CAPTURER_SINK_OWNER_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_CAPTURER_SINK_OWNER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/synchronization/lock.h" | 11 #include "base/synchronization/lock.h" |
| 12 #include "content/renderer/media/webrtc_audio_device_impl.h" | 12 #include "content/renderer/media/webrtc_audio_device_impl.h" |
| 13 #include "media/audio/audio_parameters.h" | 13 #include "media/audio/audio_parameters.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 | 16 |
| 17 class WebRtcAudioCapturerSink; | |
| 18 | |
| 19 // Reference counted container of WebRtcAudioCapturerSink delegates. | 17 // Reference counted container of WebRtcAudioCapturerSink delegates. |
| 20 class WebRtcAudioCapturerSinkOwner | 18 class WebRtcAudioCapturerSinkOwner |
| 21 : public base::RefCountedThreadSafe<WebRtcAudioCapturerSinkOwner>, | 19 : public base::RefCountedThreadSafe<WebRtcAudioCapturerSinkOwner>, |
| 22 public WebRtcAudioCapturerSink { | 20 public WebRtcAudioCapturerSink { |
| 23 public: | 21 public: |
| 24 explicit WebRtcAudioCapturerSinkOwner(WebRtcAudioCapturerSink* sink); | 22 explicit WebRtcAudioCapturerSinkOwner(WebRtcAudioCapturerSink* sink); |
| 25 | 23 |
| 26 // WebRtcAudioCapturerSink implementation. | 24 // WebRtcAudioCapturerSink implementation. |
| 27 virtual int CaptureData(const std::vector<int>& channels, | 25 virtual int CaptureData(const std::vector<int>& channels, |
| 28 const int16* audio_data, | 26 const int16* audio_data, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 57 friend class base::RefCountedThreadSafe<WebRtcAudioCapturerSinkOwner>; | 55 friend class base::RefCountedThreadSafe<WebRtcAudioCapturerSinkOwner>; |
| 58 WebRtcAudioCapturerSink* delegate_; | 56 WebRtcAudioCapturerSink* delegate_; |
| 59 mutable base::Lock lock_; | 57 mutable base::Lock lock_; |
| 60 | 58 |
| 61 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioCapturerSinkOwner); | 59 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioCapturerSinkOwner); |
| 62 }; | 60 }; |
| 63 | 61 |
| 64 } // namespace content | 62 } // namespace content |
| 65 | 63 |
| 66 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_CAPTURER_SINK_OWNER_H_ | 64 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_CAPTURER_SINK_OWNER_H_ |
| OLD | NEW |