<div dir="ltr"><div>I'm new in GStreamer but I think you need to initialize the library and set pipeline elements and itself before running the loop.</div><div>You can watch the library status with adding a bus to pipeline and a bus callback function and also can handle the errors.</div><div>You can want to take a look to the <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/manual.pdf" target="_blank">GStreamer ADM</a> chapte 7. bus.</div><div><br></div><div>Orkun KASAPOGLU</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-12-23 3:59 GMT+02:00 doon <span dir="ltr"><<a href="mailto:don-prog@mail.ru" target="_blank">don-prog@mail.ru</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I added new thread but still have freeze problem, here is my code:<br>
<br>
GstElement *pipeline;<br>
<br>
        void func() {<br>
                GMainLoop *loop = g_main_loop_new(NULL, FALSE);<br>
                g_main_loop_run(loop);<br>
        }<br>
        void start(char* path, void* hwnd_ptr) {<br>
                gst_init(NULL, NULL);<br>
                HWND hwnd = (HWND)hwnd_ptr;<br>
<br>
                pipeline = gst_element_factory_make("playbin", "player");<br>
                g_object_set(G_OBJECT(pipeline), "uri", path, NULL);<br>
<br>
                gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(pipeline),<br>
(guintptr)hwnd);<br>
<br>
                gst_element_set_state(pipeline, GST_STATE_PLAYING);<br>
<br>
                GThread* thread = g_thread_new(NULL, (GThreadFunc)func, NULL);<br>
                g_thread_join(thread);<br>
        }<br>
<br>
How can I fix it? Any help will be useful.<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/g-main-loop-run-freeze-the-window-tp4674922p4674987.html" target="_blank" rel="noreferrer">http://gstreamer-devel.966125.n4.nabble.com/g-main-loop-run-freeze-the-window-tp4674922p4674987.html</a><br>
Sent from the GStreamer-devel mailing list archive at Nabble.com.<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank" rel="noreferrer">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div><br></div>