validate:scenario: Fix a leak when done waiting for an ASYNC action
[platform/upstream/gstreamer.git] / subprojects / gst-plugins-base / 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., 51 Franklin St, Fifth Floor,
17  * Boston, MA 02110-1301, 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 (gst_video_rate_get_type())
29 G_DECLARE_FINAL_TYPE (GstVideoRate, gst_video_rate, GST, VIDEO_RATE,
30     GstBaseTransform)
31
32 /**
33  * GstVideoRate:
34  *
35  * Opaque data structure.
36  */
37 struct _GstVideoRate
38 {
39   GstBaseTransform parent;
40
41   /* video state */
42   gint from_rate_numerator, from_rate_denominator;
43   gint to_rate_numerator, to_rate_denominator;
44   guint64 next_ts;              /* Timestamp of next buffer to output */
45   GstBuffer *prevbuf;
46   guint64 prev_ts;              /* Previous buffer timestamp */
47   guint64 out_frame_count;      /* number of frames output since the beginning
48                                  * of the segment or the last frame rate caps
49                                  * change, whichever was later */
50   guint64 base_ts;              /* used in next_ts calculation after a
51                                  * frame rate caps change */
52   gboolean discont;
53   guint64 last_ts;              /* Timestamp of last input buffer */
54
55   guint64 average_period;
56   GstClockTimeDiff wanted_diff; /* target average diff */
57   GstClockTimeDiff average;     /* moving average period */
58   gboolean force_variable_rate;
59   gboolean updating_caps;
60   guint64 max_duplication_time;
61
62   /* segment handling */
63   GstSegment segment;
64
65   /* properties */
66   guint64 in, out, dup, drop;
67   gboolean silent;
68   gdouble new_pref;
69   gboolean skip_to_first;
70   gboolean drop_only;
71   guint64 average_period_set;
72
73   int max_rate;
74   gdouble rate;
75   gdouble pending_rate;
76 };
77
78 GST_ELEMENT_REGISTER_DECLARE (videorate);
79
80 G_END_DECLS
81 #endif /* __GST_VIDEO_RATE_H__ */