Changeset 159797 in webkit


Ignore:
Timestamp:
Nov 26, 2013 6:13:04 PM (10 years ago)
Author:
commit-queue@webkit.org
Message:

[MediaStream API] HTMLMediaElement should be able to use MediaStream as source
https://bugs.webkit.org/show_bug.cgi?id=121943

Patch by Nick Diego Yamane <nick.yamane@openbossa.org> on 2013-11-26
Reviewed by Eric Carlson.

Source/WebCore:

Implement MediaStream direct assignment to Media Elements using the new 'srcObject'
attribute: http://www.w3.org/TR/mediacapture-streams/#direct-assignment-to-media-elements

Test: fast/mediastream/MediaStream-MediaElement-srcObject.html

  • CMakeLists.txt: Added new HTMLMediaElementMediaStream.h and .cpp to cmake build.
  • DerivedSources.make: Added HTMLMediaElementMediaStream.idl.
  • GNUmakefile.list.am: Added new HTMLMediaElementMediaStream* to autotools build.
  • WebCore.xcodeproj/project.pbxproj: Added new files.
  • Modules/mediastream/HTMLMediaElementMediaStream.cpp: Added.

(WebCore::HTMLMediaElementMediaStream::srcObject): implements srcObject getter.
(WebCore::HTMLMediaElementMediaStream::setSrcObject): implements srcObject setter.

  • Modules/mediastream/HTMLMediaElementMediaStream.h: Added.
  • Modules/mediastream/HTMLMediaElementMediaStream.idl: Added.
  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::setSrcObject): This is an initial implementation, and
is still incomplete, that will be addressed in a separate bug: https://webkit.org/b/124896

  • html/HTMLMediaElement.h: Added m_mediaStreamSrcObject class variable

and its corresponding getter.

Source/WebKit2:

Add mediastream module and platform to cmake include directories.

  • CMakeLists.txt:

LayoutTests:

Add layout tests to MediaStream direct assignment to HTMLMediaElement
using brand new srcObject attribute.

  • fast/mediastream/MediaStream-MediaElement-srcObject-expected.txt: Added.
  • fast/mediastream/MediaStream-MediaElement-srcObject.html: Added.
Location:
trunk
Files:
5 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r159792 r159797  
     12013-11-26  Nick Diego Yamane  <nick.yamane@openbossa.org>
     2
     3        [MediaStream API] HTMLMediaElement should be able to use MediaStream as source
     4        https://bugs.webkit.org/show_bug.cgi?id=121943
     5
     6        Reviewed by Eric Carlson.
     7
     8        Add layout tests to MediaStream direct assignment to HTMLMediaElement
     9        using brand new srcObject attribute.
     10
     11        * fast/mediastream/MediaStream-MediaElement-srcObject-expected.txt: Added.
     12        * fast/mediastream/MediaStream-MediaElement-srcObject.html: Added.
     13
    1142013-11-26  Bear Travis  <betravis@adobe.com>
    215
  • trunk/Source/WebCore/CMakeLists.txt

    r159679 r159797  
    190190    Modules/mediastream/AudioStreamTrack.idl
    191191    Modules/mediastream/CapabilityRange.idl
     192    Modules/mediastream/HTMLMediaElementMediaStream.idl
    192193    Modules/mediastream/MediaSourceStates.idl
    193194    Modules/mediastream/MediaStream.idl
     
    830831    Modules/mediastream/AudioStreamTrack.cpp
    831832    Modules/mediastream/CapabilityRange.cpp
     833    Modules/mediastream/HTMLMediaElementMediaStream.cpp
    832834    Modules/mediastream/MediaConstraintsImpl.cpp
    833835    Modules/mediastream/MediaSourceStates.cpp
  • trunk/Source/WebCore/ChangeLog

    r159794 r159797  
     12013-11-26  Nick Diego Yamane  <nick.yamane@openbossa.org>
     2
     3        [MediaStream API] HTMLMediaElement should be able to use MediaStream as source
     4        https://bugs.webkit.org/show_bug.cgi?id=121943
     5
     6        Reviewed by Eric Carlson.
     7
     8        Implement MediaStream direct assignment to Media Elements using the new 'srcObject'
     9        attribute: http://www.w3.org/TR/mediacapture-streams/#direct-assignment-to-media-elements
     10
     11        Test: fast/mediastream/MediaStream-MediaElement-srcObject.html
     12
     13        * CMakeLists.txt: Added new HTMLMediaElementMediaStream.h and .cpp to cmake build.
     14        * DerivedSources.make: Added HTMLMediaElementMediaStream.idl.
     15        * GNUmakefile.list.am: Added new HTMLMediaElementMediaStream* to autotools build.
     16        * WebCore.xcodeproj/project.pbxproj: Added new files.
     17        * Modules/mediastream/HTMLMediaElementMediaStream.cpp: Added.
     18        (WebCore::HTMLMediaElementMediaStream::srcObject): implements srcObject getter.
     19        (WebCore::HTMLMediaElementMediaStream::setSrcObject): implements srcObject setter.
     20        * Modules/mediastream/HTMLMediaElementMediaStream.h: Added.
     21        * Modules/mediastream/HTMLMediaElementMediaStream.idl: Added.
     22        * html/HTMLMediaElement.cpp:
     23        (WebCore::HTMLMediaElement::setSrcObject): This is an initial implementation, and
     24        is still incomplete, that will be addressed in a separate bug: https://webkit.org/b/124896
     25        * html/HTMLMediaElement.h: Added m_mediaStreamSrcObject class variable
     26        and its corresponding getter.
     27
    1282013-11-26  Andreas Kling  <akling@apple.com>
    229
  • trunk/Source/WebCore/DerivedSources.make

    r159473 r159797  
    107107        $(WebCore)/Modules/mediastream/AudioStreamTrack.idl \
    108108    $(WebCore)/Modules/mediastream/CapabilityRange.idl \
     109    $(WebCore)/Modules/mediastream/HTMLMediaElementMediaStream.idl \
    109110    $(WebCore)/Modules/mediastream/MediaSourceStates.idl \
    110111        $(WebCore)/Modules/mediastream/MediaStream.idl \
  • trunk/Source/WebCore/GNUmakefile.list.am

    r159730 r159797  
    356356        DerivedSources/WebCore/JSHTMLMediaElement.cpp \
    357357        DerivedSources/WebCore/JSHTMLMediaElement.h \
     358        DerivedSources/WebCore/JSHTMLMediaElementMediaStream.cpp \
     359        DerivedSources/WebCore/JSHTMLMediaElementMediaStream.h \
    358360        DerivedSources/WebCore/JSHTMLMenuElement.cpp \
    359361        DerivedSources/WebCore/JSHTMLMenuElement.h \
     
    18881890        Source/WebCore/Modules/mediastream/CapabilityRange.cpp \
    18891891        Source/WebCore/Modules/mediastream/CapabilityRange.h \
     1892        Source/WebCore/Modules/mediastream/HTMLMediaElementMediaStream.cpp \
     1893        Source/WebCore/Modules/mediastream/HTMLMediaElementMediaStream.h \
    18901894        Source/WebCore/Modules/mediastream/MediaConstraintsImpl.cpp \
    18911895        Source/WebCore/Modules/mediastream/MediaConstraintsImpl.h \
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r159717 r159797  
    181181                076970871463AD8700F502CF /* TextTrackList.h in Headers */ = {isa = PBXBuildFile; fileRef = 076970851463AD8700F502CF /* TextTrackList.h */; };
    182182                076F0D0E12B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 076F0D0A12B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.h */; };
     183                0779BF0D18453168000B6AE7 /* HTMLMediaElementMediaStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0779BF0A18453168000B6AE7 /* HTMLMediaElementMediaStream.cpp */; };
     184                0779BF0E18453168000B6AE7 /* HTMLMediaElementMediaStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 0779BF0B18453168000B6AE7 /* HTMLMediaElementMediaStream.h */; };
    183185                0783228418013ED800999E0C /* MediaStreamAudioSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0783228218013ED700999E0C /* MediaStreamAudioSource.cpp */; };
    184186                0783228518013ED800999E0C /* MediaStreamAudioSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 0783228318013ED800999E0C /* MediaStreamAudioSource.h */; };
     
    67976799                076F0D0912B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaPlayerPrivateAVFoundation.cpp; sourceTree = "<group>"; };
    67986800                076F0D0A12B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlayerPrivateAVFoundation.h; sourceTree = "<group>"; };
     6801                0779BF0A18453168000B6AE7 /* HTMLMediaElementMediaStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLMediaElementMediaStream.cpp; sourceTree = "<group>"; };
     6802                0779BF0B18453168000B6AE7 /* HTMLMediaElementMediaStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLMediaElementMediaStream.h; sourceTree = "<group>"; };
     6803                0779BF0C18453168000B6AE7 /* HTMLMediaElementMediaStream.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLMediaElementMediaStream.idl; sourceTree = "<group>"; };
    67996804                0783228218013ED700999E0C /* MediaStreamAudioSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamAudioSource.cpp; sourceTree = "<group>"; };
    68006805                0783228318013ED800999E0C /* MediaStreamAudioSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamAudioSource.h; sourceTree = "<group>"; };
     
    1358013585                        isa = PBXGroup;
    1358113586                        children = (
     13587                                0779BF0A18453168000B6AE7 /* HTMLMediaElementMediaStream.cpp */,
     13588                                0779BF0B18453168000B6AE7 /* HTMLMediaElementMediaStream.h */,
     13589                                0779BF0C18453168000B6AE7 /* HTMLMediaElementMediaStream.idl */,
    1358213590                                0705853917FE0770005F2BCB /* MediaTrackConstraint.cpp */,
    1358313591                                0705853717FE044F005F2BCB /* MediaTrackConstraintSet.cpp */,
     
    2281222820                                97B38E27151C4271004622E9 /* DOMWindowNotifications.h in Headers */,
    2281322821                                97D2AD0414B823A60093DF32 /* DOMWindowProperty.h in Headers */,
     22822                                0779BF0E18453168000B6AE7 /* HTMLMediaElementMediaStream.h in Headers */,
    2281422823                                89F60B11157F686E0075E157 /* DOMWindowQuota.h in Headers */,
    2281522824                                AA2A5AD616A4861600975A25 /* DOMWindowSpeechSynthesis.h in Headers */,
     
    2621626225                                C57FEDE11212EE9C0097BE65 /* FileSystem.cpp in Sources */,
    2621726226                                5160306C0CC4362300C8AC25 /* FileSystemCF.cpp in Sources */,
     26227                                0779BF0D18453168000B6AE7 /* HTMLMediaElementMediaStream.cpp in Sources */,
    2621826228                                26C17A3F1491D2D400D12BA2 /* FileSystemIOS.mm in Sources */,
    2621926229                                CD3A495417A9CC9000274E42 /* MediaSourceBase.cpp in Sources */,
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r159789 r159797  
    113113
    114114#if ENABLE(MEDIA_STREAM)
     115#include "MediaStream.h"
    115116#include "MediaStreamRegistry.h"
    116117#endif
     
    321322#endif
    322323    , m_reportedExtraMemoryCost(0)
     324#if ENABLE(MEDIA_STREAM)
     325    , m_mediaStreamSrcObject(nullptr)
     326#endif
    323327{
    324328    LOG(Media, "HTMLMediaElement::HTMLMediaElement");
     
    747751}
    748752
     753#if ENABLE(MEDIA_STREAM)
     754void HTMLMediaElement::setSrcObject(MediaStream* mediaStream)
     755{
     756    // FIXME: Setting the srcObject attribute may cause other changes to the media element's internal state:
     757    // Specifically, if srcObject is specified, the UA must use it as the source of media, even if the src
     758    // attribute is also set or children are present. If the value of srcObject is replaced or set to null
     759    // the UA must re-run the media element load algorithm.
     760    //
     761    // https://bugs.webkit.org/show_bug.cgi?id=124896
     762
     763    m_mediaStreamSrcObject = mediaStream;
     764}
     765#endif
     766
    749767HTMLMediaElement::NetworkState HTMLMediaElement::networkState() const
    750768{
  • trunk/Source/WebCore/html/HTMLMediaElement.h

    r159363 r159797  
    4949#endif
    5050
    51 
     51#if ENABLE(MEDIA_STREAM)
     52#include "MediaStream.h"
     53#endif
    5254
    5355namespace WebCore {
     
    140142    PassRefPtr<MediaError> error() const;
    141143
    142 // network state
    143144    void setSrc(const String&);
    144145    const URL& currentSrc() const { return m_currentSrc; }
    145146
     147#if ENABLE(MEDIA_STREAM)
     148    MediaStream* srcObject() const { return m_mediaStreamSrcObject.get(); }
     149    void setSrcObject(MediaStream*);
     150#endif
     151
     152// network state
    146153    enum NetworkState { NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, NETWORK_NO_SOURCE };
    147154    NetworkState networkState() const;
     
    798805    RefPtr<DOMWrapperWorld> m_isolatedWorld;
    799806#endif
     807
     808#if ENABLE(MEDIA_STREAM)
     809    RefPtr<MediaStream> m_mediaStreamSrcObject;
     810#endif
    800811};
    801812
  • trunk/Source/WebKit2/CMakeLists.txt

    r159509 r159797  
    6565    "${WEBCORE_DIR}"
    6666    "${WEBCORE_DIR}/Modules/battery"
     67    "${WEBCORE_DIR}/Modules/mediastream"
    6768    "${WEBCORE_DIR}/Modules/networkinfo"
    6869    "${WEBCORE_DIR}/Modules/notifications"
     
    101102    "${WEBCORE_DIR}/platform/graphics/texmap"
    102103    "${WEBCORE_DIR}/platform/graphics/transforms"
     104    "${WEBCORE_DIR}/platform/mediastream"
    103105    "${WEBCORE_DIR}/platform/network"
    104106    "${WEBCORE_DIR}/platform/sql"
  • trunk/Source/WebKit2/ChangeLog

    r159788 r159797  
     12013-11-26  Nick Diego Yamane  <nick.yamane@openbossa.org>
     2
     3        [MediaStream API] HTMLMediaElement should be able to use MediaStream as source
     4        https://bugs.webkit.org/show_bug.cgi?id=121943
     5
     6        Reviewed by Eric Carlson.
     7
     8        Add mediastream module and platform to cmake include directories.
     9
     10        * CMakeLists.txt:
     11
    1122013-11-26  Dan Bernstein  <mitz@apple.com>
    213
Note: See TracChangeset for help on using the changeset viewer.