All of lore.kernel.org
 help / color / mirror / Atom feed
From: Carlos Rafael Giani <dv@pseudoterminal.org>
To: meta-freescale@yoctoproject.org
Subject: Re: [meta-fsl-arm][PATCH 7/9] gstreamer1.0-plugins-bad: Add fps print in glimagesink
Date: Wed, 27 Jan 2016 13:23:23 +0100	[thread overview]
Message-ID: <56A8B6BB.50509@pseudoterminal.org> (raw)
In-Reply-To: <1453887720-16863-8-git-send-email-b54851@freescale.com>

This seems like a patch for debug output (the number of frames shown so 
far). This is OK, except that it should not be always enabled, and it 
should not directly call g_print. Have a look at fpsdisplaysink. It uses 
the last-message property, a "silent" property, and 
g_object_notify_by_pspec() to send out messages just like fakesink does.

Example:

gst-launch-1.0 videotestsrc ! fpsdisplaysink text-overlay=false 
silent=false -v

This is how your output should work.


On 01/27/2016 10:41 AM, Yuqing Zhu wrote:
> In GST-1.6, Pipeline will set start time to 0 when state
> change form PAUSE to READY, so get start time in state change
> PLAYING_PAUSE.
>
> Signed-off-by: Yuqing Zhu <b54851@freescale.com>
> ---
>   ...008-glplugin-Add-fps-print-in-glimagesink.patch | 83 ++++++++++++++++++++++
>   .../gstreamer/gstreamer1.0-plugins-bad_%.bbappend  |  1 +
>   2 files changed, 84 insertions(+)
>   create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0008-glplugin-Add-fps-print-in-glimagesink.patch
>
> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0008-glplugin-Add-fps-print-in-glimagesink.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0008-glplugin-Add-fps-print-in-glimagesink.patch
> new file mode 100755
> index 0000000..32f78b2
> --- /dev/null
> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0008-glplugin-Add-fps-print-in-glimagesink.patch
> @@ -0,0 +1,83 @@
> +From 8b6786fa049e9a5acfd6e7776fe0790c57c9c569 Mon Sep 17 00:00:00 2001
> +From: Haihua Hu <b55597@freescale.com>
> +Date: Wed, 18 Nov 2015 15:10:22 +0800
> +Subject: [PATCH 1/5] [glplugin] Add fps print in glimagesink
> +
> +In GST-1.6, Pipeline will set start time to 0 when state
> +change form PAUSE to READY, so get start time in state change
> +PLAYING_PAUSE.
> +
> +Upstream-Status: Inappropriate [i.MX specific]
> +
> +Signed-off-by: Haihua Hu <b55597@freescale.com>
> +---
> + ext/gl/gstglimagesink.c |   15 +++++++++++++++
> + ext/gl/gstglimagesink.h |    4 ++++
> + 2 files changed, 19 insertions(+)
> +
> +diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c
> +index 6fc0f9e..60355ec 100644
> +--- a/ext/gl/gstglimagesink.c
> ++++ b/ext/gl/gstglimagesink.c
> +@@ -587,6 +587,8 @@ gst_glimage_sink_init (GstGLImageSink * glimage_sink)
> +   glimage_sink->overlay_compositor = NULL;
> +   glimage_sink->cropmeta = NULL;
> +   glimage_sink->prev_cropmeta = NULL;
> ++  glimage_sink->frame_showed = 0;
> ++  glimage_sink->run_time = 0;
> +
> +   glimage_sink->mview_output_mode = DEFAULT_MULTIVIEW_MODE;
> +   glimage_sink->mview_output_flags = DEFAULT_MULTIVIEW_FLAGS;
> +@@ -964,7 +966,10 @@ gst_glimage_sink_change_state (GstElement * element, GstStateChange transition)
> +
> +   switch (transition) {
> +     case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
> ++    {
> ++      glimage_sink->run_time = gst_element_get_start_time (GST_ELEMENT (glimage_sink));
> +       break;
> ++    }
> +     case GST_STATE_CHANGE_PAUSED_TO_READY:
> +     {
> +       GstBuffer *buf[2];
> +@@ -1047,6 +1052,14 @@ gst_glimage_sink_change_state (GstElement * element, GstStateChange transition)
> +         g_slice_free(GstVideoCropMeta, glimage_sink->prev_cropmeta);
> +       glimage_sink->prev_cropmeta = NULL;
> +
> ++      if (glimage_sink->run_time > 0) {
> ++        g_print ("Total showed frames (%lld), playing for (%"GST_TIME_FORMAT"), fps (%.3f).\n",
> ++                glimage_sink->frame_showed, GST_TIME_ARGS (glimage_sink->run_time),
> ++                (gfloat)GST_SECOND * glimage_sink->frame_showed / glimage_sink->run_time);
> ++      }
> ++
> ++      glimage_sink->frame_showed = 0;
> ++      glimage_sink->run_time = 0;
> +       break;
> +     default:
> +       break;
> +@@ -1474,6 +1487,8 @@ gst_glimage_sink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
> +     return GST_FLOW_ERROR;
> +   }
> +
> ++  glimage_sink->frame_showed++;
> ++
> +   return GST_FLOW_OK;
> +
> + /* ERRORS */
> +diff --git a/ext/gl/gstglimagesink.h b/ext/gl/gstglimagesink.h
> +index a26ca4b..fa69999 100644
> +--- a/ext/gl/gstglimagesink.h
> ++++ b/ext/gl/gstglimagesink.h
> +@@ -120,6 +120,10 @@ struct _GstGLImageSink
> +     GstGLStereoDownmix mview_downmix_mode;
> +
> +     GstGLOverlayCompositor *overlay_compositor;
> ++
> ++    /* fps print support */
> ++    guint64 frame_showed;
> ++    GstClockTime run_time;
> + };
> +
> + struct _GstGLImageSinkClass
> +--
> +1.7.9.5
> +
> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend
> index 40be87a..d3b8c2d 100644
> --- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend
> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend
> @@ -17,6 +17,7 @@ IMX_PATCHES = " file://0001-PATCH-install-gstaggregator-and-gstvideoaggregator-h
>                   file://0005-glplugin-support-video-crop-for-glimagesink.patch \
>                   file://0006-glplugin-Support-fb-backend-for-gl-plugins.patch \
>                   file://0007-glplugin-Change-wayland-default-res-to-1024x768.patch \
> +                file://0008-glplugin-Add-fps-print-in-glimagesink.patch \
>   "
>   
>   SRC_URI_append_mx6 = "${IMX_PATCHES}"



  reply	other threads:[~2016-01-27 12:23 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-27  9:41 [meta-fsl-arm][PATCH 0/9] Add patches for gstreamer1.0-plugins-bad 1.6 Yuqing Zhu
2016-01-27  9:41 ` [meta-fsl-arm][PATCH 1/9] gstreamer1.0-plugins-bad: Modify the videoparsers rank down to avoid link them in Yuqing Zhu
2016-01-27 11:17   ` Carlos Rafael Giani
2016-01-27  9:41 ` [meta-fsl-arm][PATCH 2/9] gstreamer1.0-plugins-bad: Fix for gl plugin not built in wayland backend Yuqing Zhu
2016-01-27 11:21   ` Carlos Rafael Giani
2016-01-27 12:05     ` Otavio Salvador
2016-01-28  7:29     ` Yuqing Zhu
2016-01-28 11:52       ` Otavio Salvador
2016-02-01  6:54         ` Yuqing Zhu
2016-02-01  7:25           ` Carlos Rafael Giani
2016-02-01  9:38             ` Yuqing Zhu
2016-02-01 12:43           ` Otavio Salvador
2016-02-02 13:57             ` Yuqing Zhu
2016-01-27  9:41 ` [meta-fsl-arm][PATCH 3/9] gstreamer1.0-plugins-bad: Add directviv to glimagesink to improve playback performance Yuqing Zhu
2016-01-27  9:41 ` [meta-fsl-arm][PATCH 4/9] gstreamer1.0-plugins-bad: Support video crop for glimagesink Yuqing Zhu
2016-01-27  9:41 ` [meta-fsl-arm][PATCH 5/9] gstreamer1.0-plugins-bad: Support fb backend for gl plugins Yuqing Zhu
2016-01-27  9:41 ` [meta-fsl-arm][PATCH 6/9] gstreamer1.0-plugins-bad: Change wayland default res to 1024x768 Yuqing Zhu
2016-01-27 12:24   ` Carlos Rafael Giani
2016-01-29  6:41     ` Yuqing Zhu
2016-02-01  7:26       ` Carlos Rafael Giani
2016-01-27  9:41 ` [meta-fsl-arm][PATCH 7/9] gstreamer1.0-plugins-bad: Add fps print in glimagesink Yuqing Zhu
2016-01-27 12:23   ` Carlos Rafael Giani [this message]
2016-01-28  7:22     ` Yuqing Zhu
2016-01-28 17:10       ` Pushpal Sidhu
2016-01-29  6:28         ` Yuqing Zhu
2016-01-27  9:41 ` [meta-fsl-arm][PATCH 8/9] gstreamer1.0-plugins-bad: Fix gleffects fisheye shader compile error Yuqing Zhu
2016-01-27 12:11   ` Carlos Rafael Giani
2016-01-28  7:25     ` Yuqing Zhu
2016-02-01  7:27       ` Carlos Rafael Giani
2016-02-01  9:25         ` Yuqing Zhu
2016-01-27  9:42 ` [meta-fsl-arm][PATCH 9/9] gstreamer1.0-plugins-bad: Roll-back h264parse rank Yuqing Zhu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56A8B6BB.50509@pseudoterminal.org \
    --to=dv@pseudoterminal.org \
    --cc=meta-freescale@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.