g_object_set(GST_OBJECT(pipeline), "video-sink", vsink, NULL); // connect to interesting signals GstBus *bus = gst_element_get_bus(pipeline); gst_bus_add_watch(bus, &PlayerWindow::postGstMessage, window); gst_object_unref(bus); // run the pipeline GstStateChangeReturn sret = gst_...
bus=gst_pipeline_get_bus(GST_PIPELINE(pipeline)); gst_bus_add_watch(bus, bus_call, loop); gst_object_unref(bus); //Add and link gst_bin_add_many(GST_BIN(pipeline), fakesrc1, udpsink1, NULL); gst_element_link(fakesrc1, udpsink1); //now play g_print("Setting to PLAYING\n");...
OK,basesink中,如果preroll完成(第一个非event的buffer到达,由函数gst_base_sink_preroll_object完成),就会调用gst_base_sink_commit_state函数,这个函数会直接将该sink的state设置成最终的那个state,也就是保存在pending中的state,同时将next和pending state都设成VOID,这表示sink现在preroll完成了,对于状态转换已经没...
bus = gst_element_get_bus(pipeline); gst_bus_add_watch(bus, bus_call, loop); gst_object_unref(bus); gst_element_set_state(pipeline, GST_STATE_PLAYING); g_main_loop_run(loop); gst_element_set_state(pipeline, GST_STATE_NULL); gst_object_unref(pipeline); g_main_loop_unref(loop); ...
msg = gst_bus_poll (bus, GST_MESSAGE_ERROR, 0); if (msg) { GError *err = NULL; gst_message_parse_error (msg, &err, NULL); g_print ("ERROR: %s\n", err->message); g_error_free (err); gst_message_unref (msg); } 1 2 3 4 5 6 7 8 状态 通过gst_element_set_state设...
gst_object_unref(bus);gst_bin_add_many(GST_BIN(app->pipeline),app->appsrc,app->queue,app->filesink,NULL);if (!gst_element_link_many (app->appsrc,app->queue,app->filesink,NULL)) {g_print ("Failed to link one or more elements! \n");return -1;}g_print("Gst-Pipeline is ...
gst_bus_add_watch (intBus, bus_call, loop); gst_object_unref (intBus); gst_bin_add_many(GST_BIN (pipeline), filesrc, demuxer, findtype, asink, NULL); gst_element_link (filesrc, demuxer); gst_element_link(findtype, asink); g_signal_connect (demuxer, "pad-adde...
gst_object_unref(testsource); bus=gst_element_get_bus(data->sink); gst_bus_add_watch(bus,(GstBusFunc)on_sink_message, data); gst_object_unref(bus); /* launching things */ gst_element_set_state(data->sink, GST_STATE_PLAYING); ...
avdec_h264 ! autovideosink )"); gst_rtsp_mount_points_add_factory (mounts, "/test", factory); gst_rtsp_server_attach (server, NULL); g_print ("Stream ready at rtsp://127.0.0.1:8554/test\n"); g_main_loop_run (loop); gst_object_unref (server); g_main_loop_unref (loop); ...
gst_object_unref (bus); gst_element_set_state (pipeline, GST_STATE_NULL); gst_object_unref (pipeline); return 0; } This is how you could build it on the board in case your .c is named capture.c gcc capture.c -o capture `pkg-config --libs --cflags gstreamer-1.0` ...