1 /* 2 * Copyright 2009 Nokia Corporation <multimedia@maemo.org> 3 * 2006 Zeeshan Ali <zeeshan.ali@nokia.com>. 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU Lesser General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 */ 19 20 #ifndef __FPS_DISPLAY_SINK_H__ 21 #define __FPS_DISPLAY_SINK_H__ 22 23 #include <gst/gst.h> 24 25 G_BEGIN_DECLS 26 27 #define GST_TYPE_FPS_DISPLAY_SINK \ 28 (fps_display_sink_get_type()) 29 #define GST_FPS_DISPLAY_SINK(obj) \ 30 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FPS_DISPLAY_SINK,GstFPSDisplaySink)) 31 #define GST_FPS_DISPLAY_SINK_CLASS(klass) \ 32 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FPS_DISPLAY_SINK,GstFPSDisplaySinkClass)) 33 #define GST_IS_FPS_DISPLAY_SINK(obj) \ 34 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FPS_DISPLAY_SINK)) 35 #define GST_IS_FPS_DISPLAY_SINK_CLASS(klass) \ 36 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FPS_DISPLAY_SINK)) 37 38 GType fps_display_sink_get_type (void); 39 40 typedef struct _GstFPSDisplaySink GstFPSDisplaySink; 41 typedef struct _GstFPSDisplaySinkClass GstFPSDisplaySinkClass; 42 43 struct _GstFPSDisplaySink 44 { 45 GstBin bin; 46 47 /*< private >*/ 48 /* gstreamer components */ 49 GstElement *text_overlay; 50 GstElement *video_sink; 51 GstPad *ghost_pad; 52 53 /* statistics */ 54 gint frames_rendered, frames_dropped; /* ATOMIC */ 55 guint64 last_frames_rendered, last_frames_dropped; 56 57 GstClockTime start_ts; 58 GstClockTime last_ts; 59 GstClockTime interval_ts; 60 guint data_probe_id; 61 62 /* properties */ 63 gboolean sync; 64 gboolean use_text_overlay; 65 gboolean signal_measurements; 66 GstClockTime fps_update_interval; 67 gdouble max_fps; 68 gdouble min_fps; 69 gboolean silent; 70 gchar *last_message; 71 }; 72 73 struct _GstFPSDisplaySinkClass 74 { 75 GstBinClass parent_class; 76 }; 77 78 G_END_DECLS 79 80 #endif /* __FPS_DISPLAY_SINK_H__ */ 81