Output WebRTCBin to GTK Window using VideoOverlay

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Output WebRTCBin to GTK Window using VideoOverlay

Busayo Famutimi
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). 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
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Output WebRTCBin to GTK Window using VideoOverlay

Matthew Waters
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). 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
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Output WebRTCBin to GTK Window using VideoOverlay

Busayo Famutimi
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 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 <[hidden email]> 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). 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
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Output WebRTCBin to GTK Window using VideoOverlay

Matthew Waters
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 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 <[hidden email]> 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). 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
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Output WebRTCBin to GTK Window using VideoOverlay

Busayo Famutimi
Hi Matthew,

This works great. Thanks.

The only problem left is just this issue to be fixed. I hope it's resolved in the next stable release.

Thanks.

On Fri, Jul 3, 2020 at 1:01 PM Matthew Waters <[hidden email]> wrote:
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 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 <[hidden email]> 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). 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
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel