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 11 matching lines...) Expand all Loading... |
22 #include "third_party/WebKit/public/platform/WebVector.h" | 22 #include "third_party/WebKit/public/platform/WebVector.h" |
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
24 #include "third_party/libjingle/source/talk/app/webrtc/jsep.h" | 24 #include "third_party/libjingle/source/talk/app/webrtc/jsep.h" |
25 | 25 |
26 namespace content { | 26 namespace content { |
27 | 27 |
28 static webrtc::MediaStreamInterface* GetNativeMediaStream( | 28 static webrtc::MediaStreamInterface* GetNativeMediaStream( |
29 const WebKit::WebMediaStream& stream) { | 29 const WebKit::WebMediaStream& stream) { |
30 MediaStreamExtraData* extra_data = | 30 MediaStreamExtraData* extra_data = |
31 static_cast<MediaStreamExtraData*>(stream.extraData()); | 31 static_cast<MediaStreamExtraData*>(stream.extraData()); |
32 return extra_data->stream(); | 32 return extra_data->stream().get(); |
33 } | 33 } |
34 | 34 |
35 static webrtc::MediaStreamTrackInterface* GetNativeMediaStreamTrack( | 35 static webrtc::MediaStreamTrackInterface* GetNativeMediaStreamTrack( |
36 const WebKit::WebMediaStream& stream, | 36 const WebKit::WebMediaStream& stream, |
37 const WebKit::WebMediaStreamTrack& component) { | 37 const WebKit::WebMediaStreamTrack& component) { |
38 std::string track_id = UTF16ToUTF8(component.id()); | 38 std::string track_id = UTF16ToUTF8(component.id()); |
39 webrtc::MediaStreamInterface* native_stream = GetNativeMediaStream(stream); | 39 webrtc::MediaStreamInterface* native_stream = GetNativeMediaStream(stream); |
40 if (native_stream) { | 40 if (native_stream) { |
41 if (component.source().type() == WebKit::WebMediaStreamSource::TypeAudio) { | 41 if (component.source().type() == WebKit::WebMediaStreamSource::TypeAudio) { |
42 return native_stream->FindAudioTrack(track_id); | 42 return native_stream->FindAudioTrack(track_id); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 bool MediaStreamCenter::didRemoveMediaStreamTrack( | 110 bool MediaStreamCenter::didRemoveMediaStreamTrack( |
111 const WebKit::WebMediaStream& stream, | 111 const WebKit::WebMediaStream& stream, |
112 const WebKit::WebMediaStreamTrack& track) { | 112 const WebKit::WebMediaStreamTrack& track) { |
113 if (!rtc_factory_) | 113 if (!rtc_factory_) |
114 return false; | 114 return false; |
115 | 115 |
116 return rtc_factory_->RemoveNativeMediaStreamTrack(stream, track); | 116 return rtc_factory_->RemoveNativeMediaStreamTrack(stream, track); |
117 } | 117 } |
118 | 118 |
119 } // namespace content | 119 } // namespace content |
OLD | NEW |