Changeset 232796 in webkit


Ignore:
Timestamp:
Jun 13, 2018 11:22:40 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

[WPE] Build getUserMedia support
https://bugs.webkit.org/show_bug.cgi?id=186547

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-06-13
Reviewed by Alejandro G. Castro.

.:

  • Source/cmake/OptionsWPE.cmake: Build MediaStream support

Source/WebCore:

Enable mediastream tests.

  • PlatformWPE.cmake: Build MediaStream support.
  • SourcesGTK.txt: Moved GStreamer related files to GStreamer.cmake.
  • SourcesWPE.txt: Removed platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp

which is now in GStreamer.cmake.

  • platform/GStreamer.cmake: Build more MediaStream/webrtc related files.
  • platform/graphics/ImageBuffer.cpp: Handle the fact that toBGRAData is

now built directly into the Cairo backend and not GTK anymore.

  • platform/graphics/cairo/ImageBufferCairo.cpp: Implement toBGRAData
  • platform/graphics/gtk/ImageBufferGtk.cpp: Removed toBGRAData as it is

now implemented in the Cairo backend itself.

  • platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: Switch an

ASSERT to RELEASE_ASSERT when adding the GhostPad to itself. This was making
test fail when built in RELEASE mode.
(WebCore::webkitMediaStreamSrcChain): Minor variable name change to make it
more accurate.
(WebCore::webkitMediaStreamSrcAddPad): Now add the ghost pad to the element
before setting its chain function, making things clearer.
(WebCore::webkitMediaStreamSrcSetupSrc): Remove extra new line.

Source/WebKit:

  • SourcesWPE.txt: Compile files necessary for MediaStream/webrtc.

LayoutTests:

  • platform/gtk/TestExpectations: Mark some tests as potentially passing (they fail only

when built in debug mode).

  • platform/wpe/TestExpectations: Enable MediaStream tests.
