OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 11 matching lines...) Expand all Loading... |
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | 22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | 23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 */ | 26 */ |
27 | 27 |
28 #ifndef TALK_APP_WEBRTC_MEDIACONTROLLER_H_ | 28 #ifndef TALK_APP_WEBRTC_MEDIACONTROLLER_H_ |
29 #define TALK_APP_WEBRTC_MEDIACONTROLLER_H_ | 29 #define TALK_APP_WEBRTC_MEDIACONTROLLER_H_ |
30 | 30 |
31 #include "webrtc/base/thread.h" | 31 #include "webrtc/base/thread.h" |
| 32 #include "webrtc/common_types.h" |
| 33 #include "webrtc/call.h" |
| 34 |
| 35 namespace cricket { |
| 36 class TransportChannel; |
| 37 } // namespace cricket |
32 | 38 |
33 namespace webrtc { | 39 namespace webrtc { |
34 class Call; | |
35 class VoiceEngine; | 40 class VoiceEngine; |
36 | 41 |
| 42 class CallFactory { |
| 43 public: |
| 44 virtual Call* CreateCall(const webrtc::Call::Config& config) { |
| 45 return webrtc::Call::Create(config); |
| 46 } |
| 47 }; |
| 48 |
37 // The MediaController currently owns shared state between media channels, but | 49 // The MediaController currently owns shared state between media channels, but |
38 // in the future will create and own RtpSenders and RtpReceivers. | 50 // in the future will create and own RtpSenders and RtpReceivers. |
39 class MediaControllerInterface { | 51 class MediaControllerInterface { |
40 public: | 52 public: |
41 static MediaControllerInterface* Create(rtc::Thread* worker_thread, | 53 static MediaControllerInterface* Create(rtc::Thread* worker_thread, |
42 webrtc::VoiceEngine* voice_engine); | 54 webrtc::VoiceEngine* voice_engine); |
43 | 55 |
| 56 // Ownership of call_factory is passed on to the MediaController. |
| 57 static MediaControllerInterface* Create(CallFactory* call_factory, |
| 58 rtc::Thread* worker_thread, |
| 59 webrtc::VoiceEngine* voice_engine); |
| 60 |
44 virtual ~MediaControllerInterface() {} | 61 virtual ~MediaControllerInterface() {} |
45 virtual webrtc::Call* call_w() = 0; | 62 virtual webrtc::Call* call_w() = 0; |
| 63 // Connects the media controller to a transport channel's SignalSentPacket. |
| 64 // This method should be called with the transport channel of newly created |
| 65 // BaseChannels. |
| 66 // The media controller will not be notified when transport channels are |
| 67 // removed to avoid having to reference count them, therefore the media |
| 68 // controller may have dangling pointers to transport channels. |
| 69 // TODO(holmer): This should be removed once we have RtpSenders and |
| 70 // RtpTransports, which the MediaController will have direct access to. |
| 71 virtual void ConnectToSignalSentPacket_w( |
| 72 cricket::TransportChannel* transport_channel) = 0; |
46 }; | 73 }; |
47 } // namespace webrtc | 74 } // namespace webrtc |
48 | 75 |
49 #endif // TALK_APP_WEBRTC_MEDIACONTROLLER_H_ | 76 #endif // TALK_APP_WEBRTC_MEDIACONTROLLER_H_ |
OLD | NEW |