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/media_stream_center.h" | 5 #include "content/renderer/media/media_stream_center.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 // existing MediaStream. | 39 // existing MediaStream. |
40 NOTIMPLEMENTED(); | 40 NOTIMPLEMENTED(); |
41 return NULL; | 41 return NULL; |
42 } | 42 } |
43 | 43 |
44 template <class TrackList> | 44 template <class TrackList> |
45 static webrtc::MediaStreamTrackInterface* GetTrack( | 45 static webrtc::MediaStreamTrackInterface* GetTrack( |
46 const std::string& source_id, | 46 const std::string& source_id, |
47 TrackList* tracks) { | 47 TrackList* tracks) { |
48 for (size_t i = 0; i < tracks->count(); ++i) { | 48 for (size_t i = 0; i < tracks->count(); ++i) { |
49 if (tracks->at(i)->label() == source_id) | 49 if (tracks->at(i)->id() == source_id) |
50 return tracks->at(i); | 50 return tracks->at(i); |
51 } | 51 } |
52 return NULL; | 52 return NULL; |
53 } | 53 } |
54 | 54 |
55 static webrtc::MediaStreamTrackInterface* GetNativeMediaStreamTrack( | 55 static webrtc::MediaStreamTrackInterface* GetNativeMediaStreamTrack( |
56 const WebKit::WebMediaStreamDescriptor& stream, | 56 const WebKit::WebMediaStreamDescriptor& stream, |
57 const WebKit::WebMediaStreamComponent& component) { | 57 const WebKit::WebMediaStreamComponent& component) { |
58 std::string source_id = UTF16ToUTF8(component.source().id()); | 58 std::string source_id = UTF16ToUTF8(component.source().id()); |
59 webrtc::MediaStreamInterface* native_stream = GetNativeMediaStream(stream); | 59 webrtc::MediaStreamInterface* native_stream = GetNativeMediaStream(stream); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 } | 116 } |
117 | 117 |
118 void MediaStreamCenter::didCreateMediaStream( | 118 void MediaStreamCenter::didCreateMediaStream( |
119 WebKit::WebMediaStreamDescriptor& stream) { | 119 WebKit::WebMediaStreamDescriptor& stream) { |
120 if (!rtc_factory_) | 120 if (!rtc_factory_) |
121 return; | 121 return; |
122 rtc_factory_->CreateNativeLocalMediaStream(&stream); | 122 rtc_factory_->CreateNativeLocalMediaStream(&stream); |
123 } | 123 } |
124 | 124 |
125 } // namespace content | 125 } // namespace content |
OLD | NEW |