Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport upstream WebRTC patches to the wpe-2.22 #568

Closed

Conversation

thiblahute and others added 30 commits January 23, 2019 12:41
Making sure neon files are built as required
https://bugs.webkit.org/show_bug.cgi?id=192226

Patch by Thibault Saunier <[email protected]> on 2018-12-01
Reviewed by Philippe Normand.

Somehow that was overlooked at some point (it used to work).

* CMakeLists.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@238780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
… always synced with enable-media-stream

https://bugs.webkit.org/show_bug.cgi?id=188704

By default m_isMediaDevicesEnabled and m_isScreenCaptureEnabled are false but
m_isMediaStreamEnabled is true meaning that in the WPE minibrowser getUserMedia
was disabled even if we explicitly set `"enable-media-stream", TRUE`.

Patch by Thibault Saunier <[email protected]> on 2018-09-20
Reviewed by Michael Catanzaro.

* UIProcess/API/glib/WebKitSettings.cpp:
(webKitSettingsConstructed):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@236279 268f45cc-cd09-0410-ab3c-d52691b4dbfc
… always synced with enable-media-stream

https://bugs.webkit.org/show_bug.cgi?id=188704

By default m_isMediaDevicesEnabled and m_isScreenCaptureEnabled are false but
m_isMediaStreamEnabled is true meaning that in the WPE minibrowser getUserMedia
was disabled even if we explicitly set `"enable-media-stream", TRUE`.

Patch by Thibault Saunier <[email protected]> on 2018-09-20
Reviewed by Michael Catanzaro.

* UIProcess/API/glib/WebKitSettings.cpp:
(webKitSettingsConstructed):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@236279 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=189828

Reviewed by Alejandro G. Castro.

The rest of the code allows it, but there was an unecessary assert

See Bug 187302

* Source/webrtc/p2p/base/tcpport.cc:
https://bugs.webkit.org/show_bug.cgi?id=189800

This is just a test tool and we should make
it just work, security and privacy is not really
a primary focus here.

Patch by Thibault Saunier <[email protected]> on 2018-09-22
Reviewed by Žan Doberšek.

* MiniBrowser/wpe/main.cpp:
(decidePermissionRequest):
(main):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@236385 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=189835

Patch by Thibault Saunier <[email protected]> on 2018-09-24
Reviewed by Philippe Normand.

- Rework memory management to avoid leaking encoded frames (basically use the same
  strategy as other libwebrtc encoder implementation).
- Plug a GstCaps leak.

* platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp:
* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::InitEncode):
(WebCore::GStreamerVideoEncoder::newSampleCallback):
(WebCore::GStreamerVideoEncoder::Fragmentize):
(WebCore::GStreamerVideoEncoder::SetRestrictionCaps):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@236397 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=189921

Previous leak fixing commit introduced a regression in
the way the encoded buffer were prepared in the default
GStreamerVideoEncoder::Fragmentize implementation (when
encoding with VP8 basically).

+ Fix a build warning in the decoder.
+ Fix some wrong object members namings.
+ Properly move the caps reference when setting restriction caps.
+ Do not raise a GStreamer error when GStreamerVideoEncoder::OnEncodedImage
  fails - this might be a network issue and other encoders do not consider that
  fatal.
+ Use GstMappedBuffer where appropriate.

Patch by Thibault Saunier <[email protected]> on 2018-09-25
Reviewed by Philippe Normand.

* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::InitEncode):
(WebCore::GStreamerVideoEncoder::newSampleCallback):
(WebCore::GStreamerVideoEncoder::Fragmentize):
(WebCore::GStreamerVideoEncoder::SetRestrictionCaps):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@236466 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…o bridging

https://bugs.webkit.org/show_bug.cgi?id=189829

Patch by Thibault Saunier <[email protected]> on 2018-10-02
Reviewed by Alejandro G. Castro.

* platform/gtk/TestExpectations:
* platform/wpe/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@236725 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=185761

Patch by Alejandro G. Castro <[email protected]> on 2018-10-11
Reviewed by Youenn Fablet.

Source/WebCore:

We are adopting the same policy COCOA is using when returning the
list of media devices if the user does not have persistent
access. Namely, we just return the first media device for audio
and video capture.

* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::filterDeviceList): Add support for
other platforms when filtering devices if there is no persistent
access to the origin.

Source/WebKit:

