| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 | 32 |
| 33 #include "core/platform/mediastream/chromium/MediaStreamCenterChromium.h" | 33 #include "core/platform/mediastream/chromium/MediaStreamCenterChromium.h" |
| 34 | 34 |
| 35 #include "core/platform/mediastream/MediaStreamComponent.h" | 35 #include "core/platform/mediastream/MediaStreamDescriptor.h" |
| 36 #include "core/platform/mediastream/MediaStreamSourcesQueryClient.h" | 36 #include "core/platform/mediastream/MediaStreamSourcesQueryClient.h" |
| 37 #include "public/platform/Platform.h" | 37 #include "public/platform/Platform.h" |
| 38 #include "public/platform/WebMediaStream.h" | 38 #include "public/platform/WebMediaStream.h" |
| 39 #include "public/platform/WebMediaStreamCenter.h" | 39 #include "public/platform/WebMediaStreamCenter.h" |
| 40 #include "public/platform/WebMediaStreamSourcesRequest.h" | 40 #include "public/platform/WebMediaStreamSourcesRequest.h" |
| 41 #include "public/platform/WebMediaStreamTrack.h" | 41 #include "public/platform/WebMediaStreamTrack.h" |
| 42 #include "wtf/MainThread.h" | 42 #include "wtf/MainThread.h" |
| 43 #include "wtf/PassOwnPtr.h" | 43 #include "wtf/PassOwnPtr.h" |
| 44 | 44 |
| 45 namespace WebCore { | 45 namespace WebCore { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 68 MediaStreamSourceVector audioSources, videoSources; | 68 MediaStreamSourceVector audioSources, videoSources; |
| 69 client->didCompleteQuery(audioSources, videoSources); | 69 client->didCompleteQuery(audioSources, videoSources); |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 | 72 |
| 73 bool MediaStreamCenterChromium::getSourceInfos(const String& url, WebKit::WebVec
tor<WebKit::WebSourceInfo>& sourceInfos) | 73 bool MediaStreamCenterChromium::getSourceInfos(const String& url, WebKit::WebVec
tor<WebKit::WebSourceInfo>& sourceInfos) |
| 74 { | 74 { |
| 75 return m_private && m_private->getSourceInfos(url, sourceInfos); | 75 return m_private && m_private->getSourceInfos(url, sourceInfos); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void MediaStreamCenterChromium::didSetMediaStreamTrackEnabled(WebKit::WebMediaSt
ream stream, MediaStreamComponent* component) | 78 void MediaStreamCenterChromium::didSetMediaStreamTrackEnabled(MediaStreamDescrip
tor* stream, MediaStreamComponent* component) |
| 79 { | 79 { |
| 80 if (m_private) { | 80 if (m_private) { |
| 81 if (component->enabled()) | 81 if (component->enabled()) |
| 82 m_private->didEnableMediaStreamTrack(stream, component); | 82 m_private->didEnableMediaStreamTrack(stream, component); |
| 83 else | 83 else |
| 84 m_private->didDisableMediaStreamTrack(stream, component); | 84 m_private->didDisableMediaStreamTrack(stream, component); |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 | 87 |
| 88 bool MediaStreamCenterChromium::didAddMediaStreamTrack(WebKit::WebMediaStream st
ream, MediaStreamComponent* component) | 88 bool MediaStreamCenterChromium::didAddMediaStreamTrack(MediaStreamDescriptor* st
ream, MediaStreamComponent* component) |
| 89 { | 89 { |
| 90 return m_private && m_private->didAddMediaStreamTrack(stream, component); | 90 return m_private && m_private->didAddMediaStreamTrack(stream, component); |
| 91 } | 91 } |
| 92 | 92 |
| 93 bool MediaStreamCenterChromium::didRemoveMediaStreamTrack(WebKit::WebMediaStream
stream, MediaStreamComponent* component) | 93 bool MediaStreamCenterChromium::didRemoveMediaStreamTrack(MediaStreamDescriptor*
stream, MediaStreamComponent* component) |
| 94 { | 94 { |
| 95 return m_private && m_private->didRemoveMediaStreamTrack(stream, component); | 95 return m_private && m_private->didRemoveMediaStreamTrack(stream, component); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void MediaStreamCenterChromium::didStopLocalMediaStream(WebKit::WebMediaStream s
tream) | 98 void MediaStreamCenterChromium::didStopLocalMediaStream(MediaStreamDescriptor* s
tream) |
| 99 { | 99 { |
| 100 if (m_private) { | 100 if (m_private) { |
| 101 m_private->didStopLocalMediaStream(stream); | 101 m_private->didStopLocalMediaStream(stream); |
| 102 for (unsigned i = 0; i < stream.numberOfAudioComponents(); i++) | 102 for (unsigned i = 0; i < stream->numberOfAudioComponents(); i++) |
| 103 stream.audioComponent(i)->source()->setReadyState(MediaStreamSource:
:ReadyStateEnded); | 103 stream->audioComponent(i)->source()->setReadyState(MediaStreamSource
::ReadyStateEnded); |
| 104 for (unsigned i = 0; i < stream.numberOfVideoComponents(); i++) | 104 for (unsigned i = 0; i < stream->numberOfVideoComponents(); i++) |
| 105 stream.videoComponent(i)->source()->setReadyState(MediaStreamSource:
:ReadyStateEnded); | 105 stream->videoComponent(i)->source()->setReadyState(MediaStreamSource
::ReadyStateEnded); |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 | 108 |
| 109 void MediaStreamCenterChromium::didCreateMediaStream(WebKit::WebMediaStream stre
am) | 109 void MediaStreamCenterChromium::didCreateMediaStream(MediaStreamDescriptor* stre
am) |
| 110 { | 110 { |
| 111 if (m_private) { | 111 if (m_private) { |
| 112 WebKit::WebMediaStream webStream(stream); | 112 WebKit::WebMediaStream webStream(stream); |
| 113 m_private->didCreateMediaStream(webStream); | 113 m_private->didCreateMediaStream(webStream); |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 | 116 |
| 117 void MediaStreamCenterChromium::stopLocalMediaStream(WebKit::WebMediaStream stre
am) | 117 void MediaStreamCenterChromium::stopLocalMediaStream(const WebKit::WebMediaStrea
m& stream) |
| 118 { | 118 { |
| 119 endLocalMediaStream(stream); | 119 endLocalMediaStream(stream); |
| 120 } | 120 } |
| 121 | 121 |
| 122 } // namespace WebCore | 122 } // namespace WebCore |
| OLD | NEW |