| 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 #include "content/renderer/media/peer_connection_handler_base.h" | 5 #include "content/renderer/media/peer_connection_handler_base.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "content/renderer/media/media_stream_dependency_factory.h" | 9 #include "content/renderer/media/media_stream_dependency_factory.h" |
| 10 #include "content/renderer/media/media_stream_extra_data.h" | 10 #include "content/renderer/media/media_stream_extra_data.h" |
| 11 #include "third_party/WebKit/public/platform/WebMediaStream.h" | 11 #include "third_party/WebKit/public/platform/WebMediaStream.h" |
| 12 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" | 12 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" |
| 13 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 13 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
| 14 #include "third_party/WebKit/public/platform/WebString.h" | 14 #include "third_party/WebKit/public/platform/WebString.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 | 17 |
| 18 PeerConnectionHandlerBase::PeerConnectionHandlerBase( | 18 PeerConnectionHandlerBase::PeerConnectionHandlerBase( |
| 19 MediaStreamDependencyFactory* dependency_factory) | 19 MediaStreamDependencyFactory* dependency_factory) |
| 20 : dependency_factory_(dependency_factory), | 20 : dependency_factory_(dependency_factory), |
| 21 message_loop_proxy_(base::MessageLoopProxy::current()) { | 21 message_loop_proxy_(base::MessageLoopProxy::current()) { |
| 22 } | 22 } |
| 23 | 23 |
| 24 PeerConnectionHandlerBase::~PeerConnectionHandlerBase() { | 24 PeerConnectionHandlerBase::~PeerConnectionHandlerBase() { |
| 25 } | 25 } |
| 26 | 26 |
| 27 bool PeerConnectionHandlerBase::AddStream( | 27 bool PeerConnectionHandlerBase::AddStream( |
| 28 const WebKit::WebMediaStream& stream, | 28 const blink::WebMediaStream& stream, |
| 29 const webrtc::MediaConstraintsInterface* constraints) { | 29 const webrtc::MediaConstraintsInterface* constraints) { |
| 30 webrtc::MediaStreamInterface* native_stream = | 30 webrtc::MediaStreamInterface* native_stream = |
| 31 MediaStreamDependencyFactory::GetNativeMediaStream(stream); | 31 MediaStreamDependencyFactory::GetNativeMediaStream(stream); |
| 32 if (!native_stream) | 32 if (!native_stream) |
| 33 return false; | 33 return false; |
| 34 return native_peer_connection_->AddStream(native_stream, constraints); | 34 return native_peer_connection_->AddStream(native_stream, constraints); |
| 35 } | 35 } |
| 36 | 36 |
| 37 void PeerConnectionHandlerBase::RemoveStream( | 37 void PeerConnectionHandlerBase::RemoveStream( |
| 38 const WebKit::WebMediaStream& stream) { | 38 const blink::WebMediaStream& stream) { |
| 39 webrtc::MediaStreamInterface* native_stream = | 39 webrtc::MediaStreamInterface* native_stream = |
| 40 MediaStreamDependencyFactory::GetNativeMediaStream(stream); | 40 MediaStreamDependencyFactory::GetNativeMediaStream(stream); |
| 41 if (native_stream) | 41 if (native_stream) |
| 42 native_peer_connection_->RemoveStream(native_stream); | 42 native_peer_connection_->RemoveStream(native_stream); |
| 43 DCHECK(native_stream); | 43 DCHECK(native_stream); |
| 44 } | 44 } |
| 45 | 45 |
| 46 } // namespace content | 46 } // namespace content |
| OLD | NEW |