• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* GStreamer monoscope visualisation element
2  * Copyright (C) <2002> Richard Boulton <richard@tartarus.org>
3  * Copyright (C) <2006> Tim-Philipp Müller <tim centricular net>
4  * Copyright (C) <2006> Wim Taymans <wim at fluendo dot com>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef __GST_MONOSCOPE__
23 #define __GST_MONOSCOPE__
24 
25 G_BEGIN_DECLS
26 
27 #include <gst/gst.h>
28 #include <gst/base/gstadapter.h>
29 
30 #define GST_TYPE_MONOSCOPE            (gst_monoscope_get_type())
31 #define GST_MONOSCOPE(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MONOSCOPE,GstMonoscope))
32 #define GST_MONOSCOPE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MONOSCOPE,GstMonoscopeClass))
33 #define GST_IS_MONOSCOPE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MONOSCOPE))
34 #define GST_IS_MONOSCOPE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MONOSCOPE))
35 
36 typedef struct _GstMonoscope GstMonoscope;
37 typedef struct _GstMonoscopeClass GstMonoscopeClass;
38 
39 struct _GstMonoscope
40 {
41   GstElement element;
42 
43   /* pads */
44   GstPad      *sinkpad;
45   GstPad      *srcpad;
46 
47   GstAdapter  *adapter;
48 
49   guint64      next_ts;             /* expected timestamp of the next frame */
50   guint64      frame_duration;      /* video frame duration    */
51   gint         rate;                /* sample rate             */
52   guint        bps;                 /* bytes per sample        */
53   guint        spf;                 /* samples per video frame */
54   GstBufferPool *pool;
55 
56   GstSegment   segment;
57   gboolean     segment_pending;
58 
59   /* QoS stuff *//* with LOCK */
60   gdouble      proportion;
61   GstClockTime earliest_time;
62 
63   /* video state */
64   gint         fps_num;
65   gint         fps_denom;
66   gint         width;
67   gint         height;
68   guint        outsize;
69 
70   /* visualisation state */
71   struct monoscope_state *visstate;
72 };
73 
74 struct _GstMonoscopeClass
75 {
76   GstElementClass parent_class;
77 };
78 
79 GType gst_monoscope_get_type (void);
80 
81 GST_ELEMENT_REGISTER_DECLARE (monoscope);
82 
83 G_END_DECLS
84 
85 #endif /* __GST_MONOSCOPE__ */
86 
87