[GStreamer][WebRTC] Implement black frame generation
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Nov 2018 14:47:37 +0000 (14:47 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Nov 2018 14:47:37 +0000 (14:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=190684

Patch by Thibault Saunier <tsaunier@igalia.com> on 2018-11-06
Reviewed by Xabier Rodriguez-Calvar.

Avoiding webrtc/video-mute-vp8.html to crash but it still fails because
we are missing the canvas bridging code.

Source/WebCore:

* platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingVideoSourceLibWebRTC::createBlackFrame):
* platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h:

LayoutTests:

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

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

LayoutTests/ChangeLog
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/wpe/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp
Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h

index 1d9c6e7..ce267d2 100644 (file)
@@ -1,3 +1,16 @@
+2018-11-06  Thibault Saunier  <tsaunier@igalia.com>
+
+        [GStreamer][WebRTC] Implement black frame generation
+        https://bugs.webkit.org/show_bug.cgi?id=190684
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        Avoiding webrtc/video-mute-vp8.html to crash but it still fails because
+        we are missing the canvas bridging code.
+
+        * platform/gtk/TestExpectations:
+        * platform/wpe/TestExpectations:
+
 2018-11-06  Antoine Quint  <graouts@apple.com>
 
         [Web Animations] Update all tests to match the latest API changes
index 39b4c13..9946e36 100644 (file)
@@ -2392,7 +2392,7 @@ webkit.org/b/190738 media/encrypted-media/clearKey/clearKey-webm-video-playback-
 
 webkit.org/b/191008 webanimations/accelerated-animation-suspension.html [ Timeout ]
 
-webkit.org/b/191009 webrtc/video-mute-vp8.html [ Timeout ]
+webkit.org/b/191009 webrtc/video-mute-vp8.html [ Failure ]
 
 #////////////////////////////////////////////////////////////////////////////////////////
 # End of Tests timing out
index 543c436..ee112e3 100644 (file)
@@ -47,6 +47,7 @@
 
 # The webrtc implementation is not fully completed yet
 webkit.org/b/187064 webrtc/simulcast-h264.html
+webkit.org/b/191009 webrtc/video-mute-vp8.html [ Failure ]
 webkit.org/b/189567 webrtc/video-addLegacyTransceiver.html [ Failure ]
 webkit.org/b/187064 webrtc/audio-peer-connection-g722.html
 webkit.org/b/187064 webrtc/video-with-receiver.html
index 566e89c..b0ef6c7 100644 (file)
@@ -1,5 +1,19 @@
 2018-11-06  Thibault Saunier  <tsaunier@igalia.com>
 
+        [GStreamer][WebRTC] Implement black frame generation
+        https://bugs.webkit.org/show_bug.cgi?id=190684
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        Avoiding webrtc/video-mute-vp8.html to crash but it still fails because
+        we are missing the canvas bridging code.
+
+        * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp:
+        (WebCore::RealtimeOutgoingVideoSourceLibWebRTC::createBlackFrame):
+        * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h:
+
+2018-11-06  Thibault Saunier  <tsaunier@igalia.com>
+
         [GStreamer][WebRTC] Do not try to handle framerate modulation in the encoder
         https://bugs.webkit.org/show_bug.cgi?id=190683
 
index 9131422..f178eed 100644 (file)
@@ -80,6 +80,21 @@ void RealtimeOutgoingVideoSourceLibWebRTC::sampleBufferUpdated(MediaStreamTrackP
     sendFrame(WTFMove(frameBuffer));
 }
 
+rtc::scoped_refptr<webrtc::VideoFrameBuffer> RealtimeOutgoingVideoSourceLibWebRTC::createBlackFrame(size_t  width, size_t  height)
+{
+    GstVideoInfo info;
+
+    gst_video_info_set_format(&info, GST_VIDEO_FORMAT_RGB, width, height);
+
+    GRefPtr<GstBuffer> buffer = adoptGRef(gst_buffer_new_allocate(nullptr, info.size, nullptr));
+    GRefPtr<GstCaps> caps = adoptGRef(gst_video_info_to_caps(&info));
+
+    GstMappedBuffer map(buffer.get(), GST_MAP_WRITE);
+    memset(map.data(), 0, info.size);
+
+    return GStreamerVideoFrameLibWebRTC::create(gst_sample_new(buffer.get(), caps.get(), NULL, NULL));
+}
+
 } // namespace WebCore
 
 #endif // USE(LIBWEBRTC)
index 1f01a25..9e1758d 100644 (file)
@@ -39,7 +39,7 @@ public:
 private:
     explicit RealtimeOutgoingVideoSourceLibWebRTC(Ref<MediaStreamTrackPrivate>&&);
 
-    rtc::scoped_refptr<webrtc::VideoFrameBuffer> createBlackFrame(size_t, size_t) final { return nullptr; }
+    rtc::scoped_refptr<webrtc::VideoFrameBuffer> createBlackFrame(size_t, size_t) final;
 
     // MediaStreamTrackPrivate::Observer API
     void sampleBufferUpdated(MediaStreamTrackPrivate&, MediaSample&) final;