mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
ges-launch: Report position while playing back
Giving more feedbacks to the user
This commit is contained in:
parent
6c7b28161c
commit
ea95cb1ee3
1 changed files with 18 additions and 0 deletions
|
@ -381,6 +381,23 @@ print_pattern_list (void)
|
||||||
print_enum (GES_VIDEO_TEST_PATTERN_TYPE);
|
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 ("<Position: %" GST_TIME_FORMAT " / %" GST_TIME_FORMAT "/>\r",
|
||||||
|
GST_TIME_ARGS (position), GST_TIME_ARGS (duration));
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, gchar ** argv)
|
main (int argc, gchar ** argv)
|
||||||
{
|
{
|
||||||
|
@ -547,6 +564,7 @@ main (int argc, gchar ** argv)
|
||||||
g_error ("Failed to start the encoding\n");
|
g_error ("Failed to start the encoding\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
g_timeout_add (100, (GSourceFunc) _print_position, NULL);
|
||||||
g_main_loop_run (mainloop);
|
g_main_loop_run (mainloop);
|
||||||
|
|
||||||
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
|
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
|
||||||
|
|
Loading…
Reference in a new issue