mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-08 16:35:40 +00:00
tools: Position printing is now done at the gst-validate level
https://bugzilla.gnome.org/show_bug.cgi?id=729382
This commit is contained in:
parent
56abc17a70
commit
3197a02487
2 changed files with 30 additions and 20 deletions
|
@ -506,24 +506,6 @@ 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 ("<position: %" GST_TIME_FORMAT " duration: %" GST_TIME_FORMAT
|
||||
"/>\r", GST_TIME_ARGS (position), GST_TIME_ARGS (duration));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static GstEncodingProfile *
|
||||
_parse_encoding_profile (const gchar * format)
|
||||
{
|
||||
|
@ -833,7 +815,6 @@ main (int argc, gchar ** argv)
|
|||
g_error ("Failed to start the pipeline\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);
|
||||
|
|
|
@ -94,20 +94,49 @@ ges_validate_clean (GstPipeline * pipeline)
|
|||
}
|
||||
|
||||
#else
|
||||
static gboolean
|
||||
_print_position (GstElement * pipeline)
|
||||
{
|
||||
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 " duration: %" GST_TIME_FORMAT
|
||||
"/>\r", GST_TIME_ARGS (position), GST_TIME_ARGS (duration));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
ges_validate_activate (GstPipeline * pipeline, const gchar * scenario)
|
||||
{
|
||||
if (scenario)
|
||||
if (scenario) {
|
||||
GST_WARNING ("Trying to run scenario %s, but gst-validate not supported",
|
||||
scenario);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
g_object_set_data (G_OBJECT (pipeline), "pposition-id",
|
||||
GUINT_TO_POINTER (g_timeout_add (200,
|
||||
(GSourceFunc) _print_position, pipeline)));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gint
|
||||
ges_validate_clean (GstPipeline * pipeline)
|
||||
{
|
||||
g_source_remove (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (pipeline),
|
||||
"pposition-id")));
|
||||
|
||||
gst_object_unref (pipeline);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue