Explaining Gstreamer plugin example

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

Explaining Gstreamer plugin example

horai
Dear all,

would anyone be so kind to explain me for what purpose this example exactly
is?
https://github.com/GStreamer/gst-plugins-bad/blob/master/tests/examples/waylandsink/wayland-threads.c

From the code, I would kind of assume that it is meant to show how the code
should be written in order to run two pipelines simultaneously on Wayland.
Simple, just creating pipeline and assigning waylandsink to multiple
pipelines is not enough to run them properly on top of Wayland actually it's
compositor Weston.

I have an application with 4 rendering wayland surfaces and all pipelines
run fine (without usage of code of the above mentioned example), but I am
experiencing problems with disposing rendering areas and also reloading
pipelines whenever I stop them and want to run them once more.
Whenever I want to restart all my 4 pipelines, I experience segmentation
fault in method:
wl_list_insert() resizing in wayland-client.c.
It randomly crashes on several spots in my code for example this method
which assigns context to waylandsink:
gst_element_set_context(GST_ELEMENT(GST_MESSAGE_SRC(message)), context);
(none of these variables are NULL).
On start of the application, this method runs fine for all 4 video
renderings, but when I stop all renderings and start them once more, it
crashes even though GST_ELEMENT(GST_MESSAGE_SRC(message)) is really
reference to one of 4 waylandsinks I am creating for each of pipeline and
context is a variable created by method:
GstContext *context =
gst_wayland_display_handle_context_new(display_handle);
I have asked several times about my problem if not being able to clear
rendering surface with set_render_rectangle method, therefore I made a
workaround with stopping all pipelines and unreferencing all of them. It
clears the rendering surfaces properly, but the downside is that I cannot
reuse the already created pipeline and unref forces me to create 4 pipelines
once more.
But it seems problems are not yet finished and this workaround has some
deeper issues.
Could this example be utilized in order to fix my problem?
If anyone has some more examples how to write gstreamer code on Wayland,
please share it with me.

Thank you very much
Best regards,
Ivo





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

Re: Explaining Gstreamer plugin example

Wonchul Lee
Hi Ivo,
There was a race condition in the wayland when multi-threaded clients
share wl_display/wl_surface. It could cause to set to the wrong
wayland queue.
The purpose of that example is to check that it fixes with this
change, https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/74

I think if you're using GStreamer 1.16 or later, you will not have the
same issue and don't need to do this way, so could you check the
version you are using?

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

Re: Explaining Gstreamer plugin example

horai
Ok, I have 1.14.4 installed from repository.
I left it intact without uninstalling. Downloaded source code version 1.16
of gstreamer-1.0, base,good,bad, compiled and installed.
Now it seems like when video is being rendered in eventBox where waylandsink
renders the event signal from mouse click is not propagated and the method
does not trigger at all so I am unable to event test whether I experience
race condition.
When no video is being rendered to eventBox (it is grey colored when empty)
GTK catches the event and maximizes it properly, I guess something wrong is
with waylandsink in 1.16.



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

Re: Explaining Gstreamer plugin example

horai
Just to note, I also recompiled GTK this way:
nice -20 ./autogen.sh --enable-wayland-backend --enable-gtk-doc=no
--enable-gtk-doc-html=no --enable-gtk-doc-pdf=no  --enable-broadway-backend
--enable-x11-backend --libdir=/usr/lib/x86_64-linux-gnu/

I am using --libdir=/usr/lib/x86_64-linux-gnu/  when configuring Gstreamer
compilation just to overwrite libraries of version 1.14. I know this is
rather messy mixing 1.14 deb packages with raw 1.16 libraries, but I hope
old libraries will be overridden and won't add any more problems saving some
time and making it easier when not building .deb packages.





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

Re: Explaining Gstreamer plugin example

horai
Seriously,

when running running official gst-plugin-bad wayland example with mouse
button click signal hander attached to videoarea the following code written
way, the video runs but upon button click on video the signal is not
triggered, whey I don't set the pipeline to PLAYING state that means no
video is rendered, the signal triggers properly:

d->video_widget = GTK_WIDGET (gtk_builder_get_object (builder,
"videoarea"));
  g_signal_connect (d->video_widget, "draw",
      G_CALLBACK (video_widget_draw_cb), d);
    g_signal_connect(G_OBJECT(d->video_widget), "button_press_event",
button_press_event, d);

....
static void button_press_event(GtkWidget *widget, GdkEventButton *event,
DemoApp * d) {
        g_print("button Pressed ...\r\n");
}

Please, could anyone more skilled verify this and possibly claim problem on
my side or on waylandsink side?

Thank you






--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel