Source/WebCore/ChangeLog

 12013-10-06 Eric Carlson <eric.carlson@apple.com>
 2
 3 [MediaStream API] update MediaStreamTrack object to match spec
 4 https://bugs.webkit.org/show_bug.cgi?id=121940
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 No new tests, existing test updated.
 9
 10 Add new source files to the project:
 11 * CMakeLists.txt:
 12 * DerivedSources.make:
 13 * GNUmakefile.list.am:
 14 * WebCore.xcodeproj/project.pbxproj:
 15
 16 New capability dictionary objects:
 17 * Modules/mediastream/AllAudioCapabilities.h: Added.
 18 * Modules/mediastream/AllAudioCapabilities.idl: Added.
 19 * Modules/mediastream/AllVideoCapabilities.h: Added.
 20 * Modules/mediastream/AllVideoCapabilities.idl: Added.
 21
 22 * Modules/mediastream/AudioStreamTrack.cpp:
 23 (WebCore::AudioStreamTrack::create): New version that takes a MediaStreamTrack*.
 24 * Modules/mediastream/AudioStreamTrack.h:
 25
 26 New object for a capability range:
 27 * Modules/mediastream/CapabilityRange.cpp: Added.
 28 * Modules/mediastream/CapabilityRange.h: Added.
 29 * Modules/mediastream/CapabilityRange.idl: Added.
 30
 31 * Modules/mediastream/MediaConstraintsImpl.h: Make initialize() public.
 32
 33 New object for the current states for a media source.
 34 * Modules/mediastream/MediaSourceStates.cpp: Added.
 35 * Modules/mediastream/MediaSourceStates.h: Added.
 36 * Modules/mediastream/MediaSourceStates.idl: Added.
 37
 38 Don't call the media stream center to notify it when the state of other
 39 objects change.
 40 * Modules/mediastream/MediaStream.cpp:
 41 (WebCore::processTrack): Remove the stream source duplication hack.
 42 (WebCore::createFromSourceVectors):
 43 (WebCore::MediaStream::MediaStream):
 44 (WebCore::MediaStream::addTrack):
 45 (WebCore::MediaStream::removeTrack):
 46 * Modules/mediastream/MediaStream.h:
 47
 48 New object for the capabilities of a source.
 49 * Modules/mediastream/MediaStreamCapabilities.cpp: Added.
 50 * Modules/mediastream/MediaStreamCapabilities.h: Added.
 51 * Modules/mediastream/MediaStreamCapabilities.idl: Added.
 52
 53 Update interface to match spec.
 54 * Modules/mediastream/MediaStreamTrack.cpp:
 55 (WebCore::MediaStreamTrack::MediaStreamTrack): Define a copy constructor to use in clone().
 56 (WebCore::MediaStreamTrack::setSource): Call removeObserver if the track already has a source.
 57 Initialize m_muted from new source's muted state.
 58 (WebCore::MediaStreamTrack::id): Allow source to provide ID as the spec suggests.
 59 (WebCore::MediaStreamTrack::setEnabled): Add some spec text to clarify logic. Always call
 60 source->setEnabled, it can figure out if nothing needs to be done.
 61 (WebCore::MediaStreamTrack::muted): Don't call the stream center when muted changes, the
 62 source can take care of notifying interested parties.
 63 (WebCore::MediaStreamTrack::readonly): New.
 64 (WebCore::MediaStreamTrack::remote): New.
 65 (WebCore::MediaStreamTrack::constraints): New.
 66 (WebCore::MediaStreamTrack::states): New.
 67 (WebCore::MediaStreamTrack::capabilities): New.
 68 (WebCore::MediaStreamTrack::applyConstraints): New.
 69 (WebCore::MediaStreamTrack::clone): New.
 70 (WebCore::MediaStreamTrack::stopProducingData): New.
 71 (WebCore::MediaStreamTrack::sourceStateChanged): Renamed from sourceChangedState.
 72 (WebCore::MediaStreamTrack::sourceMutedChanged): New.
 73 (WebCore::MediaStreamTrack::sourceEnabledChanged): New.
 74 (WebCore::MediaStreamTrack::configureTrackRendering): New.
 75 (WebCore::MediaStreamTrack::stopped): New.
 76 (WebCore::MediaStreamTrack::stop): Call stopProducingData.
 77 (WebCore::MediaStreamTrack::scheduleEventDispatch): New.
 78 (WebCore::MediaStreamTrack::dispatchQueuedEvents): New.
 79 * Modules/mediastream/MediaStreamTrack.h:
 80 * Modules/mediastream/MediaStreamTrack.idl:
 81
 82 * Modules/mediastream/MediaTrackConstraint.cpp: Added.
 83 * Modules/mediastream/MediaTrackConstraint.h: Added.
 84 * Modules/mediastream/MediaTrackConstraint.idl: Added.
 85
 86 // Add empty classes/IDL for track constraint objects.
 87 * Modules/mediastream/MediaTrackConstraintSet.cpp: Added.
 88 * Modules/mediastream/MediaTrackConstraintSet.h: Added.
 89 * Modules/mediastream/MediaTrackConstraintSet.idl: Added.
 90 * Modules/mediastream/MediaTrackConstraints.cpp: Added.
 91 * Modules/mediastream/MediaTrackConstraints.h: Added.
 92 * Modules/mediastream/MediaTrackConstraints.idl: Added.
 93
 94 * Modules/mediastream/UserMediaRequest.cpp:
 95 (WebCore::UserMediaRequest::callSuccessHandler): Don't call the stream center, the
 96 stream can take care of notifying interested parties.
 97
 98 // Add a constructor and create() that take a MediaStreamTrack*.
 99 * Modules/mediastream/VideoStreamTrack.cpp:
 100 (WebCore::VideoStreamTrack::create):
 101 (WebCore::VideoStreamTrack::VideoStreamTrack):
 102 * Modules/mediastream/VideoStreamTrack.h:
 103
 104 // Create a MediaStreamSource subclass for WebAudio
 105 * Modules/webaudio/AudioContext.cpp:
 106 (WebCore::AudioContext::createMediaStreamSource): Call isAudioStreamSource instead
 107 of checking deviceID.
 108 * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
 109 (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode): Create a
 110 MediaStreamAudioSource instead of a MediaStreamSource.
 111 * Modules/webaudio/MediaStreamAudioDestinationNode.h:
 112 * Modules/webaudio/MediaStreamAudioSource.cpp: Added.
 113 * Modules/webaudio/MediaStreamAudioSource.h: Added.
 114 (WebCore::MediaStreamAudioSource::~MediaStreamAudioSource):
 115
 116 // Add new generated files.
 117 * bindings/js/JSMediaSourceStatesCustom.cpp: Added.
 118 * bindings/js/JSMediaStreamCapabilitiesCustom.cpp: Added.
 119
 120 * dom/EventNames.h: Defined 'overconstrained' event.
 121
 122 * platform/mediastream/MediaStreamCenter.h: Get rid of all of the methods nobody uses.
 123 It isn't clear that they are necessary, and we can add them back if/when we need them.
 124
 125 * platform/mediastream/MediaStreamDescriptor.cpp:
 126 (WebCore::MediaStreamDescriptor::~MediaStreamDescriptor): Clear the all source streams.
 127 (WebCore::MediaStreamDescriptor::removeSource): Clear the source stream.
 128 * platform/mediastream/MediaStreamDescriptor.h:
 129
 130 // Make MediaStreamSource an abstract base class, and remove everyting WebAudio-specific
 131 // to MediaStreamAudioSource.
 132 * platform/mediastream/MediaStreamSource.cpp:
 133 (WebCore::MediaStreamSource::MediaStreamSource): Remove readyState and requiresConsumer
 134 parameters. Create new UUID for id if non was passed.
 135 (WebCore::MediaStreamSource::reset): Reset internal state to just-constructed. Used for testing.
 136 (WebCore::MediaStreamSource::setReadyState): sourceChangedState -> sourceStateChanged.
 137 (WebCore::MediaStreamSource::setStream): Remove the ASSERT that check for a source being
 138 added to a new stream. This is still a problem, but it is required for testing and will
 139 be fixed as a part of bug 121954.
 140 (WebCore::MediaStreamSource::setConstraints): Added.
 141 (WebCore::MediaStreamSource::setMuted): Notify observers when muted changes.
 142 (WebCore::MediaStreamSource::setEnabled): Notify observers when enabled changes.
 143 (WebCore::MediaStreamSource::readonly): New.
 144 (WebCore::MediaStreamSource::stop): New. Set state to Ended when all of the observers has
 145 stopped.
 146 * platform/mediastream/MediaStreamSource.h:
 147
 148 // Define platform versions of the Capabilities classes.
 149 * platform/mediastream/MediaStreamSourceCapabilities.h: Added.
 150
 151 // Update the non-functional platform stream centers for the API changes.
 152 * platform/mediastream/blackberry/MediaStreamCenterBlackBerry.cpp:
 153 * platform/mediastream/blackberry/MediaStreamCenterBlackBerry.h:
 154 * platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp:
 155 * platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h:
 156 * platform/mediastream/mac/MediaStreamCenterMac.cpp:
 157 * platform/mediastream/mac/MediaStreamCenterMac.h:
 158
 159 // Update the Mock stream center for the API changes. Add a concrete mock MediaStreamSource
 160 // subclass.
 161 * platform/mock/MockMediaStreamCenter.cpp:
 162 (WebCore::MockSource::MockSource): New, the mock media stream source.
 163 (WebCore::MockSource::~MockSource):
 164 (WebCore::MockSource::capabilities):
 165 (WebCore::MockSource::states):
 166 (WebCore::mockSourceMap):
 167 (WebCore::mockAudioSourceID):
 168 (WebCore::mockVideoSourceID):
 169 (WebCore::initializeMockSources): Create one audio and one video mock source.
 170 (WebCore::MockMediaStreamCenter::registerMockMediaStreamCenter): Call initializeMockSources.
 171 (WebCore::MockMediaStreamCenter::createMediaStream): Use the already allocated mock media
 172 sources.
 173 (WebCore::MockMediaStreamCenter::getMediaStreamTrackSources): Ditto.
 174 * platform/mock/MockMediaStreamCenter.h:
 175
11762013-10-07 Philippe Normand <pnormand@igalia.com>
2177
3178 URLMediaStream is unguarded by ENABLE(MEDIA_STREAM)
157041

Source/WebCore/CMakeLists.txt

