mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:36:20 +00:00
fpsdisplaysink: signal-fps-measurements is writable
signal-fps-measurements is a readwrite property, not read-only. Also adds some more debugging logs.
This commit is contained in:
parent
677ae19bd0
commit
c470918903
1 changed files with 10 additions and 2 deletions
|
@ -150,7 +150,7 @@ fps_display_sink_class_init (GstFPSDisplaySinkClass * klass)
|
||||||
"Signal fps measurements",
|
"Signal fps measurements",
|
||||||
"If the fps-measurements signal should be emited.",
|
"If the fps-measurements signal should be emited.",
|
||||||
DEFAULT_SIGNAL_FPS_MEASUREMENTS,
|
DEFAULT_SIGNAL_FPS_MEASUREMENTS,
|
||||||
G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
|
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstFPSDisplaySink::fps-measurements:
|
* GstFPSDisplaySink::fps-measurements:
|
||||||
|
@ -320,10 +320,14 @@ display_current_fps (gpointer data)
|
||||||
gint64 current_ts;
|
gint64 current_ts;
|
||||||
|
|
||||||
/* if query failed try again on next timer tick */
|
/* if query failed try again on next timer tick */
|
||||||
if (!gst_element_query (self->video_sink, self->query))
|
if (!gst_element_query (self->video_sink, self->query)) {
|
||||||
|
GST_DEBUG_OBJECT (self, "Failed to query position, skipping measurement");
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
gst_query_parse_position (self->query, NULL, ¤t_ts);
|
gst_query_parse_position (self->query, NULL, ¤t_ts);
|
||||||
|
GST_LOG_OBJECT (self, "Received position %" GST_TIME_FORMAT,
|
||||||
|
GST_TIME_ARGS (current_ts));
|
||||||
|
|
||||||
if (GST_CLOCK_TIME_IS_VALID (self->last_ts)) {
|
if (GST_CLOCK_TIME_IS_VALID (self->last_ts)) {
|
||||||
gdouble rr, dr, average_fps;
|
gdouble rr, dr, average_fps;
|
||||||
|
@ -347,6 +351,8 @@ display_current_fps (gpointer data)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self->signal_measurements) {
|
if (self->signal_measurements) {
|
||||||
|
GST_LOG_OBJECT (self, "Signaling measurements: fps:%f droprate:%f "
|
||||||
|
"avg-fps:%f", rr, dr, average_fps);
|
||||||
g_signal_emit (G_OBJECT (self),
|
g_signal_emit (G_OBJECT (self),
|
||||||
fpsdisplaysink_signals[SIGNAL_FPS_MEASUREMENTS], 0, rr, dr,
|
fpsdisplaysink_signals[SIGNAL_FPS_MEASUREMENTS], 0, rr, dr,
|
||||||
average_fps);
|
average_fps);
|
||||||
|
@ -421,6 +427,8 @@ no_text_overlay:
|
||||||
gst_object_unref (target_pad);
|
gst_object_unref (target_pad);
|
||||||
|
|
||||||
/* Set a timeout for the fps display */
|
/* Set a timeout for the fps display */
|
||||||
|
GST_DEBUG_OBJECT (self, "setting a timeout with a %dms interval",
|
||||||
|
self->fps_update_interval);
|
||||||
self->timeout_id =
|
self->timeout_id =
|
||||||
g_timeout_add (self->fps_update_interval, display_current_fps,
|
g_timeout_add (self->fps_update_interval, display_current_fps,
|
||||||
(gpointer) self);
|
(gpointer) self);
|
||||||
|
|
Loading…
Reference in a new issue