Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Unified Diff: content/renderer/media/webrtc/processed_local_audio_track.h

Issue 1647773002: MediaStream audio sourcing: Bypass audio processing for non-WebRTC cases. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NOT FOR REVIEW -- This will be broken-up across multiple CLs. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698