@@set(WebCore_IDL_FILES
186186 Modules/mediasource/WebKitSourceBuffer.idl
187187 Modules/mediasource/WebKitSourceBufferList.idl
188188
 189 Modules/mediastream/AllAudioCapabilities.idl
 190 Modules/mediastream/AllVideoCapabilities.idl
189191 Modules/mediastream/AudioStreamTrack.idl
 192 Modules/mediastream/CapabilityRange.idl
 193 Modules/mediastream/MediaSourceStates.idl
190194 Modules/mediastream/MediaStream.idl
 195 Modules/mediastream/MediaStreamCapabilities.idl
191196 Modules/mediastream/MediaStreamEvent.idl
192197 Modules/mediastream/MediaStreamTrack.idl
193198 Modules/mediastream/MediaStreamTrackEvent.idl
194199 Modules/mediastream/MediaStreamTrackSourcesCallback.idl
 200 Modules/mediastream/MediaTrackConstraint.idl
 201 Modules/mediastream/MediaTrackConstraintSet.idl
 202 Modules/mediastream/MediaTrackConstraints.idl
195203 Modules/mediastream/NavigatorMediaStream.idl
196204 Modules/mediastream/NavigatorUserMediaError.idl
197205 Modules/mediastream/NavigatorUserMediaErrorCallback.idl

@@set(WebCore_SOURCES
786794 Modules/mediasource/SourceBufferList.cpp
787795
788796 Modules/mediastream/AudioStreamTrack.cpp
 797 Modules/mediastream/CapabilityRange.cpp
789798 Modules/mediastream/MediaConstraintsImpl.cpp
 799 Modules/mediastream/MediaSourceStates.cpp
790800 Modules/mediastream/MediaStream.cpp
 801 Modules/mediastream/MediaStreamCapabilities.cpp
791802 Modules/mediastream/MediaStreamEvent.cpp
792803 Modules/mediastream/MediaStreamRegistry.cpp
793804 Modules/mediastream/MediaStreamTrack.cpp
794805 Modules/mediastream/MediaStreamTrackEvent.cpp
795806 Modules/mediastream/MediaStreamTrackSourcesRequest.cpp
 807 Modules/mediastream/MediaTrackConstraint.cpp
 808 Modules/mediastream/MediaTrackConstraintSet.cpp
 809 Modules/mediastream/MediaTrackConstraints.cpp
796810 Modules/mediastream/NavigatorMediaStream.cpp
797811 Modules/mediastream/NavigatorUserMediaError.cpp
798812 Modules/mediastream/RTCDTMFSender.cpp

@@set(WebCore_SOURCES
863877 Modules/webaudio/GainNode.cpp
864878 Modules/webaudio/MediaElementAudioSourceNode.cpp
865879 Modules/webaudio/MediaStreamAudioDestinationNode.cpp
 880 Modules/webaudio/MediaStreamAudioSource.cpp
866881 Modules/webaudio/MediaStreamAudioSourceNode.cpp
867882 Modules/webaudio/OfflineAudioCompletionEvent.cpp
868883 Modules/webaudio/OfflineAudioContext.cpp
157016

Source/WebCore/DerivedSources.make

@@BINDING_IDLS = \
101101 $(WebCore)/Modules/mediasource/WebKitSourceBufferList.idl \
102102 $(WebCore)/Modules/mediasource/SourceBuffer.idl \
103103 $(WebCore)/Modules/mediasource/SourceBufferList.idl \
 104 $(WebCore)/Modules/mediastream/AllVideoCapabilities.idl \
 105 $(WebCore)/Modules/mediastream/AllAudioCapabilities.idl \
104106 $(WebCore)/Modules/mediastream/AudioStreamTrack.idl \
 107 $(WebCore)/Modules/mediastream/CapabilityRange.idl \
 108 $(WebCore)/Modules/mediastream/MediaSourceStates.idl \
105109 $(WebCore)/Modules/mediastream/MediaStream.idl \
 110 $(WebCore)/Modules/mediastream/MediaStreamCapabilities.idl \
106111 $(WebCore)/Modules/mediastream/MediaStreamEvent.idl \
107112 $(WebCore)/Modules/mediastream/MediaStreamTrack.idl \
108113 $(WebCore)/Modules/mediastream/MediaStreamTrackEvent.idl \
109114 $(WebCore)/Modules/mediastream/MediaStreamTrackSourcesCallback.idl \
 115 $(WebCore)/Modules/mediastream/MediaTrackConstraint.idl \
 116 $(WebCore)/Modules/mediastream/MediaTrackConstraints.idl \
 117 $(WebCore)/Modules/mediastream/MediaTrackConstraintSet.idl \
110118 $(WebCore)/Modules/mediastream/NavigatorMediaStream.idl \
111119 $(WebCore)/Modules/mediastream/NavigatorUserMediaError.idl \
112120 $(WebCore)/Modules/mediastream/NavigatorUserMediaErrorCallback.idl \
157016

Source/WebCore/GNUmakefile.list.am

@@webcore_built_sources += \
3131 DerivedSources/WebCore/InspectorProtocolVersion.h \
3232 DerivedSources/WebCore/JSAbstractWorker.cpp \
3333 DerivedSources/WebCore/JSAbstractWorker.h \
 34 DerivedSources/WebCore/JSAllAudioCapabilities.cpp \
 35 DerivedSources/WebCore/JSAllAudioCapabilities.h \
 36 DerivedSources/WebCore/JSAllVideoCapabilities.cpp \
 37 DerivedSources/WebCore/JSAllVideoCapabilities.h \
3438 DerivedSources/WebCore/JSAttr.cpp \
3539 DerivedSources/WebCore/JSAttr.h \
3640 DerivedSources/WebCore/JSAudioBuffer.cpp \

@@webcore_built_sources += \
8791 DerivedSources/WebCore/JSCanvasRenderingContext2D.h \
8892 DerivedSources/WebCore/JSCanvasRenderingContext.cpp \
8993 DerivedSources/WebCore/JSCanvasRenderingContext.h \
 94 DerivedSources/WebCore/JSCapabilityRange.cpp \
 95 DerivedSources/WebCore/JSCapabilityRange.h \
9096 DerivedSources/WebCore/JSCDATASection.cpp \
9197 DerivedSources/WebCore/JSCDATASection.h \
9298 DerivedSources/WebCore/JSCharacterData.cpp \

@@webcore_built_sources += \
462468 DerivedSources/WebCore/JSMediaSource.h \
463469 DerivedSources/WebCore/JSWebKitMediaSource.cpp \
464470 DerivedSources/WebCore/JSWebKitMediaSource.h \
 471 DerivedSources/WebCore/JSMediaSourceStates.cpp \
 472 DerivedSources/WebCore/JSMediaSourceStates.h \
465473 DerivedSources/WebCore/JSMediaStream.cpp \
466474 DerivedSources/WebCore/JSMediaStream.h \
467475 DerivedSources/WebCore/JSMediaStreamAudioSourceNode.cpp \
468476 DerivedSources/WebCore/JSMediaStreamAudioSourceNode.h \
469477 DerivedSources/WebCore/JSMediaStreamAudioDestinationNode.cpp \
470478 DerivedSources/WebCore/JSMediaStreamAudioDestinationNode.h \
 479 DerivedSources/WebCore/JSMediaStreamCapabilities.cpp \
 480 DerivedSources/WebCore/JSMediaStreamCapabilities.h \
471481 DerivedSources/WebCore/JSMediaStreamEvent.cpp \
472482 DerivedSources/WebCore/JSMediaStreamEvent.h \
473483 DerivedSources/WebCore/JSMediaStreamTrack.cpp \

@@webcore_built_sources += \
480490 DerivedSources/WebCore/JSMediaQueryList.h \
481491 DerivedSources/WebCore/JSMediaQueryListListener.cpp \
482492 DerivedSources/WebCore/JSMediaQueryListListener.h \
 493 DerivedSources/WebCore/JSMediaTrackConstraint.cpp \
 494 DerivedSources/WebCore/JSMediaTrackConstraint.h \
 495 DerivedSources/WebCore/JSMediaTrackConstraints.cpp \
 496 DerivedSources/WebCore/JSMediaTrackConstraints.h \
 497 DerivedSources/WebCore/JSMediaTrackConstraintSet.cpp \
 498 DerivedSources/WebCore/JSMediaTrackConstraintSet.h \
483499 DerivedSources/WebCore/JSMessageChannel.cpp \
484500 DerivedSources/WebCore/JSMessageChannel.h \
485501 DerivedSources/WebCore/JSMessageEvent.cpp \

@@dom_binding_idls += \
11861202 $(WebCore)/Modules/mediasource/WebKitMediaSource.idl \
11871203 $(WebCore)/Modules/mediasource/WebKitSourceBuffer.idl \
11881204 $(WebCore)/Modules/mediasource/WebKitSourceBufferList.idl \
 1205 $(WebCore)/Modules/mediastream/AllVideoCapabilities.idl \
 1206 $(WebCore)/Modules/mediastream/AllAudioCapabilities.idl \
11891207 $(WebCore)/Modules/mediastream/AudioStreamTrack.idl \
 1208 $(WebCore)/Modules/mediastream/CapabilityRange.idl \
 1209 $(WebCore)/Modules/mediastream/MediaSourceStates.idl \
11901210 $(WebCore)/Modules/mediastream/MediaStream.idl \
 1211 $(WebCore)/Modules/mediastream/MediaStreamCapabilities.idl \
11911212 $(WebCore)/Modules/mediastream/MediaStreamEvent.idl \
11921213 $(WebCore)/Modules/mediastream/MediaStreamTrack.idl \
11931214 $(WebCore)/Modules/mediastream/MediaStreamTrackEvent.idl \
11941215 $(WebCore)/Modules/mediastream/MediaStreamTrackSourcesCallback.idl \
 1216 $(WebCore)/Modules/mediastream/MediaTrackConstraint.idl \
 1217 $(WebCore)/Modules/mediastream/MediaTrackConstraints.idl \
 1218 $(WebCore)/Modules/mediastream/MediaTrackConstraintSet.idl \
11951219 $(WebCore)/Modules/mediastream/NavigatorMediaStream.idl \
11961220 $(WebCore)/Modules/mediastream/NavigatorUserMediaError.idl \
11971221 $(WebCore)/Modules/mediastream/NavigatorUserMediaErrorCallback.idl \

@@webcore_modules_sources += \
18451869 Source/WebCore/Modules/mediasource/WebKitSourceBuffer.h \
18461870 Source/WebCore/Modules/mediasource/WebKitSourceBufferList.cpp \
18471871 Source/WebCore/Modules/mediasource/WebKitSourceBufferList.h \
 1872 Source/WebCore/Modules/mediastream/AllAudioCapabilities.h \
 1873 Source/WebCore/Modules/mediastream/AllVideoCapabilities.h \
18481874 Source/WebCore/Modules/mediastream/AudioStreamTrack.cpp \
18491875 Source/WebCore/Modules/mediastream/AudioStreamTrack.h \
 1876 Source/WebCore/Modules/mediastream/CapabilityRange.cpp \
 1877 Source/WebCore/Modules/mediastream/CapabilityRange.h \
18501878 Source/WebCore/Modules/mediastream/MediaConstraintsImpl.cpp \
18511879 Source/WebCore/Modules/mediastream/MediaConstraintsImpl.h \
 1880 Source/WebCore/Modules/mediastream/MediaSourceStates.cpp \
 1881 Source/WebCore/Modules/mediastream/MediaSourceStates.h \
18521882 Source/WebCore/Modules/mediastream/MediaStream.cpp \
18531883 Source/WebCore/Modules/mediastream/MediaStream.h \
 1884 Source/WebCore/Modules/mediastream/MediaStreamCapabilities.cpp \
 1885 Source/WebCore/Modules/mediastream/MediaStreamCapabilities.h \
18541886 Source/WebCore/Modules/mediastream/MediaStreamEvent.cpp \
18551887 Source/WebCore/Modules/mediastream/MediaStreamEvent.h \
18561888 Source/WebCore/Modules/mediastream/MediaStreamRegistry.cpp \

@@webcore_modules_sources += \
18621894 Source/WebCore/Modules/mediastream/MediaStreamTrackSourcesCallback.h \
18631895 Source/WebCore/Modules/mediastream/MediaStreamTrackSourcesRequest.cpp \
18641896 Source/WebCore/Modules/mediastream/MediaStreamTrackSourcesRequest.h \
 1897 Source/WebCore/Modules/mediastream/MediaTrackConstraint.cpp \
 1898 Source/WebCore/Modules/mediastream/MediaTrackConstraint.h \
 1899 Source/WebCore/Modules/mediastream/MediaTrackConstraintSet.cpp \
 1900 Source/WebCore/Modules/mediastream/MediaTrackConstraintSet.h \
 1901 Source/WebCore/Modules/mediastream/MediaTrackConstraints.cpp \
 1902 Source/WebCore/Modules/mediastream/MediaTrackConstraints.h \
18651903 Source/WebCore/Modules/mediastream/NavigatorMediaStream.cpp \
18661904 Source/WebCore/Modules/mediastream/NavigatorMediaStream.h \
18671905 Source/WebCore/Modules/mediastream/NavigatorUserMediaError.cpp \

@@webcore_modules_sources += \
20072045 Source/WebCore/Modules/webaudio/MediaStreamAudioSourceNode.h \
20082046 Source/WebCore/Modules/webaudio/MediaStreamAudioDestinationNode.cpp \
20092047 Source/WebCore/Modules/webaudio/MediaStreamAudioDestinationNode.h \
 2048 Source/WebCore/Modules/webaudio/MediaStreamAudioSource.cpp \
 2049 Source/WebCore/Modules/webaudio/MediaStreamAudioSource.h \
20102050 Source/WebCore/Modules/webaudio/OfflineAudioContext.cpp \
20112051 Source/WebCore/Modules/webaudio/OfflineAudioContext.h \
20122052 Source/WebCore/Modules/webaudio/OfflineAudioDestinationNode.h \

@@webcore_sources += \
23122352 Source/WebCore/bindings/js/JSMainThreadExecState.cpp \
23132353 Source/WebCore/bindings/js/JSMainThreadExecState.h \
23142354 Source/WebCore/bindings/js/JSMediaListCustom.h \
 2355 Source/WebCore/bindings/js/JSMediaSourceStatesCustom.cpp \
23152356 Source/WebCore/bindings/js/JSMessageChannelCustom.cpp \
23162357 Source/WebCore/bindings/js/JSMessageEventCustom.cpp \
23172358 Source/WebCore/bindings/js/JSMessagePortCustom.cpp \

@@webcore_platform_sources += \
53365377 Source/WebCore/platform/mediastream/MediaStreamDescriptor.h \
53375378 Source/WebCore/platform/mediastream/MediaStreamSource.cpp \
53385379 Source/WebCore/platform/mediastream/MediaStreamSource.h \
 5380 Source/WebCore/platform/mediastream/MediaStreamSourceCapabilities.h \
53395381 Source/WebCore/platform/mediastream/MediaStreamTrackSourcesRequestClient.h \
53405382 Source/WebCore/platform/mediastream/RTCConfiguration.h \
53415383 Source/WebCore/platform/mediastream/RTCDTMFSenderHandler.h \
157016

Source/WebCore/Modules/mediastream/AllAudioCapabilities.h

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef AllAudioCapabilities_h
 27#define AllAudioCapabilities_h
 28
 29#if ENABLE(MEDIA_STREAM)
 30
 31#include "MediaStreamCapabilities.h"
 32#include "MediaStreamSourceCapabilities.h"
 33#include <wtf/text/WTFString.h>
 34
 35namespace WebCore {
 36
 37class CapabilityRange;
 38class MediaStreamSourceCapabilities;
 39
 40class AllAudioCapabilities : public MediaStreamCapabilities {
 41public:
 42 static PassRefPtr<AllAudioCapabilities> create(PassRefPtr<MediaStreamSourceCapabilities> capabilities)
 43 {
 44 return adoptRef(new AllAudioCapabilities(capabilities));
 45 }
 46 virtual ~AllAudioCapabilities() { }
 47
 48private:
 49 explicit AllAudioCapabilities(PassRefPtr<MediaStreamSourceCapabilities> capabilities)
 50 : MediaStreamCapabilities(capabilities)
 51 {
 52 }
 53};
 54
 55} // namespace WebCore
 56
 57#endif // AllAudioCapabilities_h
 58
 59#endif
0

Source/WebCore/Modules/mediastream/AllAudioCapabilities.idl

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26[
 27 NoInterfaceObject,
 28 Conditional=MEDIA_STREAM,
 29 JSGenerateToJSObject,
 30] interface AllAudioCapabilities : MediaStreamCapabilities {
 31 readonly attribute DOMString[] sourceId;
 32 readonly attribute CapabilityRange volume;
 33};
0

Source/WebCore/Modules/mediastream/AllVideoCapabilities.h

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef AllVideoCapabilities_h
 27#define AllVideoCapabilities_h
 28
 29#if ENABLE(MEDIA_STREAM)
 30
 31#include "MediaStreamCapabilities.h"
 32
 33namespace WebCore {
 34
 35class CapabilityRange;
 36class MediaStreamSourceCapabilities;
 37
 38class AllVideoCapabilities : public MediaStreamCapabilities {
 39public:
 40 static PassRefPtr<AllVideoCapabilities> create(PassRefPtr<MediaStreamSourceCapabilities> capabilities)
 41 {
 42 return adoptRef(new AllVideoCapabilities(capabilities));
 43 }
 44 virtual ~AllVideoCapabilities() { }
 45
 46private:
 47 explicit AllVideoCapabilities(PassRefPtr<MediaStreamSourceCapabilities> capabilities)
 48 : MediaStreamCapabilities(capabilities)
 49 {
 50 }
 51};
 52
 53} // namespace WebCore
 54
 55#endif // AllVideoCapabilities_h
 56
 57#endif
0

Source/WebCore/Modules/mediastream/AllVideoCapabilities.idl

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26[
 27 NoInterfaceObject,
 28 Conditional=MEDIA_STREAM,
 29 JSGenerateToJSObject,
 30] interface AllVideoCapabilities : MediaStreamCapabilities {
 31 readonly attribute DOMString[] sourceType;
 32 readonly attribute DOMString[] sourceId;
 33 readonly attribute CapabilityRange width;
 34 readonly attribute CapabilityRange height;
 35 readonly attribute CapabilityRange frameRate;
 36 readonly attribute CapabilityRange aspectRatio;
 37 readonly attribute DOMString[] facingMode;
 38};
0

Source/WebCore/Modules/mediastream/AudioStreamTrack.cpp

@@namespace WebCore {
3737
3838PassRefPtr<AudioStreamTrack> AudioStreamTrack::create(ScriptExecutionContext* context, const Dictionary& audioConstraints)
3939{
40  RefPtr<AudioStreamTrack> track = adoptRef(new AudioStreamTrack(context, 0, &audioConstraints));
41  return track.release();
 40 return adoptRef(new AudioStreamTrack(context, 0, &audioConstraints));
4241}
4342
4443PassRefPtr<AudioStreamTrack> AudioStreamTrack::create(ScriptExecutionContext* context, MediaStreamSource* source)
4544{
46  RefPtr<AudioStreamTrack> track = adoptRef(new AudioStreamTrack(context, source, 0));
47  return track.release();
 45 return adoptRef(new AudioStreamTrack(context, source, 0));
 46}
 47
 48PassRefPtr<AudioStreamTrack> AudioStreamTrack::create(MediaStreamTrack* track)
 49{
 50 return adoptRef(new AudioStreamTrack(track));
4851}
4952
5053AudioStreamTrack::AudioStreamTrack(ScriptExecutionContext* context, MediaStreamSource* source, const Dictionary* audioConstraints)

@@AudioStreamTrack::AudioStreamTrack(Scrip
5255{
5356}
5457
 58AudioStreamTrack::AudioStreamTrack(MediaStreamTrack* track)
 59 : MediaStreamTrack(track)
 60{
 61}
 62
5563const AtomicString& AudioStreamTrack::kind() const
5664{
5765 static NeverDestroyed<AtomicString> audioKind("audio", AtomicString::ConstructFromLiteral);
157016

Source/WebCore/Modules/mediastream/AudioStreamTrack.h

2929#if ENABLE(MEDIA_STREAM)
3030
3131#include "MediaStreamTrack.h"
32 #include <wtf/Vector.h>
3332#include <wtf/RefCounted.h>
 33#include <wtf/Vector.h>
3434
3535namespace WebCore {
3636

@@class AudioStreamTrack FINAL : public Me
4141public:
4242 static PassRefPtr<AudioStreamTrack> create(ScriptExecutionContext*, const Dictionary&);
4343 static PassRefPtr<AudioStreamTrack> create(ScriptExecutionContext*, MediaStreamSource*);
 44 static PassRefPtr<AudioStreamTrack> create(MediaStreamTrack*);
4445
4546 virtual ~AudioStreamTrack() { }
4647

@@public:
4849
4950private:
5051 AudioStreamTrack(ScriptExecutionContext*, MediaStreamSource*, const Dictionary*);
 52 explicit AudioStreamTrack(MediaStreamTrack*);
5153};
5254
5355} // namespace WebCore
157039

Source/WebCore/Modules/mediastream/CapabilityRange.cpp

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 *
 25 */
 26
 27#include "config.h"
 28
 29#if ENABLE(MEDIA_STREAM)
 30
 31#include "CapabilityRange.h"
 32
 33#include "JSDOMBinding.h"
 34#include "MediaSourceStates.h"
 35#include "ScriptValue.h"
 36#include <interpreter/CallFrame.h>
 37#include <runtime/JSCJSValue.h>
 38
 39using namespace JSC;
 40
 41namespace WebCore {
 42
 43PassRefPtr<CapabilityRange> CapabilityRange::create(const MediaStreamSourceCapabilityRange& rangeInfo)
 44{
 45 return adoptRef(new CapabilityRange(rangeInfo));
 46}
 47
 48CapabilityRange::CapabilityRange(const MediaStreamSourceCapabilityRange& rangeInfo)
 49 : m_rangeInfo(rangeInfo)
 50{
 51}
 52
 53static ScriptValue scriptValue(ExecState* exec, const MediaStreamSourceCapabilityRange::ValueUnion& value, MediaStreamSourceCapabilityRange::Type type)
 54{
 55 // NOTE: the spec says:
 56 // ... an implementation should make a reasonable attempt to translate and scale the hardware's setting
 57 // onto the mapping provided by this specification. If this is not possible due to the user agent's
 58 // inability to retrieve a given capability from a source, then for CapabilityRange-typed capabilities,
 59 // the min and max fields will not be present on the returned dictionary, and the supported field will be false.
 60 // We don't do this currently because I don't know of an instance where it isn't possible to retrieve a source
 61 // capability, but when we have to deal with this we will need to mark CapabilityRange.min and CapabilityRange.max as
 62 // "Custom" and return jsUndefined() from the custom getter to support it.
 63
 64 switch (type) {
 65 case MediaStreamSourceCapabilityRange::Float:
 66 return ScriptValue(exec->vm(), JSValue(value.asFloat));
 67 break;
 68 case MediaStreamSourceCapabilityRange::ULong:
 69 return ScriptValue(exec->vm(), JSValue(value.asULong));
 70 break;
 71 case MediaStreamSourceCapabilityRange::Undefined:
 72 return ScriptValue(exec->vm(), jsUndefined());
 73 break;
 74 }
 75
 76 ASSERT_NOT_REACHED();
 77 return ScriptValue(exec->vm(), jsUndefined());
 78}
 79
 80ScriptValue CapabilityRange::min(ExecState* exec) const
 81{
 82 return scriptValue(exec, m_rangeInfo.min(), m_rangeInfo.type());
 83}
 84
 85ScriptValue CapabilityRange::max(ExecState* exec) const
 86{
 87 return scriptValue(exec, m_rangeInfo.max(), m_rangeInfo.type());
 88}
 89
 90} // namespace WebCore
 91
 92#endif
0

Source/WebCore/Modules/mediastream/CapabilityRange.h

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 *
 25 */
 26
 27#ifndef CapabilityRange_h
 28#define CapabilityRange_h
 29
 30#if ENABLE(MEDIA_STREAM)
 31
 32#include "MediaStreamSourceCapabilities.h"
 33#include "ScriptValue.h"
 34#include "ScriptWrappable.h"
 35#include <interpreter/CallFrame.h>
 36#include <wtf/RefCounted.h>
 37
 38namespace WebCore {
 39
 40class CapabilityRange : public RefCounted<CapabilityRange>, public ScriptWrappable {
 41public:
 42 virtual ~CapabilityRange() { }
 43
 44 static PassRefPtr<CapabilityRange> create(const MediaStreamSourceCapabilityRange&);
 45
 46 ScriptValue min(JSC::ExecState*) const;
 47 ScriptValue max(JSC::ExecState*) const;
 48 bool supported() const { return m_rangeInfo.supported(); }
 49
 50private:
 51 CapabilityRange(const MediaStreamSourceCapabilityRange&);
 52
 53 MediaStreamSourceCapabilityRange m_rangeInfo;
 54};
 55
 56} // namespace WebCore
 57
 58#endif // CapabilityRange_h
 59
 60#endif
0

Source/WebCore/Modules/mediastream/CapabilityRange.idl

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26[
 27 NoInterfaceObject,
 28 Conditional=MEDIA_STREAM,
 29] interface CapabilityRange {
 30 [CallWith=ScriptState] readonly attribute any max;
 31 [CallWith=ScriptState] readonly attribute any min;
 32 readonly attribute boolean supported;
 33};
0

Source/WebCore/Modules/mediastream/MediaConstraintsImpl.h

@@class MediaConstraintsImpl : public Medi
4545public:
4646 static PassRefPtr<MediaConstraintsImpl> create();
4747 static PassRefPtr<MediaConstraintsImpl> create(const Dictionary&, ExceptionCode&);
 48
4849 virtual ~MediaConstraintsImpl();
 50 bool initialize(const Dictionary&);
4951
5052 virtual void getMandatoryConstraints(Vector<MediaConstraint>&) const OVERRIDE;
5153 virtual void getOptionalConstraints(Vector<MediaConstraint>&) const OVERRIDE;

@@public:
5557
5658private:
5759 MediaConstraintsImpl() { }
58  bool initialize(const Dictionary&);
5960
6061 HashMap<String, String> m_mandatoryConstraints;
6162 Vector<MediaConstraint> m_optionalConstraints;
157016

Source/WebCore/Modules/mediastream/MediaSourceStates.cpp

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27
 28#if ENABLE(MEDIA_STREAM)
 29
 30#include "MediaSourceStates.h"
 31
 32#include <wtf/NeverDestroyed.h>
 33
 34namespace WebCore {
 35
 36PassRefPtr<MediaSourceStates> MediaSourceStates::create(const MediaStreamSourceStates& states)
 37{
 38 return adoptRef(new MediaSourceStates(states));
 39}
 40
 41MediaSourceStates::MediaSourceStates(const MediaStreamSourceStates& states)
 42 : m_SourceStates(states)
 43{
 44}
 45
 46const AtomicString& MediaSourceStates::facingMode(MediaStreamSourceStates::VideoFacingMode mode)
 47{
 48 static NeverDestroyed<AtomicString> userFacing("user", AtomicString::ConstructFromLiteral);
 49 static NeverDestroyed<AtomicString> environmentFacing("environment", AtomicString::ConstructFromLiteral);
 50 static NeverDestroyed<AtomicString> leftFacing("left", AtomicString::ConstructFromLiteral);
 51 static NeverDestroyed<AtomicString> rightFacing("right", AtomicString::ConstructFromLiteral);
 52
 53 switch (mode) {
 54 case MediaStreamSourceStates::User:
 55 return userFacing;
 56 case MediaStreamSourceStates::Environment:
 57 return environmentFacing;
 58 case MediaStreamSourceStates::Left:
 59 return leftFacing;
 60 case MediaStreamSourceStates::Right:
 61 return rightFacing;
 62 }
 63
 64 ASSERT_NOT_REACHED();
 65 return emptyAtom;
 66}
 67
 68const AtomicString& MediaSourceStates::sourceType(MediaStreamSourceStates::SourceType sourceType)
 69{
 70 static NeverDestroyed<AtomicString> none("none", AtomicString::ConstructFromLiteral);
 71 static NeverDestroyed<AtomicString> camera("camera", AtomicString::ConstructFromLiteral);
 72 static NeverDestroyed<AtomicString> microphone("microphone", AtomicString::ConstructFromLiteral);
 73
 74 switch (sourceType) {
 75 case MediaStreamSourceStates::None:
 76 return none;
 77 case MediaStreamSourceStates::Camera:
 78 return camera;
 79 case MediaStreamSourceStates::Microphone:
 80 return microphone;
 81 }
 82
 83 ASSERT_NOT_REACHED();
 84 return emptyAtom;
 85}
 86
 87const AtomicString& MediaSourceStates::sourceType() const
 88{
 89 return MediaSourceStates::sourceType(m_SourceStates.sourceType);
 90}
 91
 92const AtomicString& MediaSourceStates::facingMode() const
 93{
 94 return MediaSourceStates::facingMode(m_SourceStates.facingMode);
 95}
 96
 97
 98} // namespace WebCore
 99
 100#endif
0

Source/WebCore/Modules/mediastream/MediaSourceStates.h

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef MediaSourceStates_h
 27#define MediaSourceStates_h
 28
 29#if ENABLE(MEDIA_STREAM)
 30
 31#include "MediaStreamSourceCapabilities.h"
 32#include "ScriptWrappable.h"
 33#include <wtf/Forward.h>
 34#include <wtf/RefCounted.h>
 35
 36namespace WebCore {
 37
 38class MediaSourceStates : public RefCounted<MediaSourceStates>, public ScriptWrappable {
 39public:
 40 static PassRefPtr<MediaSourceStates> create(const MediaStreamSourceStates&);
 41
 42 static const AtomicString& sourceType(MediaStreamSourceStates::SourceType);
 43 static const AtomicString& facingMode(MediaStreamSourceStates::VideoFacingMode);
 44
 45 const AtomicString& sourceType() const;
 46 const AtomicString& sourceId() const { return m_SourceStates.sourceId; }
 47 unsigned long width() const { return m_SourceStates.width; }
 48 unsigned long height() const { return m_SourceStates.height; }
 49 float frameRate() const { return m_SourceStates.frameRate; }
 50 float aspectRatio() const { return m_SourceStates.aspectRatio; }
 51 const AtomicString& facingMode() const;
 52 unsigned long volume() const { return m_SourceStates.volume; }
 53
 54 bool hasVideoSource() const { return m_SourceStates.sourceType == MediaStreamSourceStates::Camera; }
 55
 56private:
 57 explicit MediaSourceStates(const MediaStreamSourceStates&);
 58
 59 MediaStreamSourceStates m_SourceStates;
 60};
 61
 62} // namespace WebCore
 63
 64#endif // MediaSourceStates_h
 65
 66#endif
0

Source/WebCore/Modules/mediastream/MediaSourceStates.idl

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26enum SourceTypeEnum { "none", "camera", "microphone" };
 27enum VideoFacingModeEnum { "user", "environment", "left", "right" };
 28
 29[
 30 Conditional=MEDIA_STREAM,
 31 ImplementationLacksVTable,
 32 NoInterfaceObject,
 33] interface MediaSourceStates {
 34 readonly attribute SourceTypeEnum sourceType;
 35 readonly attribute DOMString sourceId;
 36
 37 [CustomGetter] readonly attribute unsigned long width;
 38 [CustomGetter] readonly attribute unsigned long height;
 39 [CustomGetter] readonly attribute float frameRate;
 40 [CustomGetter] readonly attribute float aspectRatio;
 41 [CustomGetter] readonly attribute VideoFacingModeEnum facingMode;
 42 [CustomGetter] readonly attribute unsigned long volume;
 43};
 44
0

Source/WebCore/Modules/mediastream/MediaStream.cpp

@@static void processTrack(MediaStreamTrac
5656 return;
5757
5858 MediaStreamSource* source = track->source();
59  if (!containsSource(sourceVector, source)) {
60  if (source->stream()) {
61  // FIXME: this should not be necessary because tracks and streams must be able to share sources, but our code
62  // currenlty assumes each source is attached to just one track.
63  // https://bugs.webkit.org/show_bug.cgi?id=121954
64  sourceVector.append(MediaStreamSource::create(source->id(), source->type(), source->name(), source->readyState(), source->requiresAudioConsumer()).get());
65  } else
66  sourceVector.append(source);
67  }
 59 if (!containsSource(sourceVector, source))
 60 sourceVector.append(source);
6861}
6962
7063static PassRefPtr<MediaStream> createFromSourceVectors(ScriptExecutionContext* context, const MediaStreamSourceVector& audioSources, const MediaStreamSourceVector& videoSources)
7164{
7265 RefPtr<MediaStreamDescriptor> descriptor = MediaStreamDescriptor::create(audioSources, videoSources);
73  MediaStreamCenter::shared().didCreateMediaStream(descriptor.get());
74 
7566 return MediaStream::create(context, descriptor.release());
7667}
7768

@@MediaStream::MediaStream(ScriptExecution
121112 , m_descriptor(streamDescriptor)
122113 , m_scheduledEventTimer(this, &MediaStream::scheduledEventTimerFired)
123114{
 115 ASSERT(m_descriptor);
124116 m_descriptor->setClient(this);
125117
126118 size_t numberOfAudioTracks = m_descriptor->numberOfAudioStreams();

@@void MediaStream::stop()
156148 if (ended())
157149 return;
158150
159  MediaStreamCenter::shared().didStopLocalMediaStream(descriptor());
160151 setEnded();
161152}
162153

@@void MediaStream::addTrack(PassRefPtr<Me
184175 m_videoTracks.append(track);
185176 break;
186177 }
187 
188  MediaStreamCenter::shared().didAddMediaStreamTrack(track->source());
189178}
190179
191180void MediaStream::removeTrack(PassRefPtr<MediaStreamTrack> prpTrack, ExceptionCode& ec)

@@void MediaStream::removeTrack(PassRefPtr
223212
224213 if (!m_audioTracks.size() && !m_videoTracks.size())
225214 setEnded();
226 
227  MediaStreamCenter::shared().didRemoveMediaStreamTrack(track->source());
228215}
229216
230217MediaStreamTrack* MediaStream::getTrackById(String id)
157016

Source/WebCore/Modules/mediastream/MediaStream.h

@@protected:
8585 MediaStream(ScriptExecutionContext*, PassRefPtr<MediaStreamDescriptor>);
8686
8787 // ContextDestructionObserver
88  virtual void contextDestroyed() OVERRIDE;
 88 virtual void contextDestroyed() OVERRIDE FINAL;
8989
9090private:
91  // MediaStreamDescriptorClient
92  virtual void trackDidEnd() OVERRIDE;
93  virtual void streamDidEnd() OVERRIDE;
94 
9591 // EventTarget
96  virtual void refEventTarget() OVERRIDE { ref(); }
97  virtual void derefEventTarget() OVERRIDE { deref(); }
 92 virtual void refEventTarget() OVERRIDE FINAL { ref(); }
 93 virtual void derefEventTarget() OVERRIDE FINAL { deref(); }
9894
9995 // MediaStreamDescriptorClient
100  virtual void addRemoteSource(MediaStreamSource*) OVERRIDE;
101  virtual void removeRemoteSource(MediaStreamSource*) OVERRIDE;
 96 virtual void trackDidEnd() OVERRIDE FINAL;
 97 virtual void streamDidEnd() OVERRIDE FINAL;
 98 virtual void addRemoteSource(MediaStreamSource*) OVERRIDE FINAL;
 99 virtual void removeRemoteSource(MediaStreamSource*) OVERRIDE FINAL;
102100
103101 void scheduleDispatchEvent(PassRefPtr<Event>);
104102 void scheduledEventTimerFired(Timer<MediaStream>*);
157016

Source/WebCore/Modules/mediastream/MediaStreamCapabilities.cpp

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27
 28#if ENABLE(MEDIA_STREAM)
 29
 30#include "MediaStreamCapabilities.h"
 31
 32#include "AllAudioCapabilities.h"
 33#include "AllVideoCapabilities.h"
 34#include "CapabilityRange.h"
 35#include "MediaSourceStates.h"
 36#include "MediaStreamSourceCapabilities.h"
 37
 38namespace WebCore {
 39
 40PassRefPtr<MediaStreamCapabilities> MediaStreamCapabilities::create(PassRefPtr<MediaStreamSourceCapabilities> capabilities)
 41{
 42 if (capabilities->hasVideoSource())
 43 return AllVideoCapabilities::create(capabilities);
 44
 45 return AllAudioCapabilities::create(capabilities);
 46}
 47
 48MediaStreamCapabilities::MediaStreamCapabilities(PassRefPtr<MediaStreamSourceCapabilities> capabilities)
 49 : m_SourceCapabilities(capabilities)
 50{
 51}
 52
 53Vector<String> MediaStreamCapabilities::sourceType() const
 54{
 55 ASSERT(m_SourceCapabilities->hasVideoSource());
 56
 57 size_t count = m_SourceCapabilities->sourceTypes().size();
 58 if (!count)
 59 return Vector<String>();
 60
 61 const Vector<MediaStreamSourceStates::SourceType>& sourceTypes = m_SourceCapabilities->sourceTypes();
 62 Vector<String> capabilities;
 63 capabilities.reserveCapacity(count);
 64
 65 for (size_t i = 0; i < count; ++i)
 66 capabilities.append(MediaSourceStates::sourceType(sourceTypes[i]));
 67
 68 return capabilities;
 69}
 70
 71Vector<String> MediaStreamCapabilities::sourceId() const
 72{
 73 size_t count = m_SourceCapabilities->sourceId().size();
 74 if (!count)
 75 return Vector<String>();
 76
 77 const Vector<AtomicString>& sourceIds = m_SourceCapabilities->sourceId();
 78 Vector<String> capabilities;
 79 capabilities.reserveCapacity(count);
 80
 81 for (size_t i = 0; i < count; ++i)
 82 capabilities.append(sourceIds[i]);
 83
 84 return capabilities;
 85}
 86
 87Vector<String> MediaStreamCapabilities::facingMode() const
 88{
 89 ASSERT(m_SourceCapabilities->hasVideoSource());
 90
 91 size_t count = m_SourceCapabilities->facingModes().size();
 92 if (!count)
 93 return Vector<String>();
 94
 95 const Vector<MediaStreamSourceStates::VideoFacingMode>& facingModes = m_SourceCapabilities->facingModes();
 96 Vector<String> capabilities;
 97 capabilities.reserveCapacity(count);
 98
 99 for (size_t i = 0; i < count; ++i)
 100 capabilities.append(MediaSourceStates::facingMode(facingModes[i]));
 101
 102 return capabilities;
 103}
 104
 105RefPtr<CapabilityRange> MediaStreamCapabilities::width() const
 106{
 107 ASSERT(m_SourceCapabilities->hasVideoSource());
 108
 109 return CapabilityRange::create(m_SourceCapabilities->width());
 110}
 111
 112RefPtr<CapabilityRange> MediaStreamCapabilities::height() const
 113{
 114 ASSERT(m_SourceCapabilities->hasVideoSource());
 115
 116 return CapabilityRange::create(m_SourceCapabilities->height());
 117}
 118
 119RefPtr<CapabilityRange> MediaStreamCapabilities::frameRate() const
 120{
 121 ASSERT(m_SourceCapabilities->hasVideoSource());
 122
 123 return CapabilityRange::create(m_SourceCapabilities->frameRate());
 124}
 125
 126RefPtr<CapabilityRange> MediaStreamCapabilities::aspectRatio() const
 127{
 128 ASSERT(m_SourceCapabilities->hasVideoSource());
 129
 130 return CapabilityRange::create(m_SourceCapabilities->aspectRatio());
 131}
 132
 133RefPtr<CapabilityRange> MediaStreamCapabilities::volume() const
 134{
 135 ASSERT(!m_SourceCapabilities->hasVideoSource());
 136
 137 return CapabilityRange::create(m_SourceCapabilities->volume());
 138}
 139
 140} // namespace WebCore
 141
 142#endif
0

Source/WebCore/Modules/mediastream/MediaStreamCapabilities.h

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef MediaStreamCapabilities_h
 27#define MediaStreamCapabilities_h
 28
 29#if ENABLE(MEDIA_STREAM)
 30
 31#include "MediaStreamCapabilities.h"
 32#include "MediaStreamSourceCapabilities.h"
 33#include "ScriptWrappable.h"
 34#include <wtf/RefCounted.h>
 35#include <wtf/Vector.h>
 36#include <wtf/text/WTFString.h>
 37
 38namespace WebCore {
 39
 40class CapabilityRange;
 41class MediaStreamSourceCapabilities;
 42
 43class MediaStreamCapabilities : public RefCounted<MediaStreamCapabilities>, public ScriptWrappable {
 44public:
 45 static PassRefPtr<MediaStreamCapabilities> create(PassRefPtr<MediaStreamSourceCapabilities>);
 46 virtual ~MediaStreamCapabilities() { }
 47
 48 virtual Vector<String> sourceType() const;
 49 virtual Vector<String> sourceId() const;
 50 virtual RefPtr<CapabilityRange> width() const;
 51 virtual RefPtr<CapabilityRange> height() const;
 52 virtual RefPtr<CapabilityRange> frameRate() const;
 53 virtual RefPtr<CapabilityRange> aspectRatio() const;
 54 virtual Vector<String> facingMode() const;
 55 virtual RefPtr<CapabilityRange> volume() const;
 56
 57 bool hasVideoSource() { return m_SourceCapabilities->hasVideoSource(); }
 58
 59protected:
 60 explicit MediaStreamCapabilities(PassRefPtr<MediaStreamSourceCapabilities>);
 61
 62 RefPtr<MediaStreamSourceCapabilities> m_SourceCapabilities;
 63};
 64
 65} // namespace WebCore
 66
 67#endif // MediaStreamCapabilities_h
 68
 69#endif
0

Source/WebCore/Modules/mediastream/MediaStreamCapabilities.idl

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26[
 27 Conditional=MEDIA_STREAM,
 28 NoInterfaceObject,
 29 SkipVTableValidation,
 30 CustomToJSObject,
 31] interface MediaStreamCapabilities {
 32};
 33
0

Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp

2929
3030#if ENABLE(MEDIA_STREAM)
3131
 32#include "AllAudioCapabilities.h"
 33#include "AllVideoCapabilities.h"
 34#include "AudioStreamTrack.h"
3235#include "Dictionary.h"
3336#include "Event.h"
3437#include "ExceptionCode.h"
 38#include "MediaConstraintsImpl.h"
 39#include "MediaSourceStates.h"
3540#include "MediaStream.h"
3641#include "MediaStreamCenter.h"
3742#include "MediaStreamDescriptor.h"
3843#include "MediaStreamTrackSourcesCallback.h"
3944#include "MediaStreamTrackSourcesRequest.h"
 45#include "MediaTrackConstraints.h"
 46#include "NotImplemented.h"
4047#include "UUID.h"
 48#include "VideoStreamTrack.h"
 49#include <wtf/Functional.h>
4150#include <wtf/NeverDestroyed.h>
4251
4352namespace WebCore {
4453
4554MediaStreamTrack::MediaStreamTrack(ScriptExecutionContext* context, MediaStreamSource* source, const Dictionary*)
4655 : ActiveDOMObject(context)
47  , m_source(source)
 56 , m_source(0)
4857 , m_readyState(MediaStreamSource::New)
4958 , m_stopped(false)
5059 , m_enabled(true)
5160 , m_muted(false)
 61 , m_eventDispatchScheduled(false)
5262{
5363 suspendIfNeeded();
54  if (m_source) {
55  m_source->addObserver(this);
56  m_muted = m_source->muted();
57  }
 64 if (source)
 65 setSource(source);
 66}
 67
 68MediaStreamTrack::MediaStreamTrack(MediaStreamTrack* other)
 69 : ActiveDOMObject(other->scriptExecutionContext())
 70{
 71 suspendIfNeeded();
 72
 73 // When the clone() method is invoked, the user agent must run the following steps:
 74 // 1. Let trackClone be a newly constructed MediaStreamTrack object.
 75 // 2. Initialize trackClone's id attribute to a newly generated value.
 76 m_id = createCanonicalUUIDString();
 77
 78 // 3. Let trackClone inherit this track's underlying source, kind, label and enabled attributes.
 79 setSource(other->source());
 80 m_readyState = m_source ? m_source->readyState() : MediaStreamSource::New;
 81 m_enabled = other->enabled();
 82
 83 // Note: the "clone" steps don't say anything about 'muted', but 4.3.1 says:
 84 // For a newly created MediaStreamTrack object, the following applies. The track is always enabled
 85 // unless stated otherwise (for examlpe when cloned) and the muted state reflects the state of the
 86 // source at the time the track is created.
 87 m_muted = other->muted();
 88
 89 m_eventDispatchScheduled =false;
 90 m_stopped = other->stopped();
5891}
5992
6093MediaStreamTrack::~MediaStreamTrack()

@@const AtomicString& MediaStreamTrack::ki
85118void MediaStreamTrack::setSource(MediaStreamSource* source)
86119{
87120 ASSERT(source == m_source || !m_source);
 121
 122 if (m_source)
 123 m_source->removeObserver(this);
 124
 125 if (source) {
 126 source->addObserver(this);
 127 m_muted = source->muted();
 128 }
 129
88130 m_source = source;
89131}
90132

@@const String& MediaStreamTrack::id() con
93135 if (!m_id.isEmpty())
94136 return m_id;
95137
96  if (!m_source)
97  return emptyString();
98 
99  const String& id = m_source->id();
100  if (!id.isEmpty())
101  return id;
102 
103138 // The spec says:
104139 // Unless a MediaStreamTrack object is created as a part a of special purpose algorithm that
105140 // specifies how the track id must be initialized, the user agent must generate a globally
106141 // unique identifier string and initialize the object's id attribute to that string.
107  // so generate a UUID if the source doesn't have an ID.
 142 if (m_source && m_source->useIDForTrackID())
 143 return m_source->id();
 144
108145 m_id = createCanonicalUUIDString();
109146 return m_id;
110147}

@@void MediaStreamTrack::setEnabled(bool e
125162{
126163 if (m_stopped)
127164 return;
128 
 165
 166 // 4.3.3.1
 167 // ... after a MediaStreamTrack is disassociated from its track, its enabled attribute still
 168 // changes value when set; it just doesn't do anything with that new value.
129169 m_enabled = enabled;
130170
131  if (!m_source || enabled == m_source->enabled())
 171 if (!m_source)
132172 return;
133173
134174 m_source->setEnabled(enabled);
 175}
135176
136  if (m_source->stream()->ended())
137  return;
 177bool MediaStreamTrack::muted() const
 178{
 179 if (m_stopped || !m_source)
 180 return false;
 181
 182 return m_source->muted();
 183}
 184
 185bool MediaStreamTrack::readonly() const
 186{
 187 if (m_stopped || !m_source)
 188 return true;
 189
 190 return m_source->readonly();
 191}
 192
 193bool MediaStreamTrack::remote() const
 194{
 195 if (!m_source)
 196 return false;
138197
139  MediaStreamCenter::shared().didSetMediaStreamTrackEnabled(m_source.get());
 198 return m_source->remote();
140199}
141200
142201const AtomicString& MediaStreamTrack::readyState() const

@@void MediaStreamTrack::getSources(Script
171230 ec = NOT_SUPPORTED_ERR;
172231}
173232
 233PassRefPtr<MediaTrackConstraints> MediaStreamTrack::constraints() const
 234{
 235 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=122428
 236 notImplemented();
 237 return 0;
 238}
 239
 240PassRefPtr<MediaSourceStates> MediaStreamTrack::states() const
 241{
 242 if (!m_source)
 243 return 0;
 244
 245 return MediaSourceStates::create(m_source->states());
 246}
 247
 248PassRefPtr<MediaStreamCapabilities> MediaStreamTrack::capabilities() const
 249{
 250 if (!m_source)
 251 return 0;
 252
 253 return MediaStreamCapabilities::create(m_source->capabilities());
 254}
 255
 256void MediaStreamTrack::applyConstraints(const Dictionary& constraints)
 257{
 258 // FIXME: apply the new constraints to the track
 259 // https://bugs.webkit.org/show_bug.cgi?id=122428
 260 m_constraints->initialize(constraints);
 261}
 262
 263PassRefPtr<MediaStreamTrack> MediaStreamTrack::clone()
 264{
 265 if (m_source && m_source->type() == MediaStreamSource::Audio)
 266 return AudioStreamTrack::create(this);
 267
 268 return VideoStreamTrack::create(this);
 269}
 270
 271void MediaStreamTrack::stopProducingData()
 272{
 273 if (m_stopped || !m_source)
 274 return;
 275
 276 // Set m_stopped before stopping the source because that may result in a call to sourceChangedState
 277 // and we only want to dispatch the 'ended' event if necessary.
 278 m_stopped = true;
 279 m_source->stop();
 280
 281 if (m_readyState != MediaStreamSource::Ended)
 282 scheduleEventDispatch(Event::create(eventNames().endedEvent, false, false));
 283}
 284
174285bool MediaStreamTrack::ended() const
175286{
176287 return m_stopped || (m_source && m_source->readyState() == MediaStreamSource::Ended);
177288}
178289
179 void MediaStreamTrack::sourceChangedState()
 290void MediaStreamTrack::sourceStateChanged()
180291{
181292 if (m_stopped)
182293 return;

@@void MediaStreamTrack::sourceChangedStat
185296 m_readyState = m_source->readyState();
186297
187298 if (m_readyState >= MediaStreamSource::Live && oldReadyState == MediaStreamSource::New)
188  dispatchEvent(Event::create(eventNames().startedEvent, false, false));
 299 scheduleEventDispatch(Event::create(eventNames().startedEvent, false, false));
189300 if (m_readyState == MediaStreamSource::Ended && oldReadyState != MediaStreamSource::Ended)
190  dispatchEvent(Event::create(eventNames().endedEvent, false, false));
 301 scheduleEventDispatch(Event::create(eventNames().endedEvent, false, false));
 302}
 303
 304void MediaStreamTrack::sourceMutedChanged()
 305{
 306 if (m_stopped)
 307 return;
191308
192  if (m_muted == m_source->muted())
 309 bool muted = m_source->muted();
 310 if (m_muted == muted)
193311 return;
194312
195  m_muted = m_source->muted();
 313 m_muted = muted;
196314 if (m_muted)
197  dispatchEvent(Event::create(eventNames().muteEvent, false, false));
 315 scheduleEventDispatch(Event::create(eventNames().muteEvent, false, false));
198316 else
199  dispatchEvent(Event::create(eventNames().unmuteEvent, false, false));
 317 scheduleEventDispatch(Event::create(eventNames().unmuteEvent, false, false));
 318
 319 configureTrackRendering();
 320}
 321
 322void MediaStreamTrack::sourceEnabledChanged()
 323{
 324 if (m_stopped)
 325 return;
 326
 327 // media from the source only flows when a MediaStreamTrack object is both unmuted and enabled
 328 configureTrackRendering();
 329}
 330
 331void MediaStreamTrack::configureTrackRendering()
 332{
 333 if (m_stopped)
 334 return;
 335
 336 // 4.3.1
 337 // ... media from the source only flows when a MediaStreamTrack object is both unmuted and enabled
 338}
 339
 340bool MediaStreamTrack::stopped()
 341{
 342 return m_stopped;
200343}
201344
202345void MediaStreamTrack::trackDidEnd()

@@void MediaStreamTrack::trackDidEnd()
211354
212355void MediaStreamTrack::stop()
213356{
214  m_stopped = true;
 357 stopProducingData();
 358}
 359
 360void MediaStreamTrack::scheduleEventDispatch(PassRefPtr<Event> event)
 361{
 362 {
 363 MutexLocker locker(m_mutex);
 364 m_scheduledEvents.append(event);
 365 if (m_eventDispatchScheduled)
 366 return;
 367 m_eventDispatchScheduled = true;
 368 }
 369
 370 callOnMainThread(bind(&MediaStreamTrack::dispatchQueuedEvents, this));
 371}
 372
 373void MediaStreamTrack::dispatchQueuedEvents()
 374{
 375 Vector<RefPtr<Event>> events;
 376 {
 377 MutexLocker locker(m_mutex);
 378
 379 m_eventDispatchScheduled = false;
 380 if (!scriptExecutionContext()) {
 381 m_scheduledEvents.clear();
 382 return;
 383 }
 384
 385 events.swap(m_scheduledEvents);
 386 }
 387
 388 Vector<RefPtr<Event> >::iterator it = events.begin();
 389 for (; it != events.end(); ++it)
 390 dispatchEvent((*it).release());
 391
 392 events.clear();
215393}
216394
217395} // namespace WebCore
157016

Source/WebCore/Modules/mediastream/MediaStreamTrack.h

4141namespace WebCore {
4242
4343class Dictionary;
44 class MediaConstraints;
 44class MediaConstraintsImpl;
 45class MediaSourceStates;
4546class MediaStreamTrackSourcesCallback;
 47class MediaStreamCapabilities;
 48class MediaTrackConstraints;
4649
4750class MediaStreamTrack : public RefCounted<MediaStreamTrack>, public ScriptWrappable, public ActiveDOMObject, public EventTargetWithInlineData, public MediaStreamSource::Observer {
4851public:

@@public:
5457
5558 bool enabled() const;
5659 void setEnabled(bool);
57 
 60
 61 bool muted() const;
 62 bool readonly() const;
 63 bool remote() const;
 64
5865 const AtomicString& readyState() const;
5966
6067 static void getSources(ScriptExecutionContext*, PassRefPtr<MediaStreamTrackSourcesCallback>, ExceptionCode&);
6168
62  MediaStreamSource* source() const { return m_source.get(); }
63  void setSource(MediaStreamSource*);
 69 PassRefPtr<MediaTrackConstraints> constraints() const;
 70 PassRefPtr<MediaSourceStates> states() const;
 71 PassRefPtr<MediaStreamCapabilities> capabilities() const;
 72 void applyConstraints(const Dictionary&);
 73
 74 PassRefPtr<MediaStreamTrack> clone();
 75 void stopProducingData();
6476
6577 DEFINE_ATTRIBUTE_EVENT_LISTENER(mute);
6678 DEFINE_ATTRIBUTE_EVENT_LISTENER(unmute);
 79 DEFINE_ATTRIBUTE_EVENT_LISTENER(started);
6780 DEFINE_ATTRIBUTE_EVENT_LISTENER(ended);
 81 DEFINE_ATTRIBUTE_EVENT_LISTENER(overconstrained);
 82
 83 MediaStreamSource* source() const { return m_source.get(); }
 84 void setSource(MediaStreamSource*);
6885
6986 bool ended() const;
7087

@@public:
7289 virtual EventTargetInterface eventTargetInterface() const OVERRIDE FINAL { return MediaStreamTrackEventTargetInterfaceType; }
7390 virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE FINAL { return ActiveDOMObject::scriptExecutionContext(); }
7491
75  // ActiveDOMObject
76  virtual void stop() OVERRIDE FINAL;
77 
7892 using RefCounted<MediaStreamTrack>::ref;
7993 using RefCounted<MediaStreamTrack>::deref;
8094
8195protected:
 96 explicit MediaStreamTrack(MediaStreamTrack*);
8297 MediaStreamTrack(ScriptExecutionContext*, MediaStreamSource*, const Dictionary*);
8398
8499private:
 100
 101 void configureTrackRendering();
85102 void trackDidEnd();
 103 void scheduleEventDispatch(PassRefPtr<Event>);
 104 void dispatchQueuedEvents();
 105
 106 // ActiveDOMObject
 107 virtual void stop() OVERRIDE FINAL;
86108
87109 // EventTarget
88110 virtual void refEventTarget() OVERRIDE FINAL { ref(); }
89111 virtual void derefEventTarget() OVERRIDE FINAL { deref(); }
90112
91113 // MediaStreamSourceObserver
92  virtual void sourceChangedState() OVERRIDE FINAL;
 114 virtual void sourceStateChanged() OVERRIDE FINAL;
 115 virtual void sourceMutedChanged() OVERRIDE FINAL;
 116 virtual void sourceEnabledChanged() OVERRIDE FINAL;
 117 virtual bool stopped() OVERRIDE FINAL;
 118
 119 Vector<RefPtr<Event>> m_scheduledEvents;
93120
94121 RefPtr<MediaStreamSource> m_source;
95  RefPtr<MediaConstraints> m_constraints;
 122 RefPtr<MediaConstraintsImpl> m_constraints;
96123 MediaStreamSource::ReadyState m_readyState;
97124 mutable String m_id;
 125 Mutex m_mutex;
98126
99127 bool m_stopped;
100128 bool m_enabled;
101129 bool m_muted;
 130 bool m_eventDispatchScheduled;
102131};
103132
104133typedef Vector<RefPtr<MediaStreamTrack> > MediaStreamTrackVector;
157039

Source/WebCore/Modules/mediastream/MediaStreamTrack.idl

11/*
22 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
34 *
45 * Redistribution and use in source and binary forms, with or without
56 * modification, are permitted provided that the following conditions

2223 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2324 */
2425
 26enum MediaStreamTrackState { "new", "live", "ended" };
 27
2528[
2629 Conditional=MEDIA_STREAM,
2730 EventTarget,

3336 readonly attribute DOMString id;
3437 readonly attribute DOMString label;
3538 attribute boolean enabled;
36 
37  readonly attribute DOMString readyState;
38 
 39 readonly attribute boolean muted;
3940 attribute EventListener onmute;
4041 attribute EventListener onunmute;
 42 readonly attribute boolean _readonly;
 43 readonly attribute boolean remote;
 44 readonly attribute MediaStreamTrackState readyState;
 45 attribute EventListener onstarted;
4146 attribute EventListener onended;
4247
4348 [CallWith=ScriptExecutionContext, RaisesException] static void getSources(MediaStreamTrackSourcesCallback callback);
4449
 50 MediaTrackConstraints constraints();
 51
 52 MediaSourceStates states();
 53
 54 MediaStreamCapabilities capabilities(); // returns either AllVideoCapabilities or AllAudioCapabilities
 55
 56 void applyConstraints(Dictionary constraints);
 57
 58 attribute EventListener onoverconstrained;
 59 MediaStreamTrack clone();
 60 [ImplementedAs=stopProducingData] void stop();
 61
4562 // EventTarget interface
4663 void addEventListener(DOMString type,
4764 EventListener listener,
157016

Source/WebCore/Modules/mediastream/MediaTrackConstraint.cpp

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 *
 25 */
 26
 27#include "config.h"
 28
 29#if ENABLE(MEDIA_STREAM)
 30
 31#include "MediaTrackConstraint.h"
 32
 33using namespace JSC;
 34
 35namespace WebCore {
 36
 37PassRefPtr<MediaTrackConstraint> MediaTrackConstraint::create(const Dictionary& constraint)
 38{
 39 return adoptRef(new MediaTrackConstraint(constraint));
 40}
 41
 42MediaTrackConstraint::MediaTrackConstraint(const Dictionary& constraint)
 43 : m_constraint(constraint)
 44{
 45}
 46
 47MediaTrackConstraint::~MediaTrackConstraint()
 48{
 49}
 50
 51} // namespace WebCore
 52
 53#endif
0

Source/WebCore/Modules/mediastream/MediaTrackConstraint.h

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 *
 25 */
 26
 27#ifndef MediaTrackConstraint_h
 28#define MediaTrackConstraint_h
 29
 30#if ENABLE(MEDIA_STREAM)
 31
 32#include "Dictionary.h"
 33#include "ScriptWrappable.h"
 34#include <wtf/RefCounted.h>
 35
 36namespace WebCore {
 37
 38class ScriptValue;
 39
 40class MediaTrackConstraint : public RefCounted<MediaTrackConstraint>, public ScriptWrappable {
 41public:
 42 static PassRefPtr<MediaTrackConstraint> create(const Dictionary&);
 43
 44 virtual ~MediaTrackConstraint();
 45
 46 const Dictionary& constraint() const { return m_constraint; }
 47
 48private:
 49 explicit MediaTrackConstraint(const Dictionary&);
 50
 51 const Dictionary& m_constraint;
 52};
 53
 54} // namespace WebCore
 55
 56#endif // MediaTrackConstraint_h
 57
 58#endif
0

Source/WebCore/Modules/mediastream/MediaTrackConstraint.idl

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26[
 27 Conditional=MEDIA_STREAM,
 28 NoInterfaceObject,
 29] interface MediaTrackConstraint {
 30};
 31
0

Source/WebCore/Modules/mediastream/MediaTrackConstraintSet.cpp

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 *
 25 */
 26
 27#include "config.h"
 28
 29#if ENABLE(MEDIA_STREAM)
 30
 31#include "MediaTrackConstraintSet.h"
 32
 33using namespace JSC;
 34
 35namespace WebCore {
 36
 37PassRefPtr<MediaTrackConstraintSet> MediaTrackConstraintSet::create(const Dictionary& constraints)
 38{
 39 return adoptRef(new MediaTrackConstraintSet(constraints));
 40}
 41
 42MediaTrackConstraintSet::MediaTrackConstraintSet(const Dictionary& constraints)
 43 : m_constraints(constraints)
 44{
 45}
 46
 47MediaTrackConstraintSet::~MediaTrackConstraintSet()
 48{
 49}
 50
 51} // namespace WebCore
 52
 53#endif
0

Source/WebCore/Modules/mediastream/MediaTrackConstraintSet.h

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 *
 25 */
 26
 27#ifndef MediaTrackConstraintSet_h
 28#define MediaTrackConstraintSet_h
 29
 30#if ENABLE(MEDIA_STREAM)
 31
 32#include "Dictionary.h"
 33#include "ScriptWrappable.h"
 34#include <wtf/RefCounted.h>
 35
 36namespace WebCore {
 37
 38class MediaTrackConstraintSet : public RefCounted<MediaTrackConstraintSet>, public ScriptWrappable {
 39public:
 40 static PassRefPtr<MediaTrackConstraintSet> create(const Dictionary&);
 41
 42 virtual ~MediaTrackConstraintSet();
 43
 44 const Dictionary& constraints() const { return m_constraints; }
 45
 46private:
 47 explicit MediaTrackConstraintSet(const Dictionary&);
 48
 49 const Dictionary& m_constraints;
 50};
 51
 52} // namespace WebCore
 53
 54#endif // MediaTrackConstraintSet_h
 55
 56#endif
0

Source/WebCore/Modules/mediastream/MediaTrackConstraintSet.idl

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26[
 27 Conditional=MEDIA_STREAM,
 28 NoInterfaceObject,
 29] interface MediaTrackConstraintSet {
 30 // FIXME: Not implemented.
 31 // https://bugs.webkit.org/show_bug.cgi?id=121954
 32};
 33
0

Source/WebCore/Modules/mediastream/MediaTrackConstraints.cpp

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 *
 25 */
 26
 27#include "config.h"
 28
 29#if ENABLE(MEDIA_STREAM)
 30
 31#include "MediaTrackConstraints.h"
 32
 33#include "MediaTrackConstraint.h"
 34#include "MediaTrackConstraintSet.h"
 35#include "NotImplemented.h"
 36
 37using namespace JSC;
 38
 39namespace WebCore {
 40
 41PassRefPtr<MediaTrackConstraints> MediaTrackConstraints::create(PassRefPtr<MediaConstraintsImpl> constraints)
 42{
 43 return adoptRef(new MediaTrackConstraints(constraints));
 44}
 45
 46MediaTrackConstraints::MediaTrackConstraints(PassRefPtr<MediaConstraintsImpl> constraints)
 47 : m_constraints(constraints)
 48{
 49}
 50
 51Vector<PassRefPtr<MediaTrackConstraint>> MediaTrackConstraints::optional(bool) const
 52{
 53 // https://bugs.webkit.org/show_bug.cgi?id=121954
 54 notImplemented();
 55 return Vector<PassRefPtr<MediaTrackConstraint>>();
 56}
 57
 58PassRefPtr<MediaTrackConstraintSet> MediaTrackConstraints::mandatory(bool) const
 59{
 60 // https://bugs.webkit.org/show_bug.cgi?id=121954
 61 notImplemented();
 62 return nullptr;
 63}
 64
 65} // namespace WebCore
 66
 67#endif
0

Source/WebCore/Modules/mediastream/MediaTrackConstraints.h

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 *
 25 */
 26
 27#ifndef MediaTrackConstraints_h
 28#define MediaTrackConstraints_h
 29
 30#if ENABLE(MEDIA_STREAM)
 31
 32#include "MediaConstraintsImpl.h"
 33#include "ScriptWrappable.h"
 34#include <wtf/RefCounted.h>
 35
 36namespace WebCore {
 37
 38class MediaTrackConstraint;
 39class MediaTrackConstraintSet;
 40
 41class MediaTrackConstraints : public RefCounted<MediaTrackConstraints>, public ScriptWrappable {
 42public:
 43 virtual ~MediaTrackConstraints() { }
 44
 45 static PassRefPtr<MediaTrackConstraints> create(PassRefPtr<MediaConstraintsImpl>);
 46
 47 Vector<PassRefPtr<MediaTrackConstraint>> optional(bool) const;
 48 PassRefPtr<MediaTrackConstraintSet> mandatory(bool) const;
 49
 50private:
 51 explicit MediaTrackConstraints(PassRefPtr<MediaConstraintsImpl>);
 52
 53 RefPtr<MediaConstraintsImpl> m_constraints;
 54};
 55
 56} // namespace WebCore
 57
 58#endif // MediaTrackConstraints_h
 59
 60#endif
0

Source/WebCore/Modules/mediastream/MediaTrackConstraints.idl

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26[
 27 Conditional=MEDIA_STREAM,
 28 NoInterfaceObject,
 29] interface MediaTrackConstraints {
 30 readonly attribute MediaTrackConstraintSet? mandatory;
 31 readonly attribute MediaTrackConstraint[]? optional;
 32};
 33
0

Source/WebCore/Modules/mediastream/UserMediaRequest.cpp

@@void UserMediaRequest::callSuccessHandle
173173 for (MediaStreamTrackVector::iterator iter = tracks.begin(); iter != tracks.end(); ++iter)
174174 (*iter)->source()->setConstraints(m_videoConstraints);
175175
176  MediaStreamCenter::shared().didCreateMediaStream(streamDescriptor.get());
177176 m_successCallback->handleEvent(stream.get());
178177}
179178
157016

Source/WebCore/Modules/mediastream/VideoStreamTrack.cpp

@@PassRefPtr<VideoStreamTrack> VideoStream
4747 return track.release();
4848}
4949
 50PassRefPtr<VideoStreamTrack> VideoStreamTrack::create(MediaStreamTrack* track)
 51{
 52 return adoptRef(new VideoStreamTrack(track));
 53}
 54
5055VideoStreamTrack::VideoStreamTrack(ScriptExecutionContext* context, MediaStreamSource* source, const Dictionary* videoConstraints)
5156 : MediaStreamTrack(context, source, videoConstraints)
5257{
5358}
5459
 60VideoStreamTrack::VideoStreamTrack(MediaStreamTrack* track)
 61 : MediaStreamTrack(track)
 62{
 63}
 64
5565const AtomicString& VideoStreamTrack::kind() const
5666{
5767 static NeverDestroyed<AtomicString> videoKind("video", AtomicString::ConstructFromLiteral);
157016

Source/WebCore/Modules/mediastream/VideoStreamTrack.h

2929#if ENABLE(MEDIA_STREAM)
3030
3131#include "MediaStreamTrack.h"
32 #include <wtf/Vector.h>
3332#include <wtf/RefCounted.h>
 33#include <wtf/Vector.h>
3434
3535namespace WebCore {
3636

@@class VideoStreamTrack FINAL : public Me
4141public:
4242 static PassRefPtr<VideoStreamTrack> create(ScriptExecutionContext*, const Dictionary&);
4343 static PassRefPtr<VideoStreamTrack> create(ScriptExecutionContext*, MediaStreamSource*);
 44 static PassRefPtr<VideoStreamTrack> create(MediaStreamTrack*);
4445
4546 virtual ~VideoStreamTrack() { }
4647

@@public:
4849
4950private:
5051 VideoStreamTrack(ScriptExecutionContext*, MediaStreamSource*, const Dictionary*);
 52 explicit VideoStreamTrack(MediaStreamTrack*);
5153};
5254
5355} // namespace WebCore
157039

Source/WebCore/Modules/webaudio/AudioContext.cpp

6363#if ENABLE(MEDIA_STREAM)
6464#include "MediaStream.h"
6565#include "MediaStreamAudioDestinationNode.h"
 66#include "MediaStreamAudioSource.h"
6667#include "MediaStreamAudioSourceNode.h"
6768#endif
6869

@@PassRefPtr<MediaStreamAudioSourceNode> A
420421 // FIXME: get a provider for non-local MediaStreams (like from a remote peer).
421422 for (size_t i = 0; i < audioTracks.size(); ++i) {
422423 RefPtr<MediaStreamTrack> localAudio = audioTracks[i];
423  MediaStreamSource* source = localAudio->source();
424  if (!source->deviceId().isEmpty()) {
425  destination()->enableInput(source->deviceId());
426  provider = destination()->localAudioInputProvider();
427  break;
428  }
 424 if (!localAudio->source()->isAudioStreamSource())
 425 continue;
 426
 427 MediaStreamAudioSource* source = static_cast<MediaStreamAudioSource*>(localAudio->source());
 428 ASSERT(!source->deviceId().isEmpty());
 429 destination()->enableInput(source->deviceId());
 430 provider = destination()->localAudioInputProvider();
 431 break;
429432 }
430433
431434 RefPtr<MediaStreamAudioSourceNode> node = MediaStreamAudioSourceNode::create(this, mediaStream, provider);

@@void AudioContext::addDeferredFinishDere
733736void AudioContext::handlePreRenderTasks()
734737{
735738 ASSERT(isAudioThread());
736 
 739
737740 // At the beginning of every render quantum, try to update the internal rendering graph state (from main thread changes).
738741 // It's OK if the tryLock() fails, we'll just take slightly longer to pick up the changes.
739742 bool mustReleaseLock;

@@void AudioContext::handlePreRenderTasks(
752755void AudioContext::handlePostRenderTasks()
753756{
754757 ASSERT(isAudioThread());
755 
756  // Must use a tryLock() here too. Don't worry, the lock will very rarely be contended and this method is called frequently.
 758
 759 // Must use a tryLock() here too. Don't worry, the lock will very rarely be contended and this method is called frequently.
757760 // The worst that can happen is that there will be some nodes which will take slightly longer than usual to be deleted or removed
758761 // from the render graph (in which case they'll render silence).
759762 bool mustReleaseLock;
157016

Source/WebCore/Modules/webaudio/MediaStreamAudioDestinationNode.cpp

3131#include "AudioContext.h"
3232#include "AudioNodeInput.h"
3333#include "MediaStream.h"
34 #include "MediaStreamCenter.h"
 34#include "MediaStreamAudioSource.h"
3535#include "RTCPeerConnectionHandler.h"
36 #include "UUID.h"
3736#include <wtf/Locker.h>
3837
3938namespace WebCore {

@@MediaStreamAudioDestinationNode::MediaSt
4948{
5049 setNodeType(NodeTypeMediaStreamAudioDestination);
5150
52  m_source = MediaStreamSource::create(ASCIILiteral("WebAudio-") + createCanonicalUUIDString(), MediaStreamSource::Audio, "MediaStreamAudioDestinationNode", MediaStreamSource::Live, true);
 51 m_source = MediaStreamAudioSource::create();
5352 MediaStreamSourceVector audioSources;
5453 audioSources.append(m_source);
55  MediaStreamSourceVector videoSources;
56  m_stream = MediaStream::create(context->scriptExecutionContext(), MediaStreamDescriptor::create(audioSources, videoSources));
57  MediaStreamCenter::shared().didCreateMediaStream(m_stream->descriptor());
 54 m_stream = MediaStream::create(context->scriptExecutionContext(), MediaStreamDescriptor::create(audioSources, MediaStreamSourceVector()));
5855
5956 m_source->setAudioFormat(numberOfChannels, context->sampleRate());
6057
157016

Source/WebCore/Modules/webaudio/MediaStreamAudioDestinationNode.h

3636namespace WebCore {
3737
3838class AudioContext;
 39class MediaStreamAudioSource;
3940
4041class MediaStreamAudioDestinationNode : public AudioBasicInspectorNode {
4142public:

@@private:
6162 virtual bool propagatesSilence() const OVERRIDE { return false; }
6263
6364 RefPtr<MediaStream> m_stream;
64  RefPtr<MediaStreamSource> m_source;
 65 RefPtr<MediaStreamAudioSource> m_source;
6566 RefPtr<AudioBus> m_mixBus;
6667};
6768
157016

Source/WebCore/Modules/webaudio/MediaStreamAudioSource.cpp

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27
 28#if ENABLE(MEDIA_STREAM)
 29
 30#include "MediaStreamAudioSource.h"
 31
 32#include "NotImplemented.h"
 33#include "UUID.h"
 34#include <wtf/PassOwnPtr.h>
 35
 36namespace WebCore {
 37
 38PassRefPtr<MediaStreamAudioSource> MediaStreamAudioSource::create()
 39{
 40 return adoptRef(new MediaStreamAudioSource());
 41}
 42
 43MediaStreamAudioSource::MediaStreamAudioSource()
 44 : MediaStreamSource(ASCIILiteral("WebAudio-") + createCanonicalUUIDString(), MediaStreamSource::Audio, "MediaStreamAudioDestinationNode")
 45{
 46}
 47
 48PassRefPtr<MediaStreamSourceCapabilities> MediaStreamAudioSource::capabilities() const
 49{
 50 // FIXME: implement this.
 51 // https://bugs.webkit.org/show_bug.cgi?id=122430
 52 notImplemented();
 53 return 0;
 54}
 55
 56const MediaStreamSourceStates& MediaStreamAudioSource::states()
 57{
 58 // FIXME: implement this.
 59 // https://bugs.webkit.org/show_bug.cgi?id=122430
 60 notImplemented();
 61 return m_currentStates;
 62
 63}
 64
 65void MediaStreamAudioSource::addAudioConsumer(PassRefPtr<AudioDestinationConsumer> consumer)
 66{
 67 MutexLocker locker(m_audioConsumersLock);
 68 m_audioConsumers.append(consumer);
 69}
 70
 71bool MediaStreamAudioSource::removeAudioConsumer(AudioDestinationConsumer* consumer)
 72{
 73 MutexLocker locker(m_audioConsumersLock);
 74 size_t pos = m_audioConsumers.find(consumer);
 75 if (pos != notFound) {
 76 m_audioConsumers.remove(pos);
 77 return true;
 78 }
 79 return false;
 80}
 81
 82void MediaStreamAudioSource::setAudioFormat(size_t numberOfChannels, float sampleRate)
 83{
 84 MutexLocker locker(m_audioConsumersLock);
 85 for (Vector<RefPtr<AudioDestinationConsumer> >::iterator it = m_audioConsumers.begin(); it != m_audioConsumers.end(); ++it)
 86 (*it)->setFormat(numberOfChannels, sampleRate);
 87}
 88
 89void MediaStreamAudioSource::consumeAudio(AudioBus* bus, size_t numberOfFrames)
 90{
 91 MutexLocker locker(m_audioConsumersLock);
 92 for (Vector<RefPtr<AudioDestinationConsumer> >::iterator it = m_audioConsumers.begin(); it != m_audioConsumers.end(); ++it)
 93 (*it)->consumeAudio(bus, numberOfFrames);
 94}
 95
 96} // namespace WebCore
 97
 98#endif // ENABLE(MEDIA_STREAM)
0

Source/WebCore/Modules/webaudio/MediaStreamAudioSource.h

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef MediaStreamAudioSource_h
 27#define MediaStreamAudioSource_h
 28
 29#if ENABLE(MEDIA_STREAM)
 30
 31#include "AudioDestinationConsumer.h"
 32#include "MediaStreamSource.h"
 33#include <wtf/RefCounted.h>
 34#include <wtf/Vector.h>
 35#include <wtf/text/WTFString.h>
 36
 37namespace WebCore {
 38
 39class AudioBus;
 40class MediaStreamSourceCapabilities;
 41
 42class MediaStreamAudioSource : public MediaStreamSource {
 43public:
 44 static PassRefPtr<MediaStreamAudioSource> create();
 45
 46 ~MediaStreamAudioSource() { }
 47
 48 virtual bool isAudioStreamSource() const { return true; }
 49 virtual bool useIDForTrackID() const { return true; }
 50
 51 virtual PassRefPtr<MediaStreamSourceCapabilities> capabilities() const;
 52 virtual const MediaStreamSourceStates& states();
 53
 54 const String& deviceId() const { return m_deviceId; }
 55 void setDeviceId(const String& deviceId) { m_deviceId = deviceId; }
 56
 57 void setAudioFormat(size_t numberOfChannels, float sampleRate);
 58 void consumeAudio(AudioBus*, size_t numberOfFrames);
 59
 60 void addAudioConsumer(PassRefPtr<AudioDestinationConsumer>);
 61 bool removeAudioConsumer(AudioDestinationConsumer*);
 62 const Vector<RefPtr<AudioDestinationConsumer>>& audioConsumers() const { return m_audioConsumers; }
 63
 64private:
 65 MediaStreamAudioSource();
 66
 67 String m_deviceId;
 68 Mutex m_audioConsumersLock;
 69 Vector<RefPtr<AudioDestinationConsumer>> m_audioConsumers;
 70 MediaStreamSourceStates m_currentStates;
 71};
 72
 73} // namespace WebCore
 74
 75#endif // ENABLE(MEDIA_STREAM)
 76
 77#endif // MediaStreamAudioSource_h
0

Source/WebCore/WebCore.xcodeproj/project.pbxproj

8484 070334D71459FFD5008D8D45 /* TrackBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 070334D61459FFD5008D8D45 /* TrackBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
8585 070334D9145A006F008D8D45 /* TrackBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 070334D8145A006F008D8D45 /* TrackBase.cpp */; };
8686 070334E9145A1F36008D8D45 /* JSTrackCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 070334E8145A1F35008D8D45 /* JSTrackCustom.cpp */; };
 87 070584FD17F9D6DF005F2BCB /* MediaStreamSourceCapabilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 070584FB17F9D6DF005F2BCB /* MediaStreamSourceCapabilities.h */; settings = {ATTRIBUTES = (Private, ); }; };
 88 070584FF17F9F05E005F2BCB /* CapabilityRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 070584FE17F9F05E005F2BCB /* CapabilityRange.cpp */; };
 89 0705850217FA10D0005F2BCB /* JSAllVideoCapabilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0705850017FA10D0005F2BCB /* JSAllVideoCapabilities.cpp */; };
 90 0705850317FA10D0005F2BCB /* JSAllVideoCapabilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 0705850117FA10D0005F2BCB /* JSAllVideoCapabilities.h */; };
 91 0705850817FA4689005F2BCB /* AllAudioCapabilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 0705850517FA4689005F2BCB /* AllAudioCapabilities.h */; };
 92 0705850B17FA4827005F2BCB /* MediaStreamCapabilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 0705850A17FA4827005F2BCB /* MediaStreamCapabilities.h */; };
 93 0705851217FA7107005F2BCB /* JSMediaStreamCapabilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0705851017FA7107005F2BCB /* JSMediaStreamCapabilities.cpp */; };
 94 0705851317FA7107005F2BCB /* JSMediaStreamCapabilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 0705851117FA7107005F2BCB /* JSMediaStreamCapabilities.h */; };
 95 0705851517FB0EEA005F2BCB /* MediaStreamCapabilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0705851417FB0E2C005F2BCB /* MediaStreamCapabilities.cpp */; };
 96 0705851717FB40E9005F2BCB /* JSMediaStreamCapabilitiesCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0705851617FB40E9005F2BCB /* JSMediaStreamCapabilitiesCustom.cpp */; };
 97 0705851A17FB44B4005F2BCB /* JSAllAudioCapabilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0705851817FB44B4005F2BCB /* JSAllAudioCapabilities.cpp */; };
 98 0705851B17FB44B4005F2BCB /* JSAllAudioCapabilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 0705851917FB44B4005F2BCB /* JSAllAudioCapabilities.h */; };
 99 0705852117FDC140005F2BCB /* MediaTrackConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0705851D17FDC140005F2BCB /* MediaTrackConstraint.h */; };
 100 0705852317FDC140005F2BCB /* MediaTrackConstraints.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0705851F17FDC140005F2BCB /* MediaTrackConstraints.cpp */; };
 101 0705852417FDC140005F2BCB /* MediaTrackConstraints.h in Headers */ = {isa = PBXBuildFile; fileRef = 0705852017FDC140005F2BCB /* MediaTrackConstraints.h */; };
 102 0705852917FDE02C005F2BCB /* MediaTrackConstraintSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0705852617FDE02B005F2BCB /* MediaTrackConstraintSet.h */; };
 103 0705853117FDE6D9005F2BCB /* JSMediaTrackConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0705852B17FDE6D9005F2BCB /* JSMediaTrackConstraint.cpp */; };
 104 0705853217FDE6D9005F2BCB /* JSMediaTrackConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0705852C17FDE6D9005F2BCB /* JSMediaTrackConstraint.h */; };
 105 0705853317FDE6D9005F2BCB /* JSMediaTrackConstraints.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0705852D17FDE6D9005F2BCB /* JSMediaTrackConstraints.cpp */; };
 106 0705853417FDE6D9005F2BCB /* JSMediaTrackConstraints.h in Headers */ = {isa = PBXBuildFile; fileRef = 0705852E17FDE6D9005F2BCB /* JSMediaTrackConstraints.h */; };
 107 0705853517FDE6D9005F2BCB /* JSMediaTrackConstraintSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0705852F17FDE6D9005F2BCB /* JSMediaTrackConstraintSet.cpp */; };
 108 0705853617FDE6D9005F2BCB /* JSMediaTrackConstraintSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0705853017FDE6D9005F2BCB /* JSMediaTrackConstraintSet.h */; };
 109 0705853817FE044F005F2BCB /* MediaTrackConstraintSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0705853717FE044F005F2BCB /* MediaTrackConstraintSet.cpp */; };
 110 0705853A17FE0770005F2BCB /* MediaTrackConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0705853917FE0770005F2BCB /* MediaTrackConstraint.cpp */; };