Implemented the enumerateDevices API using a new WebKit class
(DeviceIdHashSaltStorage) that generates and stores the device ids
hash salts per origin, used to avoid fingerprinting in the
webpages.

The patch also adds a new type of data for the WebsiteDataStore.
That way the users can call the WebsiteDataStore to show what
origins have hash salt generated and remove them at some point.

For the moment just GTK+ and WPE ports are using this class to
generate the hash salts. The patch adds code to the
checkUserMediaPermissionForOrigin API implementation, it was empty
until now for these ports. In this function we create an instance
of a new class WebKitDeviceInfoPermissionRequest that implements
the WebKitPermissionRequestIface interface, that allows the ports
to use the current permission managers implemented in the
embedders to handle this new kind of request the way they like
it. The default implementation is deny.

The class WebKitDeviceInfoPermissionRequest takes care of
contacting the DeviceIdHashSaltStorage and request/regenerate the
hash salts accordingly.

Persistency is still not implemented, we will add it in a
future patch.

* Shared/WebsiteData/WebsiteDataType.h: Added the new type of
webside data: DeviceIdHashSalt.
* Sources.txt: Added new files to compilation.
* SourcesGTK.txt: Ditto.
* SourcesWPE.txt: Ditto.
* UIProcess/API/glib/WebKitDeviceInfoPermissionRequest.cpp: Added
this class to represent a request of permission to access the
devices information. This is specific for glib ports and implements
the policies regarding the hash salts when the embedder allows or
denies the access using the DeviceIdHashSaltStorage class.
(webkitDeviceInfoPermissionRequestAllow): Get the device hash salt
when the origin is allowed and set it in the original request.
(webkitDeviceInfoPermissionRequestDeny): Regenerate the device id
hash salt when the user does not allow to access the device information.
(webkit_permission_request_interface_init):
(webkitDeviceInfoPermissionRequestDispose):
(webkit_device_info_permission_request_class_init):
(webkitDeviceInfoPermissionRequestCreate): Create the class using
the proxy request from the webprocess and a reference to the
DeviceIdHashSaltStorage.
* UIProcess/API/glib/WebKitDeviceInfoPermissionRequestPrivate.h:
Ditto.
* UIProcess/API/glib/WebKitUIClient.cpp: Added the implementation
for the checkUserMediaPermissionForOrigin API for the glib ports,
it creates the device info request and calls the permission
request API.
* UIProcess/API/glib/WebKitWebsiteData.cpp:
(recordContainsSupportedDataTypes): Added the DeviceIdHashSalt
type.
(toWebKitWebsiteDataTypes): Added the conversion from the WebKit
types to the glib types for the WebsiteDataType::DeviceIdHashSalt.
* UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
(toWebsiteDataTypes): Added the conversion from the glib type
WEBKIT_WEBSITE_DATA_DEVICE_ID_HASH_SALT to the WebKit type.
(webkit_website_data_manager_remove): Make sure we remote the
DeviceIdHashSalt if the Cookies are selected.
* UIProcess/API/gtk/WebKitDeviceInfoPermissionRequest.h: Added
this new class that represents a permission request for the device
information in the GTK+ port.
* UIProcess/API/gtk/WebKitWebsiteData.h: Added the new type of
website that in the GTK+ port:
WEBKIT_WEBSITE_DATA_DEVICE_ID_HASH_SALT.
* UIProcess/API/wpe/WebKitDeviceInfoPermissionRequest.h: Added
this new class that represents a permission request for the device
information in the WPE port.
* UIProcess/API/wpe/WebKitWebsiteData.h: Added the new type of
website that in the WPE port:
WEBKIT_WEBSITE_DATA_DEVICE_ID_HASH_SALT.
* UIProcess/DeviceIdHashSaltStorage.cpp: Added this new class that
handles how to generate and store the hash salts inside
WebKit. Persistency is still not implemented, we will add it in a
future patch.
(WebKit::DeviceIdHashSaltStorage::create):
(WebKit::DeviceIdHashSaltStorage::deviceIdentifierHashSaltForOrigin):
Check the map to get the hash salt for an origin, if there is none
create a new random one.
(WebKit::DeviceIdHashSaltStorage::regenerateDeviceIdentifierHashSaltForOrigin):
Delete the hash salt of an origin if it already exists and create a new one.
(WebKit::DeviceIdHashSaltStorage::getDeviceIdHashSaltOrigins):
Returns the list of origins that have a hash salt generated for
them. It is used in the WebsiteDataStore.
(WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltForOrigins):
Deletes the hash salts in the map for an origin.
(WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltOriginsModifiedSince):
Delete the origins that have not been modified since a time.
* UIProcess/DeviceIdHashSaltStorage.h: Ditto.
* UIProcess/UserMediaPermissionCheckProxy.h: Remove uneeded class
definition.
* UIProcess/WebsiteData/WebsiteDataStore.cpp: Added support to
return and remove the origins with a generate hash salt used to
generate the device ids.
(WebKit::WebsiteDataStore::WebsiteDataStore): Added the new
reference to the DeviceIdHashSaltStorage class, used to handle the
hash salts.
(WebKit::WebsiteDataStore::fetchDataAndApply): Get the list of
origins with a hash salts in the DeviceIdHashSaltStorage.
(WebKit::WebsiteDataStore::removeData): Remove the hash salts in
DeviceIdHashSaltStorage for an origin.
* UIProcess/WebsiteData/WebsiteDataStore.h: Ditto.
(WebKit::WebsiteDataStore::deviceIdHashSaltStorage):
* WebKit.xcodeproj/project.pbxproj: Added the
DeviceIdHashSaltStorage to the compilation.

