OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Ericsson AB. All rights reserved. | 2 * Copyright (C) 2011 Ericsson AB. All rights reserved. |
3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 16 matching lines...) Expand all Loading... |
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 */ | 30 */ |
31 | 31 |
32 #include "config.h" | 32 #include "config.h" |
33 | 33 |
34 #include "core/platform/mediastream/MediaStreamCenter.h" | 34 #include "core/platform/mediastream/MediaStreamCenter.h" |
35 | 35 |
36 #include "core/platform/mediastream/MediaStreamDescriptor.h" | 36 #include "core/platform/mediastream/MediaStreamDescriptor.h" |
| 37 #include "core/platform/mediastream/MediaStreamSourcesQueryClient.h" |
| 38 #include "modules/mediastream/MediaStreamTrackSourcesRequest.h" |
37 #include "public/platform/Platform.h" | 39 #include "public/platform/Platform.h" |
38 #include "public/platform/WebMediaStream.h" | 40 #include "public/platform/WebMediaStream.h" |
39 #include "public/platform/WebMediaStreamCenter.h" | 41 #include "public/platform/WebMediaStreamCenter.h" |
40 #include "public/platform/WebMediaStreamTrack.h" | 42 #include "public/platform/WebMediaStreamTrack.h" |
| 43 #include "public/platform/WebMediaStreamTrackSourcesRequest.h" |
41 #include "wtf/MainThread.h" | 44 #include "wtf/MainThread.h" |
42 #include "wtf/PassOwnPtr.h" | 45 #include "wtf/PassOwnPtr.h" |
43 | 46 |
44 namespace WebCore { | 47 namespace WebCore { |
45 | 48 |
46 MediaStreamCenter& MediaStreamCenter::instance() | 49 MediaStreamCenter& MediaStreamCenter::instance() |
47 { | 50 { |
48 ASSERT(isMainThread()); | 51 ASSERT(isMainThread()); |
49 DEFINE_STATIC_LOCAL(MediaStreamCenter, center, ()); | 52 DEFINE_STATIC_LOCAL(MediaStreamCenter, center, ()); |
50 return center; | 53 return center; |
51 } | 54 } |
52 | 55 |
53 MediaStreamCenter::MediaStreamCenter() | 56 MediaStreamCenter::MediaStreamCenter() |
54 : m_private(adoptPtr(WebKit::Platform::current()->createMediaStreamCenter(th
is))) | 57 : m_private(adoptPtr(WebKit::Platform::current()->createMediaStreamCenter(th
is))) |
55 { | 58 { |
56 } | 59 } |
57 | 60 |
58 MediaStreamCenter::~MediaStreamCenter() | 61 MediaStreamCenter::~MediaStreamCenter() |
59 { | 62 { |
60 } | 63 } |
61 | 64 |
62 bool MediaStreamCenter::getSourceInfos(const String& url, WebKit::WebVector<WebK
it::WebSourceInfo>& sourceInfos) | 65 bool MediaStreamCenter::getMediaStreamTrackSources(PassRefPtr<MediaStreamTrackSo
urcesRequest> request) |
63 { | 66 { |
64 return m_private && m_private->getSourceInfos(url, sourceInfos); | 67 return m_private && m_private->getMediaStreamTrackSources(request); |
65 } | 68 } |
66 | 69 |
67 void MediaStreamCenter::didSetMediaStreamTrackEnabled(MediaStreamDescriptor* str
eam, MediaStreamComponent* component) | 70 void MediaStreamCenter::didSetMediaStreamTrackEnabled(MediaStreamDescriptor* str
eam, MediaStreamComponent* component) |
68 { | 71 { |
69 if (m_private) { | 72 if (m_private) { |
70 if (component->enabled()) | 73 if (component->enabled()) |
71 m_private->didEnableMediaStreamTrack(stream, component); | 74 m_private->didEnableMediaStreamTrack(stream, component); |
72 else | 75 else |
73 m_private->didDisableMediaStreamTrack(stream, component); | 76 m_private->didDisableMediaStreamTrack(stream, component); |
74 } | 77 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 { | 110 { |
108 MediaStreamDescriptor* stream = webStream; | 111 MediaStreamDescriptor* stream = webStream; |
109 MediaStreamDescriptorClient* client = stream->client(); | 112 MediaStreamDescriptorClient* client = stream->client(); |
110 if (client) | 113 if (client) |
111 client->streamEnded(); | 114 client->streamEnded(); |
112 else | 115 else |
113 stream->setEnded(); | 116 stream->setEnded(); |
114 } | 117 } |
115 | 118 |
116 } // namespace WebCore | 119 } // namespace WebCore |
OLD | NEW |