2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
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.
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.
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.
20 #ifndef __GST_VIDEO_RATE_H__
21 #define __GST_VIDEO_RATE_H__
22 #define VIDEORATE_MODIFICATION
24 #include <gst/base/gstbasetransform.h>
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))
39 typedef struct _GstVideoRate GstVideoRate;
40 typedef struct _GstVideoRateClass GstVideoRateClass;
45 * Opaque data structure.
49 GstBaseTransform parent;
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 */
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 */
63 guint64 last_ts; /* Timestamp of last input buffer */
65 guint64 average_period;
66 GstClockTimeDiff wanted_diff; /* target average diff */
67 GstClockTimeDiff average; /* moving average period */
69 /* segment handling */
73 guint64 in, out, dup, drop;
76 gboolean skip_to_first;
78 guint64 average_period_set;
79 gint force_fps_n, force_fps_d;
81 volatile int max_rate;
84 struct _GstVideoRateClass
86 GstBaseTransformClass parent_class;
89 GType gst_video_rate_get_type (void);
93 #endif /* __GST_VIDEO_RATE_H__ */