Tools:

Added new API test for the mediaDevices.enumerateDevices:
usermedia-enumeratedevices-permission-check. And a new API test
for the WebsiteDataStore: testWebsiteDataDeviceIdHashSalt.

* MiniBrowser/gtk/main.c:
(gotWebsiteDataCallback): Added a new section to the about:data
webpage to include the information about the hash salt.
* TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp:
(testWebViewUserMediaEnumerateDevicesPermissionCheck): Added the
new test checking the enumerateDevices API when permission is
denied and when permission is allowed for the origin.
(beforeAll): Defined the new test.
* TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp:
(serverCallback): Register a new URI for the enumerateDevices.
(testWebsiteDataConfiguration): Remove the hash salts from the
directories.
(testWebsiteDataDeviceIdHashSalt): New test cheking the
enumerateDevices API.
(beforeAll): Added the new test testWebsiteDataDeviceIdHashSalt to
the init structure.
* TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp:
(WebViewTest::initializeWebView): Make sure the media-stream is
activated in the webView.

LayoutTests:

Remove the failure expectation for the test
media-devices-enumerate-devices.html. Just for the record we have
also checked the following tests.

fast/mediastream/media-devices-enumerate-devices.html
fast/mediastream/resources/enumerate-devices-frame.html
http/tests/media/media-stream/enumerate-devices-source-id.html
http/tests/media/media-stream/enumerate-devices-source-id-persistent.html
http/tests/media/media-stream/resources/enumerate-devices-source-id-frame.html

* platform/gtk/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@237031 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=190470

The GStreamerVideoDecoder.m_dtsPtsMap filed is accessed from
the main thread and some GStreamer streaming thread, make sure
to protect its access.

And use WTF::StdMap instead of std::map.

Patch by Thibault Saunier <[email protected]> on 2018-10-11
Reviewed by Philippe Normand.

Manually tested and a random crash is gone.

* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
(WebCore::GStreamerVideoDecoder::newSampleCallback):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@237036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=190573

Patch by Alejandro G. Castro <[email protected]> on 2018-10-16
Reviewed by Philippe Normand.

We found some situations where gstreamer gets confused when it
tries to use opus because it finds opus symbols compiled for
liwebrtc. We are going to try the option to use the system opus
library also for libwebrtc.

* CMakeLists.txt: Added opus dependency.
* cmake/FindOpus.cmake: Added the hints to find the opus library
in the compilation.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@237174 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=190677

The approach here is basically to let libwebrtc do all the
synchronisation for us, and the same way as it is done in apple ports,
we basically try to display what libwebrtc outputs as fast as possible.

Patch by Thibault Saunier <[email protected]> on 2018-11-05
Reviewed by Philippe Normand.

Manually tested

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::setSyncOnSink):
(WebCore::MediaPlayerPrivateGStreamer::syncOnClock):
(WebCore::MediaPlayerPrivateGStreamer::loadFull):
(WebCore::MediaPlayerPrivateGStreamer::load):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@237799 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=190676

Patch by Thibault Saunier <[email protected]> on 2018-11-05
Reviewed by Philippe Normand.

Avoiding to have h264parse make assumption (which might be wrong at some
point).

* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
(WebCore::GStreamerVideoDecoder::GetCapsForFrame):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@237800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
… way we set encoders

https://bugs.webkit.org/show_bug.cgi?id=190674

Patch by Thibault Saunier <[email protected]> on 2018-11-05
Reviewed by Philippe Normand.

webrtcencoder is a simple GstBin with a set of well known GStreamer encoders which
it can use to implement encoding for different formats exposing a trimmed down unified API.

It also adds proper handling of H264 profiles.

The added files follow GStreamer coding style as we aim at upstreaming the element
in the future.

Source/WebCore:

This is a refactoring so current tests already cover it.

* platform/GStreamer.cmake:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements):
* platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp: Added.
(gst_webrtc_video_encoder_get_property):
(gst_webrtc_video_encoder_set_bitrate):
(gst_webrtc_video_encoder_set_format):
(gst_webrtc_video_encoder_set_property):
(register_known_encoder):
(setup_x264enc):
(setup_vp8enc):
(setup_openh264enc):
(set_bitrate_kbit_per_sec):
(set_bitrate_bit_per_sec):
(gst_webrtc_video_encoder_class_init):
(gst_webrtc_video_encoder_init):
* platform/mediastream/libwebrtc/GStreamerVideoEncoder.h: Added.
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
(WebCore::GStreamerVideoEncoder::InitEncode):
(WebCore::GStreamerVideoEncoder::createEncoder):
(WebCore::GStreamerVideoEncoder::AddCodecIfSupported):
(WebCore::GStreamerVideoEncoder::ImplementationName const):
(WebCore::GStreamerVideoEncoder::SetRestrictionCaps):

Tools:

Reviewed by Philippe Normand.

* Scripts/webkitpy/style/checker.py:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@237801 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=190035

Patch by Thibault Saunier <[email protected]> on 2018-11-05
Reviewed by Philippe Normand.

We can't rely on GStreamer timestamps to pass to EncodedImages after encoding
because libWebRTC doesn't use the timestamp we fed it but does
some computation on the input timestamp in the images we pass in before it passes
them back to the encoder. Then internally LibWebRTC relies on those exact timestamps
passed into the encoder to do checks and compute RTP timestamps so we need to carefully
pass the exact timestamps to LibWebRTC (in practice we still use GStreamer timestamps in
all the GStreamer processing pipelines as the WebRTC object basically wraps the "same"
`GstSample` all around, but we are not synced on the clock anyway).

* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
* platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp:
(WebCore::LibWebRTCVideoFrameFromGStreamerSample):
* platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.h:
* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
(WebCore::GStreamerVideoDecoder::newSampleCallback):
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
(WebCore::GStreamerVideoEncoder::newSampleCallback):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@237819 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…encoder

https://bugs.webkit.org/show_bug.cgi?id=190683

Patch by Thibault Saunier <[email protected]> on 2018-11-06
Reviewed by Philippe Normand.

This has to already be handled in capturing pipeline or in libwebrtc itself.

No other encoder implementation do that, and libwebrtc is not happy with encoder that do not output the exact number of frames that have been passed in.

No regressions detected and libwebrtc is happier this way, less warning output and no more frame corruption in H264 streams found.

* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::InitEncode):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@237860 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=190682

Patch by Thibault Saunier <[email protected]> on 2018-11-06
Reviewed by Philippe Normand.

That has been manually checked.

* platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
(gst_webrtc_video_encoder_get_property):
(gst_webrtc_video_encoder_set_property):
(register_known_encoder):
(gst_webrtc_video_encoder_class_init):
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::InitEncode):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@237865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…ncoming track

https://bugs.webkit.org/show_bug.cgi?id=191631

Patch by Thibault Saunier <[email protected]> on 2018-11-15
Reviewed by Xabier Rodriguez-Calvar.

This will be tested once webkit.org/b/186933 is implemented.

* platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeIncomingAudioSourceLibWebRTC::OnData):
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@238224 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=191599

Patch by Thibault Saunier <[email protected]> on 2018-11-16
Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

Test: fast/mediastream/MediaStream-video-element-remove-track.html

* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(WebCore::WebKitMediaStreamObserver::~WebKitMediaStreamObserver):
(WebCore::WebKitMediaStreamObserver::WebKitMediaStreamObserver):
(WebCore::webkitMediaStreamSrcFinalize):
(WebCore::webkitMediaStreamSrcChangeState):
(WebCore::webkit_media_stream_src_init):
(WebCore::webkitMediaStreamSrcSetupSrc):
(WebCore::webkitMediaStreamSrcAddTrack):
(WebCore::webkitMediaStreamSrcRemoveTrackByType):
(WebCore::webkitMediaStreamSrcSetStream):

LayoutTests:

* fast/mediastream/MediaStream-video-element-remove-track-expected.txt: Added.
* fast/mediastream/MediaStream-video-element-remove-track.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@238276 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=191744

It should always have been there.

Patch by Thibault Saunier <[email protected]> on 2018-11-16
Reviewed by Carlos Garcia Campos.

* UIProcess/API/gtk/webkit2.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@238277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=191699

This basically us to test MediaStream/WebRTC support without
requiring cameras or microphones and is quite useful.

Also fix the GStreamerAudioMock by:
  - Stop setting `leaky-upstream` on the GStreamerCapturer queue,
    this was usefull when we were trying to bring the MediaStream
    sources inside the main pipeline, it is not the case anymore
    (and not doable with latest version of LibWebRTC).
  - Use a 'ticks' wave on the gstreamer audiotestsrc so the test
    stream is similar to what Apple port does.

Patch by Thibault Saunier <[email protected]> on 2018-11-16
Reviewed by Xabier Rodriguez-Calvar.

The mocks are already tested and the API is really simple.

Source/WebCore:

* platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp:
(WebCore::GStreamerAudioCapturer::createSource):
* platform/mediastream/gstreamer/GStreamerAudioCapturer.h:
* platform/mediastream/gstreamer/GStreamerCapturer.cpp:
(WebCore::GStreamerCapturer::addSink):
* platform/mediastream/gstreamer/GStreamerCapturer.h:

Source/WebKit:

* UIProcess/API/glib/WebKitSettings.cpp:
(webKitSettingsSetProperty):
(webKitSettingsGetProperty):
(webkit_settings_class_init):
(webkit_settings_get_enable_mock_capture_devices):
(webkit_settings_set_enable_mock_capture_devices):
* UIProcess/API/gtk/WebKitSettings.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@238278 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=191861

Source/ThirdParty/libwebrtc:

Patch by Thibault Saunier <[email protected]> on 2018-11-27
Reviewed by Philippe Normand.

* CMakeLists.txt: Build LibVPX vp8 encoder and decoders.

Source/WebCore:

The GStreamer implementations are less feature full and less tested, now that Apple
also use the LibWebRTC provided implementations it makes a lot of sense for us to
do the same.

Basically everything related to temporal scalability is not implemented in GStreamer.

We should make sure to use GStreamer elements on low powered platforms and for
accelerated encoders and decoders.

Patch by Thibault Saunier <[email protected]> on 2018-11-27
Reviewed by Philippe Normand.

This is mostly refactoring, no new test required.

* platform/graphics/gstreamer/GStreamerCommon.h: Added GstMappedFrame similar to GstMappedBuffer but for video frames.
(WebCore::GstMappedFrame::GstMappedFrame):
(WebCore::GstMappedFrame::get):
(WebCore::GstMappedFrame::ComponentData):
(WebCore::GstMappedFrame::ComponentStride):
(WebCore::GstMappedFrame::info):
(WebCore::GstMappedFrame::width):
(WebCore::GstMappedFrame::height):
(WebCore::GstMappedFrame::format):
(WebCore::GstMappedFrame::~GstMappedFrame):
(WebCore::GstMappedFrame::operator bool const):
* platform/graphics/gstreamer/GUniquePtrGStreamer.h:
* platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp:
(WebCore::GStreamerVideoFrameLibWebRTC::ToI420): Implemented support for converting frame formats with the GstVideoConverter API
* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
(WebCore::GStreamerVideoDecoder::GstDecoderFactory):
(WebCore::GStreamerVideoDecoder::HasGstDecoder):
(WebCore::VP8Decoder::Create): Creates a `webrtc::LibvpxVp8Decoder()` if GStreamer decoder would be the LibVPX based one.
(WebCore::GStreamerVideoDecoderFactory::CreateVideoDecoder):
* platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
(gst_webrtc_video_encoder_class_init):
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: Stop using vp8enc and use LibWebRTC based implementation
(WebCore::GStreamerH264Encoder::GStreamerH264Encoder): Renamed H264Encoder to GStreamerH264Encoder to be more coherent with what is done in LibVPX
(WebCore::GStreamerVP8Encoder::GStreamerVP8Encoder): Renamed VP8Encoder to GStreamerVP8Encoder to be more coherent with what is done in LibVPX
(WebCore::GStreamerVideoEncoderFactory::CreateVideoEncoder):
(WebCore::GStreamerVideoEncoderFactory::GetSupportedFormats const):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@238557 268f45cc-cd09-0410-ab3c-d52691b4dbfc
… MediaPlayerPrivateGStreamer

