Index: content/renderer/media/webrtc/processed_local_audio_track.h |
diff --git a/content/renderer/media/webrtc/processed_local_audio_track.h b/content/renderer/media/webrtc/processed_local_audio_track.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b2d019ab000106957eee4edbe93bf1a9b6554c6b |
--- /dev/null |
+++ b/content/renderer/media/webrtc/processed_local_audio_track.h |
@@ -0,0 +1,51 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_RENDERER_MEDIA_WEBRTC_PROCESSED_LOCAL_AUDIO_TRACK_H_ |
+#define CONTENT_RENDERER_MEDIA_WEBRTC_PROCESSED_LOCAL_AUDIO_TRACK_H_ |
+ |
+#include "base/macros.h" |
+#include "base/memory/ref_counted.h" |
+#include "content/renderer/media/media_stream_audio_track.h" |
+ |
+namespace content { |
+ |
+class WebRtcLocalAudioTrackAdapter; |
+ |
+// A MediaStreamAudioTrack that also holds a WebRtcLocalAudioTrackAdapter and |
+// provides an "adapter" bridge between the media stream object graph in the |
+// content namespace and the separate object graph in the webrtc namespace. |
+// |
+// This class is instantiated by ProcessLocalAudioSource. |
+class CONTENT_EXPORT ProcessedLocalAudioTrack |
+ : NON_EXPORTED_BASE(public MediaStreamAudioTrack) { |
+ public: |
+ explicit ProcessedLocalAudioTrack( |
+ const scoped_refptr<WebRtcLocalAudioTrackAdapter>& adapter); |
+ |
+ ~ProcessedLocalAudioTrack() override; |
+ |
+ // If |track| is an instance of ProcessedLocalAudioTrack, return a type-casted |
+ // pointer to it. Otherwise, return null. |
+ static ProcessedLocalAudioTrack* From(MediaStreamAudioTrack* track); |
+ |
+ WebRtcLocalAudioTrackAdapter* adapter() const { return adapter_.get(); } |
+ |
+ // MediaStreamTrack override. |
+ void SetEnabled(bool enabled) override; |
+ |
+ private: |
+ // MediaStreamAudioTrack override. |
+ void* GetClassIdentifier() const final; |
+ |
+ // All usage of libjingle is through this adapter. The adapter holds |
+ // a pointer to this object, but no reference. |
+ const scoped_refptr<WebRtcLocalAudioTrackAdapter> adapter_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ProcessedLocalAudioTrack); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_RENDERER_MEDIA_WEBRTC_PROCESSED_LOCAL_AUDIO_TRACK_H_ |