87111 0707568B142262D600414161 /* HTMLTrackElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07075688142262D600414161 /* HTMLTrackElement.cpp */; };
88112 0707568C142262D600414161 /* HTMLTrackElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 07075689142262D600414161 /* HTMLTrackElement.h */; };
89113 070756941422668D00414161 /* JSTextTrack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0707568E1422668C00414161 /* JSTextTrack.cpp */; };

119143 0735EE6A0F40C5E4004A2604 /* MediaPlayerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 0735EE690F40C5E4004A2604 /* MediaPlayerProxy.h */; settings = {ATTRIBUTES = (Private, ); }; };
120144 07367DDF172CA67F00D861B9 /* InbandTextTrackPrivateLegacyAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = 07367DDD172CA67F00D861B9 /* InbandTextTrackPrivateLegacyAVFObjC.h */; };
121145 07367DE0172CA68200D861B9 /* InbandTextTrackPrivateLegacyAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07367DDE172CA67F00D861B9 /* InbandTextTrackPrivateLegacyAVFObjC.mm */; };
 146 073AB4B317F8BACA006E0D6F /* AllVideoCapabilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 073AB4B017F8BACA006E0D6F /* AllVideoCapabilities.h */; };
 147 073AB4B717F92ECF006E0D6F /* JSCapabilityRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 073AB4B517F92ECF006E0D6F /* JSCapabilityRange.cpp */; };
 148 073AB4B817F92ECF006E0D6F /* JSCapabilityRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 073AB4B617F92ECF006E0D6F /* JSCapabilityRange.h */; };
122149 073BE34017D17E01002BD431 /* JSNavigatorMediaStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 073BE33E17D17E01002BD431 /* JSNavigatorMediaStream.cpp */; };
123150 073BE34117D17E01002BD431 /* JSNavigatorMediaStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 073BE33F17D17E01002BD431 /* JSNavigatorMediaStream.h */; settings = {ATTRIBUTES = (Private, ); }; };
124151 073BE34817D17E7A002BD431 /* JSNavigatorUserMediaError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 073BE34217D17E7A002BD431 /* JSNavigatorUserMediaError.cpp */; };

145172 076970861463AD8700F502CF /* TextTrackList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 076970841463AD8700F502CF /* TextTrackList.cpp */; };
146173 076970871463AD8700F502CF /* TextTrackList.h in Headers */ = {isa = PBXBuildFile; fileRef = 076970851463AD8700F502CF /* TextTrackList.h */; };
147174 076F0D0E12B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 076F0D0A12B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.h */; };
 175 0783228418013ED800999E0C /* MediaStreamAudioSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0783228218013ED700999E0C /* MediaStreamAudioSource.cpp */; };
 176 0783228518013ED800999E0C /* MediaStreamAudioSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 0783228318013ED800999E0C /* MediaStreamAudioSource.h */; };
148177 07846342145B151A00A58DF1 /* JSTrackEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07846340145B151A00A58DF1 /* JSTrackEvent.cpp */; };
149178 07846343145B151A00A58DF1 /* JSTrackEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 07846341145B151A00A58DF1 /* JSTrackEvent.h */; };
150179 07846385145B1B8E00A58DF1 /* JSTrackCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 07846384145B1B8E00A58DF1 /* JSTrackCustom.h */; };

276305 07C59B6017F4B208000FBCBB /* JSVideoStreamTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = 07C59B5C17F4B208000FBCBB /* JSVideoStreamTrack.h */; };
277306 07C59B6317F4D1BF000FBCBB /* MockMediaStreamCenter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07C59B6117F4CF87000FBCBB /* MockMediaStreamCenter.cpp */; };
278307 07C59B6417F4D1C4000FBCBB /* MockMediaStreamCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 07C59B6217F4CF87000FBCBB /* MockMediaStreamCenter.h */; };
 308 07C59B6817F784BA000FBCBB /* MediaSourceStates.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07C59B6517F784BA000FBCBB /* MediaSourceStates.cpp */; };
 309 07C59B6917F784BA000FBCBB /* MediaSourceStates.h in Headers */ = {isa = PBXBuildFile; fileRef = 07C59B6617F784BA000FBCBB /* MediaSourceStates.h */; };
 310 07C59B6E17F794F6000FBCBB /* JSMediaSourceStatesCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07C59B6D17F794F6000FBCBB /* JSMediaSourceStatesCustom.cpp */; };
 311 07C59B7117F79C7C000FBCBB /* JSMediaSourceStates.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07C59B6F17F79C7C000FBCBB /* JSMediaSourceStates.cpp */; };
 312 07C59B7217F79C7C000FBCBB /* JSMediaSourceStates.h in Headers */ = {isa = PBXBuildFile; fileRef = 07C59B7017F79C7C000FBCBB /* JSMediaSourceStates.h */; };
 313 07C59B7617F7D0DB000FBCBB /* CapabilityRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 07C59B7417F7D09D000FBCBB /* CapabilityRange.h */; };
