OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_SINK_OWNER_H_ | |
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_SINK_OWNER_H_ | |
7 | |
8 #include <vector> | |
9 | |
10 #include "base/macros.h" | |
11 #include "base/synchronization/lock.h" | |
12 #include "content/renderer/media/media_stream_audio_track_sink.h" | |
13 | |
14 namespace content { | |
15 | |
16 class MediaStreamAudioSink; | |
17 | |
18 // Reference counted holder of MediaStreamAudioSink sinks. | |
19 class MediaStreamAudioSinkOwner : public MediaStreamAudioTrackSink { | |
20 public: | |
21 explicit MediaStreamAudioSinkOwner(MediaStreamAudioSink* sink); | |
22 | |
23 // MediaStreamAudioTrackSink implementation. | |
24 void OnData(const media::AudioBus& audio_bus, | |
25 base::TimeTicks estimated_capture_time) override; | |
26 void OnSetFormat(const media::AudioParameters& params) override; | |
27 void OnReadyStateChanged( | |
28 blink::WebMediaStreamSource::ReadyState state) override; | |
29 void Reset() override; | |
30 bool IsEqual(const MediaStreamAudioSink* other) const override; | |
31 | |
32 protected: | |
33 ~MediaStreamAudioSinkOwner() override {} | |
34 | |
35 private: | |
36 mutable base::Lock lock_; | |
37 | |
38 // Raw pointer to the delegate, the client need to call Reset() to set the | |
39 // pointer to NULL before the delegate goes away. | |
40 MediaStreamAudioSink* delegate_; | |
41 | |
42 DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioSinkOwner); | |
43 }; | |
44 | |
45 } // namespace content | |
46 | |
47 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_AUDIO_SINK_OWNER_H_ | |
OLD | NEW |