tizen 2.0 init
[framework/multimedia/gst-plugins-base0.10.git] / gst / videorate / gstvideorate.h
1 /* GStreamer
2  * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef __GST_VIDEO_RATE_H__
21 #define __GST_VIDEO_RATE_H__
22
23 #include <gst/gst.h>
24 #include <gst/base/gstbasetransform.h>
25
26 G_BEGIN_DECLS
27
28 #define GST_TYPE_VIDEO_RATE \
29   (gst_video_rate_get_type())
30 #define GST_VIDEO_RATE(obj) \
31   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VIDEO_RATE,GstVideoRate))
32 #define GST_VIDEO_RATE_CLASS(klass) \
33   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VIDEO_RATE,GstVideoRateClass))
34 #define GST_IS_VIDEO_RATE(obj) \
35   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VIDEO_RATE))
36 #define GST_IS_VIDEO_RATE_CLASS(klass) \
37   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VIDEO_RATE))
38
39 typedef struct _GstVideoRate GstVideoRate;
40 typedef struct _GstVideoRateClass GstVideoRateClass;
41
42 /**
43  * GstVideoRate:
44  *
45  * Opaque data structure.
46  */
47 struct _GstVideoRate
48 {
49   GstBaseTransform parent;
50
51   /* video state */
52   gint from_rate_numerator, from_rate_denominator;
53   gint to_rate_numerator, to_rate_denominator;
54   guint64 next_ts;              /* Timestamp of next buffer to output */
55   GstBuffer *prevbuf;
56   guint64 prev_ts;              /* Previous buffer timestamp */
57   guint64 out_frame_count;      /* number of frames output since the beginning
58                                  * of the segment or the last frame rate caps
59                                  * change, whichever was later */
60   guint64 base_ts;              /* used in next_ts calculation after a
61                                  * frame rate caps change */
62   gboolean discont;
63   guint64 last_ts;              /* Timestamp of last input buffer */
64
65   guint64 average_period;
66   GstClockTimeDiff wanted_diff; /* target average diff */
67   GstClockTimeDiff average;     /* moving average period */
68
69   /* segment handling */
70   GstSegment segment;
71
72   /* properties */
73   guint64 in, out, dup, drop;
74   gboolean silent;
75   gdouble new_pref;
76   gboolean skip_to_first;
77   gboolean drop_only;
78   guint64 average_period_set;
79   gint force_fps_n, force_fps_d;
80
81   volatile int max_rate;
82 };
83
84 struct _GstVideoRateClass
85 {
86   GstBaseTransformClass parent_class;
87 };
88
89 GType gst_video_rate_get_type (void);
90
91 G_END_DECLS
92
93 #endif /* __GST_VIDEO_RATE_H__ */