Output WebRTCBin to GTK Window using VideoOverlay

Matthew Waters ystreet00 at gmail.com
Fri Jul 3 12:01:19 UTC 2020


Use a different video sink, or respond the the 'prepare-window-handle'
message from the actual video sink created by autovideosink (no
guarantees that all possible video sinks chosen by autovideosink support
the GstVideoOverlay interface, but most do).  See the documentation or
any of the overlay examples in gst-plugins-base.

On 3/7/20 9:40 pm, Busayo Famutimi wrote:
> Hi Matthew,
>
> Thanks for your response.
>
> However, I am still getting the same error message when I called the
> overlay function on my sink element.
>
>     *(webrtc-sendrecv.exe:14920): GLib-GObject-WARNING **:
>     12:35:52.095: invalid cast from 'GstAutoVideoSink' to
>     'GstVideoOverlay'
>
>     ** (webrtc-sendrecv.exe:14920): CRITICAL **: 12:35:52.095:
>     gst_video_overlay_set_window_handle: assertion
>     'GST_IS_VIDEO_OVERLAY (overlay)' failed*
>
>
> I then looked up the documentation
> <https://gstreamer.freedesktop.org/documentation/autodetect/autovideosink.html?gi-language=c#autovideosink-page>
> and I noticed that autovideosink does not implement the
> GstVideoOverlay interface.
>
> How can I fix this problem?
>
> Thanks.
>
> On Fri, Jul 3, 2020 at 3:01 AM Matthew Waters <ystreet00 at gmail.com
> <mailto:ystreet00 at gmail.com>> wrote:
>
>     GstVideoOverlay is an interface that is implemented by most video
>     sinks.  You need to call gst_video_overlay_set_window_handle() on
>     your video sink, not webrtcbin.
>
>     On 3/7/20 6:40 am, Busayo Famutimi wrote:
>>     Hi Devs,
>>
>>     I am trying to display a video stream from WebRTCBin to a GTK
>>     Window using VideoOverlay rather than have gstreamer create it's
>>     own window.
>>
>>     The code works fine (gstwebrtc-demos - sendrecv.c
>>     <https://github.com/centricular/gstwebrtc-demos/blob/master/sendrecv/gst/webrtc-sendrecv.c>).
>>     I managed to tweak it to suit my intended purpose but I keep
>>     getting the following error:
>>
>>         *GLib-GObject-WARNING **: 21:14:46.552: invalid cast from
>>         'GstWebRTCBin' to 'GstVideoOverlay'
>>
>>         ** (webrtc-sendrecv.exe:6304): CRITICAL **: 21:14:46.552:
>>         gst_video_overlay_set_window_handle: assertion
>>         'GST_IS_VIDEO_OVERLAY (overlay)' failed*
>>
>>     *
>>     *
>>     The error is coming from this line of the code:
>>
>>         */* Pass it to playbin, which implements VideoOverlay and
>>         will forward it to the video sink */
>>            
>>         gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(webrtc1),
>>         window_handle);*
>>
>>     *
>>     *
>>     Please how can I handle this situation?
>>
>>     Thanks.
>>
>>     _______________________________________________
>>     gstreamer-devel mailing list
>>     gstreamer-devel at lists.freedesktop.org <mailto:gstreamer-devel at lists.freedesktop.org>
>>     https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20200703/c84eb0ee/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20200703/c84eb0ee/attachment.sig>


More information about the gstreamer-devel mailing list