OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ | |
6 #define CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/compiler_specific.h" | |
10 #include "content/common/content_export.h" | |
11 #include "content/renderer/media/peer_connection_handler_base.h" | |
12 #include "third_party/WebKit/Source/Platform/chromium/public/WebRTCPeerConnectio nHandler.h" | |
13 | |
14 // RTCPeerConnectionHandler is a delegate for the RTC PeerConnection API | |
15 // messages going between WebKit and native PeerConnection in libjingle. It's | |
16 // owned by WebKit. | |
wjia(left Chromium)
2012/08/12 17:06:52
could you elaborate threading? Do all functions ca
perkj_chrome
2012/08/13 07:35:46
Done.
| |
17 class CONTENT_EXPORT RTCPeerConnectionHandler | |
18 : public PeerConnectionHandlerBase, | |
19 NON_EXPORTED_BASE(public WebKit::WebRTCPeerConnectionHandler) { | |
20 public: | |
21 RTCPeerConnectionHandler( | |
22 WebKit::WebRTCPeerConnectionHandlerClient* client, | |
23 MediaStreamDependencyFactory* dependency_factory); | |
24 virtual ~RTCPeerConnectionHandler(); | |
25 | |
26 // WebKit::WebRTCPeerConnectionHandler implementation | |
27 virtual bool initialize( | |
28 const WebKit::WebRTCConfiguration& server_configuration, | |
29 const WebKit::WebMediaConstraints& options) OVERRIDE; | |
30 | |
31 virtual void createOffer( | |
32 const WebKit::WebRTCSessionDescriptionRequest& request, | |
33 const WebKit::WebMediaConstraints& options) OVERRIDE; | |
34 virtual void createAnswer( | |
35 const WebKit::WebRTCSessionDescriptionRequest& request, | |
36 const WebKit::WebMediaConstraints& options) OVERRIDE; | |
37 | |
38 virtual void setLocalDescription( | |
39 const WebKit::WebRTCVoidRequest& request, | |
40 const WebKit::WebRTCSessionDescriptionDescriptor& description) OVERRIDE; | |
41 virtual void setRemoteDescription( | |
42 const WebKit::WebRTCVoidRequest& request, | |
43 const WebKit::WebRTCSessionDescriptionDescriptor& description) OVERRIDE; | |
44 | |
45 virtual WebKit::WebRTCSessionDescriptionDescriptor localDescription() | |
46 OVERRIDE; | |
47 virtual WebKit::WebRTCSessionDescriptionDescriptor remoteDescription() | |
48 OVERRIDE; | |
49 virtual bool updateICE( | |
50 const WebKit::WebRTCConfiguration& server_configuration, | |
51 const WebKit::WebMediaConstraints& options) OVERRIDE; | |
52 virtual bool addICECandidate( | |
53 const WebKit::WebRTCICECandidateDescriptor& candidate) OVERRIDE; | |
54 | |
55 virtual bool addStream( | |
56 const WebKit::WebMediaStreamDescriptor& stream, | |
57 const WebKit::WebMediaConstraints& options) OVERRIDE; | |
58 virtual void removeStream( | |
59 const WebKit::WebMediaStreamDescriptor& stream) OVERRIDE; | |
60 // We will be deleted by WebKit after stop has been returned. | |
61 virtual void stop() OVERRIDE; | |
62 | |
63 // webrtc::PeerConnectionObserver implementation | |
64 virtual void OnError() OVERRIDE; | |
65 virtual void OnStateChange(StateType state_changed) OVERRIDE; | |
66 virtual void OnAddStream(webrtc::MediaStreamInterface* stream) OVERRIDE; | |
67 virtual void OnRemoveStream(webrtc::MediaStreamInterface* stream) OVERRIDE; | |
68 virtual void OnIceCandidate( | |
69 const webrtc::IceCandidateInterface* candidate) OVERRIDE; | |
70 virtual void OnIceComplete() OVERRIDE; | |
71 virtual void OnRenegotiationNeeded() OVERRIDE; | |
72 | |
73 private: | |
74 webrtc::SessionDescriptionInterface* CreateNativeSessionDescription( | |
75 const WebKit::WebRTCSessionDescriptionDescriptor& description); | |
76 | |
77 // client_ is a weak pointer, and is valid until stop() has returned. | |
wjia(left Chromium)
2012/08/12 17:06:52
|client_|
perkj_chrome
2012/08/13 07:35:46
Done.
| |
78 WebKit::WebRTCPeerConnectionHandlerClient* client_; | |
79 | |
80 DISALLOW_COPY_AND_ASSIGN(RTCPeerConnectionHandler); | |
81 }; | |
82 | |
83 #endif // CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ | |
OLD | NEW |