OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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_WEBRTC_PROCESSED_LOCAL_AUDIO_TRACK_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_PROCESSED_LOCAL_AUDIO_TRACK_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" |
| 10 #include "content/renderer/media/media_stream_audio_track.h" |
| 11 |
| 12 namespace content { |
| 13 |
| 14 class WebRtcLocalAudioTrackAdapter; |
| 15 |
| 16 // A MediaStreamAudioTrack that also holds a WebRtcLocalAudioTrackAdapter and |
| 17 // provides an "adapter" bridge between the media stream object graph in the |
| 18 // content namespace and the separate object graph in the webrtc namespace. |
| 19 // |
| 20 // This class is instantiated by ProcessLocalAudioSource. |
| 21 class CONTENT_EXPORT ProcessedLocalAudioTrack |
| 22 : NON_EXPORTED_BASE(public MediaStreamAudioTrack) { |
| 23 public: |
| 24 explicit ProcessedLocalAudioTrack( |
| 25 const scoped_refptr<WebRtcLocalAudioTrackAdapter>& adapter); |
| 26 |
| 27 ~ProcessedLocalAudioTrack() override; |
| 28 |
| 29 // If |track| is an instance of ProcessedLocalAudioTrack, return a type-casted |
| 30 // pointer to it. Otherwise, return null. |
| 31 static ProcessedLocalAudioTrack* From(MediaStreamAudioTrack* track); |
| 32 |
| 33 WebRtcLocalAudioTrackAdapter* adapter() const { return adapter_.get(); } |
| 34 |
| 35 // MediaStreamTrack override. |
| 36 void SetEnabled(bool enabled) override; |
| 37 |
| 38 private: |
| 39 // MediaStreamAudioTrack override. |
| 40 void* GetClassIdentifier() const final; |
| 41 |
| 42 // All usage of libjingle is through this adapter. The adapter holds |
| 43 // a pointer to this object, but no reference. |
| 44 const scoped_refptr<WebRtcLocalAudioTrackAdapter> adapter_; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(ProcessedLocalAudioTrack); |
| 47 }; |
| 48 |
| 49 } // namespace content |
| 50 |
| 51 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_PROCESSED_LOCAL_AUDIO_TRACK_H_ |
OLD | NEW |