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

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

Issue 1522903002: Add a 'remote' property to MediaSourceInterface. Also adding an implementation to the relevant sour… (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
« no previous file with comments | « no previous file | talk/app/webrtc/audiotrack.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/audiotrack.h
diff --git a/talk/app/webrtc/audiotrack.h b/talk/app/webrtc/audiotrack.h
index 750f272ba2b79c8dcd4ccc14de83b55ca43d4ec4..55f48377145ef044942b397357c6dc41c5bf97d5 100644
--- a/talk/app/webrtc/audiotrack.h
+++ b/talk/app/webrtc/audiotrack.h
@@ -28,40 +28,47 @@
#ifndef TALK_APP_WEBRTC_AUDIOTRACK_H_
#define TALK_APP_WEBRTC_AUDIOTRACK_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"
+#include "webrtc/base/thread_checker.h"
namespace webrtc {
-class AudioTrack : public MediaStreamTrack<AudioTrackInterface> {
+class AudioTrack : public MediaStreamTrack<AudioTrackInterface>,
+ public ObserverInterface {
+ protected:
+ // Protected ctor to force use of factory method.
+ AudioTrack(const std::string& label,
+ const rtc::scoped_refptr<AudioSourceInterface>& source);
+ ~AudioTrack() override;
+
public:
static rtc::scoped_refptr<AudioTrack> Create(
- const std::string& id, AudioSourceInterface* source);
-
- // AudioTrackInterface implementation.
- AudioSourceInterface* GetSource() const override {
- return audio_source_.get();
- }
- // TODO(xians): Implement these methods.
- void AddSink(AudioTrackSinkInterface* sink) override {}
- void RemoveSink(AudioTrackSinkInterface* sink) override {}
- bool GetSignalLevel(int* level) override { return false; }
- rtc::scoped_refptr<AudioProcessorInterface> GetAudioProcessor() override {
- return NULL;
- }
- cricket::AudioRenderer* GetRenderer() override { return NULL; }
+ const std::string& id,
+ const rtc::scoped_refptr<AudioSourceInterface>& source);
+ private:
// MediaStreamTrack implementation.
std::string kind() const override;
- protected:
- AudioTrack(const std::string& label, AudioSourceInterface* audio_source);
+ // AudioTrackInterface implementation.
+ AudioSourceInterface* GetSource() const override;
+
+ void AddSink(AudioTrackSinkInterface* sink) override;
+ void RemoveSink(AudioTrackSinkInterface* sink) override;
+
+ // ObserverInterface implementation.
+ void OnChanged() override;
private:
- rtc::scoped_refptr<AudioSourceInterface> audio_source_;
+ const rtc::scoped_refptr<AudioSourceInterface> audio_source_;
+ rtc::ThreadChecker thread_checker_;
+ RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioTrack);
};
} // namespace webrtc
« no previous file with comments | « no previous file | talk/app/webrtc/audiotrack.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698