Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ | 6 #define CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "content/renderer/media/peer_connection_handler_base.h" | 11 #include "content/renderer/media/peer_connection_handler_base.h" |
| 12 #include "content/renderer/media/webaudio_capturer_source.h" | |
| 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebRTCPeerConnectio nHandler.h" | 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebRTCPeerConnectio nHandler.h" |
| 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebVector.h" | |
| 13 | 15 |
| 14 namespace WebKit { | 16 namespace WebKit { |
| 15 class WebFrame; | 17 class WebFrame; |
| 16 } | 18 } |
| 17 | 19 |
| 18 namespace content { | 20 namespace content { |
| 19 | 21 |
| 20 // RTCPeerConnectionHandler is a delegate for the RTC PeerConnection API | 22 // RTCPeerConnectionHandler is a delegate for the RTC PeerConnection API |
| 21 // messages going between WebKit and native PeerConnection in libjingle. It's | 23 // messages going between WebKit and native PeerConnection in libjingle. It's |
| 22 // owned by WebKit. | 24 // owned by WebKit. |
| 23 // WebKit call all of these methods on the main render thread. | 25 // WebKit call all of these methods on the main render thread |
| 26 // except for consumeAudio(). | |
| 24 // Callbacks to the webrtc::PeerConnectionObserver implementation also occur on | 27 // Callbacks to the webrtc::PeerConnectionObserver implementation also occur on |
| 25 // the main render thread. | 28 // the main render thread. |
| 26 class CONTENT_EXPORT RTCPeerConnectionHandler | 29 class CONTENT_EXPORT RTCPeerConnectionHandler |
| 27 : public PeerConnectionHandlerBase, | 30 : public PeerConnectionHandlerBase, |
| 28 NON_EXPORTED_BASE(public WebKit::WebRTCPeerConnectionHandler) { | 31 NON_EXPORTED_BASE(public WebKit::WebRTCPeerConnectionHandler) { |
| 29 public: | 32 public: |
| 30 RTCPeerConnectionHandler( | 33 RTCPeerConnectionHandler( |
| 31 WebKit::WebRTCPeerConnectionHandlerClient* client, | 34 WebKit::WebRTCPeerConnectionHandlerClient* client, |
| 32 MediaStreamDependencyFactory* dependency_factory); | 35 MediaStreamDependencyFactory* dependency_factory); |
| 33 virtual ~RTCPeerConnectionHandler(); | 36 virtual ~RTCPeerConnectionHandler(); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 const WebKit::WebRTCICECandidate& candidate) OVERRIDE; | 72 const WebKit::WebRTCICECandidate& candidate) OVERRIDE; |
| 70 | 73 |
| 71 virtual bool addStream( | 74 virtual bool addStream( |
| 72 const WebKit::WebMediaStreamDescriptor& stream, | 75 const WebKit::WebMediaStreamDescriptor& stream, |
| 73 const WebKit::WebMediaConstraints& options) OVERRIDE; | 76 const WebKit::WebMediaConstraints& options) OVERRIDE; |
| 74 virtual void removeStream( | 77 virtual void removeStream( |
| 75 const WebKit::WebMediaStreamDescriptor& stream) OVERRIDE; | 78 const WebKit::WebMediaStreamDescriptor& stream) OVERRIDE; |
| 76 // We will be deleted by WebKit after stop has been returned. | 79 // We will be deleted by WebKit after stop has been returned. |
| 77 virtual void stop() OVERRIDE; | 80 virtual void stop() OVERRIDE; |
| 78 | 81 |
| 82 virtual void consumeAudio(const WebKit::WebVector<const float*>&, | |
|
tommi (sloooow) - chröme
2012/11/12 09:46:18
missing param name (I know webkit is different)
| |
| 83 size_t number_of_frames) OVERRIDE; | |
| 84 | |
| 79 // webrtc::PeerConnectionObserver implementation | 85 // webrtc::PeerConnectionObserver implementation |
| 80 virtual void OnError() OVERRIDE; | 86 virtual void OnError() OVERRIDE; |
| 81 virtual void OnStateChange(StateType state_changed) OVERRIDE; | 87 virtual void OnStateChange(StateType state_changed) OVERRIDE; |
| 82 virtual void OnAddStream(webrtc::MediaStreamInterface* stream) OVERRIDE; | 88 virtual void OnAddStream(webrtc::MediaStreamInterface* stream) OVERRIDE; |
| 83 virtual void OnRemoveStream(webrtc::MediaStreamInterface* stream) OVERRIDE; | 89 virtual void OnRemoveStream(webrtc::MediaStreamInterface* stream) OVERRIDE; |
| 84 virtual void OnIceCandidate( | 90 virtual void OnIceCandidate( |
| 85 const webrtc::IceCandidateInterface* candidate) OVERRIDE; | 91 const webrtc::IceCandidateInterface* candidate) OVERRIDE; |
| 86 virtual void OnIceComplete() OVERRIDE; | 92 virtual void OnIceComplete() OVERRIDE; |
| 87 virtual void OnRenegotiationNeeded() OVERRIDE; | 93 virtual void OnRenegotiationNeeded() OVERRIDE; |
| 88 | 94 |
| 89 private: | 95 private: |
| 90 webrtc::SessionDescriptionInterface* CreateNativeSessionDescription( | 96 webrtc::SessionDescriptionInterface* CreateNativeSessionDescription( |
| 91 const WebKit::WebRTCSessionDescription& description); | 97 const WebKit::WebRTCSessionDescription& description); |
| 92 | 98 |
| 93 // |client_| is a weak pointer, and is valid until stop() has returned. | 99 // |client_| is a weak pointer, and is valid until stop() has returned. |
| 94 WebKit::WebRTCPeerConnectionHandlerClient* client_; | 100 WebKit::WebRTCPeerConnectionHandlerClient* client_; |
| 95 | 101 |
| 96 WebKit::WebFrame* frame_; | 102 WebKit::WebFrame* frame_; |
| 97 | 103 |
| 104 // Handles audio from MediaStreamAudioDestinationNode. | |
| 105 scoped_refptr<WebAudioCapturerSource> webaudio_capturer_source_; | |
| 106 | |
| 107 // Synchronizes uses of |webaudio_capturer_source_|. | |
| 108 base::Lock audio_lock_; | |
| 109 | |
| 98 DISALLOW_COPY_AND_ASSIGN(RTCPeerConnectionHandler); | 110 DISALLOW_COPY_AND_ASSIGN(RTCPeerConnectionHandler); |
| 99 }; | 111 }; |
| 100 | 112 |
| 101 } // namespace content | 113 } // namespace content |
| 102 | 114 |
| 103 #endif // CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ | 115 #endif // CONTENT_RENDERER_MEDIA_RTC_PEER_CONNECTION_HANDLER_H_ |
| OLD | NEW |