g_main_loop_run() freeze the window

OrkUn Kasapoglu orkun.kasapoglu at gmail.com
Tue Dec 22 21:25:18 PST 2015


I'm new in GStreamer but I think you need to initialize the library and set
pipeline elements and itself before running the loop.
You can watch the library status with adding a bus to pipeline and a bus
callback function and also can handle the errors.
You can want to take a look to the GStreamer ADM
<http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/manual.pdf>
chapte
7. bus.

Orkun KASAPOGLU

2015-12-23 3:59 GMT+02:00 doon <don-prog at mail.ru>:

> I added new thread but still have freeze problem, here is my code:
>
> GstElement *pipeline;
>
>         void func() {
>                 GMainLoop *loop = g_main_loop_new(NULL, FALSE);
>                 g_main_loop_run(loop);
>         }
>         void start(char* path, void* hwnd_ptr) {
>                 gst_init(NULL, NULL);
>                 HWND hwnd = (HWND)hwnd_ptr;
>
>                 pipeline = gst_element_factory_make("playbin", "player");
>                 g_object_set(G_OBJECT(pipeline), "uri", path, NULL);
>
>
> gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(pipeline),
> (guintptr)hwnd);
>
>                 gst_element_set_state(pipeline, GST_STATE_PLAYING);
>
>                 GThread* thread = g_thread_new(NULL, (GThreadFunc)func,
> NULL);
>                 g_thread_join(thread);
>         }
>
> How can I fix it? Any help will be useful.
>
>
>
> --
> View this message in context:
> http://gstreamer-devel.966125.n4.nabble.com/g-main-loop-run-freeze-the-window-tp4674922p4674987.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20151223/f67f32fb/attachment.html>


More information about the gstreamer-devel mailing list