Location:
trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r232749 r232796  
     12018-06-13  Thibault Saunier  <tsaunier@igalia.com>
     2
     3        [WPE] Build getUserMedia support
     4        https://bugs.webkit.org/show_bug.cgi?id=186547
     5
     6        Reviewed by Alejandro G. Castro.
     7
     8        * Source/cmake/OptionsWPE.cmake: Build MediaStream support
     9
    1102018-06-12  Philippe Normand  <pnormand@igalia.com>
    211
  • trunk/LayoutTests/ChangeLog

    r232793 r232796  
     12018-06-13  Thibault Saunier  <tsaunier@igalia.com>
     2
     3        [WPE] Build getUserMedia support
     4        https://bugs.webkit.org/show_bug.cgi?id=186547
     5
     6        Reviewed by Alejandro G. Castro.
     7
     8        * platform/gtk/TestExpectations: Mark some tests as potentially passing (they fail only
     9        when built in debug mode).
     10        * platform/wpe/TestExpectations: Enable MediaStream tests.
     11
    1122018-06-13  Ms2ger  <Ms2ger@igalia.com>
    213
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r232793 r232796  
    582582webkit.org/b/79203 fast/mediastream/RTCPeerConnection-dtmf.html [ Timeout ]
    583583webkit.org/b/79203 fast/mediastream/RTCPeerConnection-icecandidate-event.html [ Failure Crash ]
    584 webkit.org/b/79203 fast/mediastream/RTCPeerConnection-media-setup-two-dialogs.html [ Failure Crash ]
     584webkit.org/b/79203 fast/mediastream/RTCPeerConnection-media-setup-two-dialogs.html [ Pass Failure Crash ]
    585585webkit.org/b/79203 fast/mediastream/RTCRtpSender-replaceTrack.html [ Failure ]
    586586# Crash is webkit.org/b/184292
     
    592592webkit.org/b/79203 fast/mediastream/RTCPeerConnection-inspect-offer.html [ Failure ]
    593593webkit.org/b/79203 fast/mediastream/RTCPeerConnection-legacy-stream-based-api.html [ Failure ]
    594 webkit.org/b/79203 fast/mediastream/RTCPeerConnection-media-setup-callbacks-single-dialog.html [ Crash Failure ]
     594webkit.org/b/79203 fast/mediastream/RTCPeerConnection-media-setup-callbacks-single-dialog.html [ Pass Crash Failure ]
    595595webkit.org/b/79203 webaudio/mediastreamaudiosourcenode.html [ Failure ]
    596596webkit.org/b/79203 fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html [ Timeout Failure ]
     
    605605webkit.org/b/172269 fast/mediastream/media-devices-enumerate-devices.html [ Failure ]
    606606webkit.org/b/173257 fast/mediastream/getUserMedia-grant-persistency3.html [ Pass Failure ]
     607webkit.org/b/176801 fast/mediastream/argument-types.html [ Crash Pass ]
    607608
    608609# Canvas captureStream support is not implemented
     
    12411242
    12421243webkit.org/b/175575 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/ready-states/autoplay-with-slow-text-tracks.html [ Crash Pass ]
    1243 
    1244 webkit.org/b/176801 fast/mediastream/argument-types.html [ Crash Pass ]
    12451244
    12461245webkit.org/b/176803 http/tests/local/blob/send-hybrid-blob-using-open-panel.html [ Crash ]
  • trunk/LayoutTests/platform/wpe/TestExpectations

    r232464 r232796  
    1515Bug(WPE) webaudio/ [ Skip ]
    1616Bug(WPE) webrtc [ Skip ]
     17
     18# The MediaStream implementation is still not completed
     19webkit.org/b/79203 fast/mediastream/mock-media-source-webaudio.html [ Timeout ]
     20webkit.org/b/79203 fast/mediastream/getUserMedia-webaudio.html [ Failure ]
     21webkit.org/b/79203 fast/mediastream/MediaStream-video-element-track-stop.html [ Timeout ]
     22webkit.org/b/79203 fast/mediastream/RTCPeerConnection-dtmf.html [ Timeout ]
     23webkit.org/b/79203 fast/mediastream/RTCPeerConnection-icecandidate-event.html [ Pass Failure Crash ]
     24webkit.org/b/79203 fast/mediastream/RTCPeerConnection-media-setup-two-dialogs.html [ Pass Failure Crash ]
     25webkit.org/b/79203 fast/mediastream/RTCRtpSender-replaceTrack.html [ Failure ]
     26# Crash is webkit.org/b/184292
     27webkit.org/b/79203 fast/mediastream/RTCPeerConnection-addIceCandidate.html [ Failure Pass Crash ]
     28webkit.org/b/79203 fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event.html [ Failure Timeout ]
     29webkit.org/b/79203 fast/mediastream/RTCPeerConnection-ice.html [ Failure Timeout ]
     30webkit.org/b/79203 fast/mediastream/RTCPeerConnection-inspect-answer.html [ Pass Failure ]
     31webkit.org/b/79203 fast/mediastream/RTCPeerConnection-inspect-offer-bundlePolicy-bundle-only.html [ Failure ]
     32webkit.org/b/79203 fast/mediastream/RTCPeerConnection-inspect-offer.html [ Pass Failure ]
     33webkit.org/b/79203 fast/mediastream/RTCPeerConnection-legacy-stream-based-api.html [ Pass Failure ]
     34webkit.org/b/79203 fast/mediastream/RTCPeerConnection-media-setup-callbacks-single-dialog.html [ Pass Crash Failure ]
     35webkit.org/b/79203 webaudio/mediastreamaudiosourcenode.html [ Failure ]
     36webkit.org/b/79203 fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html [ Timeout Failure ]
     37webkit.org/b/79203 fast/mediastream/MediaStream-video-element-displays-buffer.html [ Failure ]
     38webkit.org/b/79203 http/tests/media/media-stream/getusermedia-with-canvas.html [ Crash ]
     39webkit.org/b/79203 fast/mediastream/RTCPeerConnection-stats.html [ Timeout ]
     40webkit.org/b/79203 imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-MediaElement-preload-none.https.html [ Failure ]
     41webkit.org/b/79203 imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-end-manual.https.html [ Failure ]
     42webkit.org/b/151344 fast/mediastream/MediaStream-add-ended-tracks.html [ Timeout ]
     43# Crash is bug #176801
     44webkit.org/b/160996 fast/mediastream/MediaStream-video-element-video-tracks-disabled.html [ ImageOnlyFailure Crash ]
     45webkit.org/b/172269 fast/mediastream/media-devices-enumerate-devices.html [ Failure ]
     46webkit.org/b/173257 fast/mediastream/getUserMedia-grant-persistency3.html [ Pass Failure ]
     47
     48# Canvas captureStream support is not implemented
     49webkit.org/b/169811 fast/mediacapturefromelement [ Skip ]
     50webkit.org/b/169811 fast/mediastream/captureStream/ [ Failure ]
     51webkit.org/b/169811 fast/mediastream/captureStream/canvas2d.html [ Crash Timeout ]
     52webkit.org/b/169811 fast/mediastream/captureStream/canvas3d.html [ Crash Timeout ]
     53
    1754
    1855# Doesn't apply to platforms that don't enforce the CFNetwork-style 3rd party cookie policy.
     
    423460Bug(WPE) fast/media [ Skip ]
    424461Bug(WPE) fast/mediacapturefromelement [ Skip ]
    425 Bug(WPE) fast/mediastream [ Skip ]
    426462Bug(WPE) fast/multicol [ Skip ]
    427463Bug(WPE) fast/overflow [ Skip ]
  • trunk/Source/WebCore/ChangeLog

    r232795 r232796  
     12018-06-13  Thibault Saunier  <tsaunier@igalia.com>
     2
     3        [WPE] Build getUserMedia support
     4        https://bugs.webkit.org/show_bug.cgi?id=186547
     5
     6        Reviewed by Alejandro G. Castro.
     7
     8        Enable mediastream tests.
     9
     10        * PlatformWPE.cmake: Build MediaStream support.
     11        * SourcesGTK.txt: Moved GStreamer related files to GStreamer.cmake.
     12        * SourcesWPE.txt: Removed `platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp`
     13        which is now in GStreamer.cmake.
     14        * platform/GStreamer.cmake: Build more MediaStream/webrtc related files.
     15        * platform/graphics/ImageBuffer.cpp: Handle the fact that toBGRAData is
     16        now built directly into the Cairo backend and not GTK anymore.
     17        * platform/graphics/cairo/ImageBufferCairo.cpp: Implement `toBGRAData`
     18        * platform/graphics/gtk/ImageBufferGtk.cpp: Removed `toBGRAData` as it is
     19        now implemented in the Cairo backend itself.
     20        * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: Switch an
     21        ASSERT to RELEASE_ASSERT when adding the GhostPad to itself. This was making
     22        test fail when built in RELEASE mode.
     23        (WebCore::webkitMediaStreamSrcChain): Minor variable name change to make it
     24        more accurate.
     25        (WebCore::webkitMediaStreamSrcAddPad): Now add the ghost pad to the element
     26        before setting its chain function, making things clearer.
     27        (WebCore::webkitMediaStreamSrcSetupSrc): Remove extra new line.
     28
    1292018-06-13  Philippe Normand  <pnormand@igalia.com>
    230
  • trunk/Source/WebCore/PlatformWPE.cmake

    r228451 r232796  
    2828    "${WEBCORE_DIR}/platform/graphics/wayland"
    2929    "${WEBCORE_DIR}/platform/mock/mediasource"
     30    "${WEBCORE_DIR}/platform/mediastream/gstreamer"
    3031    "${WEBCORE_DIR}/platform/network/soup"
    3132    "${WEBCORE_DIR}/platform/text/icu"
  • trunk/Source/WebCore/SourcesGTK.txt

    r231043 r232796  
    9393platform/gtk/SelectionData.cpp
    9494
    95 platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp
    96 platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp
    97 platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp
    98 platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp
    99 
    100 platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp
    101 platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp
    102 
    10395platform/text/Hyphenation.cpp
    10496platform/text/LocaleICU.cpp
  • trunk/Source/WebCore/SourcesWPE.txt

    r231043 r232796  
    6565platform/graphics/wpe/PlatformDisplayWPE.cpp
    6666
    67 platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp
    68 
    6967platform/text/Hyphenation.cpp
    7068platform/text/LocaleICU.cpp
  • trunk/Source/WebCore/platform/GStreamer.cmake

    r232749 r232796  
    3434        platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp
    3535
     36        platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp
     37        platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp
     38
    3639        platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp
    3740        platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp
     
    4346        platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp
    4447        platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp
     48        platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp
     49        platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp
    4550        platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp
     51        platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp
     52        platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp
    4653    )
    4754
  • trunk/Source/WebCore/platform/graphics/ImageBuffer.cpp

    r232535 r232796  
    103103}
    104104
    105 #if !USE(CG) && !PLATFORM(GTK)
     105#if !USE(CG) && !USE(CAIRO)
    106106Vector<uint8_t> ImageBuffer::toBGRAData() const
    107107{
  • trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp

    r232618 r232796  
    205205#endif
    206206
     207static RefPtr<cairo_surface_t>
     208cairoSurfaceCoerceToImage(cairo_surface_t* surface)
     209{
     210    if (cairo_surface_get_type(surface) == CAIRO_SURFACE_TYPE_IMAGE
     211        && cairo_surface_get_content(surface) == CAIRO_CONTENT_COLOR_ALPHA)
     212        return surface;
     213
     214    auto copy = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
     215        cairo_image_surface_get_width(surface),
     216        cairo_image_surface_get_height(surface)));
     217
     218    auto cr = adoptRef(cairo_create(copy.get()));
     219    cairo_set_operator(cr.get(), CAIRO_OPERATOR_SOURCE);
     220    cairo_set_source_surface(cr.get(), surface, 0, 0);
     221    cairo_paint(cr.get());
     222
     223    return copy;
     224}
     225
     226Vector<uint8_t> ImageBuffer::toBGRAData() const
     227{
     228    auto surface = cairoSurfaceCoerceToImage(m_data.m_surface.get());
     229    cairo_surface_flush(surface.get());
     230
     231    Vector<uint8_t> imageData;
     232    if (cairo_surface_status(surface.get()))
     233        return imageData;
     234
     235    auto pixels = cairo_image_surface_get_data(surface.get());
     236    imageData.append(pixels, cairo_image_surface_get_stride(surface.get()) *
     237        cairo_image_surface_get_height(surface.get()));
     238
     239    return imageData;
     240}
     241
    207242ImageBuffer::ImageBuffer(const FloatSize& size, float resolutionScale, ColorSpace, RenderingMode renderingMode, const HostWindow*, bool& success)
    208243    : m_data(IntSize(size), renderingMode)
  • trunk/Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp

    r231638 r232796  
    8888}
    8989
    90 Vector<uint8_t> ImageBuffer::toBGRAData() const
    91 {
    92     auto pixbuf = adoptGRef(cairoSurfaceToGdkPixbuf(m_data.m_surface.get()));
    93     auto pixels = gdk_pixbuf_get_pixels(pixbuf.get());
    94 
    95     Vector<uint8_t> imageData;
    96     imageData.append(pixels, gdk_pixbuf_get_byte_length(pixbuf.get()));
    97     return imageData;
    98 }
    99 
    10090Vector<uint8_t> ImageBuffer::toData(const String& mimeType, std::optional<double> quality) const
    10191{
  • trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp

    r232589 r232796  
    329329} ProbeData;
    330330
    331 static GstFlowReturn webkitMediaStreamSrcChain(GstPad* pad, GstObject* object, GstBuffer* buffer)
     331static GstFlowReturn webkitMediaStreamSrcChain(GstPad* pad, GstObject* parent, GstBuffer* buffer)
    332332{
    333333    GstFlowReturn result;
    334     GRefPtr<WebKitMediaStreamSrc> self = adoptGRef(WEBKIT_MEDIA_STREAM_SRC(gst_object_get_parent(object)));
     334    GRefPtr<WebKitMediaStreamSrc> self = adoptGRef(WEBKIT_MEDIA_STREAM_SRC(gst_object_get_parent(parent)));
    335335
    336336    result = gst_flow_combiner_update_pad_flow(self.get()->flowCombiner, pad,
     
    351351
    352352    auto proxypad = adoptGRef(GST_PAD(gst_proxy_pad_get_internal(GST_PROXY_PAD(ghostpad))));
     353    gst_pad_set_active(ghostpad, TRUE);
     354    if (!gst_element_add_pad(GST_ELEMENT(self), GST_PAD(ghostpad))) {
     355        GST_ERROR_OBJECT(self, "Could not add pad %s:%s", GST_DEBUG_PAD_NAME(ghostpad));
     356        ASSERT_NOT_REACHED();
     357
     358        return;
     359    }
     360
    353361    gst_pad_set_chain_function(proxypad.get(),
    354362        static_cast<GstPadChainFunction>(webkitMediaStreamSrcChain));
    355     gst_pad_set_active(ghostpad, TRUE);
    356     ASSERT(gst_element_add_pad(GST_ELEMENT(self), GST_PAD(ghostpad)));
    357363}
    358364
     
    399405
    400406    gst_bin_add(GST_BIN(self), element);
    401 
    402407
    403408    ProbeData* data = new ProbeData;
  • trunk/Source/WebKit/ChangeLog

    r232794 r232796  
     12018-06-13  Thibault Saunier  <tsaunier@igalia.com>
     2
     3        [WPE] Build getUserMedia support
     4        https://bugs.webkit.org/show_bug.cgi?id=186547
     5
     6        Reviewed by Alejandro G. Castro.
     7
     8        * SourcesWPE.txt: Compile files necessary for MediaStream/webrtc.
     9
    1102018-06-13  Andy Estes  <aestes@apple.com>
    211
  • trunk/Source/WebKit/SourcesWPE.txt

    r230429 r232796  
    3737NetworkProcess/soup/NetworkSessionSoup.cpp
    3838NetworkProcess/soup/RemoteNetworkingContextSoup.cpp
     39
     40NetworkProcess/webrtc/LibWebRTCSocketClient.cpp
     41NetworkProcess/webrtc/NetworkRTCMonitor.cpp
     42NetworkProcess/webrtc/NetworkRTCProvider.cpp
     43NetworkProcess/webrtc/NetworkRTCSocket.cpp
    3944
    4045Platform/IPC/glib/GSocketMonitor.cpp
  • trunk/Source/cmake/OptionsWPE.cmake

    r232670 r232796  
    4141WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_TOUCH_EVENTS PRIVATE ON)
    4242WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBGL2 PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
     43WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_STREAM PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
     44WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_RTC PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
    4345
    4446# Public options specific to the WPE port. Do not add any options here unless
     
    4951# Private options specific to the WPE port.
    5052WEBKIT_OPTION_DEFINE(USE_OPENVR "Whether to use OpenVR as WebVR backend." PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
     53WEBKIT_OPTION_DEFINE(USE_LIBWEBRTC "Whether to use libwebrtc for WebRTC support" PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
     54
     55WEBKIT_OPTION_DEPEND(USE_LIBWEBRTC ENABLE_WEB_RTC)
    5156
    5257if (CMAKE_SYSTEM_NAME MATCHES "Linux")
     
    111116endif ()
    112117
     118if (ENABLE_MEDIA_STREAM OR ENABLE_WEB_RTC)
     119    set(USE_LIBWEBRTC TRUE)
     120    SET_AND_EXPOSE_TO_BUILD(USE_LIBWEBRTC TRUE)
     121    SET_AND_EXPOSE_TO_BUILD(WEBRTC_WEBKIT_BUILD TRUE)
     122endif ()
     123
    113124add_definitions(-DBUILDING_WPE__=1)
    114125add_definitions(-DGETTEXT_PACKAGE="WPE")
  • trunk/Tools/wpe/install-dependencies

    r230949 r232796  
    140140    # These are dependencies necessary for building WPE.
    141141    packages=" \
     142        alsa-lib \
    142143        autoconf \
    143144        automake \
     
    238239        autoconf \
    239240        automake \
     241        alsa-lib-devel \
    240242        bison \
    241243        cmake \
Note: See TracChangeset for help on using the changeset viewer.