g_main_loop_run() freeze the window

doon don-prog at mail.ru
Tue Dec 22 17:59:15 PST 2015


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.


More information about the gstreamer-devel mailing list