Index: talk/app/webrtc/mediacontroller.h |
diff --git a/talk/app/webrtc/audiotrackrenderer.h b/talk/app/webrtc/mediacontroller.h |
similarity index 58% |
copy from talk/app/webrtc/audiotrackrenderer.h |
copy to talk/app/webrtc/mediacontroller.h |
index e22805fe19ef918a5983ab2bad9b16a05cd902ff..038e00d2adab9f728499e82265c173ff32b6d51d 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,44 @@ |
* 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 cricket { |
+class VideoChannel; |
+} // namespace cricket |
namespace webrtc { |
+class VoiceEngine; |
-// 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 { |
+// MediaController owns state shared between multiple concurrent media streams. |
pthatcher1
2015/09/04 04:52:31
What does "concurrent" mean?
And what does "medi
the sun
2015/09/04 10:18:47
"media stream" was referring to the actual stream
|
+class MediaController : public webrtc::LoadObserver { |
public: |
- AudioTrackRenderer(); |
- ~AudioTrackRenderer(); |
+ MediaController(rtc::Thread* worker_thread, |
+ webrtc::VoiceEngine* voice_engine); |
+ ~MediaController() override; |
+ |
+ webrtc::Call* call() { return call_.get(); } |
pthatcher1
2015/09/04 04:52:31
This still needs clear thread safety.
the sun
2015/09/04 10:18:47
Let me first say that thread safety is a very big
pthatcher1
2015/09/04 22:58:32
That's exactly why we're refactoring ChannelManage
|
+ void set_video_channel(cricket::VideoChannel* video_channel); |
- // 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(webrtc::VoiceEngine* voice_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_ |