[gst-devel] How can I make a playbin2 to jump to the last video frame and display it?

wl2776 wl2776 at gmail.com
Wed Feb 24 10:12:21 CET 2010


I would like my playbin2 to perform "Go End" command - display the last video
frame in the loaded file.
Here is how I create the playbin:

m_player = gst_element_factory_make("playbin2","playbin0");
GstElement *bus = (GstElement
*)gst_pipeline_get_bus(GST_PIPELINE(m_player));
gst_bus_set_sync_handler (GST_BUS(bus),
(GstBusSyncHandler)gst_bus_sync_handler, this);
gst_bus_add_watch (GST_BUS(bus), bus_call, this);
gst_object_unref(bus);
m_loop = g_main_loop_new(NULL,FALSE);

if(!m_videosink){
	m_videosink = gst_element_factory_make("directdrawsink","videosink");
	if(m_videosink){
		g_object_set(m_videosink,"sync",TRUE,NULL);
		gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (m_videosink),m_hwnd);
			g_object_set(G_OBJECT(m_player),"video-sink",m_videosink,NULL);
	}
}
g_object_set(G_OBJECT(m_player),"uri",
g_locale_to_utf8(filename,-1,NULL,NULL,NULL),NULL);

gst_element_set_state(GST_ELEMENT(m_player),GST_STATE_PLAYING);

And here is how I currently jump to the end.

gst_element_seek_simple(GST_ELEMENT(m_player),
		GST_FORMAT_TIME,
		(GstSeekFlags)(GST_SEEK_FLAG_FLUSH|GST_SEEK_FLAG_ACCURATE),
		m_stream_duration);
gst_element_get_state(GST_ELEMENT(m_player),NULL,NULL,100 * GST_MSECOND);
gst_element_set_state(GST_ELEMENT(m_player),GST_STATE_PAUSED);

I've turned on the debug messages (--gst-debug=playbin2:5,playbin:5),
however, I don't see anything, when seeking functions are called.
-- 
View this message in context: http://n4.nabble.com/How-can-I-make-a-playbin2-to-jump-to-the-last-video-frame-and-display-it-tp1567156p1567156.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.




More information about the gstreamer-devel mailing list