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

Unified Diff: talk/app/webrtc/remoteaudiotrack.h

Issue 1505253004: Support for remote audio into tracks (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Address comments Created 5 years 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: talk/app/webrtc/remoteaudiotrack.h
diff --git a/talk/app/webrtc/remoteaudiotrack.h b/talk/app/webrtc/remoteaudiotrack.h
index 4ce4e792763e79a5f9f84fb98011054277375ae9..c9240ebf3ac3c4f6daa2a24698956a8c63e6626f 100644
--- a/talk/app/webrtc/remoteaudiotrack.h
+++ b/talk/app/webrtc/remoteaudiotrack.h
@@ -28,4 +28,50 @@
#ifndef TALK_APP_WEBRTC_REMOTEAUDIOTRACK_H_
#define TALK_APP_WEBRTC_REMOTEAUDIOTRACK_H_
+#include <string>
+
+#include "talk/app/webrtc/mediastreaminterface.h"
+#include "talk/app/webrtc/mediastreamtrack.h"
+#include "talk/app/webrtc/notifier.h"
+#include "webrtc/base/scoped_ptr.h"
+#include "webrtc/base/scoped_ref_ptr.h"
+
+namespace webrtc {
+
+class RemoteAudioSource;
+
+class RemoteAudioTrack : public MediaStreamTrack<AudioTrackInterface>,
+ public ObserverInterface {
+ protected:
+ // Protected ctor to force use of factory method.
+ RemoteAudioTrack(const std::string& label,
+ const rtc::scoped_refptr<RemoteAudioSource>& source);
+ ~RemoteAudioTrack() override;
+
+ public:
+ static rtc::scoped_refptr<RemoteAudioTrack> Create(
+ const std::string& id,
+ const rtc::scoped_refptr<RemoteAudioSource>& source);
+
+ private:
+ // MediaStreamTrack implementation.
+ std::string kind() const override;
+
+ // AudioTrackInterface implementation.
+ AudioSourceInterface* GetSource() const override;
+
+ void AddSink(AudioTrackSinkInterface* sink) override;
+ void RemoveSink(AudioTrackSinkInterface* sink) override;
+ bool GetSignalLevel(int* level) override;
+
+ // ObserverInterface implementation.
+ void OnChanged() override;
+
+ private:
+ const rtc::scoped_refptr<RemoteAudioSource> audio_source_;
+ RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RemoteAudioTrack);
+};
+
+} // namespace webrtc
+
#endif // TALK_APP_WEBRTC_REMOTEAUDIOTRACK_H_

Powered by Google App Engine
This is Rietveld 408576698