Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id C1A21E00C0B; Wed, 27 Jan 2016 04:23:29 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.0 SPF_HELO_PASS SPF: HELO matches SPF record * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from ptmx.org (ptmx.org [178.63.28.110]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id A2E85E00863 for ; Wed, 27 Jan 2016 04:23:25 -0800 (PST) Received: from [10.1.14.248] (vpn.streamunlimited.com [91.114.0.140]) by ptmx.org (Postfix) with ESMTPSA id 1DE662891A for ; Wed, 27 Jan 2016 13:23:23 +0100 (CET) To: meta-freescale@yoctoproject.org References: <1453887720-16863-1-git-send-email-b54851@freescale.com> <1453887720-16863-8-git-send-email-b54851@freescale.com> From: Carlos Rafael Giani Message-ID: <56A8B6BB.50509@pseudoterminal.org> Date: Wed, 27 Jan 2016 13:23:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <1453887720-16863-8-git-send-email-b54851@freescale.com> Subject: Re: [meta-fsl-arm][PATCH 7/9] gstreamer1.0-plugins-bad: Add fps print in glimagesink X-BeenThere: meta-freescale@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Usage and development list for the meta-fsl-* layers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 12:23:29 -0000 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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 > --- > ...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 > +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 > +--- > + 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}"