https://bugs.webkit.org/show_bug.cgi?id=191586

Patch by Thibault Saunier <[email protected]> on 2018-11-20
Reviewed by Xabier Rodriguez-Calvar.

This is minor changes that do not require tests.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties):
(WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL):
(WebCore::MediaPlayerPrivateGStreamer::loadFull):
(WebCore::MediaPlayerPrivateGStreamer::commitLoad):
(WebCore::MediaPlayerPrivateGStreamer::readyTimerFired):
(WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
(WebCore::MediaPlayerPrivateGStreamer::prepareToPlay):
(WebCore::MediaPlayerPrivateGStreamer::play):
(WebCore::MediaPlayerPrivateGStreamer::pause):
(WebCore::MediaPlayerPrivateGStreamer::durationMediaTime const):
(WebCore::MediaPlayerPrivateGStreamer::seek):
(WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate):
(WebCore::MediaPlayerPrivateGStreamer::paused const):
(WebCore::MediaPlayerPrivateGStreamer::enableTrack):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::processBufferingStats):
(WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
(WebCore::MediaPlayerPrivateGStreamer::maxMediaTimeSeekable const):
(WebCore::MediaPlayerPrivateGStreamer::totalBytes const):
(WebCore::MediaPlayerPrivateGStreamer::uriDecodeBinElementAddedCallback):
(WebCore::MediaPlayerPrivateGStreamer::downloadBufferFileCreatedCallback):
(WebCore::MediaPlayerPrivateGStreamer::sourceSetup):
(WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone):
(WebCore::MediaPlayerPrivateGStreamer::updateStates):
(WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
(WebCore::MediaPlayerPrivateGStreamer::didEnd):
(WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
(WebCore::MediaPlayerPrivateGStreamer::setPreload):
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@238396 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…ot handle

https://bugs.webkit.org/show_bug.cgi?id=191904

This is useless work and it throws warning about use GstDeviceMonitor without filters.

Patch by Thibault Saunier <[email protected]> on 2018-11-28
Reviewed by Philippe Normand.

* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
(WebCore::GStreamerCaptureDeviceManager::refreshCaptureDevices):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@238605 268f45cc-cd09-0410-ab3c-d52691b4dbfc
… our OutgoingAudioSource

https://bugs.webkit.org/show_bug.cgi?id=192027

Patch by Thibault Saunier <[email protected]> on 2018-11-28
Reviewed by Xabier Rodriguez-Calvar.

Cleaning up a bit the code.

It is a minor refactoring, no new test required.

* platform/graphics/gstreamer/GUniquePtrGStreamer.h:
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::~RealtimeOutgoingAudioSourceLibWebRTC):
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::audioSamplesAvailable):
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@238606 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=192028

Patch by Thibault Saunier <[email protected]> on 2018-11-28
Reviewed by Philippe Normand.

* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoCaptureSource::capabilities):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@238607 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…op of the list

https://bugs.webkit.org/show_bug.cgi?id=192026

Patch by Thibault Saunier <[email protected]> on 2018-11-28
Reviewed by Philippe Normand.

Otherwise we might end up picking a useless one in some applications
(not sure what those application do though).

GStreamer patch proposed as https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/merge_requests/34/diffs

Source/WebCore:

* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
(WebCore::sortDevices):
(WebCore::GStreamerCaptureDeviceManager::addDevice):
(WebCore::GStreamerCaptureDeviceManager::refreshCaptureDevices):
* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h:

Tools:

* flatpak/org.webkit.CommonModules.yaml:
* gstreamer/jhbuild.modules:
* gstreamer/patches/gst-plugins-good-0014-pulse-Mark-default-devices-as-default.patch: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@238609 268f45cc-cd09-0410-ab3c-d52691b4dbfc
…r now

It raises Not Negotiated Error 'randomly'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants