MediaStream API: Remove LocalMediaStream
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Sep 2013 22:32:26 +0000 (22:32 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Sep 2013 22:32:26 +0000 (22:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=120875

blink merge: https://chromium.googlesource.com/chromium/blink/+/81643ee3fe048a64fa8931132e1294fa2c8e821a

Patch by Thiago de Barros Lacerda <thiago.lacerda@openbossa.org> on 2013-09-11
Reviewed by Eric Carlson.

Source/WebCore:

Existing tests were updated.

* CMakeLists.txt:
* DerivedSources.make:
* GNUmakefile.list.am:
* Modules/mediastream/LocalMediaStream.cpp: Removed.
* Modules/mediastream/LocalMediaStream.h: Removed.
* Modules/mediastream/LocalMediaStream.idl: Removed.
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::stop):
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/MediaStream.idl:
* Modules/mediastream/NavigatorUserMediaSuccessCallback.h:
* Modules/mediastream/NavigatorUserMediaSuccessCallback.idl:
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::succeed):
* Modules/mediastream/UserMediaRequest.h:
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::createMediaStreamSource):
* Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
(WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
* WebCore.xcodeproj/project.pbxproj:
* dom/EventTarget.h:
* dom/EventTargetFactory.in:
* platform/mediastream/MediaStreamDescriptor.h:

LayoutTests:

* fast/mediastream/LocalMediaStream-onended-expected.txt: Removed.
* fast/mediastream/LocalMediaStream-onended.html: Removed.
* fast/mediastream/MediaStream-onended-expected.txt:
* fast/mediastream/MediaStream-onended.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155573 268f45cc-cd09-0410-ab3c-d52691b4dbfc

25 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/mediastream/LocalMediaStream-onended-expected.txt [deleted file]
LayoutTests/fast/mediastream/LocalMediaStream-onended.html [deleted file]
LayoutTests/fast/mediastream/MediaStream-onended-expected.txt
LayoutTests/fast/mediastream/MediaStream-onended.html
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Modules/mediastream/LocalMediaStream.cpp [deleted file]
Source/WebCore/Modules/mediastream/LocalMediaStream.h [deleted file]
Source/WebCore/Modules/mediastream/LocalMediaStream.idl [deleted file]
Source/WebCore/Modules/mediastream/MediaStream.cpp
Source/WebCore/Modules/mediastream/MediaStream.h
Source/WebCore/Modules/mediastream/MediaStream.idl
Source/WebCore/Modules/mediastream/NavigatorUserMediaSuccessCallback.h
Source/WebCore/Modules/mediastream/NavigatorUserMediaSuccessCallback.idl
Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
Source/WebCore/Modules/mediastream/UserMediaRequest.h
Source/WebCore/Modules/webaudio/AudioContext.cpp
Source/WebCore/Modules/webaudio/MediaStreamAudioDestinationNode.cpp
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/EventTarget.h
Source/WebCore/dom/EventTargetFactory.in
Source/WebCore/platform/mediastream/MediaStreamDescriptor.h

index 02ca8a3da8cff11d7e78d35eeb7fdb2791224274..07a6db5368d2448ac8c877ab91f7c6ae585fbf6a 100644 (file)
@@ -1,3 +1,17 @@
+2013-09-11  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
+
+        MediaStream API: Remove LocalMediaStream
+        https://bugs.webkit.org/show_bug.cgi?id=120875
+
+        blink merge: https://chromium.googlesource.com/chromium/blink/+/81643ee3fe048a64fa8931132e1294fa2c8e821a
+
+        Reviewed by Eric Carlson.
+
+        * fast/mediastream/LocalMediaStream-onended-expected.txt: Removed.
+        * fast/mediastream/LocalMediaStream-onended.html: Removed.
+        * fast/mediastream/MediaStream-onended-expected.txt:
+        * fast/mediastream/MediaStream-onended.html:
+
 2013-09-10  Filip Pizlo  <fpizlo@apple.com>
 
         Int32ToDouble should be predicted SpecInt48 and predictions should have nothing to do with constant folding
diff --git a/LayoutTests/fast/mediastream/LocalMediaStream-onended-expected.txt b/LayoutTests/fast/mediastream/LocalMediaStream-onended-expected.txt
deleted file mode 100644 (file)
index a8bcd95..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-Tests LocalMediaStream::onended callback.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS stream.ended is false
-PASS streamEnded was called.
-PASS stream.ended is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/fast/mediastream/LocalMediaStream-onended.html b/LayoutTests/fast/mediastream/LocalMediaStream-onended.html
deleted file mode 100644 (file)
index e6c149e..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src="../../resources/js-test-pre.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-<script>
-description("Tests LocalMediaStream::onended callback.");
-
-function error() {
-    testFailed('Stream generation failed.');
-    finishJSTest();
-}
-
-function getUserMedia(dictionary, callback) {
-    try {
-        navigator.webkitGetUserMedia(dictionary, callback, error);
-    } catch (e) {
-        testFailed('webkitGetUserMedia threw exception :' + e);
-        finishJSTest();
-    }
-}
-
-var stream;
-
-function streamEnded() {
-    testPassed('streamEnded was called.');
-    shouldBeTrue('stream.ended');
-    finishJSTest();
-}
-
-function gotStream(s) {
-    stream = s;
-    shouldBeFalse('stream.ended');
-    try {
-        stream.onended = streamEnded;
-        stream.stop();
-    } catch (e) {
-        testFailed('LocalMediaStream threw exception :' + e);
-        finishJSTest();
-    }
-}
-
-getUserMedia({audio:true, video:true}, gotStream);
-
-window.jsTestIsAsync = true;
-window.successfullyParsed = true;
-</script>
-<script src="../../resources/js-test-post.js"></script>
-</body>
-</html>
index 491b35b957c5be5682714aadb96c4a19294c991c..e066473b02a28d82a5509798590a84b90d8586d4 100644 (file)
@@ -3,6 +3,9 @@ Tests MediaStream::onended callback.
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
+PASS stream.ended is false
+PASS streamEnded was called.
+PASS stream.ended is true
 PASS stream.ended is false
 PASS streamEnded was called.
 PASS stream.ended is true
index 393c520d0a3ccd6ed892a653ebf87b5ba507cfaf..f01dbc2c1e4c835876841f6a189fd7256e2ff500 100644 (file)
@@ -25,20 +25,39 @@ function getUserMedia(dictionary, callback) {
 
 var stream;
 
-function streamEnded() {
+function streamEnded2() {
     testPassed('streamEnded was called.');
     shouldBeTrue('stream.ended');
     finishJSTest();
 }
 
-function gotStream(s) {
+function gotStream2(s) {
     stream = new webkitMediaStream(s);
     shouldBeFalse('stream.ended');
     try {
-        stream.onended = streamEnded;
+        stream.onended = streamEnded2;
         s.stop();
     } catch (e) {
-        testFailed('LocalMediaStream threw exception :' + e);
+        testFailed('MediaStream threw exception :' + e);
+        finishJSTest();
+    }
+}
+
+function streamEnded() {
+    testPassed('streamEnded was called.');
+    shouldBeTrue('stream.ended');
+
+    getUserMedia({audio:true, video:true}, gotStream2);
+}
+
+function gotStream(s) {
+    stream = s;
+    shouldBeFalse('stream.ended');
+    try {
+        stream.onended = streamEnded;
+        stream.stop();
+    } catch (e) {
+        testFailed('MediaStream threw exception :' + e);
         finishJSTest();
     }
 }
index 05b85162909d9eeea5a6c57d72eb2df898da81ed..804773af3467518310f0451f737c60e79a130200 100644 (file)
@@ -211,7 +211,6 @@ set(WebCore_IDL_FILES
     Modules/mediasource/SourceBuffer.idl
     Modules/mediasource/SourceBufferList.idl
 
-    Modules/mediastream/LocalMediaStream.idl
     Modules/mediastream/MediaStream.idl
     Modules/mediastream/MediaStreamEvent.idl
     Modules/mediastream/MediaStreamTrack.idl
@@ -833,7 +832,6 @@ set(WebCore_SOURCES
     Modules/mediasource/SourceBuffer.cpp
     Modules/mediasource/SourceBufferList.cpp
 
-    Modules/mediastream/LocalMediaStream.cpp
     Modules/mediastream/MediaConstraintsImpl.cpp
     Modules/mediastream/MediaStream.cpp
     Modules/mediastream/MediaStreamEvent.cpp
index 3bbd56b638e163835747737b2eeaacad7ae59a61..b395432c568fbc4072cd7dace5ee80d4f789aa79 100644 (file)
@@ -1,3 +1,38 @@
+2013-09-11  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
+
+        MediaStream API: Remove LocalMediaStream
+        https://bugs.webkit.org/show_bug.cgi?id=120875
+
+        blink merge: https://chromium.googlesource.com/chromium/blink/+/81643ee3fe048a64fa8931132e1294fa2c8e821a
+
+        Reviewed by Eric Carlson.
+
+        Existing tests were updated.
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * GNUmakefile.list.am:
+        * Modules/mediastream/LocalMediaStream.cpp: Removed.
+        * Modules/mediastream/LocalMediaStream.h: Removed.
+        * Modules/mediastream/LocalMediaStream.idl: Removed.
+        * Modules/mediastream/MediaStream.cpp:
+        (WebCore::MediaStream::stop):
+        * Modules/mediastream/MediaStream.h:
+        * Modules/mediastream/MediaStream.idl:
+        * Modules/mediastream/NavigatorUserMediaSuccessCallback.h:
+        * Modules/mediastream/NavigatorUserMediaSuccessCallback.idl:
+        * Modules/mediastream/UserMediaRequest.cpp:
+        (WebCore::UserMediaRequest::succeed):
+        * Modules/mediastream/UserMediaRequest.h:
+        * Modules/webaudio/AudioContext.cpp:
+        (WebCore::AudioContext::createMediaStreamSource):
+        * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
+        (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/EventTarget.h:
+        * dom/EventTargetFactory.in:
+        * platform/mediastream/MediaStreamDescriptor.h:
+
 2013-09-11  Timothy Hatcher  <timothy@apple.com>
 
         Remove PlatformInstrumentation since we don't show decode or resize in the new Web Inspector
index ab5eee6ed23eddf2751ab8ac0d8820e321568b26..3df446848622c2fb98106d7ddcffbd390a3f1449 100644 (file)
@@ -116,7 +116,6 @@ BINDING_IDLS = \
     $(WebCore)/Modules/mediasource/MediaSource.idl \
     $(WebCore)/Modules/mediasource/SourceBuffer.idl \
     $(WebCore)/Modules/mediasource/SourceBufferList.idl \
-    $(WebCore)/Modules/mediastream/LocalMediaStream.idl \
     $(WebCore)/Modules/mediastream/MediaStream.idl \
     $(WebCore)/Modules/mediastream/MediaStreamEvent.idl \
     $(WebCore)/Modules/mediastream/MediaStreamTrack.idl \
index 9f7727163c9f755ac7bbb69c6d4876c7f540cf40..752d4ebe6b1f3395cbf1c2004459b7aa9c3c4090 100644 (file)
@@ -488,8 +488,6 @@ webcore_built_sources += \
        DerivedSources/WebCore/JSJavaScriptCallFrame.h \
        DerivedSources/WebCore/JSKeyboardEvent.cpp \
        DerivedSources/WebCore/JSKeyboardEvent.h \
-       DerivedSources/WebCore/JSLocalMediaStream.cpp \
-       DerivedSources/WebCore/JSLocalMediaStream.h \
        DerivedSources/WebCore/JSLocation.cpp \
        DerivedSources/WebCore/JSLocation.h \
        DerivedSources/WebCore/JSMediaController.cpp \
@@ -1240,7 +1238,6 @@ dom_binding_idls += \
        $(WebCore)/Modules/mediasource/MediaSource.idl \
        $(WebCore)/Modules/mediasource/SourceBuffer.idl \
        $(WebCore)/Modules/mediasource/SourceBufferList.idl \
-       $(WebCore)/Modules/mediastream/LocalMediaStream.idl \
        $(WebCore)/Modules/mediastream/MediaStream.idl \
        $(WebCore)/Modules/mediastream/MediaStreamEvent.idl \
        $(WebCore)/Modules/mediastream/MediaStreamTrack.idl \
@@ -1945,8 +1942,6 @@ webcore_modules_sources += \
        Source/WebCore/Modules/mediasource/SourceBuffer.h \
        Source/WebCore/Modules/mediasource/SourceBufferList.cpp \
        Source/WebCore/Modules/mediasource/SourceBufferList.h \
-       Source/WebCore/Modules/mediastream/LocalMediaStream.cpp \
-       Source/WebCore/Modules/mediastream/LocalMediaStream.h \
        Source/WebCore/Modules/mediastream/MediaConstraintsImpl.cpp \
        Source/WebCore/Modules/mediastream/MediaConstraintsImpl.h \
        Source/WebCore/Modules/mediastream/MediaStream.cpp \
diff --git a/Source/WebCore/Modules/mediastream/LocalMediaStream.cpp b/Source/WebCore/Modules/mediastream/LocalMediaStream.cpp
deleted file mode 100644 (file)
index 994d501..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2011 Ericsson AB. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "LocalMediaStream.h"
-
-#if ENABLE(MEDIA_STREAM)
-
-#include "MediaStreamCenter.h"
-
-namespace WebCore {
-
-PassRefPtr<LocalMediaStream> LocalMediaStream::create(ScriptExecutionContext* context, const MediaStreamSourceVector& audioSources, const MediaStreamSourceVector& videoSources)
-{
-    return adoptRef(new LocalMediaStream(context, MediaStreamDescriptor::create(audioSources, videoSources)));
-}
-
-PassRefPtr<LocalMediaStream> LocalMediaStream::create(ScriptExecutionContext* context, PassRefPtr<MediaStreamDescriptor> streamDescriptor)
-{
-    return adoptRef(new LocalMediaStream(context, streamDescriptor));
-}
-
-LocalMediaStream::LocalMediaStream(ScriptExecutionContext* context, PassRefPtr<MediaStreamDescriptor> streamDescriptor)
-    : MediaStream(context, streamDescriptor)
-{
-}
-
-void LocalMediaStream::stop()
-{
-    if (ended())
-        return;
-
-    MediaStreamCenter::instance().didStopLocalMediaStream(descriptor());
-
-    streamEnded();
-}
-
-LocalMediaStream::~LocalMediaStream()
-{
-}
-
-const AtomicString& LocalMediaStream::interfaceName() const
-{
-    return eventNames().interfaceForLocalMediaStream;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(MEDIA_STREAM)
diff --git a/Source/WebCore/Modules/mediastream/LocalMediaStream.h b/Source/WebCore/Modules/mediastream/LocalMediaStream.h
deleted file mode 100644 (file)
index 7c48107..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2011 Ericsson AB. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef LocalMediaStream_h
-#define LocalMediaStream_h
-
-#if ENABLE(MEDIA_STREAM)
-
-#include "MediaStream.h"
-
-namespace WebCore {
-
-class LocalMediaStream : public MediaStream {
-public:
-    static PassRefPtr<LocalMediaStream> create(ScriptExecutionContext*, const MediaStreamSourceVector& audioSources, const MediaStreamSourceVector& videoSources);
-    static PassRefPtr<LocalMediaStream> create(ScriptExecutionContext*, PassRefPtr<MediaStreamDescriptor>);
-    virtual ~LocalMediaStream();
-
-    void stop();
-
-    // MediaStream
-    virtual bool isLocal() const OVERRIDE { return true; }
-
-    // EventTarget
-    virtual const AtomicString& interfaceName() const OVERRIDE;
-
-private:
-    LocalMediaStream(ScriptExecutionContext*, PassRefPtr<MediaStreamDescriptor>);
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(MEDIA_STREAM)
-
-#endif // LocalMediaStream_h
diff --git a/Source/WebCore/Modules/mediastream/LocalMediaStream.idl b/Source/WebCore/Modules/mediastream/LocalMediaStream.idl
deleted file mode 100644 (file)
index c4b480f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
-    Conditional=MEDIA_STREAM,
-    EventTarget,
-    JSGenerateToNativeObject,
-    JSGenerateToJSObject
-] interface LocalMediaStream : MediaStream {
-    void stop();
-};
-
index f9cf8355552c3e1d650eb6b41f5d2a34894dadb2..b810fa843ab6aed94635f8b66d195683b851c384 100644 (file)
@@ -132,6 +132,15 @@ bool MediaStream::ended() const
     return m_stopped || m_descriptor->ended();
 }
 
+void MediaStream::stop()
+{
+    if (ended())
+        return;
+
+    MediaStreamCenter::instance().didStopLocalMediaStream(descriptor());
+    streamEnded();
+}
+
 void MediaStream::addTrack(PassRefPtr<MediaStreamTrack> prpTrack, ExceptionCode& ec)
 {
     if (ended()) {
index 782b9235928807c99d568c858f5a4ccd6b507118..cea2c9c2d958d64314d755f9eec099ca48beb286 100644 (file)
@@ -61,6 +61,7 @@ public:
     MediaStreamTrackVector getVideoTracks() const { return m_videoTracks; }
 
     bool ended() const;
+    void stop();
 
     DEFINE_ATTRIBUTE_EVENT_LISTENER(ended);
     DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack);
@@ -70,8 +71,6 @@ public:
     virtual void trackEnded() OVERRIDE;
     virtual void streamEnded() OVERRIDE;
 
-    virtual bool isLocal() const { return false; }
-
     MediaStreamDescriptor* descriptor() const { return m_descriptor.get(); }
 
     // EventTarget
index ba1dc639243ef0f8fbd6a8be2d0bbd2e81359086..04df17b9cd314ac58dee8bef91a5789d23654657 100644 (file)
@@ -29,7 +29,6 @@
     Constructor(MediaStream stream),
     Constructor(MediaStreamTrack[] tracks),
     ConstructorCallWith=ScriptExecutionContext,
-    SkipVTableValidation,
     InterfaceName=webkitMediaStream
 ] interface MediaStream {
     // DEPRECATED
@@ -45,6 +44,7 @@
     MediaStreamTrack getTrackById(DOMString trackId);
 
     readonly attribute boolean ended;
+    void stop();
 
     attribute EventListener onended;
     attribute EventListener onaddtrack;
index 2b6aae5df03094be787caf8189ba30799ff60871..9f456eadc6ae494186cf07c6e2a52e04763f9990 100644 (file)
 
 namespace WebCore {
 
-class LocalMediaStream;
+class MediaStream;
 
 class NavigatorUserMediaSuccessCallback : public RefCounted<NavigatorUserMediaSuccessCallback> {
 public:
     virtual ~NavigatorUserMediaSuccessCallback() { }
-    virtual bool handleEvent(LocalMediaStream*) = 0;
+    virtual bool handleEvent(MediaStream*) = 0;
 };
 
 } // namespace WebCore
index 226a9a69d3d22e81ddc6ad724a893abebf1f04fe..3912797d313e2aaee4b808b2d00c14a7ee1ab05e 100644 (file)
@@ -25,6 +25,6 @@
 [
     Conditional=MEDIA_STREAM,
 ] callback interface NavigatorUserMediaSuccessCallback {
-    boolean handleEvent(LocalMediaStream stream);
+    boolean handleEvent(MediaStream stream);
 };
 
index 623acbcc81dcc010362bb706086a16b4052fe9f9..c64edeeedaaff9ec87e383a374a641aa094d5a30 100644 (file)
@@ -38,8 +38,8 @@
 #include "Dictionary.h"
 #include "Document.h"
 #include "ExceptionCode.h"
-#include "LocalMediaStream.h"
 #include "MediaConstraintsImpl.h"
+#include "MediaStream.h"
 #include "MediaStreamCenter.h"
 #include "MediaStreamDescriptor.h"
 #include "SpaceSplitString.h"
@@ -135,21 +135,12 @@ void UserMediaRequest::didCompleteQuery(const MediaStreamSourceVector& audioSour
         m_controller->requestUserMedia(this, audioSources, videoSources);
 }
 
-void UserMediaRequest::succeed(const MediaStreamSourceVector& audioSources, const MediaStreamSourceVector& videoSources)
-{
-    if (!m_scriptExecutionContext)
-        return;
-
-    RefPtr<LocalMediaStream> stream = LocalMediaStream::create(m_scriptExecutionContext, audioSources, videoSources);
-    m_successCallback->handleEvent(stream.get());
-}
-
 void UserMediaRequest::succeed(PassRefPtr<MediaStreamDescriptor> streamDescriptor)
 {
     if (!m_scriptExecutionContext)
         return;
 
-    RefPtr<LocalMediaStream> stream = LocalMediaStream::create(m_scriptExecutionContext, streamDescriptor);
+    RefPtr<MediaStream> stream = MediaStream::create(m_scriptExecutionContext, streamDescriptor);
     m_successCallback->handleEvent(stream.get());
 }
 
index 64d0b17ed9a0683c74e1acb78b229e7965ca894d..7881496630bd794d36428b0ef9d373306791aa57 100644 (file)
@@ -63,7 +63,6 @@ public:
 
     void start();
 
-    void succeed(const MediaStreamSourceVector& audioSources, const MediaStreamSourceVector& videoSources);
     void succeed(PassRefPtr<MediaStreamDescriptor>);
     void fail();
 
index ccdb305fd99a129615ade9175141aa8aaeef0880..fe9c4550f9c785f0eb2a3becc177b1b2fbd30ced 100644 (file)
@@ -418,15 +418,15 @@ PassRefPtr<MediaStreamAudioSourceNode> AudioContext::createMediaStreamSource(Med
     AudioSourceProvider* provider = 0;
 
     MediaStreamTrackVector audioTracks = mediaStream->getAudioTracks();
-    if (mediaStream->isLocal() && audioTracks.size()) {
-        // Enable input for the specific local audio device specified in the MediaStreamSource.
-        RefPtr<MediaStreamTrack> localAudio = audioTracks[0];
+    // FIXME: get a provider for non-local MediaStreams (like from a remote peer).
+    for (size_t i = 0; i < audioTracks.size(); ++i) {
+        RefPtr<MediaStreamTrack> localAudio = audioTracks[i];
         MediaStreamSource* source = localAudio->component()->source();
-        destination()->enableInput(source->deviceId());
-        provider = destination()->localAudioInputProvider();
-    } else {
-        // FIXME: get a provider for non-local MediaStreams (like from a remote peer).
-        provider = 0;
+        if (!source->deviceId().isEmpty()) {
+            destination()->enableInput(source->deviceId());
+            provider = destination()->localAudioInputProvider();
+            break;
+        }
     }
 
     RefPtr<MediaStreamAudioSourceNode> node = MediaStreamAudioSourceNode::create(this, mediaStream, provider);
index 3613dbe9ea3b3625587cea8286dd3e4ec3c38c5d..d57beb8d0f983a47cc37ce92f215cead62538375 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "AudioContext.h"
 #include "AudioNodeInput.h"
-#include "LocalMediaStream.h"
+#include "MediaStream.h"
 #include "MediaStreamCenter.h"
 #include "RTCPeerConnectionHandler.h"
 #include "UUID.h"
@@ -53,7 +53,7 @@ MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode(AudioContext* c
     MediaStreamSourceVector audioSources;
     audioSources.append(m_source);
     MediaStreamSourceVector videoSources;
-    m_stream = LocalMediaStream::create(context->scriptExecutionContext(), audioSources, videoSources);
+    m_stream = MediaStream::create(context->scriptExecutionContext(), MediaStreamDescriptor::create(audioSources, videoSources));
     MediaStreamCenter::instance().didCreateMediaStream(m_stream->descriptor());
 
     m_source->setAudioFormat(numberOfChannels, context->sampleRate());
index 3290825e787043175528b29de65b1647c29ba136..d49f449efaf8bfa0be60441f14d0730747f738ef 100644 (file)
                07846342145B151A00A58DF1 /* JSTrackEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07846340145B151A00A58DF1 /* JSTrackEvent.cpp */; };
                07846343145B151A00A58DF1 /* JSTrackEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 07846341145B151A00A58DF1 /* JSTrackEvent.h */; };
                07846385145B1B8E00A58DF1 /* JSTrackCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 07846384145B1B8E00A58DF1 /* JSTrackCustom.h */; };
-               078E08FC17D14CBD00420AA1 /* LocalMediaStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 07221B4817CEC32700848E51 /* LocalMediaStream.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               078E08FD17D14CC600420AA1 /* LocalMediaStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221B4717CEC32700848E51 /* LocalMediaStream.cpp */; };
                078E08FE17D14CEE00420AA1 /* MediaConstraintsImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221B4A17CEC32700848E51 /* MediaConstraintsImpl.cpp */; };
                078E08FF17D14CEE00420AA1 /* MediaStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221B4C17CEC32700848E51 /* MediaStream.cpp */; };
                078E090017D14CEE00420AA1 /* MediaStreamEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221B4F17CEC32700848E51 /* MediaStreamEvent.cpp */; };
                07941791166E855F009416C2 /* InbandTextTrack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0794178F166E855F009416C2 /* InbandTextTrack.cpp */; };
                07941792166E855F009416C2 /* InbandTextTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = 07941790166E855F009416C2 /* InbandTextTrack.h */; };
                07941794166EA04E009416C2 /* InbandTextTrackPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 07941793166EA04E009416C2 /* InbandTextTrackPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               07969D8F17D13F43007FF842 /* JSLocalMediaStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07969D8D17D13F43007FF842 /* JSLocalMediaStream.cpp */; };
-               07969D9017D13F43007FF842 /* JSLocalMediaStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 07969D8E17D13F43007FF842 /* JSLocalMediaStream.h */; };
                07969DAB17D14151007FF842 /* JSRTCDataChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07969D9117D14151007FF842 /* JSRTCDataChannel.cpp */; };
                07969DAC17D14151007FF842 /* JSRTCDataChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 07969D9217D14151007FF842 /* JSRTCDataChannel.h */; };
                07969DAD17D14151007FF842 /* JSRTCDataChannelEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07969D9317D14151007FF842 /* JSRTCDataChannelEvent.cpp */; };
                0720B09F14D3323500642955 /* GenericEventQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GenericEventQueue.h; sourceTree = "<group>"; };
                0720B09F14D3323500642956 /* GestureEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GestureEvent.cpp; sourceTree = "<group>"; };
                0720B09F14D3323500642957 /* GestureEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GestureEvent.h; sourceTree = "<group>"; };
-               07221B4717CEC32700848E51 /* LocalMediaStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LocalMediaStream.cpp; sourceTree = "<group>"; };
-               07221B4817CEC32700848E51 /* LocalMediaStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalMediaStream.h; sourceTree = "<group>"; };
-               07221B4917CEC32700848E51 /* LocalMediaStream.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LocalMediaStream.idl; sourceTree = "<group>"; };
                07221B4A17CEC32700848E51 /* MediaConstraintsImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaConstraintsImpl.cpp; sourceTree = "<group>"; };
                07221B4B17CEC32700848E51 /* MediaConstraintsImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaConstraintsImpl.h; sourceTree = "<group>"; };
                07221B4C17CEC32700848E51 /* MediaStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStream.cpp; sourceTree = "<group>"; };
                0794178F166E855F009416C2 /* InbandTextTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InbandTextTrack.cpp; sourceTree = "<group>"; };
                07941790166E855F009416C2 /* InbandTextTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InbandTextTrack.h; sourceTree = "<group>"; };
                07941793166EA04E009416C2 /* InbandTextTrackPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InbandTextTrackPrivate.h; sourceTree = "<group>"; };
-               07969D8D17D13F43007FF842 /* JSLocalMediaStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSLocalMediaStream.cpp; sourceTree = "<group>"; };
-               07969D8E17D13F43007FF842 /* JSLocalMediaStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSLocalMediaStream.h; sourceTree = "<group>"; };
                07969D9117D14151007FF842 /* JSRTCDataChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRTCDataChannel.cpp; sourceTree = "<group>"; };
                07969D9217D14151007FF842 /* JSRTCDataChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRTCDataChannel.h; sourceTree = "<group>"; };
                07969D9317D14151007FF842 /* JSRTCDataChannelEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRTCDataChannelEvent.cpp; sourceTree = "<group>"; };
                07221B4617CEC32700848E51 /* mediastream */ = {
                        isa = PBXGroup;
                        children = (
-                               07221B4717CEC32700848E51 /* LocalMediaStream.cpp */,
-                               07221B4817CEC32700848E51 /* LocalMediaStream.h */,
-                               07221B4917CEC32700848E51 /* LocalMediaStream.idl */,
                                07221B4A17CEC32700848E51 /* MediaConstraintsImpl.cpp */,
                                07221B4B17CEC32700848E51 /* MediaConstraintsImpl.h */,
                                07221B4C17CEC32700848E51 /* MediaStream.cpp */,
                07CFD99317D01405001C4FFC /* MediaStream */ = {
                        isa = PBXGroup;
                        children = (
-                               07969D8D17D13F43007FF842 /* JSLocalMediaStream.cpp */,
-                               07969D8E17D13F43007FF842 /* JSLocalMediaStream.h */,
                                07277E3E17D018CC0015534D /* JSMediaSource.cpp */,
                                07277E3F17D018CC0015534D /* JSMediaSource.h */,
                                07277E4017D018CC0015534D /* JSMediaStream.cpp */,
                                4496E39E1398136C003EE32A /* JSSVGAnimateMotionElement.h in Headers */,
                                B2FA3D550AB75A6F000E5AC4 /* JSSVGAnimateTransformElement.h in Headers */,
                                B2FA3D570AB75A6F000E5AC4 /* JSSVGAnimationElement.h in Headers */,
-                               078E08FC17D14CBD00420AA1 /* LocalMediaStream.h in Headers */,
-                               07969D9017D13F43007FF842 /* JSLocalMediaStream.h in Headers */,
                                B2FA3D590AB75A6F000E5AC4 /* JSSVGCircleElement.h in Headers */,
                                B2FA3D5B0AB75A6F000E5AC4 /* JSSVGClipPathElement.h in Headers */,
                                B2FA3D5D0AB75A6F000E5AC4 /* JSSVGColor.h in Headers */,
                                0F605AEC15F94848004DF0C0 /* ScrollingConstraints.cpp in Sources */,
                                1AF62EE714DA22A70041556C /* ScrollingCoordinator.cpp in Sources */,
                                1AF62EE614DA22A70041556C /* ScrollingCoordinatorMac.mm in Sources */,
-                               07969D8F17D13F43007FF842 /* JSLocalMediaStream.cpp in Sources */,
                                93C38BFE164473C700091EB2 /* ScrollingStateFixedNode.cpp in Sources */,
                                931CBD0C161A44E900E4C874 /* ScrollingStateNode.cpp in Sources */,
                                931CBD13161A44F800E4C874 /* ScrollingStateNodeMac.mm in Sources */,
                                49C7B9D41042D32F0009D447 /* WebGLObject.cpp in Sources */,
                                49C7B9D61042D32F0009D447 /* WebGLProgram.cpp in Sources */,
                                49C7B9D91042D32F0009D447 /* WebGLRenderbuffer.cpp in Sources */,
-                               078E08FD17D14CC600420AA1 /* LocalMediaStream.cpp in Sources */,
                                49C7B9DF1042D32F0009D447 /* WebGLRenderingContext.cpp in Sources */,
                                49C7B9E21042D32F0009D447 /* WebGLShader.cpp in Sources */,
                                A08CF154152B77B3009C5775 /* WebGLShaderPrecisionFormat.cpp in Sources */,
index a21bd00b0ff76232f542efae27941eca7076cdbf..928b62f9dd68ca81e0cddc7839ec5cb16bac54b5 100644 (file)
@@ -55,7 +55,6 @@ namespace WebCore {
     class IDBRequest;
     class IDBTransaction;
     class ScriptProcessorNode;
-    class LocalMediaStream;
     class MediaController;
     class MediaSource;
     class MediaStream;
index aeea96a6cc2a6029889621aceccf8e4fb7c70151..2f5be8ded4ab4a9bc16b7ec484c01a631a01fbcb 100644 (file)
@@ -15,7 +15,6 @@ IDBDatabase conditional=INDEXED_DATABASE
 IDBOpenDBRequest conditional=INDEXED_DATABASE
 IDBRequest conditional=INDEXED_DATABASE
 IDBTransaction conditional=INDEXED_DATABASE
-LocalMediaStream conditional=MEDIA_STREAM
 MediaKeySession conditional=ENCRYPTED_MEDIA_V2
 MediaController conditional=VIDEO
 MediaSource conditional=MEDIA_SOURCE
index a013d49cddfc167225b4bc7913413e75fccc2e82..8500f625e61a4d57552fbd307cb937149cc7e438 100644 (file)
@@ -36,6 +36,7 @@
 
 #include "MediaStreamComponent.h"
 #include "MediaStreamSource.h"
+#include "UUID.h"
 #include <wtf/RefCounted.h>
 #include <wtf/Vector.h>