2006-03-02 16:47:34 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
2012-11-03 23:05:09 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2006-03-02 16:47:34 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GST_VIDEO_RATE_H__
|
|
|
|
#define __GST_VIDEO_RATE_H__
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
2011-08-23 08:11:52 +00:00
|
|
|
#include <gst/base/gstbasetransform.h>
|
2006-03-02 16:47:34 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
2020-03-12 12:27:40 +00:00
|
|
|
|
|
|
|
#define GST_TYPE_VIDEO_RATE (gst_video_rate_get_type())
|
|
|
|
G_DECLARE_FINAL_TYPE (GstVideoRate, gst_video_rate, GST, VIDEO_RATE,
|
|
|
|
GstBaseTransform)
|
2006-03-02 16:47:34 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GstVideoRate:
|
|
|
|
*
|
|
|
|
* Opaque data structure.
|
|
|
|
*/
|
|
|
|
struct _GstVideoRate
|
|
|
|
{
|
2011-08-23 08:11:52 +00:00
|
|
|
GstBaseTransform parent;
|
2006-03-02 16:47:34 +00:00
|
|
|
|
|
|
|
/* video state */
|
|
|
|
gint from_rate_numerator, from_rate_denominator;
|
|
|
|
gint to_rate_numerator, to_rate_denominator;
|
|
|
|
guint64 next_ts; /* Timestamp of next buffer to output */
|
|
|
|
GstBuffer *prevbuf;
|
|
|
|
guint64 prev_ts; /* Previous buffer timestamp */
|
2011-01-06 12:08:53 +00:00
|
|
|
guint64 out_frame_count; /* number of frames output since the beginning
|
|
|
|
* of the segment or the last frame rate caps
|
|
|
|
* change, whichever was later */
|
|
|
|
guint64 base_ts; /* used in next_ts calculation after a
|
|
|
|
* frame rate caps change */
|
2009-04-28 09:32:49 +00:00
|
|
|
gboolean discont;
|
2009-04-30 14:37:38 +00:00
|
|
|
guint64 last_ts; /* Timestamp of last input buffer */
|
2006-03-02 16:47:34 +00:00
|
|
|
|
2011-05-02 09:43:38 +00:00
|
|
|
guint64 average_period;
|
|
|
|
GstClockTimeDiff wanted_diff; /* target average diff */
|
|
|
|
GstClockTimeDiff average; /* moving average period */
|
2014-12-09 12:18:42 +00:00
|
|
|
gboolean force_variable_rate;
|
|
|
|
gboolean updating_caps;
|
2019-02-19 14:59:34 +00:00
|
|
|
guint64 max_duplication_time;
|
2022-09-06 21:25:50 +00:00
|
|
|
guint64 max_closing_segment_duplication_duration;
|
2011-05-02 09:43:38 +00:00
|
|
|
|
2006-03-02 16:47:34 +00:00
|
|
|
/* segment handling */
|
|
|
|
GstSegment segment;
|
|
|
|
|
2006-09-28 11:46:26 +00:00
|
|
|
/* properties */
|
|
|
|
guint64 in, out, dup, drop;
|
2006-03-02 16:47:34 +00:00
|
|
|
gboolean silent;
|
|
|
|
gdouble new_pref;
|
2009-09-11 05:36:10 +00:00
|
|
|
gboolean skip_to_first;
|
2011-04-29 12:58:02 +00:00
|
|
|
gboolean drop_only;
|
2011-05-02 09:43:38 +00:00
|
|
|
guint64 average_period_set;
|
2011-09-19 17:26:04 +00:00
|
|
|
|
2021-03-18 08:18:36 +00:00
|
|
|
int max_rate;
|
2013-09-17 15:42:05 +00:00
|
|
|
gdouble rate;
|
2020-05-31 04:27:14 +00:00
|
|
|
gdouble pending_rate;
|
2022-09-14 19:39:48 +00:00
|
|
|
|
|
|
|
GstCaps *in_caps;
|
|
|
|
/* Only set right after caps were set so that we still have a reference to
|
|
|
|
* the caps matching the content of `->prevbuf`, this way, if we get an EOS
|
|
|
|
* right after a CAPS, we can reset to those caps and close the segment with
|
|
|
|
* it */
|
|
|
|
GstCaps *prev_caps;
|
2006-03-02 16:47:34 +00:00
|
|
|
};
|
|
|
|
|
2021-02-11 09:59:42 +00:00
|
|
|
GST_ELEMENT_REGISTER_DECLARE (videorate);
|
|
|
|
|
2006-03-02 16:47:34 +00:00
|
|
|
G_END_DECLS
|
|
|
|
#endif /* __GST_VIDEO_RATE_H__ */
|