From ea95cb1ee3fffa65fd4b063281203a564f7e8ce8 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Sun, 16 Jun 2013 21:47:52 -0400 Subject: [PATCH] ges-launch: Report position while playing back Giving more feedbacks to the user --- tools/ges-launch.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tools/ges-launch.c b/tools/ges-launch.c index 924e22c..8ed5bdc 100644 --- a/tools/ges-launch.c +++ b/tools/ges-launch.c @@ -381,6 +381,23 @@ print_pattern_list (void) print_enum (GES_VIDEO_TEST_PATTERN_TYPE); } +static gboolean +_print_position (void) +{ + gint64 position, duration; + + if (pipeline) { + gst_element_query_position (GST_ELEMENT (pipeline), GST_FORMAT_TIME, + &position); + gst_element_query_duration (GST_ELEMENT (pipeline), GST_FORMAT_TIME, + &duration); + g_print ("\r", + GST_TIME_ARGS (position), GST_TIME_ARGS (duration)); + } + + return TRUE; +} + int main (int argc, gchar ** argv) { @@ -547,6 +564,7 @@ main (int argc, gchar ** argv) g_error ("Failed to start the encoding\n"); return 1; } + g_timeout_add (100, (GSourceFunc) _print_position, NULL); g_main_loop_run (mainloop); gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL); -- 2.7.4