| 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/mock_media_stream_dependency_factory.h" | 5 #include "content/renderer/media/mock_media_stream_dependency_factory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "content/renderer/media/mock_peer_connection_impl.h" | 8 #include "content/renderer/media/mock_peer_connection_impl.h" |
| 9 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" | 9 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" |
| 10 #include "third_party/libjingle/source/talk/base/scoped_ref_ptr.h" | 10 #include "third_party/libjingle/source/talk/base/scoped_ref_ptr.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 DCHECK_NE(MediaSourceInterface::kEnded, state_); | 200 DCHECK_NE(MediaSourceInterface::kEnded, state_); |
| 201 state_ = MediaSourceInterface::kEnded; | 201 state_ = MediaSourceInterface::kEnded; |
| 202 if (observer_) | 202 if (observer_) |
| 203 observer_->OnChanged(); | 203 observer_->OnChanged(); |
| 204 } | 204 } |
| 205 | 205 |
| 206 webrtc::MediaSourceInterface::SourceState MockVideoSource::state() const { | 206 webrtc::MediaSourceInterface::SourceState MockVideoSource::state() const { |
| 207 return state_; | 207 return state_; |
| 208 } | 208 } |
| 209 | 209 |
| 210 const cricket::VideoOptions* MockVideoSource::options() const { |
| 211 NOTIMPLEMENTED(); |
| 212 return NULL; |
| 213 } |
| 214 |
| 210 MockLocalVideoTrack::MockLocalVideoTrack(std::string id, | 215 MockLocalVideoTrack::MockLocalVideoTrack(std::string id, |
| 211 webrtc::VideoSourceInterface* source) | 216 webrtc::VideoSourceInterface* source) |
| 212 : enabled_(false), | 217 : enabled_(false), |
| 213 id_(id), | 218 id_(id), |
| 214 source_(source) { | 219 source_(source) { |
| 215 } | 220 } |
| 216 | 221 |
| 217 MockLocalVideoTrack::~MockLocalVideoTrack() {} | 222 MockLocalVideoTrack::~MockLocalVideoTrack() {} |
| 218 | 223 |
| 219 void MockLocalVideoTrack::AddRenderer(VideoRendererInterface* renderer) { | 224 void MockLocalVideoTrack::AddRenderer(VideoRendererInterface* renderer) { |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 const std::string& id, | 468 const std::string& id, |
| 464 webrtc::AudioSourceInterface* source) { | 469 webrtc::AudioSourceInterface* source) { |
| 465 DCHECK(mock_pc_factory_created_); | 470 DCHECK(mock_pc_factory_created_); |
| 466 scoped_refptr<webrtc::LocalAudioTrackInterface> track( | 471 scoped_refptr<webrtc::LocalAudioTrackInterface> track( |
| 467 new talk_base::RefCountedObject<MockLocalAudioTrack>(id)); | 472 new talk_base::RefCountedObject<MockLocalAudioTrack>(id)); |
| 468 return track; | 473 return track; |
| 469 } | 474 } |
| 470 | 475 |
| 471 SessionDescriptionInterface* | 476 SessionDescriptionInterface* |
| 472 MockMediaStreamDependencyFactory::CreateSessionDescription( | 477 MockMediaStreamDependencyFactory::CreateSessionDescription( |
| 473 const std::string& type, | 478 const std::string& type, |
| 474 const std::string& sdp) { | 479 const std::string& sdp, |
| 480 webrtc::SdpParseError* error) { |
| 475 return new MockSessionDescription(type, sdp); | 481 return new MockSessionDescription(type, sdp); |
| 476 } | 482 } |
| 477 | 483 |
| 478 webrtc::IceCandidateInterface* | 484 webrtc::IceCandidateInterface* |
| 479 MockMediaStreamDependencyFactory::CreateIceCandidate( | 485 MockMediaStreamDependencyFactory::CreateIceCandidate( |
| 480 const std::string& sdp_mid, | 486 const std::string& sdp_mid, |
| 481 int sdp_mline_index, | 487 int sdp_mline_index, |
| 482 const std::string& sdp) { | 488 const std::string& sdp) { |
| 483 return new MockIceCandidate(sdp_mid, sdp_mline_index, sdp); | 489 return new MockIceCandidate(sdp_mid, sdp_mline_index, sdp); |
| 484 } | 490 } |
| 485 | 491 |
| 486 } // namespace content | 492 } // namespace content |
| OLD | NEW |