279314 07CE77D516712A6A00C55A47 /* InbandTextTrackPrivateClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 07CE77D416712A6A00C55A47 /* InbandTextTrackPrivateClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
280315 07DC5FD417D3EEE90099F890 /* JSRTCStatsResponseCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07DC5FD317D3EEE90099F890 /* JSRTCStatsResponseCustom.cpp */; };
281316 07E116B11489C9A100EC5ACE /* JSTextTrackCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07E116B01489C9A100EC5ACE /* JSTextTrackCustom.cpp */; };

64146449 070334D61459FFD5008D8D45 /* TrackBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrackBase.h; sourceTree = "<group>"; };
64156450 070334D8145A006F008D8D45 /* TrackBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TrackBase.cpp; sourceTree = "<group>"; };
64166451 070334E8145A1F35008D8D45 /* JSTrackCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTrackCustom.cpp; sourceTree = "<group>"; };
 6452 070584FB17F9D6DF005F2BCB /* MediaStreamSourceCapabilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamSourceCapabilities.h; sourceTree = "<group>"; };
 6453 070584FE17F9F05E005F2BCB /* CapabilityRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CapabilityRange.cpp; sourceTree = "<group>"; };
 6454 0705850017FA10D0005F2BCB /* JSAllVideoCapabilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAllVideoCapabilities.cpp; sourceTree = "<group>"; };
 6455 0705850117FA10D0005F2BCB /* JSAllVideoCapabilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAllVideoCapabilities.h; sourceTree = "<group>"; };
 6456 0705850517FA4689005F2BCB /* AllAudioCapabilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AllAudioCapabilities.h; sourceTree = "<group>"; };
 6457 0705850617FA4689005F2BCB /* AllAudioCapabilities.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AllAudioCapabilities.idl; sourceTree = "<group>"; };
 6458 0705850A17FA4827005F2BCB /* MediaStreamCapabilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamCapabilities.h; sourceTree = "<group>"; };
 6459 0705850E17FA6FB1005F2BCB /* MediaStreamCapabilities.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaStreamCapabilities.idl; sourceTree = "<group>"; };
 6460 0705851017FA7107005F2BCB /* JSMediaStreamCapabilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaStreamCapabilities.cpp; sourceTree = "<group>"; };
 6461 0705851117FA7107005F2BCB /* JSMediaStreamCapabilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaStreamCapabilities.h; sourceTree = "<group>"; };
 6462 0705851417FB0E2C005F2BCB /* MediaStreamCapabilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamCapabilities.cpp; sourceTree = "<group>"; };
 6463 0705851617FB40E9005F2BCB /* JSMediaStreamCapabilitiesCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaStreamCapabilitiesCustom.cpp; sourceTree = "<group>"; };
 6464 0705851817FB44B4005F2BCB /* JSAllAudioCapabilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAllAudioCapabilities.cpp; sourceTree = "<group>"; };
 6465 0705851917FB44B4005F2BCB /* JSAllAudioCapabilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAllAudioCapabilities.h; sourceTree = "<group>"; };
 6466 0705851C17FDB23C005F2BCB /* MediaTrackConstraints.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = MediaTrackConstraints.idl; sourceTree = "<group>"; };
 6467 0705851D17FDC140005F2BCB /* MediaTrackConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaTrackConstraint.h; sourceTree = "<group>"; };
 6468 0705851E17FDC140005F2BCB /* MediaTrackConstraint.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaTrackConstraint.idl; sourceTree = "<group>"; };
 6469 0705851F17FDC140005F2BCB /* MediaTrackConstraints.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaTrackConstraints.cpp; sourceTree = "<group>"; };
 6470 0705852017FDC140005F2BCB /* MediaTrackConstraints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaTrackConstraints.h; sourceTree = "<group>"; };
 6471 0705852617FDE02B005F2BCB /* MediaTrackConstraintSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaTrackConstraintSet.h; sourceTree = "<group>"; };
 6472 0705852717FDE02B005F2BCB /* MediaTrackConstraintSet.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaTrackConstraintSet.idl; sourceTree = "<group>"; };
 6473 0705852B17FDE6D9005F2BCB /* JSMediaTrackConstraint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaTrackConstraint.cpp; sourceTree = "<group>"; };
 6474 0705852C17FDE6D9005F2BCB /* JSMediaTrackConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaTrackConstraint.h; sourceTree = "<group>"; };
 6475 0705852D17FDE6D9005F2BCB /* JSMediaTrackConstraints.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaTrackConstraints.cpp; sourceTree = "<group>"; };
 6476 0705852E17FDE6D9005F2BCB /* JSMediaTrackConstraints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaTrackConstraints.h; sourceTree = "<group>"; };
 6477 0705852F17FDE6D9005F2BCB /* JSMediaTrackConstraintSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaTrackConstraintSet.cpp; sourceTree = "<group>"; };
 6478 0705853017FDE6D9005F2BCB /* JSMediaTrackConstraintSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaTrackConstraintSet.h; sourceTree = "<group>"; };
 6479 0705853717FE044F005F2BCB /* MediaTrackConstraintSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaTrackConstraintSet.cpp; sourceTree = "<group>"; };
 6480 0705853917FE0770005F2BCB /* MediaTrackConstraint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaTrackConstraint.cpp; sourceTree = "<group>"; };
64176481 07075688142262D600414161 /* HTMLTrackElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLTrackElement.cpp; sourceTree = "<group>"; };
64186482 07075689142262D600414161 /* HTMLTrackElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLTrackElement.h; sourceTree = "<group>"; };
64196483 0707568A142262D600414161 /* HTMLTrackElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLTrackElement.idl; sourceTree = "<group>"; };

65496613 0735EE690F40C5E4004A2604 /* MediaPlayerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlayerProxy.h; sourceTree = "<group>"; };
65506614 07367DDD172CA67F00D861B9 /* InbandTextTrackPrivateLegacyAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InbandTextTrackPrivateLegacyAVFObjC.h; path = objc/InbandTextTrackPrivateLegacyAVFObjC.h; sourceTree = "<group>"; };
65516615 07367DDE172CA67F00D861B9 /* InbandTextTrackPrivateLegacyAVFObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = InbandTextTrackPrivateLegacyAVFObjC.mm; path = objc/InbandTextTrackPrivateLegacyAVFObjC.mm; sourceTree = "<group>"; };
 6616 073AB4B017F8BACA006E0D6F /* AllVideoCapabilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AllVideoCapabilities.h; sourceTree = "<group>"; };
 6617 073AB4B517F92ECF006E0D6F /* JSCapabilityRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCapabilityRange.cpp; sourceTree = "<group>"; };
 6618 073AB4B617F92ECF006E0D6F /* JSCapabilityRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCapabilityRange.h; sourceTree = "<group>"; };
65526619 073BE33E17D17E01002BD431 /* JSNavigatorMediaStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNavigatorMediaStream.cpp; sourceTree = "<group>"; };
65536620 073BE33F17D17E01002BD431 /* JSNavigatorMediaStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNavigatorMediaStream.h; sourceTree = "<group>"; };
65546621 073BE34217D17E7A002BD431 /* JSNavigatorUserMediaError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNavigatorUserMediaError.cpp; sourceTree = "<group>"; };

65756642 076970851463AD8700F502CF /* TextTrackList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextTrackList.h; sourceTree = "<group>"; };
65766643 076F0D0912B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaPlayerPrivateAVFoundation.cpp; sourceTree = "<group>"; };
65776644 076F0D0A12B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlayerPrivateAVFoundation.h; sourceTree = "<group>"; };
 6645 0783228218013ED700999E0C /* MediaStreamAudioSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamAudioSource.cpp; sourceTree = "<group>"; };
 6646 0783228318013ED800999E0C /* MediaStreamAudioSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamAudioSource.h; sourceTree = "<group>"; };
65786647 07846340145B151A00A58DF1 /* JSTrackEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTrackEvent.cpp; sourceTree = "<group>"; };
65796648 07846341145B151A00A58DF1 /* JSTrackEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTrackEvent.h; sourceTree = "<group>"; };
65806649 07846384145B1B8E00A58DF1 /* JSTrackCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTrackCustom.h; sourceTree = "<group>"; };

66396708 07C59B5C17F4B208000FBCBB /* JSVideoStreamTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVideoStreamTrack.h; sourceTree = "<group>"; };
66406709 07C59B6117F4CF87000FBCBB /* MockMediaStreamCenter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MockMediaStreamCenter.cpp; path = mock/MockMediaStreamCenter.cpp; sourceTree = "<group>"; };
66416710 07C59B6217F4CF87000FBCBB /* MockMediaStreamCenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MockMediaStreamCenter.h; path = mock/MockMediaStreamCenter.h; sourceTree = "<group>"; };
 6711 07C59B6517F784BA000FBCBB /* MediaSourceStates.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaSourceStates.cpp; sourceTree = "<group>"; };
 6712 07C59B6617F784BA000FBCBB /* MediaSourceStates.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSourceStates.h; sourceTree = "<group>"; };
 6713 07C59B6717F784BA000FBCBB /* MediaSourceStates.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaSourceStates.idl; sourceTree = "<group>"; };
 6714 07C59B6D17F794F6000FBCBB /* JSMediaSourceStatesCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaSourceStatesCustom.cpp; sourceTree = "<group>"; };
 6715 07C59B6F17F79C7C000FBCBB /* JSMediaSourceStates.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaSourceStates.cpp; sourceTree = "<group>"; };
 6716 07C59B7017F79C7C000FBCBB /* JSMediaSourceStates.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaSourceStates.h; sourceTree = "<group>"; };
 6717 07C59B7317F7D09D000FBCBB /* AllVideoCapabilities.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AllVideoCapabilities.idl; sourceTree = "<group>"; };
 6718 07C59B7417F7D09D000FBCBB /* CapabilityRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CapabilityRange.h; sourceTree = "<group>"; };
 6719 07C59B7517F7D09D000FBCBB /* CapabilityRange.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CapabilityRange.idl; sourceTree = "<group>"; };
66426720 07CE77D416712A6A00C55A47 /* InbandTextTrackPrivateClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InbandTextTrackPrivateClient.h; sourceTree = "<group>"; };
66436721 07DC5FD317D3EEE90099F890 /* JSRTCStatsResponseCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRTCStatsResponseCustom.cpp; sourceTree = "<group>"; };
66446722 07E116B01489C9A100EC5ACE /* JSTextTrackCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTextTrackCustom.cpp; sourceTree = "<group>"; };

1320913287 07221B4617CEC32700848E51 /* mediastream */ = {
1321013288 isa = PBXGroup;
1321113289 children = (
 13290 0705853917FE0770005F2BCB /* MediaTrackConstraint.cpp */,
 13291 0705853717FE044F005F2BCB /* MediaTrackConstraintSet.cpp */,
 13292 0705852617FDE02B005F2BCB /* MediaTrackConstraintSet.h */,
 13293 0705852717FDE02B005F2BCB /* MediaTrackConstraintSet.idl */,
 13294 0705851D17FDC140005F2BCB /* MediaTrackConstraint.h */,
 13295 0705851E17FDC140005F2BCB /* MediaTrackConstraint.idl */,
 13296 0705851F17FDC140005F2BCB /* MediaTrackConstraints.cpp */,
 13297 0705852017FDC140005F2BCB /* MediaTrackConstraints.h */,
 13298 0705851C17FDB23C005F2BCB /* MediaTrackConstraints.idl */,
 13299 0705850517FA4689005F2BCB /* AllAudioCapabilities.h */,
 13300 0705850617FA4689005F2BCB /* AllAudioCapabilities.idl */,
 13301 070584FE17F9F05E005F2BCB /* CapabilityRange.cpp */,
 13302 073AB4B017F8BACA006E0D6F /* AllVideoCapabilities.h */,
 13303 07C59B7317F7D09D000FBCBB /* AllVideoCapabilities.idl */,
 13304 07C59B7417F7D09D000FBCBB /* CapabilityRange.h */,
 13305 07C59B7517F7D09D000FBCBB /* CapabilityRange.idl */,
 13306 07C59B6517F784BA000FBCBB /* MediaSourceStates.cpp */,
 13307 07C59B6617F784BA000FBCBB /* MediaSourceStates.h */,
 13308 07C59B6717F784BA000FBCBB /* MediaSourceStates.idl */,
1321213309 07C59B4D17F4AC15000FBCBB /* AudioStreamTrack.cpp */,
1321313310 07C59B4E17F4AC15000FBCBB /* AudioStreamTrack.h */,
1321413311 07C59B4F17F4AC15000FBCBB /* AudioStreamTrack.idl */,
1321513312 07C59B5017F4AC15000FBCBB /* VideoStreamTrack.cpp */,
1321613313 07C59B5117F4AC15000FBCBB /* VideoStreamTrack.h */,
1321713314 07C59B5217F4AC15000FBCBB /* VideoStreamTrack.idl */,
 13315 0705851417FB0E2C005F2BCB /* MediaStreamCapabilities.cpp */,
 13316 0705850E17FA6FB1005F2BCB /* MediaStreamCapabilities.idl */,
 13317 0705850A17FA4827005F2BCB /* MediaStreamCapabilities.h */,
1321813318 07221B4A17CEC32700848E51 /* MediaConstraintsImpl.cpp */,
1321913319 07221B4B17CEC32700848E51 /* MediaConstraintsImpl.h */,
1322013320 07221B4C17CEC32700848E51 /* MediaStream.cpp */,

1331313413 07221B9D17CF0AD400848E51 /* MediaStreamDescriptor.h */,
1331413414 07221B9E17CF0AD400848E51 /* MediaStreamSource.cpp */,
1331513415 07221B9F17CF0AD400848E51 /* MediaStreamSource.h */,
 13416 070584FB17F9D6DF005F2BCB /* MediaStreamSourceCapabilities.h */,
1331613417 076306E217E22A43005A7C4E /* MediaStreamTrackSourcesRequestClient.h */,
1331713418 07221BA117CF0AD400848E51 /* RTCConfiguration.h */,
1331813419 07221BA217CF0AD400848E51 /* RTCDataChannelHandler.h */,

1336013461 07CFD99317D01405001C4FFC /* MediaStream */ = {
1336113462 isa = PBXGroup;
1336213463 children = (
 13464 0705852B17FDE6D9005F2BCB /* JSMediaTrackConstraint.cpp */,
 13465 0705852C17FDE6D9005F2BCB /* JSMediaTrackConstraint.h */,
 13466 0705852D17FDE6D9005F2BCB /* JSMediaTrackConstraints.cpp */,
 13467 0705852E17FDE6D9005F2BCB /* JSMediaTrackConstraints.h */,
 13468 0705852F17FDE6D9005F2BCB /* JSMediaTrackConstraintSet.cpp */,
 13469 0705853017FDE6D9005F2BCB /* JSMediaTrackConstraintSet.h */,
 13470 0705851017FA7107005F2BCB /* JSMediaStreamCapabilities.cpp */,
 13471 0705851117FA7107005F2BCB /* JSMediaStreamCapabilities.h */,
 13472 07C59B6F17F79C7C000FBCBB /* JSMediaSourceStates.cpp */,
 13473 07C59B7017F79C7C000FBCBB /* JSMediaSourceStates.h */,
1336313474 07C59B5917F4B208000FBCBB /* JSAudioStreamTrack.cpp */,
1336413475 07C59B5A17F4B208000FBCBB /* JSAudioStreamTrack.h */,
1336513476 07C59B5B17F4B208000FBCBB /* JSVideoStreamTrack.cpp */,

1917919290 BC4EDEF70C08F414007EDD49 /* Custom */ = {
1918019291 isa = PBXGroup;
1918119292 children = (
 19293 0705851617FB40E9005F2BCB /* JSMediaStreamCapabilitiesCustom.cpp */,
 19294 07C59B6D17F794F6000FBCBB /* JSMediaSourceStatesCustom.cpp */,
1918219295 BC2ED6BB0C6BD2F000920BFF /* JSAttrCustom.cpp */,
1918319296 FDEAAAEF12B02EE400DCF33B /* JSAudioBufferSourceNodeCustom.cpp */,
1918419297 FDEAAAF012B02EE400DCF33B /* JSAudioContextCustom.cpp */,

1977519888 CD61FE7B1794CA02004101EB /* MediaSource */ = {
1977619889 isa = PBXGroup;
1977719890 children = (
 19891 0705851817FB44B4005F2BCB /* JSAllAudioCapabilities.cpp */,
 19892 0705851917FB44B4005F2BCB /* JSAllAudioCapabilities.h */,
 19893 0705850017FA10D0005F2BCB /* JSAllVideoCapabilities.cpp */,
 19894 0705850117FA10D0005F2BCB /* JSAllVideoCapabilities.h */,
 19895 073AB4B517F92ECF006E0D6F /* JSCapabilityRange.cpp */,
 19896 073AB4B617F92ECF006E0D6F /* JSCapabilityRange.h */,
1977819897 CD9DE17217AAC74C00EA386D /* JSMediaSource.cpp */,
1977919898 CD9DE17317AAC74C00EA386D /* JSMediaSource.h */,
1978019899 CD9DE17617AAC75B00EA386D /* JSSourceBuffer.cpp */,

2102221141 FD315FA212B025B100C1A359 /* webaudio */ = {
2102321142 isa = PBXGroup;
2102421143 children = (
 21144 0783228218013ED700999E0C /* MediaStreamAudioSource.cpp */,
 21145 0783228318013ED800999E0C /* MediaStreamAudioSource.h */,
2102521146 FD315FF312B0267600C1A359 /* AnalyserNode.cpp */,
2102621147 FD315FF412B0267600C1A359 /* AnalyserNode.h */,
2102721148 FD315FF512B0267600C1A359 /* AnalyserNode.idl */,

2141921540 FD3160BF12B0272A00C1A359 /* AudioFileReaderMac.h in Headers */,
2142021541 FDE2D55B159E66EB00DCCCF8 /* AudioIOCallback.h in Headers */,
2142121542 FD31601012B0267600C1A359 /* AudioListener.h in Headers */,
 21543 0705852417FDC140005F2BCB /* MediaTrackConstraints.h in Headers */,
2142221544 FD31601312B0267600C1A359 /* AudioNode.h in Headers */,
2142321545 FD31601612B0267600C1A359 /* AudioNodeInput.h in Headers */,
2142421546 FD31601812B0267600C1A359 /* AudioNodeOutput.h in Headers */,

2158121703 BC0B36A50CD3C67C00AC7EB5 /* Console.h in Headers */,
2158221704 2DF2E9D5166E39750035BEF2 /* ConsoleAPITypes.h in Headers */,
2158321705 41F0618E0F5F069800A07EAC /* ConsoleMessage.h in Headers */,
 21706 073AB4B317F8BACA006E0D6F /* AllVideoCapabilities.h in Headers */,
2158421707 BCE5644E137A34D6007D2934 /* ConsoleTypes.h in Headers */,
2158521708 A818721C0977D3C0005826D9 /* ContainerNode.h in Headers */,
2158621709 E1A1470811102B1500EEC0F3 /* ContainerNodeAlgorithms.h in Headers */,

2173721860 A5732B0B136A161D005C8D7C /* DateComponents.h in Headers */,
2173821861 F55B3DB61251F12D003EF269 /* DateInputType.h in Headers */,
2173921862 453EB637159C570400001BB7 /* DateTimeFormat.h in Headers */,
 21863 0705850317FA10D0005F2BCB /* JSAllVideoCapabilities.h in Headers */,
2174021864 F55B3DB81251F12D003EF269 /* DateTimeInputType.h in Headers */,
2174121865 F55B3DBA1251F12D003EF269 /* DateTimeLocalInputType.h in Headers */,
2174221866 45FEA5D0156DDE8C00654101 /* Decimal.h in Headers */,

2175021874 FD31602E12B0267600C1A359 /* DelayNode.h in Headers */,
2175121875 FD31603112B0267600C1A359 /* DelayProcessor.h in Headers */,
2175221876 1C4C8F660AD8655D009475CE /* DeleteButton.h in Headers */,
 21877 0705853217FDE6D9005F2BCB /* JSMediaTrackConstraint.h in Headers */,
2175321878 1C4C8F020AD85D87009475CE /* DeleteButtonController.h in Headers */,
2175421879 93309DDF099E64920056E581 /* DeleteFromTextNodeCommand.h in Headers */,
2175521880 07C59B6417F4D1C4000FBCBB /* MockMediaStreamCenter.h in Headers */,

2179121916 CE057FA61220731100A476D5 /* DocumentMarkerController.h in Headers */,
2179221917 14947FFE12F80CD200A0F631 /* DocumentOrderedMap.h in Headers */,
2179321918 BCCFBAE80B5152ED0001F1D7 /* DocumentParser.h in Headers */,
 21919 0705852917FDE02C005F2BCB /* MediaTrackConstraintSet.h in Headers */,
2179421920 4A4F48AA16B0DFC000EDBB29 /* DocumentRuleSets.h in Headers */,
2179521921 AD6E71AD1668899D00320C13 /* DocumentSharedObjectPool.h in Headers */,
2179621922 E47E276516036ED200EE2AFB /* DocumentStyleSheetCollection.h in Headers */,

2194522071 85992EBA0AA5069500AC0785 /* DOMHTMLHeadElement.h in Headers */,
2194622072 85E711AD0AC5D5350053270F /* DOMHTMLHeadElementInternal.h in Headers */,
2194722073 85183B440AA6926100F19FA3 /* DOMHTMLHeadingElement.h in Headers */,
 22074 0705853617FDE6D9005F2BCB /* JSMediaTrackConstraintSet.h in Headers */,
2194822075 85E711AE0AC5D5350053270F /* DOMHTMLHeadingElementInternal.h in Headers */,
2194922076 85ECBEF10AA7626900544F0B /* DOMHTMLHRElement.h in Headers */,
2195022077 85E711AF0AC5D5350053270F /* DOMHTMLHRElementInternal.h in Headers */,

2205722184 85CA96EA0A9624E900690CCF /* DOMNotation.h in Headers */,
2205822185 85E711D40AC5D5350053270F /* DOMNotationInternal.h in Headers */,
2205922186 856C8AE40A912649005C687B /* DOMObject.h in Headers */,
 22187 0705851317FA7107005F2BCB /* JSMediaStreamCapabilities.h in Headers */,
2206022188 BC53DA601143141A000D817E /* DOMObjectHashTableMap.h in Headers */,
2206122189 85C7F5D00AAFB8D9004014DD /* DOMOverflowEvent.h in Headers */,
2206222190 85989DCF0ACC8BBD00A0BC51 /* DOMOverflowEventInternal.h in Headers */,

2250322631 BCCD74DC0A4C8D35005FDA6D /* HTMLViewSourceDocument.h in Headers */,
2250422632 977B387A122883E900B81FF8 /* HTMLViewSourceParser.h in Headers */,
2250522633 514C76710CE923A1007EF3CD /* HTTPHeaderMap.h in Headers */,
 22634 073AB4B817F92ECF006E0D6F /* JSCapabilityRange.h in Headers */,
2250622635 514C76730CE923A1007EF3CD /* HTTPParsers.h in Headers */,
2250722636 375CD232119D43C800A2A859 /* Hyphenation.h in Headers */,
2250822637 B275356E0B053814002CE64F /* Icon.h in Headers */,

2260822737 7A24587C1021EAF4000A00AA /* InspectorDOMAgent.h in Headers */,
2260922738 F3D4C47912E07663003DA150 /* InspectorDOMDebuggerAgent.h in Headers */,
2261022739 7A74ECBB101839A600BF939E /* InspectorDOMStorageAgent.h in Headers */,
 22740 0705853417FDE6D9005F2BCB /* JSMediaTrackConstraints.h in Headers */,
2261122741 578DA20E1520EB8C006141C1 /* InspectorFrontend.h in Headers */,
2261222742 227777601345DEA9008EA455 /* InspectorFrontendChannel.h in Headers */,
2261322743 F344C7141125B82C00F26EEE /* InspectorFrontendClient.h in Headers */,

2307223202 B2FA3DDB0AB75A6F000E5AC4 /* JSSVGPathSegList.h in Headers */,
2307323203 B2FA3DDD0AB75A6F000E5AC4 /* JSSVGPathSegMovetoAbs.h in Headers */,
2307423204 B2FA3DDF0AB75A6F000E5AC4 /* JSSVGPathSegMovetoRel.h in Headers */,
 23205 0705852117FDC140005F2BCB /* MediaTrackConstraint.h in Headers */,
2307523206 B2FA3DE10AB75A6F000E5AC4 /* JSSVGPatternElement.h in Headers */,
2307623207 8542A7950AE5C94100DF58DF /* JSSVGPoint.h in Headers */,
2307723208 B2FA3DE30AB75A6F000E5AC4 /* JSSVGPointList.h in Headers */,

2355823689 439046E212DA25E800AF80A2 /* RenderMathMLRoot.h in Headers */,
2355923690 439046E412DA25E800AF80A2 /* RenderMathMLRow.h in Headers */,
2356023691 439046E612DA25E800AF80A2 /* RenderMathMLSquareRoot.h in Headers */,
 23692 0783228518013ED800999E0C /* MediaStreamAudioSource.h in Headers */,
2356123693 439046E812DA25E800AF80A2 /* RenderMathMLScripts.h in Headers */,
2356223694 439046EA12DA25E800AF80A2 /* RenderMathMLUnderOver.h in Headers */,
2356323695 E4C279590CF9741900E97B98 /* RenderMedia.h in Headers */,

2357823710 A871DFE30A15376B00B12A68 /* RenderReplaced.h in Headers */,
2357923711 BCA846D70DC67A350026C309 /* RenderReplica.h in Headers */,
2358023712 1479FAEE109AE37500DED655 /* RenderRuby.h in Headers */,
 23713 0705850817FA4689005F2BCB /* AllAudioCapabilities.h in Headers */,
2358123714 1479FAF0109AE37500DED655 /* RenderRubyBase.h in Headers */,
2358223715 1479FAF2109AE37500DED655 /* RenderRubyRun.h in Headers */,
2358323716 1479FAF4109AE37500DED655 /* RenderRubyText.h in Headers */,

2366023793 973E325710883B7C005BC493 /* ResourceLoadNotifier.h in Headers */,
2366123794 E4295FA412B0614E00D1ACE0 /* ResourceLoadPriority.h in Headers */,
2366223795 D0CE58F9125E4CC200F3F199 /* ResourceLoadScheduler.h in Headers */,
 23796 07C59B7617F7D0DB000FBCBB /* CapabilityRange.h in Headers */,
2366323797 8A81BF8511DCFD9000DA2B98 /* ResourceLoadTiming.h in Headers */,
2366423798 7EE6846D12D26E3800E79415 /* ResourceRequest.h in Headers */,
2366523799 514C767D0CE923A1007EF3CD /* ResourceRequestBase.h in Headers */,

2396924103 078E093817D16B2C00420AA1 /* MediaStreamSource.h in Headers */,
2397024104 B22279B10D00BF220071B782 /* SVGDescElement.h in Headers */,
2397124105 B5B7A17117C10AC000E4AA0A /* ElementData.h in Headers */,
 24106 0705850B17FA4827005F2BCB /* MediaStreamCapabilities.h in Headers */,
2397224107 B22279B40D00BF220071B782 /* SVGDocument.h in Headers */,
2397324108 B28C6A280D00C44800334AA4 /* SVGDocumentExtensions.h in Headers */,
2397424109 B22279B70D00BF220071B782 /* SVGElement.h in Headers */,

2404324178 7134496E146941B300720312 /* SVGLengthContext.h in Headers */,
2404424179 B2227A360D00BF220071B782 /* SVGLengthList.h in Headers */,
2404524180 B2227A390D00BF220071B782 /* SVGLinearGradientElement.h in Headers */,
 24181 07C59B6917F784BA000FBCBB /* MediaSourceStates.h in Headers */,
2404624182 B2227A3C0D00BF220071B782 /* SVGLineElement.h in Headers */,
2404724183 0810764412828556007C63BA /* SVGListProperty.h in Headers */,
2404824184 088A0E09126EF1DB00978F7A /* SVGListPropertyTearOff.h in Headers */,

2423224368 E44613B00CD6331000FADA75 /* TimeRanges.h in Headers */,
2423324369 49E912AE0EFAC906009D0CAF /* TimingFunction.h in Headers */,
2423424370 070334D71459FFD5008D8D45 /* TrackBase.h in Headers */,
 24371 070584FD17F9D6DF005F2BCB /* MediaStreamSourceCapabilities.h in Headers */,
2423524372 BE88E0C21715CE2600658D98 /* TrackListBase.h in Headers */,
2423624373 CD3A495F17A9D01B00274E42 /* MediaSource.h in Headers */,
2423724374 49E911C40EF86D47009D0CAF /* TransformationMatrix.h in Headers */,

2428524422 BE88E0E21715D2A200658D98 /* VideoTrackList.h in Headers */,
2428624423 E4C91A0E1802343100A17F6D /* TextPaintStyle.h in Headers */,
2428724424 BEF29EEC1715DD0900C4B4C9 /* VideoTrackPrivate.h in Headers */,
 24425 0705851B17FB44B4005F2BCB /* JSAllAudioCapabilities.h in Headers */,
2428824426 CEF418CF1179678C009D112C /* ViewportArguments.h in Headers */,
2428924427 3FFFF9AE159D9B060020BBD5 /* ViewportStyleResolver.h in Headers */,
2429024428 93309E20099E64920056E581 /* VisiblePosition.h in Headers */,

2447424612 83C1D428178D5AB400141E68 /* SVGPathSegCurvetoCubicRel.h in Headers */,
2447524613 83C1D429178D5AB400141E68 /* SVGPathSegCurvetoCubicSmoothAbs.h in Headers */,
2447624614 83C1D42A178D5AB400141E68 /* SVGPathSegCurvetoCubicSmoothRel.h in Headers */,
 24615 07C59B7217F79C7C000FBCBB /* JSMediaSourceStates.h in Headers */,
2447724616 83C1D42B178D5AB400141E68 /* SVGPathSegCurvetoQuadraticAbs.h in Headers */,
2447824617 83C1D42C178D5AB500141E68 /* SVGPathSegCurvetoQuadraticRel.h in Headers */,
2447924618 83C1D42D178D5AB500141E68 /* SVGPathSegCurvetoQuadraticSmoothAbs.h in Headers */,

2495925098 FD31602412B0267600C1A359 /* BiquadDSPKernel.cpp in Sources */,
2496025099 FDC54F041399B0DA008D9117 /* BiquadFilterNode.cpp in Sources */,
2496125100 FD31602612B0267600C1A359 /* BiquadProcessor.cpp in Sources */,
 25101 070584FF17F9F05E005F2BCB /* CapabilityRange.cpp in Sources */,
2496225102 A89943290B42338800D7C802 /* BitmapImage.cpp in Sources */,
2496325103 377A3A9015EFCE9B0059F5C7 /* BitmapImageCG.cpp in Sources */,
2496425104 976D6C78122B8A3D001FD1F7 /* Blob.cpp in Sources */,

2526225402 85CA975D0A962E5400690CCF /* DOMDocumentType.mm in Sources */,
2526325403 8518DCEA0A9CC80D0091B7A6 /* DOMDOMImplementation.mm in Sources */,
2526425404 52CCA9E915E3F64C0053C77F /* DOMDOMNamedFlowCollection.mm in Sources */,
 25405 0783228418013ED800999E0C /* MediaStreamAudioSource.cpp in Sources */,
2526525406 2D9A247315B9C2D100D34527 /* DOMDOMSecurityPolicy.mm in Sources */,
2526625407 7694565C1214DB630007CBAE /* DOMDOMTokenList.mm in Sources */,
2526725408 7AABA25914BC613300AA9A11 /* DOMEditor.cpp in Sources */,

2528225423 859A9C480AA5E3BD00B694B2 /* DOMHTMLBaseElement.mm in Sources */,
2528325424 078E090417D14CEE00420AA1 /* NavigatorMediaStream.cpp in Sources */,
2528425425 85ECBEEE0AA7626900544F0B /* DOMHTMLBaseFontElement.mm in Sources */,
 25426 07C59B6817F784BA000FBCBB /* MediaSourceStates.cpp in Sources */,
2528525427 859A9C4A0AA5E3BD00B694B2 /* DOMHTMLBodyElement.mm in Sources */,
2528625428 85183B430AA6926100F19FA3 /* DOMHTMLBRElement.mm in Sources */,
2528725429 85BA4CDE0AA6861B0088052D /* DOMHTMLButtonElement.mm in Sources */,

2528925431 85DF2F8F0AA3C88100AD64C5 /* DOMHTMLCollection.mm in Sources */,
2529025432 078E090017D14CEE00420AA1 /* MediaStreamEvent.cpp in Sources */,
2529125433 F5C041E40FFCA96D00839D4A /* DOMHTMLDataListElement.mm in Sources */,
 25434 0705852317FDC140005F2BCB /* MediaTrackConstraints.cpp in Sources */,
2529225435 D359D792129CA3C00006E5D2 /* DOMHTMLDetailsElement.mm in Sources */,
2529325436 85BA4D0C0AA688680088052D /* DOMHTMLDirectoryElement.mm in Sources */,
2529425437 85BA4D0E0AA688680088052D /* DOMHTMLDivElement.mm in Sources */,

2574025883 B275358E0B053A66002CE64F /* IconMac.mm in Sources */,
2574125884 51E1ECC00C91C90400DC255B /* IconRecord.cpp in Sources */,
2574225885 45099C411370A7800058D513 /* IconURL.cpp in Sources */,
 25886 0705851517FB0EEA005F2BCB /* MediaStreamCapabilities.cpp in Sources */,
2574325887 C585A66211D4FAC5004C3E4B /* IDBBindingUtilities.cpp in Sources */,
2574425888 9712A5C515004EDA0048AF10 /* IDBDatabaseCallbacksImpl.cpp in Sources */,
2574525889 9712A5C915004EDA0048AF10 /* IDBDatabaseException.cpp in Sources */,

2574725891 9712A5EF15004EDA0048AF10 /* IDBPendingTransactionMonitor.cpp in Sources */,
2574825892 9712A5FE15004EDA0048AF10 /* IDBVersionChangeEvent.cpp in Sources */,
2574925893 1A71D57B0F33819000F9CE4E /* IdentifierRep.cpp in Sources */,
 25894 0705853117FDE6D9005F2BCB /* JSMediaTrackConstraint.cpp in Sources */,
2575025895 5913A24113D49EBA00F5B05C /* IdentifiersFactory.cpp in Sources */,
2575125896 C3CF17A415B0063F00276D39 /* IdTargetObserver.cpp in Sources */,
2575225897 C3CF17A615B0063F00276D39 /* IdTargetObserverRegistry.cpp in Sources */,

2591626061 51EC92650CE90DD400F90308 /* JSCustomSQLStatementErrorCallback.cpp in Sources */,
2591726062 E10B93C30B73C291003ED890 /* JSCustomXPathNSResolver.cpp in Sources */,
2591826063 1AE82F8F0CAAFA9D002237AE /* JSDatabase.cpp in Sources */,
 26064 07C59B6E17F794F6000FBCBB /* JSMediaSourceStatesCustom.cpp in Sources */,
2591926065 B59DD69A119029E5007E9684 /* JSDatabaseCallback.cpp in Sources */,
2592026066 B58CEB6A11913607002A6790 /* JSDatabaseSync.cpp in Sources */,
2592126067 4162A4571011464700DFF3ED /* JSDedicatedWorkerGlobalScope.cpp in Sources */,

2604426190 1AE2AA2E0A1CDAB400B42B25 /* JSHTMLHeadingElement.cpp in Sources */,
2604526191 1AE2AA300A1CDAB400B42B25 /* JSHTMLHRElement.cpp in Sources */,
2604626192 1A85B18F0A1B18A200D8C87C /* JSHTMLHtmlElement.cpp in Sources */,
 26193 0705853817FE044F005F2BCB /* MediaTrackConstraintSet.cpp in Sources */,
2604726194 BC4918C80BFEA050009D6316 /* JSHTMLIFrameElement.cpp in Sources */,
2604826195 1AE2AA970A1CDD2D00B42B25 /* JSHTMLImageElement.cpp in Sources */,
2604926196 A80E7E980A1A83E3007FB8C5 /* JSHTMLInputElement.cpp in Sources */,

2616026307 7E46F6FA1627A2CA00062223 /* JSOESElementIndexUint.cpp in Sources */,
2616126308 9001788012E0370700648462 /* JSOESStandardDerivatives.cpp in Sources */,
2616226309 6EBF0E7612A9868800DB1709 /* JSOESTextureFloat.cpp in Sources */,
 26310 0705853A17FE0770005F2BCB /* MediaTrackConstraint.cpp in Sources */,
2616326311 A31C4E5216E02B08002F7957 /* JSOESTextureHalfFloat.cpp in Sources */,
2616426312 77A17AA612F28B2A004E02F6 /* JSOESVertexArrayObject.cpp in Sources */,
2616526313 FDF6BAF8134A4C9800822920 /* JSOfflineAudioCompletionEvent.cpp in Sources */,

2650226650 985BB96D13A94058007A0B69 /* LinkRelAttribute.cpp in Sources */,
2650326651 BC7FA6200D1F0CBD00DB22A9 /* LiveNodeList.cpp in Sources */,
2650426652 078E091017D14CEE00420AA1 /* RTCStatsResponse.cpp in Sources */,
 26653 0705850217FA10D0005F2BCB /* JSAllVideoCapabilities.cpp in Sources */,
2650526654 9759E93E14EF1CF80026A2DD /* LoadableTextTrack.cpp in Sources */,
2650626655 656D37330ADBA5DE00A4554D /* LoaderNSURLExtras.mm in Sources */,
2650726656 7EE6846812D26E3800E79415 /* LoaderRunLoopCF.cpp in Sources */,

2651426663 BC25B52A131C6D3900180E10 /* LocalizedStringsMac.cpp in Sources */,
2651526664 BCE1C41C0D982981003B02F2 /* Location.cpp in Sources */,
2651626665 078E090817D14CEE00420AA1 /* RTCDTMFToneChangeEvent.cpp in Sources */,
 26666 0705851A17FB44B4005F2BCB /* JSAllAudioCapabilities.cpp in Sources */,
2651726667 A8239E0009B3CF8A00B60641 /* Logging.cpp in Sources */,
2651826668 1402645E0AFDC19B005919E2 /* LoggingMac.mm in Sources */,
2651926669 1A8F6BC50DB55CDC001DB794 /* ManifestParser.cpp in Sources */,

2658026730 D6E276AF14637455001D280A /* MutationObserverRegistration.cpp in Sources */,
2658126731 C6F08FBC1430FE8F00685849 /* MutationRecord.cpp in Sources */,
2658226732 52B6C9C515E3F4DF00690B05 /* NamedFlowCollection.cpp in Sources */,
 26733 0705853317FDE6D9005F2BCB /* JSMediaTrackConstraints.cpp in Sources */,
2658326734 BCF34A3711A231CD00C71804 /* NamedNodeMap.cpp in Sources */,
2658426735 A81872240977D3C0005826D9 /* NameNodeList.cpp in Sources */,
2658526736 E10B9B6D0B747599003ED890 /* NativeXPathNSResolver.cpp in Sources */,

2684026991 934F713E0D5A6F2800018D69 /* ResourceErrorBase.cpp in Sources */,
2684126992 7EE6846B12D26E3800E79415 /* ResourceErrorCF.cpp in Sources */,
2684226993 514C76500CE9234E007EF3CD /* ResourceErrorMac.mm in Sources */,
 26994 0705851217FA7107005F2BCB /* JSMediaStreamCapabilities.cpp in Sources */,
2684326995 514C76780CE923A1007EF3CD /* ResourceHandle.cpp in Sources */,
2684426996 7EE6846C12D26E3800E79415 /* ResourceHandleCFNet.cpp in Sources */,
2684526997 E1BA003116FB92AC00BA7A35 /* ResourceHandleClient.cpp in Sources */,

2714127293 B22279C40D00BF220071B782 /* SVGExternalResourcesRequired.cpp in Sources */,
2714227294 B22279C70D00BF220071B782 /* SVGFEBlendElement.cpp in Sources */,
2714327295 B22279CA0D00BF220071B782 /* SVGFEColorMatrixElement.cpp in Sources */,
 27296 0705853517FDE6D9005F2BCB /* JSMediaTrackConstraintSet.cpp in Sources */,
2714427297 B22279CD0D00BF220071B782 /* SVGFEComponentTransferElement.cpp in Sources */,
2714527298 B22279D00D00BF220071B782 /* SVGFECompositeElement.cpp in Sources */,
2714627299 1921327411C0E6BB00456238 /* SVGFEConvolveMatrixElement.cpp in Sources */,

2720327356 B2227A3B0D00BF220071B782 /* SVGLineElement.cpp in Sources */,
2720427357 B2227A400D00BF220071B782 /* SVGLocatable.cpp in Sources */,
2720527358 B2227A430D00BF220071B782 /* SVGMarkerElement.cpp in Sources */,
 27359 0705851717FB40E9005F2BCB /* JSMediaStreamCapabilitiesCustom.cpp in Sources */,
2720627360 B2227A460D00BF220071B782 /* SVGMaskElement.cpp in Sources */,
2720727361 B2227A4A0D00BF220071B782 /* SVGMetadataElement.cpp in Sources */,
2720827362 B2A1F2B00CEF0ABF00442F6A /* SVGMissingGlyphElement.cpp in Sources */,

2726627420 B2227AF20D00BF220071B782 /* SVGViewSpec.cpp in Sources */,
2726727421 8485228A1190173C006EDC7F /* SVGVKernElement.cpp in Sources */,
2726827422 B2227AF50D00BF220071B782 /* SVGZoomAndPan.cpp in Sources */,
 27423 073AB4B717F92ECF006E0D6F /* JSCapabilityRange.cpp in Sources */,
2726927424 B2E4EC970D00C22B00432643 /* SVGZoomEvent.cpp in Sources */,
2727027425 E180811216FCF42F00B80D07 /* SynchronousLoaderClient.cpp in Sources */,
2727127426 E180811616FCF9CB00B80D07 /* SynchronousLoaderClient.mm in Sources */,

2744627601 97AABD1A14FA09D5007457AE /* WebSocket.cpp in Sources */,
2744727602 97AABD1D14FA09D5007457AE /* WebSocketChannel.cpp in Sources */,
2744827603 4A38BF5014FE1C0900612512 /* WebSocketDeflateFramer.cpp in Sources */,
 27604 07C59B7117F79C7C000FBCBB /* JSMediaSourceStates.cpp in Sources */,
2744927605 97AABD2014FA09D5007457AE /* WebSocketDeflater.cpp in Sources */,
2745027606 97AABD2214FA09D5007457AE /* WebSocketExtensionDispatcher.cpp in Sources */,
2745127607 4A5A2ADB161E7E00005889DD /* WebSocketExtensionParser.cpp in Sources */,
157016

Source/WebCore/bindings/js/JSMediaSourceStatesCustom.cpp

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27
 28#if ENABLE(MEDIA_STREAM)
 29
 30#include "JSMediaSourceStates.h"
 31
 32#include "MediaSourceStates.h"
 33
 34using namespace JSC;
 35
 36namespace WebCore {
 37
 38JSValue JSMediaSourceStates::width(ExecState*) const
 39{
 40 if (!impl()->hasVideoSource())
 41 return jsUndefined();
 42
 43 return jsNumber(impl()->width());
 44}
 45
 46JSValue JSMediaSourceStates::height(ExecState*) const
 47{
 48 if (!impl()->hasVideoSource())
 49 return jsUndefined();
 50
 51 return jsNumber(impl()->height());
 52}
 53
 54JSValue JSMediaSourceStates::frameRate(ExecState*) const
 55{
 56 if (!impl()->hasVideoSource())
 57 return jsUndefined();
 58
 59 return jsNumber(impl()->frameRate());
 60}
 61
 62JSValue JSMediaSourceStates::aspectRatio(ExecState*) const
 63{
 64 if (!impl()->hasVideoSource())
 65 return jsUndefined();
 66
 67 return jsNumber(impl()->aspectRatio());
 68}
 69
 70JSValue JSMediaSourceStates::facingMode(ExecState* exec) const
 71{
 72 if (!impl()->hasVideoSource())
 73 return jsUndefined();
 74
 75 return jsStringWithCache(exec, impl()->facingMode());
 76}
 77
 78JSValue JSMediaSourceStates::volume(ExecState*) const
 79{
 80 if (impl()->hasVideoSource())
 81 return jsUndefined();
 82
 83 return jsNumber(impl()->volume());
 84}
 85
 86} // namespace WebCore
 87
 88#endif
0

Source/WebCore/bindings/js/JSMediaStreamCapabilitiesCustom.cpp

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27
 28#if ENABLE(MEDIA_STREAM)
 29
 30#include "JSMediaStreamCapabilities.h"
 31
 32#include "JSAllAudioCapabilities.h"
 33#include "JSAllVideoCapabilities.h"
 34#include "MediaStreamCapabilities.h"
 35
 36using namespace JSC;
 37
 38namespace WebCore {
 39
 40JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, MediaStreamCapabilities* object)
 41{
 42 if (!object)
 43 return jsNull();
 44
 45 if (object->hasVideoSource())
 46 return wrap<JSAllVideoCapabilities>(exec, globalObject, static_cast<AllVideoCapabilities*>(object));
 47
 48 return wrap<JSAllAudioCapabilities>(exec, globalObject, static_cast<AllAudioCapabilities*>(object));
 49}
 50
 51} // namespace WebCore
 52
 53#endif // ENABLE(MEDIA_STREAM)
0

Source/WebCore/dom/EventNames.h

@@namespace WebCore {
238238 macro(removestream) \
239239 macro(signalingstatechange) \
240240 macro(removetrack) \
 241 macro(overconstrained) \
241242 macro(mute) \
242243 macro(unmute) \
243244 macro(started) \
157016

Source/WebCore/platform/mediastream/MediaStreamCenter.cpp

@@MediaStreamCenter::~MediaStreamCenter()
6767{
6868}
6969
70 void MediaStreamCenter::endLocalMediaStream(MediaStreamDescriptor* streamDescriptor)
71 {
72  streamDescriptor->setEnded();
73 }
74 
7570} // namespace WebCore
7671
7772#endif // ENABLE(MEDIA_STREAM)
157016

Source/WebCore/platform/mediastream/MediaStreamCenter.h

3434
3535#if ENABLE(MEDIA_STREAM)
3636
 37#include "MediaStreamSource.h"
3738#include <wtf/PassRefPtr.h>
3839#include <wtf/text/WTFString.h>
3940

@@class MediaConstraints;
4344class MediaStreamCreationClient;
4445class MediaStreamCreationClient;
4546class MediaStreamDescriptor;
46 class MediaStreamSource;
 47class MediaStreamSourceCapabilities;
4748class MediaStreamTrackSourcesRequestClient;
4849
 50struct MediaStreamSourceStates;
 51
4952class MediaStreamCenter {
5053public:
5154 virtual ~MediaStreamCenter();

@@public:
5962
6063 virtual bool getMediaStreamTrackSources(PassRefPtr<MediaStreamTrackSourcesRequestClient>) = 0;
6164
62  virtual void didSetMediaStreamTrackEnabled(MediaStreamSource*) = 0;
63 
64  virtual bool didAddMediaStreamTrack(MediaStreamSource*) = 0;
65  virtual bool didRemoveMediaStreamTrack(MediaStreamSource*) = 0;
66 
67  virtual void didStopLocalMediaStream(MediaStreamDescriptor*) = 0;
68  virtual void didCreateMediaStream(MediaStreamDescriptor*) = 0;
69 
7065protected:
7166 MediaStreamCenter();
7267
157016

Source/WebCore/platform/mediastream/MediaStreamDescriptor.cpp

3535
3636#include "MediaStreamDescriptor.h"
3737
 38#include "MediaStreamCenter.h"
3839#include "MediaStreamSource.h"
3940#include "UUID.h"
4041#include <wtf/RefCounted.h>

@@PassRefPtr<MediaStreamDescriptor> MediaS
4748 return adoptRef(new MediaStreamDescriptor(createCanonicalUUIDString(), audioSources, videoSources));
4849}
4950
 51MediaStreamDescriptor::~MediaStreamDescriptor()
 52{
 53 for (size_t i = 0; i < m_audioStreamSources.size(); i++)
 54 m_audioStreamSources[i]->setStream(0);
 55
 56 for (size_t i = 0; i < m_videoStreamSources.size(); i++)
 57 m_videoStreamSources[i]->setStream(0);
 58}
 59
5060void MediaStreamDescriptor::addSource(PassRefPtr<MediaStreamSource> source)
5161{
5262 switch (source->type()) {

@@void MediaStreamDescriptor::removeSource
6777 switch (source->type()) {
6878 case MediaStreamSource::Audio:
6979 pos = m_audioStreamSources.find(source);
70  if (pos != notFound)
71  m_audioStreamSources.remove(pos);
 80 if (pos == notFound)
 81 return;
 82 m_audioStreamSources.remove(pos);
7283 break;
7384 case MediaStreamSource::Video:
7485 pos = m_videoStreamSources.find(source);
75  if (pos != notFound)
76  m_videoStreamSources.remove(pos);
 86 if (pos == notFound)
 87 return;
 88 m_videoStreamSources.remove(pos);
7789 break;
7890 }
 91
 92 source->setStream(0);
7993}
8094
8195void MediaStreamDescriptor::addRemoteSource(MediaStreamSource* source)
157016

Source/WebCore/platform/mediastream/MediaStreamDescriptor.h

@@public:
5252
5353class MediaStreamDescriptor : public RefCounted<MediaStreamDescriptor> {
5454public:
55 
5655 static PassRefPtr<MediaStreamDescriptor> create(const MediaStreamSourceVector& audioSources, const MediaStreamSourceVector& videoSources);
5756
 57 virtual ~MediaStreamDescriptor();
 58
5859 MediaStreamDescriptorClient* client() const { return m_client; }
5960 void setClient(MediaStreamDescriptorClient* client) { m_client = client; }
6061
157016

Source/WebCore/platform/mediastream/MediaStreamSource.cpp

11/*
22 * Copyright (C) 2012 Google Inc. All rights reserved.
 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
34 *
45 * Redistribution and use in source and binary forms, with or without
56 * modification, are permitted provided that the following conditions

3435
3536#include "MediaStreamSource.h"
3637
37 #include "AudioDestinationConsumer.h"
 38#include "MediaStreamCenter.h"
 39#include "MediaStreamSourceCapabilities.h"
 40#include "UUID.h"
 41
3842#include <wtf/PassOwnPtr.h>
3943
4044namespace WebCore {
4145
42 PassRefPtr<MediaStreamSource> MediaStreamSource::create(const String& id, Type type, const String& name, ReadyState readyState, bool requiresConsumer)
43 {
44  return adoptRef(new MediaStreamSource(id, type, name, readyState, requiresConsumer));
45 }
46 
47 MediaStreamSource::MediaStreamSource(const String& id, Type type, const String& name, ReadyState readyState, bool requiresConsumer)
 46MediaStreamSource::MediaStreamSource(const String& id, Type type, const String& name)
4847 : m_id(id)
4948 , m_type(type)
5049 , m_name(name)
51  , m_readyState(readyState)
 50 , m_readyState(New)
5251 , m_stream(0)
53  , m_requiresConsumer(requiresConsumer)
5452 , m_enabled(true)
5553 , m_muted(false)
 54 , m_readonly(false)
 55 , m_remote(false)
5656{
 57 if (!m_id.isEmpty())
 58 return;
 59
 60 m_id = createCanonicalUUIDString();
 61}
 62
 63void MediaStreamSource::reset()
 64{
 65 m_readyState = New;
 66 m_stream = 0;
 67 m_enabled = true;
 68 m_muted = false;
 69 m_readonly = false;
 70 m_remote = false;
5771}
5872
5973void MediaStreamSource::setReadyState(ReadyState readyState)

@@void MediaStreamSource::setReadyState(Re
6377
6478 m_readyState = readyState;
6579 for (Vector<Observer*>::iterator i = m_observers.begin(); i != m_observers.end(); ++i)
66  (*i)->sourceChangedState();
 80 (*i)->sourceStateChanged();
6781}
6882
6983void MediaStreamSource::addObserver(MediaStreamSource::Observer* observer)

@@void MediaStreamSource::removeObserver(M
8094
8195void MediaStreamSource::setStream(MediaStreamDescriptor* stream)
8296{
83  ASSERT(!m_stream && stream);
 97 // FIXME: A source should not need to know about its stream(s). This will be fixed as a part of
 98 // https://bugs.webkit.org/show_bug.cgi?id=121954
8499 m_stream = stream;
85100}
86101
 102MediaConstraints* MediaStreamSource::constraints() const
 103{
 104 // FIXME: While this returns
 105 // https://bugs.webkit.org/show_bug.cgi?id=122428
 106 return m_constraints.get();
 107}
 108
 109void MediaStreamSource::setConstraints(PassRefPtr<MediaConstraints> constraints)
 110{
 111 m_constraints = constraints;
 112}
 113
87114void MediaStreamSource::setMuted(bool muted)
88115{
89116 if (m_muted == muted)
90117 return;
91118
92119 m_muted = muted;
 120
 121 if (m_readyState == Ended)
 122 return;
 123
93124 for (Vector<Observer*>::iterator i = m_observers.begin(); i != m_observers.end(); ++i)
94  (*i)->sourceChangedState();
 125 (*i)->sourceMutedChanged();
95126}
96127
97 void MediaStreamSource::addAudioConsumer(PassRefPtr<AudioDestinationConsumer> consumer)
 128void MediaStreamSource::setEnabled(bool enabled)
98129{
99  ASSERT(m_requiresConsumer);
100  MutexLocker locker(m_audioConsumersLock);
101  m_audioConsumers.append(consumer);
102 }
 130 if (m_enabled == enabled)
 131 return;
 132
 133 m_enabled = enabled;
103134
104 bool MediaStreamSource::removeAudioConsumer(AudioDestinationConsumer* consumer)
105 {
106  ASSERT(m_requiresConsumer);
107  MutexLocker locker(m_audioConsumersLock);
108  size_t pos = m_audioConsumers.find(consumer);
109  if (pos != notFound) {
110  m_audioConsumers.remove(pos);
111  return true;
112  }
113  return false;
 135 if (m_readyState == Ended)
 136 return;
 137
 138 for (Vector<Observer*>::iterator i = m_observers.begin(); i != m_observers.end(); ++i)
 139 (*i)->sourceEnabledChanged();
114140}
115141
116 void MediaStreamSource::setAudioFormat(size_t numberOfChannels, float sampleRate)
 142bool MediaStreamSource::readonly() const
117143{
118  ASSERT(m_requiresConsumer);
119  MutexLocker locker(m_audioConsumersLock);
120  for (Vector<RefPtr<AudioDestinationConsumer> >::iterator it = m_audioConsumers.begin(); it != m_audioConsumers.end(); ++it)
121  (*it)->setFormat(numberOfChannels, sampleRate);
 144 // http://www.w3.org/TR/mediacapture-streams/#widl-MediaStreamTrack-_readonly
 145 // If the track (audio or video) is backed by a read-only source such as a file, or the track source
 146 // is a local microphone or camera, but is shared so that this track cannot modify any of the source's
 147 // settings, the readonly attribute must return the value true. Otherwise, it must return the value false.
 148 return m_readonly;
122149}
123150
124 void MediaStreamSource::consumeAudio(AudioBus* bus, size_t numberOfFrames)
 151void MediaStreamSource::stop()
125152{
126  ASSERT(m_requiresConsumer);
127  MutexLocker locker(m_audioConsumersLock);
128  for (Vector<RefPtr<AudioDestinationConsumer> >::iterator it = m_audioConsumers.begin(); it != m_audioConsumers.end(); ++it)
129  (*it)->consumeAudio(bus, numberOfFrames);
 153 for (Vector<Observer*>::iterator i = m_observers.begin(); i != m_observers.end(); ++i) {
 154 if (!(*i)->stopped())
 155 return;
 156 }
 157
 158 // There are no more consumers of this source's data, shut it down as appropriate.
 159 setReadyState(Ended);
 160
 161 // http://www.w3.org/TR/mediacapture-streams/#widl-MediaStreamTrack-stop-void
 162 // If the data is being generated from a live source (e.g., a microphone or camera), then the user
 163 // agent should remove any active "on-air" indicator for that source. If the data is being
 164 // generated from a prerecorded source (e.g. a video file), any remaining content in the file is ignored.
130165}
131166
132167} // namespace WebCore
157016

Source/WebCore/platform/mediastream/MediaStreamSource.h

11/*
22 * Copyright (C) 2011 Ericsson AB. All rights reserved.
33 * Copyright (C) 2012 Google Inc. All rights reserved.
 4 * Copyright (C) 2013 Apple Inc. All rights reserved.
45 *
56 * Redistribution and use in source and binary forms, with or without
67 * modification, are permitted provided that the following conditions

3637
3738#include "AudioDestinationConsumer.h"
3839#include "MediaConstraints.h"
 40#include "MediaStreamSourceCapabilities.h"
3941#include <wtf/RefCounted.h>
4042#include <wtf/Vector.h>
4143#include <wtf/text/WTFString.h>

4345namespace WebCore {
4446
4547class AudioBus;
 48class MediaConstraints;
4649class MediaStreamDescriptor;
 50struct MediaStreamSourceStates;
4751
4852class MediaStreamSource : public RefCounted<MediaStreamSource> {
4953public:
5054 class Observer {
5155 public:
5256 virtual ~Observer() { }
53  virtual void sourceChangedState() = 0;
 57 virtual void sourceStateChanged() = 0;
 58 virtual void sourceMutedChanged() = 0;
 59 virtual void sourceEnabledChanged() = 0;
 60 virtual bool stopped() = 0;
5461 };
5562
5663 enum Type { Audio, Video };
5764 enum ReadyState { New = 0, Live = 1, Ended = 2 };
5865
59  static PassRefPtr<MediaStreamSource> create(const String& id, Type, const String& name, ReadyState = New, bool requiresConsumer = false);
 66 virtual ~MediaStreamSource() { }
6067
61  const String& id() const { return m_id; }
 68 virtual bool isAudioStreamSource() const { return false; }
 69 virtual bool useIDForTrackID() const { return false; }
 70
 71 void reset();
6272
 73 const String& id() const { return m_id; }
6374 Type type() const { return m_type; }
6475 const String& name() const { return m_name; }
6576
 77 virtual PassRefPtr<MediaStreamSourceCapabilities> capabilities() const = 0;
 78 virtual const MediaStreamSourceStates& states() = 0;
 79
6680 void setReadyState(ReadyState);
6781 ReadyState readyState() const { return m_readyState; }
6882
6983 void addObserver(Observer*);
7084 void removeObserver(Observer*);
7185
72  void setConstraints(PassRefPtr<MediaConstraints> constraints) { m_constraints = constraints; }
73  MediaConstraints* constraints() const { return m_constraints.get(); }
74 
75  const String& deviceId() const { return m_deviceId; }
76  void setDeviceId(const String& deviceId) { m_deviceId = deviceId; }
 86 void setConstraints(PassRefPtr<MediaConstraints>);
 87 MediaConstraints* constraints() const;
7788
7889 bool enabled() const { return m_enabled; }
79  void setEnabled(bool enabled) { m_enabled = enabled; }
 90 void setEnabled(bool);
8091
8192 bool muted() const { return m_muted; }
8293 void setMuted(bool);
83 
84  void setAudioFormat(size_t numberOfChannels, float sampleRate);
85  void consumeAudio(AudioBus*, size_t numberOfFrames);
 94
 95 bool readonly() const;
 96 void setReadonly(bool readonly) { m_readonly = readonly; }
 97
 98 bool remote() const { return m_remote; }
 99 void setRemote(bool remote) { m_remote = remote; }
 100
 101 void stop();
86102
87103 MediaStreamDescriptor* stream() const { return m_stream; }
88104 void setStream(MediaStreamDescriptor*);
89 
90  bool requiresAudioConsumer() const { return m_requiresConsumer; }
91  void addAudioConsumer(PassRefPtr<AudioDestinationConsumer>);
92  bool removeAudioConsumer(AudioDestinationConsumer*);
93  const Vector<RefPtr<AudioDestinationConsumer> >& audioConsumers() const { return m_audioConsumers; }
 105
 106protected:
 107 MediaStreamSource(const String& id, Type, const String& name);
94108
95109private:
96  MediaStreamSource(const String& id, Type, const String& name, ReadyState, bool requiresConsumer);
97 
98110 String m_id;
99111 Type m_type;
100112 String m_name;
101113 ReadyState m_readyState;
102  String m_deviceId;
103114 Vector<Observer*> m_observers;
104  Mutex m_audioConsumersLock;
105  Vector<RefPtr<AudioDestinationConsumer>> m_audioConsumers;
106115 RefPtr<MediaConstraints> m_constraints;
107116 MediaStreamDescriptor* m_stream;
 117 MediaStreamSourceStates m_states;
108118
109  bool m_requiresConsumer;
110119 bool m_enabled;
111120 bool m_muted;
 121 bool m_readonly;
 122 bool m_remote;
112123};
113124
114125typedef Vector<RefPtr<MediaStreamSource> > MediaStreamSourceVector;
157016

Source/WebCore/platform/mediastream/MediaStreamSourceCapabilities.h

 1/*
 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef MediaStreamSourceCapabilities_h
 27#define MediaStreamSourceCapabilities_h
 28
 29#if ENABLE(MEDIA_STREAM)
 30
 31#include <wtf/RefCounted.h>
 32#include <wtf/Vector.h>
 33#include <wtf/text/AtomicString.h>
 34
 35namespace WebCore {
 36
 37struct MediaStreamSourceStates {
 38public:
 39 enum SourceType { None, Camera, Microphone };
 40 enum VideoFacingMode { User, Environment, Left, Right };
 41
 42 MediaStreamSourceStates()
 43 : sourceType(None)
 44 , facingMode(User)
 45 , width(0)
 46 , height(0)
 47 , frameRate(0)
 48 , aspectRatio(0)
 49 , volume(0)
 50 {
 51 }
 52
 53 SourceType sourceType;
 54 AtomicString sourceId;
 55 VideoFacingMode facingMode;
 56 unsigned long width;
 57 unsigned long height;
 58 float frameRate;
 59 float aspectRatio;
 60 unsigned long volume;
 61
 62 bool hasVideoSource;
 63};
 64
 65class MediaStreamSourceCapabilityRange {
 66public:
 67
 68 MediaStreamSourceCapabilityRange(float min, float max, bool supported = true)
 69 : m_type(Float)
 70 {
 71 m_min.asFloat = min;
 72 m_max.asFloat = max;
 73 m_supported = supported;
 74 }
 75
 76 MediaStreamSourceCapabilityRange(unsigned long min, unsigned long max, bool supported = true)
 77 : m_type(ULong)
 78 {
 79 m_min.asULong = min;
 80 m_max.asULong = max;
 81 m_supported = supported;
 82 }
 83
 84 MediaStreamSourceCapabilityRange()
 85 {
 86 m_type = Undefined;
 87 m_min.asULong = 0;
 88 m_max.asULong = 0;
 89 m_supported = false;
 90 }
 91
 92 enum Type { Undefined, Float, ULong };
 93
 94 union ValueUnion {
 95 unsigned long asULong;
 96 float asFloat;
 97 };
 98
 99 const ValueUnion& min() const { return m_min; }
 100 const ValueUnion& max() const { return m_max; }
 101 Type type() const { return m_type; }
 102 bool supported() const { return m_supported; }
 103
 104private:
 105 ValueUnion m_min;
 106 ValueUnion m_max;
 107 Type m_type;
 108 bool m_supported;
 109};
 110
 111class MediaStreamSourceCapabilities : public RefCounted<MediaStreamSourceCapabilities> {
 112public:
 113 static PassRefPtr<MediaStreamSourceCapabilities> create()
 114 {
 115 return adoptRef(new MediaStreamSourceCapabilities());
 116 }
 117
 118 ~MediaStreamSourceCapabilities() { }
 119
 120 const Vector<MediaStreamSourceStates::SourceType>& sourceTypes() { return m_sourceType; }
 121 void addSourceType(MediaStreamSourceStates::SourceType sourceType)
 122 {
 123 if (sourceType == MediaStreamSourceStates::Camera)
 124 m_videoSource = true;
 125 m_sourceType.append(sourceType);
 126 }
 127
 128 const Vector<AtomicString>& sourceId() { return m_sourceId; }
 129 void setSourceId(const AtomicString& id) { m_sourceId.reserveCapacity(1); m_sourceId.insert(0, id); }
 130
 131 const Vector<MediaStreamSourceStates::VideoFacingMode>& facingModes() { return m_facingMode; }
 132 void addFacingMode(MediaStreamSourceStates::VideoFacingMode mode) { m_facingMode.append(mode); }
 133
 134 const MediaStreamSourceCapabilityRange& width() { return m_width; }
 135 void setWidthRange(const MediaStreamSourceCapabilityRange& width) { m_width = width; }
 136
 137 const MediaStreamSourceCapabilityRange& height() { return m_height; }
 138 void setHeightRange(const MediaStreamSourceCapabilityRange& height) { m_height = height; }
 139
 140 const MediaStreamSourceCapabilityRange& frameRate() { return m_frameRate; }
 141 void setFrameRateRange(const MediaStreamSourceCapabilityRange& frameRate) { m_frameRate = frameRate; }
 142
 143 const MediaStreamSourceCapabilityRange& aspectRatio() { return m_aspectRatio; }
 144 void setAspectRatioRange(const MediaStreamSourceCapabilityRange& aspectRatio) { m_aspectRatio = aspectRatio; }
 145
 146 const MediaStreamSourceCapabilityRange& volume() { return m_volume; }
 147 void setVolumeRange(const MediaStreamSourceCapabilityRange& volume) { m_volume = volume; }
 148
 149 bool hasVideoSource() { return m_videoSource; }
 150 void setHasVideoSource(bool isVideo) { m_videoSource = isVideo;; }
 151
 152private:
 153 MediaStreamSourceCapabilities()
 154 : m_videoSource(false)
 155 {
 156 }
 157
 158 Vector<AtomicString> m_sourceId;
 159 Vector<MediaStreamSourceStates::SourceType> m_sourceType;
 160 Vector<MediaStreamSourceStates::VideoFacingMode> m_facingMode;
 161
 162 MediaStreamSourceCapabilityRange m_width;
 163 MediaStreamSourceCapabilityRange m_height;
 164 MediaStreamSourceCapabilityRange m_frameRate;
 165 MediaStreamSourceCapabilityRange m_aspectRatio;
 166 MediaStreamSourceCapabilityRange m_volume;
 167
 168 bool m_videoSource;
 169};
 170
 171} // namespace WebCore
 172
 173#endif // MediaStreamSourceCapabilities_h
 174
 175#endif
0

Source/WebCore/platform/mediastream/blackberry/MediaStreamCenterBlackBerry.cpp

3535
3636#include "MediaStreamCenterBlackBerry.h"
3737
 38#include "MediaStreamCreationClient.h"
3839#include "MediaStreamDescriptor.h"
39 #include "MediaStreamSourcesQueryClient.h"
 40#include "MediaStreamTrackSourcesRequestClient.h"
 41#include "NotImplemented.h"
4042#include <wtf/MainThread.h>
4143
4244namespace WebCore {

@@bool MediaStreamCenterBlackBerry::getMed
7274 return false;
7375}
7476
75 void MediaStreamCenterBlackBerry::didSetMediaStreamTrackEnabled(MediaStreamSource*)
76 {
77  notImplemented();
78 }
79 
80 bool MediaStreamCenterBlackBerry::didAddMediaStreamTrack(MediaStreamSource*)
81 {
82  notImplemented();
83  return false;
84 }
85 
86 bool MediaStreamCenterBlackBerry::didRemoveMediaStreamTrack(MediaStreamSource*)
87 {
88  notImplemented();
89  return false;
90 }
91 
92 void MediaStreamCenterBlackBerry::didStopLocalMediaStream(MediaStreamDescriptor* stream)
93 {
94  endLocalMediaStream(stream);
95 }
96 
97 void MediaStreamCenterBlackBerry::didCreateMediaStream(MediaStreamDescriptor*)
98 {
99  notImplemented();
100 }
101 
10277} // namespace WebCore
10378
10479#endif // ENABLE(MEDIA_STREAM)
157016

Source/WebCore/platform/mediastream/blackberry/MediaStreamCenterBlackBerry.h

@@public:
5050 MediaStreamCenterBlackBerry();
5151 ~MediaStreamCenterBlackBerry();
5252
53  // MediaStreamCenter
5453 virtual void validateRequestConstraints(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints);
5554 virtual void createMediaStream(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints);
5655 virtual bool getMediaStreamTrackSources(PassRefPtr<MediaStreamTrackSourcesRequestClient>) OVERRIDE;
57  virtual void didSetMediaStreamTrackEnabled(MediaStreamSource*) OVERRIDE;
58  virtual bool didAddMediaStreamTrack(MediaStreamSource*) OVERRIDE;
59  virtual bool didRemoveMediaStreamTrack(MediaStreamSource*) OVERRIDE;
60  virtual void didStopLocalMediaStream(MediaStreamDescriptor*) OVERRIDE;
61  virtual void didCreateMediaStream(MediaStreamDescriptor*) OVERRIDE;
6256};
6357
6458} // namespace WebCore
157016

Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp

3535
3636#include "MediaStreamCenterGStreamer.h"
3737
 38#include "MediaStreamCreationClient.h"
3839#include "MediaStreamDescriptor.h"
 40#include "MediaStreamSourceCapabilities.h"
 41#include "MediaStreamSourceStates.h"
 42#include "MediaStreamTrackSourcesRequestClient.h"
3943#include "NotImplemented.h"
4044#include <wtf/MainThread.h>
4145

@@bool MediaStreamCenterGStreamer::getMedi
7276 return false;
7377}
7478
75 void MediaStreamCenterGStreamer::didSetMediaStreamTrackEnabled(MediaStreamSource*)
76 {
77  notImplemented();
78 }
79 
80 bool MediaStreamCenterGStreamer::didAddMediaStreamTrack(MediaStreamSource*)
81 {
82  notImplemented();
83  return false;
84 }
85 
86 bool MediaStreamCenterGStreamer::didRemoveMediaStreamTrack(MediaStreamSource*)
87 {
88  notImplemented();
89  return false;
90 }
91 
92 void MediaStreamCenterGStreamer::didStopLocalMediaStream(MediaStreamDescriptor* stream)
93 {
94  endLocalMediaStream(stream);
95 }
96 
97 void MediaStreamCenterGStreamer::didCreateMediaStream(MediaStreamDescriptor*)
98 {
99  notImplemented();
100 }
101 
10279} // namespace WebCore
10380
10481#endif // ENABLE(MEDIA_STREAM)
157016

Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h

@@public:
5050 MediaStreamCenterGStreamer();
5151 ~MediaStreamCenterGStreamer();
5252
53  // MediaStreamCenter
5453 virtual void validateRequestConstraints(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints);
5554 virtual void createMediaStream(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints);
5655 virtual bool getMediaStreamTrackSources(PassRefPtr<MediaStreamTrackSourcesRequestClient>) OVERRIDE;
57  virtual void didSetMediaStreamTrackEnabled(MediaStreamSource*) OVERRIDE;
58  virtual bool didAddMediaStreamTrack(MediaStreamSource*) OVERRIDE;
59  virtual bool didRemoveMediaStreamTrack(MediaStreamSource*) OVERRIDE;
60  virtual void didStopLocalMediaStream(MediaStreamDescriptor*) OVERRIDE;
61  virtual void didCreateMediaStream(MediaStreamDescriptor*) OVERRIDE;
6256};
6357
6458} // namespace WebCore
157016

Source/WebCore/platform/mediastream/mac/MediaStreamCenterMac.cpp

@@bool MediaStreamCenterMac::getMediaStrea
7373 return false;
7474}
7575
76 void MediaStreamCenterMac::didSetMediaStreamTrackEnabled(MediaStreamSource*)
77 {
78  notImplemented();
79 }
80 
81 bool MediaStreamCenterMac::didAddMediaStreamTrack(MediaStreamSource*)
82 {
83  notImplemented();
84  return false;
85 }
86 
87 bool MediaStreamCenterMac::didRemoveMediaStreamTrack(MediaStreamSource*)
88 {
89  notImplemented();
90  return false;
91 }
92 
93 void MediaStreamCenterMac::didStopLocalMediaStream(MediaStreamDescriptor* stream)
94 {
95  endLocalMediaStream(stream);
96 }
97 
98 void MediaStreamCenterMac::didCreateMediaStream(MediaStreamDescriptor*)
99 {
100  notImplemented();
101 }
102 
10376} // namespace WebCore
10477
10578#endif // ENABLE(MEDIA_STREAM)
157016

Source/WebCore/platform/mediastream/mac/MediaStreamCenterMac.h

3535
3636#include "MediaStreamCenter.h"
3737
 38#include "MediaStreamSource.h"
3839#include <wtf/PassRefPtr.h>
3940#include <wtf/text/WTFString.h>
4041
4142namespace WebCore {
4243
43 class MediaStreamDescriptor;
44 class MediaStreamSource;
45 class MediaStreamSourcesQueryClient;
46 
4744class MediaStreamCenterMac FINAL : public MediaStreamCenter {
4845public:
4946 MediaStreamCenterMac();
5047 ~MediaStreamCenterMac();
5148
52  // MediaStreamCenter
5349 virtual void validateRequestConstraints(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints);
5450 virtual void createMediaStream(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints);
5551 virtual bool getMediaStreamTrackSources(PassRefPtr<MediaStreamTrackSourcesRequestClient>) OVERRIDE;
56  virtual void didSetMediaStreamTrackEnabled(MediaStreamSource*) OVERRIDE;
57  virtual bool didAddMediaStreamTrack(MediaStreamSource*) OVERRIDE;
58  virtual bool didRemoveMediaStreamTrack(MediaStreamSource*) OVERRIDE;
59  virtual void didStopLocalMediaStream(MediaStreamDescriptor*) OVERRIDE;
60  virtual void didCreateMediaStream(MediaStreamDescriptor*) OVERRIDE;
6152};
6253
6354} // namespace WebCore
157016

Source/WebCore/platform/mock/MockMediaStreamCenter.cpp

3232#include "MediaStream.h"
3333#include "MediaStreamCreationClient.h"
3434#include "MediaStreamDescriptor.h"
 35#include "MediaStreamSource.h"
 36#include "MediaStreamSourceCapabilities.h"
3537#include "MediaStreamTrack.h"
3638#include "MediaStreamTrackSourcesRequestClient.h"
37 #include "NotImplemented.h"
 39#include <wtf/NeverDestroyed.h>
3840
3941namespace WebCore {
4042
 43class MockSource : public MediaStreamSource {
 44public:
 45 MockSource(const AtomicString& id, const AtomicString& name, MediaStreamSource::Type type)
 46 : MediaStreamSource(id, type, name)
 47 {
 48 }
 49
 50 virtual ~MockSource() { }
 51
 52 virtual PassRefPtr<MediaStreamSourceCapabilities> capabilities() const { return m_capabilities; }
 53 virtual const MediaStreamSourceStates& states() { return m_currentStates; }
 54
 55 RefPtr<MediaStreamSourceCapabilities> m_capabilities;
 56 MediaStreamSourceStates m_currentStates;
 57};
 58
 59typedef HashMap<String, RefPtr<MockSource>> MockSourceMap;
 60
 61static MockSourceMap& mockSourceMap()
 62{
 63 DEFINE_STATIC_LOCAL(MockSourceMap, mockSourceMap, ());
 64 return mockSourceMap;
 65}
 66
 67static const AtomicString& mockAudioSourceID()
 68{
 69 static NeverDestroyed<AtomicString> id("239c24b1-2b15-11e3-8224-0800200c9a66", AtomicString::ConstructFromLiteral);
 70 return id;
 71}
 72
 73static const AtomicString& mockVideoSourceID()
 74{
 75 static NeverDestroyed<AtomicString> id("239c24b0-2b15-11e3-8224-0800200c9a66", AtomicString::ConstructFromLiteral);
 76 return id;
 77}
 78
 79static void initializeMockSources()
 80{
 81 RefPtr<MockSource> mockSource1 = adoptRef(new MockSource(mockVideoSourceID(), "Mock video device", MediaStreamSource::Video));
 82 mockSource1->m_capabilities = MediaStreamSourceCapabilities::create();
 83 mockSource1->m_capabilities->setSourceId(mockSource1->id());
 84 mockSource1->m_capabilities->addSourceType(MediaStreamSourceStates::Camera);
 85 mockSource1->m_capabilities->addSourceType(MediaStreamSourceStates::Microphone);
 86 mockSource1->m_capabilities->addFacingMode(MediaStreamSourceStates::User);
 87 mockSource1->m_capabilities->addFacingMode(MediaStreamSourceStates::Environment);
 88 mockSource1->m_capabilities->setWidthRange(MediaStreamSourceCapabilityRange(320UL, 1920UL, true));
 89 mockSource1->m_capabilities->setHeightRange(MediaStreamSourceCapabilityRange(240UL, 1080UL, true));
 90 mockSource1->m_capabilities->setFrameRateRange(MediaStreamSourceCapabilityRange(15.0f, 60.0f, true));
 91 mockSource1->m_capabilities->setAspectRatioRange(MediaStreamSourceCapabilityRange(4 / 3.0f, 16 / 9.0f, true));
 92 mockSource1->m_capabilities->setVolumeRange(MediaStreamSourceCapabilityRange(10UL, 90UL, true));
 93
 94 mockSource1->m_currentStates.sourceType = MediaStreamSourceStates::Camera;
 95 mockSource1->m_currentStates.sourceId = mockSource1->id();
 96 mockSource1->m_currentStates.facingMode = MediaStreamSourceStates::User;
 97 mockSource1->m_currentStates.width = 1920;
 98 mockSource1->m_currentStates.height = 1080;
 99 mockSource1->m_currentStates.frameRate = 30;
 100 mockSource1->m_currentStates.aspectRatio = 16 / 9.0f;
 101 mockSource1->m_currentStates.volume = 70;
 102 mockSourceMap().add(mockSource1->id(), mockSource1.release());
 103
 104 RefPtr<MockSource> mockSource2 = adoptRef(new MockSource(mockAudioSourceID(), "Mock audio device", MediaStreamSource::Audio));
 105 mockSource2->m_capabilities = MediaStreamSourceCapabilities::create();
 106 mockSource2->m_capabilities->setSourceId(mockSource2->id());
 107 mockSource2->m_capabilities->setVolumeRange(MediaStreamSourceCapabilityRange(0UL, 100UL, true));
 108
 109 mockSource2->m_currentStates.sourceType = MediaStreamSourceStates::Microphone;
 110 mockSource2->m_currentStates.sourceId = mockSource2->id();
 111 mockSource2->m_currentStates.volume = 50;
 112 mockSourceMap().add(mockSource2->id(), mockSource2.release());
 113}
 114
 115void MockMediaStreamCenter::registerMockMediaStreamCenter()
 116{
 117 DEFINE_STATIC_LOCAL(MockMediaStreamCenter, center, ());
 118 static bool registered = false;
 119 if (!registered) {
 120 registered = true;
 121 MediaStreamCenter::setSharedStreamCenter(&center);
 122 initializeMockSources();
 123 }
 124}
 125
41126static bool isSupportedMockConstraint(const String& constraintName)
42127{
43128 return notFound != constraintName.find("_and_supported_");

@@static String verifyConstraints(MediaCon
75160 return emptyString();
76161}
77162
78 void MockMediaStreamCenter::registerMockMediaStreamCenter()
79 {
80  DEFINE_STATIC_LOCAL(MockMediaStreamCenter, center, ());
81  static bool registered = false;
82  if (!registered) {
83  registered = true;
84  MediaStreamCenter::setSharedStreamCenter(&center);
85  }
86 }
87 
88163void MockMediaStreamCenter::validateRequestConstraints(PassRefPtr<MediaStreamCreationClient> prpQueryClient, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints)
89164{
90165 RefPtr<MediaStreamCreationClient> client = prpQueryClient;

@@void MockMediaStreamCenter::createMediaS
118193
119194 Vector<RefPtr<MediaStreamSource>> audioSources;
120195 Vector<RefPtr<MediaStreamSource>> videoSources;
 196 MockSourceMap& map = mockSourceMap();
121197
122198 if (audioConstraints) {
123199 String invalidQuery = verifyConstraints(audioConstraints.get());

@@void MockMediaStreamCenter::createMediaS
127203 }
128204
129205 if (audioConstraints) {
130  RefPtr<MediaStreamSource> audioSource = MediaStreamSource::create(emptyString(), MediaStreamSource::Audio, "Mock audio device");
 206 MockSourceMap::iterator it = map.find(mockAudioSourceID());
 207 ASSERT(it != map.end());
 208
 209 RefPtr<MediaStreamSource> audioSource = it->value;
 210 audioSource->reset();
131211 audioSource->setReadyState(MediaStreamSource::Live);
132212 audioSources.append(audioSource.release());
133213 }

@@void MockMediaStreamCenter::createMediaS
141221 }
142222
143223 if (videoConstraints) {
144  RefPtr<MediaStreamSource> videoSource = MediaStreamSource::create(emptyString(), MediaStreamSource::Video, "Mock video device");
 224 MockSourceMap::iterator it = map.find(mockVideoSourceID());
 225 ASSERT(it != map.end());
 226
 227 RefPtr<MediaStreamSource> videoSource = it->value;
 228 videoSource->reset();
145229 videoSource->setReadyState(MediaStreamSource::Live);
146230 videoSources.append(videoSource.release());
147231 }

@@void MockMediaStreamCenter::createMediaS
153237bool MockMediaStreamCenter::getMediaStreamTrackSources(PassRefPtr<MediaStreamTrackSourcesRequestClient> prpClient)
154238{
155239 RefPtr<MediaStreamTrackSourcesRequestClient> requestClient = prpClient;
156  Vector<RefPtr<TrackSourceInfo>> sources(2);
 240 Vector<RefPtr<TrackSourceInfo>> sources;
157241
158  sources[0] = TrackSourceInfo::create("Mock_audio_device_ID", TrackSourceInfo::Audio, "Mock audio device");
159  sources[1] = TrackSourceInfo::create("Mock_video_device_ID", TrackSourceInfo::Video, "Mock video device");
160 
161  requestClient->didCompleteRequest(sources);
162  return true;
163 }
 242 MockSourceMap& map = mockSourceMap();
 243 MockSourceMap::iterator end = map.end();
 244 for (MockSourceMap::iterator it = map.begin(); it != end; ++it) {
 245 MockSource* source = it->value.get();
164246
165 void MockMediaStreamCenter::didSetMediaStreamTrackEnabled(MediaStreamSource* source)
166 {
167  source->setReadyState(MediaStreamSource::Live);
168 }
169 
170 bool MockMediaStreamCenter::didAddMediaStreamTrack(MediaStreamSource*)
171 {
172  return true;
173 }
 247 sources.append(TrackSourceInfo::create(source->id(), source->type() == MediaStreamSource::Video ? TrackSourceInfo::Video : TrackSourceInfo::Audio, source->name()));
 248 }
174249
175 bool MockMediaStreamCenter::didRemoveMediaStreamTrack(MediaStreamSource*)
176 {
 250 requestClient->didCompleteRequest(sources);
177251 return true;
178252}
179253
180 void MockMediaStreamCenter::didStopLocalMediaStream(MediaStreamDescriptor* stream)
181 {
182  endLocalMediaStream(stream);
183 }
184 
185 void MockMediaStreamCenter::didCreateMediaStream(MediaStreamDescriptor*)
186 {
187 }
188 
189254} // namespace WebCore
190255
191256#endif // ENABLE(MEDIA_STREAM)
157016

Source/WebCore/platform/mock/MockMediaStreamCenter.h

@@public:
4040 virtual void validateRequestConstraints(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints);
4141 virtual void createMediaStream(PassRefPtr<MediaStreamCreationClient>, PassRefPtr<MediaConstraints> audioConstraints, PassRefPtr<MediaConstraints> videoConstraints);
4242 virtual bool getMediaStreamTrackSources(PassRefPtr<MediaStreamTrackSourcesRequestClient>) OVERRIDE;
43  virtual void didSetMediaStreamTrackEnabled(MediaStreamSource*) OVERRIDE;
44  virtual bool didAddMediaStreamTrack(MediaStreamSource*) OVERRIDE;
45  virtual bool didRemoveMediaStreamTrack(MediaStreamSource*) OVERRIDE;
46  virtual void didStopLocalMediaStream(MediaStreamDescriptor*) OVERRIDE;
47  virtual void didCreateMediaStream(MediaStreamDescriptor*) OVERRIDE;
4843
4944private:
5045 MockMediaStreamCenter() { }
157016

LayoutTests/ChangeLog

 12013-10-06 Eric Carlson <eric.carlson@apple.com>
 2
 3 [MediaStream API] update MediaStreamTrack object to match spec
 4 https://bugs.webkit.org/show_bug.cgi?id=121940
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * fast/mediastream/MediaStreamTrack-expected.txt:
 9 * fast/mediastream/MediaStreamTrack.html:
 10 * fast/mediastream/MediaStreamTrack-getSources-expected.txt:
 11 * fast/mediastream/MediaStreamTrack-getSources.html:
 12
1132013-10-06 Filip Pizlo <fpizlo@apple.com>
214
315 Unified test infrastructure via the jsc shell
157016

LayoutTests/fast/mediastream/MediaStreamTrack-expected.txt

@@On success, you will see a series of "PA
44
55
66PASS getUserMedia succeeded.
 7
 8videoTrack = mediaStream.getVideoTracks()[0]
 9PASS track.readyState is "live"
 10checking track.capabilities()
 11 sourceId
 12 0 : 239c24b0-2b15-11e3-8224-0800200c9a66
 13 sourceType
 14 0 : camera
 15 1 : microphone
 16 width
 17 min : 320
 18 max : 1920
 19 supported : true
 20 height
 21 min : 240
 22 max : 1080
 23 supported : true
 24 frameRate
 25 min : 15
 26 max : 60
 27 supported : true
 28 aspectRatio
 29 min : 1.3333333730697632
 30 max : 1.7777777910232544
 31 supported : true
 32 facingMode
 33 0 : user
 34 1 : environment
 35checking track.states()
 36PASS states.sourceId is capabilities.sourceId[0]
 37PASS states.sourceType is "camera"
 38 width : 1920
 39 height : 1080
 40 frameRate : 30
 41 aspectRatio : 1.7777777910232544
 42 facingMode : user
 43
 44audioTrack = mediaStream.getAudioTracks()[0]
745PASS track.readyState is "live"
8 PASS Track onmute callback succeeded.
9 PASS track.readyState is "muted"
10 PASS Track onunmute callback succeeded.
 46checking track.capabilities()
 47 sourceId
 48 0 : 239c24b1-2b15-11e3-8224-0800200c9a66
 49 volume
 50 min : 0
 51 max : 100
 52 supported : true
 53checking track.states()
 54PASS states.sourceId is capabilities.sourceId[0]
 55PASS states.sourceType is "microphone"
 56 volume : 50
 57
 58videoTrack2 = videoTrack.clone()
1159PASS track.readyState is "live"
 60checking track.capabilities()
 61 sourceId
 62 0 : 239c24b0-2b15-11e3-8224-0800200c9a66
 63 sourceType
 64 0 : camera
 65 1 : microphone
 66 width
 67 min : 320
 68 max : 1920
 69 supported : true
 70 height
 71 min : 240
 72 max : 1080
 73 supported : true
 74 frameRate
 75 min : 15
 76 max : 60
 77 supported : true
 78 aspectRatio
 79 min : 1.3333333730697632
 80 max : 1.7777777910232544
 81 supported : true
 82 facingMode
 83 0 : user
 84 1 : environment
 85checking track.states()
 86PASS states.sourceId is capabilities.sourceId[0]
 87PASS states.sourceType is "camera"
 88 width : 1920
 89 height : 1080
 90 frameRate : 30
 91 aspectRatio : 1.7777777910232544
 92 facingMode : user
 93PASS videoTrack.id is not videoTrack2.id
 94PASS videoTrack.kind is videoTrack2.kind
 95PASS videoTrack.label is videoTrack2.label
 96PASS videoTrack.muted is videoTrack2.muted
 97PASS videoTrack.enabled is videoTrack2.enabled
 98PASS videoTrack.readyState is videoTrack2.readyState
 99
 100videoTrack.stop()
12101PASS Track onended callback succeeded.
13 PASS track.readyState is "ended"
 102PASS videoTrack.readyState is "ended"
 103
14104PASS successfullyParsed is true
15105
16106TEST COMPLETE
157016

LayoutTests/fast/mediastream/MediaStreamTrack-getSources-expected.txt

@@On success, you will see a series of "PA
77*** calling MediaStreamTrack.getSources() ***
88PASS MediaStreamTrack.getSources(gotSources1); did not throw exception.
99PASS callback called.
10 sources1[0].sourceId = "Mock_audio_device_ID"
 10sources1[0].sourceId = "239c24b1-2b15-11e3-8224-0800200c9a66"
1111sources1[0].label = "Mock audio device"
1212sources1[0].kind = "audio"
13 sources1[1].sourceId = "Mock_video_device_ID"
 13sources1[1].sourceId = "239c24b0-2b15-11e3-8224-0800200c9a66"
1414sources1[1].label = "Mock video device"
1515sources1[1].kind = "video"
1616
157016

LayoutTests/fast/mediastream/MediaStreamTrack.html

11<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
22<html>
3 <head>
4 <script src="../../resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <div id="console"></div>
9 <script>
10 description("Tests MediaStreamTrack callbacks.");
11 
12 // Note that the below behaviour doesn't reflect how it works outside of LayoutTests.
13 // The underlying mock is modified to trigger the events when certain functions are called.
14 // This modified behaviour allows us to test the MediaStreamTrack class properly.
15 
16 var stream;
17 var track;
18 
19 function error() {
20  testFailed('Stream generation failed.');
21  finishJSTest();
22 }
23 
24 function getUserMedia(constraints, callback) {
25  try {
26  navigator.webkitGetUserMedia(constraints, callback, error);
27  } catch (e) {
28  testFailed('webkitGetUserMedia threw exception :' + e);
29  finishJSTest();
30  }
31 }
32 
33 function onTrackEnded() {
34  testPassed('Track onended callback succeeded.');
35 
36  shouldBeEqualToString('track.readyState', 'ended');
37 
38  finishJSTest();
39 }
40 
41 function onTrackUnmute() {
42  testPassed('Track onunmute callback succeeded.');
43 
44  shouldBeEqualToString('track.readyState', 'live');
45 
46  stream.stop();
47 }
48 
49 function onTrackMute() {
50  testPassed('Track onmute callback succeeded.');
51 
52  shouldBeEqualToString('track.readyState', 'muted');
53 
54  track.enabled = true;
55 }
56 
57 function gotStream(s) {
58  testPassed('getUserMedia succeeded.');
59 
60  stream = s;
61  track = stream.getVideoTracks()[0];
62 
63  shouldBeEqualToString('track.readyState', 'live');
64 
65  track.onunmute = onTrackUnmute;
66  track.onmute = onTrackMute;
67  track.onended = onTrackEnded;
68 
69  track.enabled = false;
70 }
71 
72 getUserMedia({audio:true, video:true}, gotStream);
73 
74 window.jsTestIsAsync = true;
75 window.successfullyParsed = true;
76 </script>
77 <script src="../../resources/js-test-post.js"></script>
78 </body>
 3 <head>
 4 <script src="../../resources/js-test-pre.js"></script>
 5 <script>
 6 var mediaStream;
 7 var videoTrack;
 8 var videoTrack2;
 9 var audioTrack;
 10
 11 function error()
 12 {
 13 testFailed('Stream generation failed.');
 14 finishJSTest();
 15 }
 16
 17 function getUserMedia(constraints, callback)
 18 {
 19 try {
 20 navigator.webkitGetUserMedia(constraints, callback, error);
 21 } catch (e) {
 22 testFailed('webkitGetUserMedia threw exception :' + e);
 23 finishJSTest();
 24 }
 25 }
 26
 27 function onTrackEnded()
 28 {
 29 testPassed('Track onended callback succeeded.');
 30 shouldBeEqualToString('videoTrack.readyState', 'ended');
 31 debug("");
 32 finishJSTest();
 33 }
 34
 35 function onTrackStarted()
 36 {
 37 testPassed('Track onstarted callback succeeded.');
 38 shouldBeEqualToString('videoTrack.readyState', 'live');
 39 }
 40
 41 function onTrackOverConstrained()
 42 {
 43 testPassed('Track onoverconstrained callback succeeded.');
 44 finishJSTest();
 45 }
 46
 47 function onTrackUnmute()
 48 {
 49 testPassed('Track onunmute callback succeeded.');
 50 shouldBeEqualToString('videoTrack.readyState', 'live');
 51 videoTrack.stop();
 52 }
 53
 54 function onTrackMute()
 55 {
 56 testPassed('Track onmute callback succeeded.');
 57 shouldBeEqual('videoTrack.muted', true);
 58 }
 59
 60 function logCapabilityRange(name, range)
 61 {
 62 debug(" " + name);
 63 debug(" min : " + range.min);
 64 debug(" max : " + range.max);
 65 debug(" supported : " + range.supported);
 66 }
 67
 68 function logCapabilityList(name, list)
 69 {
 70 debug(" " + name);
 71 for (i = 0; i < list.length; i++)
 72 debug(" " + i + " : " + list[i]);
 73 }
 74
 75 function checkCapabilities(track)
 76 {
 77 debug("checking track.capabilities()");
 78 capabilities = track.capabilities();
 79 logCapabilityList("sourceId", capabilities.sourceId);
 80 if (track.kind == "video") {
 81 logCapabilityList("sourceType", capabilities.sourceType);
 82 logCapabilityRange("width", capabilities.width);
 83 logCapabilityRange("height", capabilities.height);
 84 logCapabilityRange("frameRate", capabilities.frameRate);
 85 logCapabilityRange("aspectRatio", capabilities.aspectRatio);
 86 logCapabilityList("facingMode", capabilities.facingMode);
 87 } else
 88 logCapabilityRange("volume", capabilities.volume);
 89 }
 90
 91 function checkStates(track)
 92 {
 93 debug("checking track.states()");
 94 capabilities = track.capabilities();
 95 states = track.states();
 96 shouldBe('states.sourceId', 'capabilities.sourceId[0]');
 97 if (track.kind == "video") {
 98 shouldBeEqualToString('states.sourceType', 'camera');
 99 debug(" width : " + states.width);
 100 debug(" height : " + states.height);
 101 debug(" frameRate : " + states.frameRate);
 102 debug(" aspectRatio : " + states.aspectRatio);
 103 debug(" facingMode : " + states.facingMode);
 104 } else {
 105 shouldBeEqualToString('states.sourceType', 'microphone');
 106 debug(" volume : " + states.volume);
 107 }
 108 }
 109
 110 function checkTrack(t)
 111 {
 112 track = t;
 113 shouldBeEqualToString('track.readyState', 'live');
 114 checkCapabilities(track);
 115 checkStates(track);
 116 }
 117
 118 function gotStream(stream)
 119 {
 120 mediaStream = stream;
 121 testPassed('getUserMedia succeeded.');
 122
 123 debug("");
 124 evalAndLog("videoTrack = mediaStream.getVideoTracks()[0]");
 125 checkTrack(videoTrack);
 126
 127 debug("");
 128 evalAndLog("audioTrack = mediaStream.getAudioTracks()[0]");
 129 checkTrack(audioTrack);
 130
 131 videoTrack.onmute = onTrackMute;
 132 videoTrack.onunmute = onTrackUnmute;
 133 videoTrack.onended = onTrackEnded;
 134 videoTrack.onstarted = onTrackStarted;
 135 videoTrack.onoverconstrained = onTrackOverConstrained;
 136
 137 debug("");
 138 evalAndLog("videoTrack2 = videoTrack.clone()");
 139 checkTrack(videoTrack2);
 140 shouldNotBe('videoTrack.id', 'videoTrack2.id');
 141 shouldBe('videoTrack.kind', 'videoTrack2.kind');
 142 shouldBe('videoTrack.label', 'videoTrack2.label');
 143 shouldBe('videoTrack.muted', 'videoTrack2.muted');
 144 shouldBe('videoTrack.enabled', 'videoTrack2.enabled');
 145 shouldBe('videoTrack.readyState', 'videoTrack2.readyState');
 146
 147 debug("");
 148 evalAndLog("videoTrack.stop()");
 149 }
 150
 151 function start()
 152 {
 153 description("Tests MediaStreamTrack callbacks.");
 154
 155 // Note that the below behaviour doesn't reflect how it works outside of LayoutTests.
 156 // The underlying mock is modified to trigger the events when certain functions are called.
 157 // This modified behaviour allows us to test the MediaStreamTrack class properly.
 158 getUserMedia({audio:true, video:true}, gotStream);
 159 }
 160
 161 window.jsTestIsAsync = true;
 162 window.successfullyParsed = true;
 163 </script>
 164 </head>
 165 <body onload="start()">
 166 <p id="description"></p>
 167 <div id="console"></div>
 168 <script src="../../resources/js-test-post.js"></script>
 169 </body>
79170</html>
157016