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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 } | 43 } |
44 virtual bool AddTrack(AudioTrackInterface* track) OVERRIDE { | 44 virtual bool AddTrack(AudioTrackInterface* track) OVERRIDE { |
45 audio_track_vector_.push_back(track); | 45 audio_track_vector_.push_back(track); |
46 return true; | 46 return true; |
47 } | 47 } |
48 virtual bool AddTrack(VideoTrackInterface* track) OVERRIDE { | 48 virtual bool AddTrack(VideoTrackInterface* track) OVERRIDE { |
49 video_track_vector_.push_back(track); | 49 video_track_vector_.push_back(track); |
50 return true; | 50 return true; |
51 } | 51 } |
52 virtual bool RemoveTrack(AudioTrackInterface* track) OVERRIDE { | 52 virtual bool RemoveTrack(AudioTrackInterface* track) OVERRIDE { |
53 NOTIMPLEMENTED(); | 53 AudioTrackVector::iterator it = FindTrack(&audio_track_vector_, |
54 return false; | 54 track->id()); |
| 55 if (it == audio_track_vector_.end()) |
| 56 return false; |
| 57 audio_track_vector_.erase(it); |
| 58 return true; |
55 } | 59 } |
56 virtual bool RemoveTrack(VideoTrackInterface* track) OVERRIDE { | 60 virtual bool RemoveTrack(VideoTrackInterface* track) OVERRIDE { |
57 NOTIMPLEMENTED(); | 61 VideoTrackVector::iterator it = FindTrack(&video_track_vector_, |
58 return false; | 62 track->id()); |
| 63 if (it == video_track_vector_.end()) |
| 64 return false; |
| 65 video_track_vector_.erase(it); |
| 66 return true; |
59 } | 67 } |
60 virtual std::string label() const OVERRIDE { return label_; } | 68 virtual std::string label() const OVERRIDE { return label_; } |
61 virtual AudioTrackVector GetAudioTracks() OVERRIDE { | 69 virtual AudioTrackVector GetAudioTracks() OVERRIDE { |
62 return audio_track_vector_; | 70 return audio_track_vector_; |
63 } | 71 } |
64 virtual VideoTrackVector GetVideoTracks() OVERRIDE { | 72 virtual VideoTrackVector GetVideoTracks() OVERRIDE { |
65 return video_track_vector_; | 73 return video_track_vector_; |
66 } | 74 } |
67 virtual talk_base::scoped_refptr<AudioTrackInterface> | 75 virtual talk_base::scoped_refptr<AudioTrackInterface> |
68 FindAudioTrack(const std::string& track_id) OVERRIDE { | 76 FindAudioTrack(const std::string& track_id) OVERRIDE { |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 | 458 |
451 webrtc::IceCandidateInterface* | 459 webrtc::IceCandidateInterface* |
452 MockMediaStreamDependencyFactory::CreateIceCandidate( | 460 MockMediaStreamDependencyFactory::CreateIceCandidate( |
453 const std::string& sdp_mid, | 461 const std::string& sdp_mid, |
454 int sdp_mline_index, | 462 int sdp_mline_index, |
455 const std::string& sdp) { | 463 const std::string& sdp) { |
456 return new MockIceCandidate(sdp_mid, sdp_mline_index, sdp); | 464 return new MockIceCandidate(sdp_mid, sdp_mline_index, sdp); |
457 } | 465 } |
458 | 466 |
459 } // namespace content | 467 } // namespace content |
OLD | NEW |