OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_MEDIA_STREAM_REMOTE_AUDIO_TRACK_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_MEDIA_STREAM_REMOTE_AUDIO_TRACK_H_ |
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_MEDIA_STREAM_REMOTE_AUDIO_TRACK_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_MEDIA_STREAM_REMOTE_AUDIO_TRACK_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "content/renderer/media/media_stream_track.h" | 9 #include "content/renderer/media/media_stream_audio_track.h" |
10 | 10 |
11 namespace content { | 11 namespace content { |
12 | 12 |
13 // MediaStreamRemoteAudioTrack is a WebRTC specific implementation of an | 13 // MediaStreamRemoteAudioTrack is a WebRTC specific implementation of an |
14 // audio track received from a PeerConnection. | 14 // audio track received from a PeerConnection. |
15 class MediaStreamRemoteAudioTrack : public MediaStreamTrack { | 15 // TODO(tommi): Chrome shouldn't have to care about remote vs local so |
| 16 // we should have a single track implementation that delegates to the |
| 17 // sources that do different things depending on the type of source. |
| 18 class MediaStreamRemoteAudioTrack : public MediaStreamAudioTrack { |
16 public: | 19 public: |
17 explicit MediaStreamRemoteAudioTrack( | 20 explicit MediaStreamRemoteAudioTrack( |
18 const scoped_refptr<webrtc::AudioTrackInterface>& track); | 21 const scoped_refptr<webrtc::AudioTrackInterface>& track); |
19 ~MediaStreamRemoteAudioTrack() override; | 22 ~MediaStreamRemoteAudioTrack() override; |
20 | 23 |
21 void SetEnabled(bool enabled) override; | 24 void SetEnabled(bool enabled) override; |
22 void Stop() override; | 25 void Stop() override; |
23 | 26 |
| 27 void AddSink(MediaStreamAudioSink* sink) override; |
| 28 void RemoveSink(MediaStreamAudioSink* sink) override; |
| 29 media::AudioParameters GetOutputFormat() const override; |
| 30 |
24 webrtc::AudioTrackInterface* GetAudioAdapter() override; | 31 webrtc::AudioTrackInterface* GetAudioAdapter() override; |
25 | 32 |
26 private: | 33 private: |
| 34 class AudioSink; |
| 35 scoped_ptr<AudioSink> sink_; |
27 const scoped_refptr<webrtc::AudioTrackInterface> track_; | 36 const scoped_refptr<webrtc::AudioTrackInterface> track_; |
28 }; | 37 }; |
29 | 38 |
30 } // namespace content | 39 } // namespace content |
31 | 40 |
32 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_MEDIA_STREAM_REMOTE_AUDIO_TRACK_H_ | 41 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_MEDIA_STREAM_REMOTE_AUDIO_TRACK_H_ |
OLD | NEW |