Index: talk/app/webrtc/mediacontroller.h |
diff --git a/talk/app/webrtc/audiotrackrenderer.h b/talk/app/webrtc/mediacontroller.h |
similarity index 59% |
copy from talk/app/webrtc/audiotrackrenderer.h |
copy to talk/app/webrtc/mediacontroller.h |
index e22805fe19ef918a5983ab2bad9b16a05cd902ff..d14072d3e8ff39fd735e8f75cf85b129dcee84ac 100644 |
--- a/talk/app/webrtc/audiotrackrenderer.h |
+++ b/talk/app/webrtc/mediacontroller.h |
@@ -1,6 +1,6 @@ |
/* |
* libjingle |
- * Copyright 2013 Google Inc. |
+ * Copyright 2015 Google Inc. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are met: |
@@ -25,35 +25,42 @@ |
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef TALK_APP_WEBRTC_AUDIOTRACKRENDERER_H_ |
-#define TALK_APP_WEBRTC_AUDIOTRACKRENDERER_H_ |
+#ifndef TALK_APP_WEBRTC_MEDIACONTROLLER_H_ |
+#define TALK_APP_WEBRTC_MEDIACONTROLLER_H_ |
-#include "talk/media/base/audiorenderer.h" |
+#include "webrtc/base/criticalsection.h" |
#include "webrtc/base/thread.h" |
+#include "webrtc/call.h" |
-namespace webrtc { |
+namespace cricket { |
+class MediaEngineInterface; |
+class VideoChannel; |
+} // namespace cricket |
-// Class used for AudioTrack to get the ID of WebRtc voice channel that |
-// the AudioTrack is connecting to. |
-// Each AudioTrack owns a AudioTrackRenderer instance. |
-// AddChannel() will be called when an AudioTrack is added to a MediaStream. |
-// RemoveChannel will be called when the AudioTrack or WebRtc VoE channel is |
-// going away. |
-// This implementation only supports one channel, and it is only used by |
-// Chrome for remote audio tracks." |
-class AudioTrackRenderer : public cricket::AudioRenderer { |
+namespace webrtc { |
+class MediaController : public webrtc::LoadObserver { |
pthatcher1
2015/09/02 21:24:22
This needs a comment saying what it is.
the sun
2015/09/03 15:00:46
Done.
|
public: |
- AudioTrackRenderer(); |
- ~AudioTrackRenderer(); |
+ MediaController(rtc::Thread* worker_thread, |
+ cricket::MediaEngineInterface* media_engine); |
+ ~MediaController() override; |
+ |
+ webrtc::Call* call() { return call_.get(); } |
pthatcher1
2015/09/02 21:24:22
Can this be called from any thread? I think it ne
|
+ void set_video_channel(cricket::VideoChannel* video_channel); |
pthatcher1
2015/09/02 21:24:22
Similarly here: I think this is "_w".
the sun
2015/09/03 15:00:46
Part of the LoadObserver discussion, but no, this
|
- // Implements cricket::AudioRenderer. |
- void AddChannel(int channel_id) override; |
- void RemoveChannel(int channel_id) override; |
+ // Implements webrtc::LoadObserver. |
+ void OnLoadUpdate(Load load) override; |
private: |
- int channel_id_; |
-}; |
+ void Construct_w(cricket::MediaEngineInterface* media_engine); |
+ void Destruct_w(); |
+ |
+ rtc::Thread* worker_thread_; |
+ rtc::scoped_ptr<webrtc::Call> call_; |
+ rtc::CriticalSection critical_section_; |
+ cricket::VideoChannel* video_channel_ GUARDED_BY(critical_section_); |
+ DISALLOW_IMPLICIT_CONSTRUCTORS(MediaController); |
+}; |
} // namespace webrtc |
-#endif // TALK_APP_WEBRTC_AUDIOTRACKRENDERER_H_ |
+#endif // TALK_APP_WEBRTC_MEDIACONTROLLER_H_ |