gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +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
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
|
|
|
|
2004-06-26 15:43:55 +00:00
|
|
|
GST_DEBUG_CATEGORY (videorate_debug);
|
|
|
|
#define GST_CAT_DEFAULT videorate_debug
|
|
|
|
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
#define GST_TYPE_VIDEORATE \
|
|
|
|
(gst_videorate_get_type())
|
|
|
|
#define GST_VIDEORATE(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VIDEORATE,GstVideorate))
|
|
|
|
#define GST_VIDEORATE_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VIDEORATE,GstVideorate))
|
|
|
|
#define GST_IS_VIDEORATE(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VIDEORATE))
|
|
|
|
#define GST_IS_VIDEORATE_CLASS(obj) \
|
|
|
|
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VIDEORATE))
|
|
|
|
|
|
|
|
typedef struct _GstVideorate GstVideorate;
|
|
|
|
typedef struct _GstVideorateClass GstVideorateClass;
|
|
|
|
|
|
|
|
struct _GstVideorate
|
|
|
|
{
|
|
|
|
GstElement element;
|
|
|
|
|
|
|
|
GstPad *sinkpad, *srcpad;
|
|
|
|
|
|
|
|
/* video state */
|
|
|
|
gdouble from_fps, to_fps;
|
|
|
|
guint64 next_ts;
|
2004-12-19 13:16:24 +00:00
|
|
|
guint64 first_ts;
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
GstBuffer *prevbuf;
|
|
|
|
guint64 in, out, dup, drop;
|
2004-06-22 11:19:46 +00:00
|
|
|
|
|
|
|
gboolean silent;
|
|
|
|
gdouble new_pref;
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GstVideorateClass
|
|
|
|
{
|
|
|
|
GstElementClass parent_class;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* elementfactory information */
|
|
|
|
static GstElementDetails videorate_details =
|
|
|
|
GST_ELEMENT_DETAILS ("Video rate adjuster",
|
|
|
|
"Filter/Effect/Video",
|
|
|
|
"Drops/duplicates/adjusts timestamps on video frames to make a perfect stream",
|
|
|
|
"Wim Taymans <wim@fluendo.com>");
|
|
|
|
|
|
|
|
/* GstVideorate signals and args */
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
/* FILL ME */
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
2004-06-22 11:19:46 +00:00
|
|
|
#define DEFAULT_SILENT TRUE
|
|
|
|
#define DEFAULT_NEW_PREF 1.0
|
|
|
|
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
ARG_0,
|
|
|
|
ARG_IN,
|
|
|
|
ARG_OUT,
|
|
|
|
ARG_DUP,
|
|
|
|
ARG_DROP,
|
2004-06-22 11:19:46 +00:00
|
|
|
ARG_SILENT,
|
|
|
|
ARG_NEW_PREF,
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
/* FILL ME */
|
|
|
|
};
|
|
|
|
|
|
|
|
static GstStaticPadTemplate gst_videorate_src_template =
|
2004-11-23 12:39:27 +00:00
|
|
|
GST_STATIC_PAD_TEMPLATE ("src",
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
2004-11-23 12:39:27 +00:00
|
|
|
GST_STATIC_CAPS ("video/x-raw-yuv; video/x-raw-rgb")
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
static GstStaticPadTemplate gst_videorate_sink_template =
|
2004-11-23 12:39:27 +00:00
|
|
|
GST_STATIC_PAD_TEMPLATE ("sink",
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
2004-11-23 12:39:27 +00:00
|
|
|
GST_STATIC_CAPS ("video/x-raw-yuv; video/x-raw-rgb")
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
static void gst_videorate_base_init (gpointer g_class);
|
|
|
|
static void gst_videorate_class_init (GstVideorateClass * klass);
|
|
|
|
static void gst_videorate_init (GstVideorate * videorate);
|
2005-05-09 14:03:20 +00:00
|
|
|
static gboolean gst_videorate_event (GstPad * pad, GstEvent * event);
|
|
|
|
static GstFlowReturn gst_videorate_chain (GstPad * pad, GstBuffer * buffer);
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
|
|
|
|
static void gst_videorate_set_property (GObject * object,
|
|
|
|
guint prop_id, const GValue * value, GParamSpec * pspec);
|
|
|
|
static void gst_videorate_get_property (GObject * object,
|
|
|
|
guint prop_id, GValue * value, GParamSpec * pspec);
|
|
|
|
|
|
|
|
static GstElementStateReturn gst_videorate_change_state (GstElement * element);
|
|
|
|
|
|
|
|
static GstElementClass *parent_class = NULL;
|
|
|
|
|
|
|
|
/*static guint gst_videorate_signals[LAST_SIGNAL] = { 0 }; */
|
|
|
|
|
|
|
|
static GType
|
|
|
|
gst_videorate_get_type (void)
|
|
|
|
{
|
|
|
|
static GType videorate_type = 0;
|
|
|
|
|
|
|
|
if (!videorate_type) {
|
|
|
|
static const GTypeInfo videorate_info = {
|
|
|
|
sizeof (GstVideorateClass),
|
|
|
|
gst_videorate_base_init,
|
|
|
|
NULL,
|
|
|
|
(GClassInitFunc) gst_videorate_class_init,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
sizeof (GstVideorate),
|
|
|
|
0,
|
|
|
|
(GInstanceInitFunc) gst_videorate_init,
|
|
|
|
};
|
|
|
|
|
|
|
|
videorate_type = g_type_register_static (GST_TYPE_ELEMENT,
|
|
|
|
"GstVideorate", &videorate_info, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
return videorate_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_videorate_base_init (gpointer g_class)
|
|
|
|
{
|
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
|
|
|
|
|
|
|
gst_element_class_set_details (element_class, &videorate_details);
|
|
|
|
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&gst_videorate_sink_template));
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&gst_videorate_src_template));
|
|
|
|
}
|
|
|
|
static void
|
|
|
|
gst_videorate_class_init (GstVideorateClass * klass)
|
|
|
|
{
|
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
|
|
|
|
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
|
|
|
|
2005-05-09 14:03:20 +00:00
|
|
|
object_class->set_property = gst_videorate_set_property;
|
|
|
|
object_class->get_property = gst_videorate_get_property;
|
|
|
|
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
g_object_class_install_property (object_class, ARG_IN,
|
|
|
|
g_param_spec_uint64 ("in", "In",
|
|
|
|
"Number of input frames", 0, G_MAXUINT64, 0, G_PARAM_READABLE));
|
|
|
|
g_object_class_install_property (object_class, ARG_OUT,
|
|
|
|
g_param_spec_uint64 ("out", "Out",
|
|
|
|
"Number of output frames", 0, G_MAXUINT64, 0, G_PARAM_READABLE));
|
|
|
|
g_object_class_install_property (object_class, ARG_DUP,
|
|
|
|
g_param_spec_uint64 ("duplicate", "Duplicate",
|
|
|
|
"Number of duplicated frames", 0, G_MAXUINT64, 0, G_PARAM_READABLE));
|
|
|
|
g_object_class_install_property (object_class, ARG_DROP,
|
|
|
|
g_param_spec_uint64 ("drop", "Drop",
|
|
|
|
"Number of dropped frames", 0, G_MAXUINT64, 0, G_PARAM_READABLE));
|
2004-06-22 11:19:46 +00:00
|
|
|
g_object_class_install_property (object_class, ARG_SILENT,
|
|
|
|
g_param_spec_boolean ("silent", "silent",
|
|
|
|
"Don't emit notify for dropped and duplicated frames",
|
|
|
|
DEFAULT_SILENT, G_PARAM_READWRITE));
|
|
|
|
g_object_class_install_property (object_class, ARG_NEW_PREF,
|
|
|
|
g_param_spec_double ("new_pref", "New Pref",
|
|
|
|
"Value indicating how much to prefer new frames",
|
|
|
|
0.0, 1.0, DEFAULT_NEW_PREF, G_PARAM_READWRITE));
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
|
|
|
|
element_class->change_state = gst_videorate_change_state;
|
|
|
|
}
|
|
|
|
|
2005-05-09 14:33:05 +00:00
|
|
|
/* return the caps that can be used on out_pad given in_caps on in_pad */
|
|
|
|
static gboolean
|
|
|
|
gst_videorate_transformcaps (GstPad * in_pad, GstCaps * in_caps,
|
|
|
|
GstPad * out_pad, GstCaps ** out_caps)
|
|
|
|
{
|
|
|
|
GstCaps *intersect;
|
|
|
|
const GstCaps *in_templ;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
in_templ = gst_pad_get_pad_template_caps (in_pad);
|
|
|
|
intersect = gst_caps_intersect (in_caps, in_templ);
|
|
|
|
|
|
|
|
/* all possible framerates are allowed */
|
|
|
|
for (i = 0; i < gst_caps_get_size (intersect); i++) {
|
|
|
|
GstStructure *structure;
|
|
|
|
|
|
|
|
structure = gst_caps_get_structure (intersect, i);
|
|
|
|
|
|
|
|
gst_structure_set (structure,
|
|
|
|
"framerate", GST_TYPE_DOUBLE_RANGE, 0.0, G_MAXDOUBLE, NULL);
|
|
|
|
}
|
|
|
|
*out_caps = intersect;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
static GstCaps *
|
|
|
|
gst_videorate_getcaps (GstPad * pad)
|
|
|
|
{
|
|
|
|
GstVideorate *videorate;
|
|
|
|
GstPad *otherpad;
|
2005-05-09 14:03:20 +00:00
|
|
|
GstCaps *caps;
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
|
2005-05-09 14:03:20 +00:00
|
|
|
videorate = GST_VIDEORATE (GST_PAD_PARENT (pad));
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
|
|
|
|
otherpad = (pad == videorate->srcpad) ? videorate->sinkpad :
|
|
|
|
videorate->srcpad;
|
|
|
|
|
2005-05-09 14:03:20 +00:00
|
|
|
/* we can do what the peer can */
|
|
|
|
caps = gst_pad_peer_get_caps (otherpad);
|
|
|
|
if (caps) {
|
2005-05-09 14:33:05 +00:00
|
|
|
GstCaps *transform;
|
2005-05-09 14:03:20 +00:00
|
|
|
|
2005-05-09 14:33:05 +00:00
|
|
|
gst_videorate_transformcaps (otherpad, caps, pad, &transform);
|
2005-05-09 14:03:20 +00:00
|
|
|
gst_caps_unref (caps);
|
2005-05-09 14:33:05 +00:00
|
|
|
caps = transform;
|
2005-05-09 14:03:20 +00:00
|
|
|
} else {
|
|
|
|
/* no peer, our padtemplate is enough then */
|
|
|
|
caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad));
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
}
|
|
|
|
|
2005-05-09 14:03:20 +00:00
|
|
|
return caps;
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
}
|
|
|
|
|
2005-05-09 14:03:20 +00:00
|
|
|
static gboolean
|
|
|
|
gst_videorate_setcaps (GstPad * pad, GstCaps * caps)
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
{
|
|
|
|
GstVideorate *videorate;
|
|
|
|
GstStructure *structure;
|
2005-05-09 14:03:20 +00:00
|
|
|
gboolean ret = TRUE;
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
double fps;
|
2005-05-09 14:03:20 +00:00
|
|
|
GstPad *otherpad, *opeer;
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
|
2005-05-09 14:03:20 +00:00
|
|
|
videorate = GST_VIDEORATE (GST_PAD_PARENT (pad));
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
|
|
|
|
structure = gst_caps_get_structure (caps, 0);
|
2005-05-09 14:03:20 +00:00
|
|
|
if (!(ret = gst_structure_get_double (structure, "framerate", &fps)))
|
|
|
|
goto done;
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
|
|
|
|
if (pad == videorate->srcpad) {
|
|
|
|
videorate->to_fps = fps;
|
2005-05-09 14:03:20 +00:00
|
|
|
otherpad = videorate->sinkpad;
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
} else {
|
|
|
|
videorate->from_fps = fps;
|
2005-05-09 14:03:20 +00:00
|
|
|
otherpad = videorate->srcpad;
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
}
|
2005-05-09 14:03:20 +00:00
|
|
|
/* now try to find something for the peer */
|
|
|
|
opeer = gst_pad_get_peer (otherpad);
|
|
|
|
if (opeer) {
|
|
|
|
if (gst_pad_accept_caps (opeer, caps)) {
|
|
|
|
/* the peer accepts the caps as they are */
|
|
|
|
gst_pad_set_caps (otherpad, caps);
|
|
|
|
|
|
|
|
ret = TRUE;
|
|
|
|
} else {
|
|
|
|
GstCaps *peercaps;
|
|
|
|
GstCaps *intersect;
|
2005-05-09 14:33:05 +00:00
|
|
|
GstCaps *transform = NULL;
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
|
2005-05-09 14:33:05 +00:00
|
|
|
ret = FALSE;
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
|
2005-05-09 14:33:05 +00:00
|
|
|
/* see how we can transform the input caps */
|
|
|
|
if (!gst_videorate_transformcaps (pad, caps, otherpad, &transform))
|
|
|
|
goto done;
|
2005-05-09 14:03:20 +00:00
|
|
|
|
2005-05-09 14:33:05 +00:00
|
|
|
/* see what the peer can do */
|
|
|
|
peercaps = gst_pad_get_caps (opeer);
|
2005-05-09 14:03:20 +00:00
|
|
|
|
2005-06-23 16:23:12 +00:00
|
|
|
GST_DEBUG ("icaps %" GST_PTR_FORMAT, peercaps);
|
|
|
|
GST_DEBUG ("transform %" GST_PTR_FORMAT, transform);
|
|
|
|
|
2005-05-09 14:33:05 +00:00
|
|
|
/* filter against our possibilities */
|
|
|
|
intersect = gst_caps_intersect (peercaps, transform);
|
2005-05-09 14:03:20 +00:00
|
|
|
gst_caps_unref (peercaps);
|
2005-05-09 14:33:05 +00:00
|
|
|
gst_caps_unref (transform);
|
2005-05-09 14:03:20 +00:00
|
|
|
|
2005-06-23 16:23:12 +00:00
|
|
|
GST_DEBUG ("intersect %" GST_PTR_FORMAT, intersect);
|
|
|
|
|
2005-05-09 14:33:05 +00:00
|
|
|
/* take first possibility */
|
|
|
|
caps = gst_caps_copy_nth (intersect, 0);
|
|
|
|
gst_caps_unref (intersect);
|
|
|
|
structure = gst_caps_get_structure (caps, 0);
|
2005-05-09 14:03:20 +00:00
|
|
|
|
2005-05-09 14:33:05 +00:00
|
|
|
/* and fixate */
|
2005-06-23 16:23:12 +00:00
|
|
|
gst_caps_structure_fixate_field_nearest_int (structure, "framerate", fps);
|
|
|
|
|
|
|
|
gst_structure_get_double (structure, "framerate", &fps);
|
|
|
|
|
|
|
|
if (otherpad == videorate->srcpad) {
|
|
|
|
videorate->to_fps = fps;
|
|
|
|
} else {
|
|
|
|
videorate->from_fps = fps;
|
2005-05-09 14:03:20 +00:00
|
|
|
}
|
2005-06-23 16:23:12 +00:00
|
|
|
gst_pad_set_caps (otherpad, caps);
|
|
|
|
ret = TRUE;
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
}
|
2005-06-28 10:16:13 +00:00
|
|
|
gst_object_unref (opeer);
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
}
|
2005-05-09 14:03:20 +00:00
|
|
|
done:
|
|
|
|
return ret;
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
}
|
|
|
|
|
2004-12-19 13:16:24 +00:00
|
|
|
static void
|
|
|
|
gst_videorate_blank_data (GstVideorate * videorate)
|
|
|
|
{
|
|
|
|
GST_DEBUG ("resetting data");
|
|
|
|
if (videorate->prevbuf)
|
|
|
|
gst_buffer_unref (videorate->prevbuf);
|
|
|
|
videorate->prevbuf = NULL;
|
2005-05-09 14:03:20 +00:00
|
|
|
|
|
|
|
videorate->from_fps = 0;
|
|
|
|
videorate->to_fps = 0;
|
2004-12-19 13:16:24 +00:00
|
|
|
videorate->in = 0;
|
|
|
|
videorate->out = 0;
|
|
|
|
videorate->drop = 0;
|
|
|
|
videorate->dup = 0;
|
|
|
|
videorate->next_ts = 0LL;
|
|
|
|
videorate->first_ts = 0LL;
|
|
|
|
}
|
|
|
|
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
static void
|
|
|
|
gst_videorate_init (GstVideorate * videorate)
|
|
|
|
{
|
|
|
|
GST_DEBUG ("gst_videorate_init");
|
|
|
|
videorate->sinkpad =
|
|
|
|
gst_pad_new_from_template (gst_static_pad_template_get
|
|
|
|
(&gst_videorate_sink_template), "sink");
|
|
|
|
gst_element_add_pad (GST_ELEMENT (videorate), videorate->sinkpad);
|
2005-05-09 14:03:20 +00:00
|
|
|
gst_pad_set_event_function (videorate->sinkpad, gst_videorate_event);
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
gst_pad_set_chain_function (videorate->sinkpad, gst_videorate_chain);
|
|
|
|
gst_pad_set_getcaps_function (videorate->sinkpad, gst_videorate_getcaps);
|
2005-05-09 14:03:20 +00:00
|
|
|
gst_pad_set_setcaps_function (videorate->sinkpad, gst_videorate_setcaps);
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
|
|
|
|
videorate->srcpad =
|
|
|
|
gst_pad_new_from_template (gst_static_pad_template_get
|
|
|
|
(&gst_videorate_src_template), "src");
|
|
|
|
gst_element_add_pad (GST_ELEMENT (videorate), videorate->srcpad);
|
|
|
|
gst_pad_set_getcaps_function (videorate->srcpad, gst_videorate_getcaps);
|
2005-05-09 14:03:20 +00:00
|
|
|
gst_pad_set_setcaps_function (videorate->srcpad, gst_videorate_setcaps);
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
|
2004-12-19 13:16:24 +00:00
|
|
|
gst_videorate_blank_data (videorate);
|
2004-06-22 11:19:46 +00:00
|
|
|
videorate->silent = DEFAULT_SILENT;
|
2004-06-22 11:57:22 +00:00
|
|
|
videorate->new_pref = DEFAULT_NEW_PREF;
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
}
|
|
|
|
|
2005-05-09 14:03:20 +00:00
|
|
|
static GstFlowReturn
|
|
|
|
gst_videorate_event (GstPad * pad, GstEvent * event)
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
{
|
2005-05-09 14:03:20 +00:00
|
|
|
GstVideorate *videorate;
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
|
2005-05-09 14:03:20 +00:00
|
|
|
videorate = GST_VIDEORATE (GST_PAD_PARENT (pad));
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
|
2005-05-09 14:03:20 +00:00
|
|
|
if (!videorate->prevbuf)
|
|
|
|
goto done;
|
2004-12-19 13:16:24 +00:00
|
|
|
|
2005-05-09 14:03:20 +00:00
|
|
|
switch (GST_EVENT_TYPE (event)) {
|
examples/seeking/seek.c: Update seek example.
Original commit message from CVS:
* examples/seeking/seek.c: (setup_dynamic_link),
(make_dv_pipeline), (make_vorbis_theora_pipeline), (query_rates),
(query_positions_elems), (query_positions_pads), (do_seek):
Update seek example.
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_typefind), (gst_ogg_demux_chain_elem_pad),
(gst_ogg_demux_queue_data), (gst_ogg_demux_chain_peer),
(gst_ogg_pad_submit_packet), (gst_ogg_pad_submit_page),
(gst_ogg_demux_handle_event),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_send_event),
(gst_ogg_demux_loop):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_collected):
* ext/theora/theoradec.c: (theora_dec_src_event),
(theora_dec_src_getcaps), (theora_dec_sink_event),
(theora_dec_push), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_event),
(vorbis_dec_sink_event), (vorbis_dec_push),
(vorbis_handle_data_packet):
* ext/vorbis/vorbisenc.c: (gst_vorbisenc_sink_event),
(gst_vorbisenc_chain):
* gst/playback/gststreaminfo.c: (cb_probe):
* gst/subparse/gstsubparse.c: (gst_subparse_src_event):
* gst/videorate/gstvideorate.c: (gst_videorate_event):
* gst/videoscale/gstvideoscale.c:
(gst_videoscale_handle_src_event):
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_event):
* sys/ximage/ximagesink.c: (gst_ximagesink_show_frame),
(gst_ximagesink_navigation_send_event):
* sys/xvimage/xvimagesink.c:
(gst_xvimagesink_navigation_send_event):
Various event updates and cleanups
2005-07-27 18:34:29 +00:00
|
|
|
case GST_EVENT_NEWSEGMENT:
|
2005-05-09 14:03:20 +00:00
|
|
|
{
|
examples/seeking/seek.c: Update seek example.
Original commit message from CVS:
* examples/seeking/seek.c: (setup_dynamic_link),
(make_dv_pipeline), (make_vorbis_theora_pipeline), (query_rates),
(query_positions_elems), (query_positions_pads), (do_seek):
Update seek example.
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_typefind), (gst_ogg_demux_chain_elem_pad),
(gst_ogg_demux_queue_data), (gst_ogg_demux_chain_peer),
(gst_ogg_pad_submit_packet), (gst_ogg_pad_submit_page),
(gst_ogg_demux_handle_event),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_send_event),
(gst_ogg_demux_loop):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_collected):
* ext/theora/theoradec.c: (theora_dec_src_event),
(theora_dec_src_getcaps), (theora_dec_sink_event),
(theora_dec_push), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_event),
(vorbis_dec_sink_event), (vorbis_dec_push),
(vorbis_handle_data_packet):
* ext/vorbis/vorbisenc.c: (gst_vorbisenc_sink_event),
(gst_vorbisenc_chain):
* gst/playback/gststreaminfo.c: (cb_probe):
* gst/subparse/gstsubparse.c: (gst_subparse_src_event):
* gst/videorate/gstvideorate.c: (gst_videorate_event):
* gst/videoscale/gstvideoscale.c:
(gst_videoscale_handle_src_event):
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_event):
* sys/ximage/ximagesink.c: (gst_ximagesink_show_frame),
(gst_ximagesink_navigation_send_event):
* sys/xvimage/xvimagesink.c:
(gst_xvimagesink_navigation_send_event):
Various event updates and cleanups
2005-07-27 18:34:29 +00:00
|
|
|
gint64 start, stop;
|
|
|
|
GstFormat format;
|
2005-05-09 14:03:20 +00:00
|
|
|
|
|
|
|
GST_STREAM_LOCK (pad);
|
|
|
|
|
examples/seeking/seek.c: Update seek example.
Original commit message from CVS:
* examples/seeking/seek.c: (setup_dynamic_link),
(make_dv_pipeline), (make_vorbis_theora_pipeline), (query_rates),
(query_positions_elems), (query_positions_pads), (do_seek):
Update seek example.
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_typefind), (gst_ogg_demux_chain_elem_pad),
(gst_ogg_demux_queue_data), (gst_ogg_demux_chain_peer),
(gst_ogg_pad_submit_packet), (gst_ogg_pad_submit_page),
(gst_ogg_demux_handle_event),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_send_event),
(gst_ogg_demux_loop):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_collected):
* ext/theora/theoradec.c: (theora_dec_src_event),
(theora_dec_src_getcaps), (theora_dec_sink_event),
(theora_dec_push), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_event),
(vorbis_dec_sink_event), (vorbis_dec_push),
(vorbis_handle_data_packet):
* ext/vorbis/vorbisenc.c: (gst_vorbisenc_sink_event),
(gst_vorbisenc_chain):
* gst/playback/gststreaminfo.c: (cb_probe):
* gst/subparse/gstsubparse.c: (gst_subparse_src_event):
* gst/videorate/gstvideorate.c: (gst_videorate_event):
* gst/videoscale/gstvideoscale.c:
(gst_videoscale_handle_src_event):
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_event):
* sys/ximage/ximagesink.c: (gst_ximagesink_show_frame),
(gst_ximagesink_navigation_send_event):
* sys/xvimage/xvimagesink.c:
(gst_xvimagesink_navigation_send_event):
Various event updates and cleanups
2005-07-27 18:34:29 +00:00
|
|
|
gst_event_parse_newsegment (event, NULL, &format, &start, &stop, NULL);
|
|
|
|
|
|
|
|
if (format != GST_FORMAT_TIME) {
|
2004-12-19 13:16:24 +00:00
|
|
|
GST_WARNING ("Got discont but doesn't have GST_FORMAT_TIME value");
|
examples/seeking/seek.c: Update seek example.
Original commit message from CVS:
* examples/seeking/seek.c: (setup_dynamic_link),
(make_dv_pipeline), (make_vorbis_theora_pipeline), (query_rates),
(query_positions_elems), (query_positions_pads), (do_seek):
Update seek example.
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_event),
(gst_ogg_pad_typefind), (gst_ogg_demux_chain_elem_pad),
(gst_ogg_demux_queue_data), (gst_ogg_demux_chain_peer),
(gst_ogg_pad_submit_packet), (gst_ogg_pad_submit_page),
(gst_ogg_demux_handle_event),
(gst_ogg_demux_deactivate_current_chain),
(gst_ogg_demux_activate_chain), (gst_ogg_demux_perform_seek),
(gst_ogg_demux_collect_chain_info), (gst_ogg_demux_collect_info),
(gst_ogg_demux_chain), (gst_ogg_demux_send_event),
(gst_ogg_demux_loop):
* ext/ogg/gstoggmux.c: (gst_ogg_mux_collected):
* ext/theora/theoradec.c: (theora_dec_src_event),
(theora_dec_src_getcaps), (theora_dec_sink_event),
(theora_dec_push), (theora_dec_chain):
* ext/vorbis/Makefile.am:
* ext/vorbis/vorbisdec.c: (vorbis_dec_src_event),
(vorbis_dec_sink_event), (vorbis_dec_push),
(vorbis_handle_data_packet):
* ext/vorbis/vorbisenc.c: (gst_vorbisenc_sink_event),
(gst_vorbisenc_chain):
* gst/playback/gststreaminfo.c: (cb_probe):
* gst/subparse/gstsubparse.c: (gst_subparse_src_event):
* gst/videorate/gstvideorate.c: (gst_videorate_event):
* gst/videoscale/gstvideoscale.c:
(gst_videoscale_handle_src_event):
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_event):
* sys/ximage/ximagesink.c: (gst_ximagesink_show_frame),
(gst_ximagesink_navigation_send_event):
* sys/xvimage/xvimagesink.c:
(gst_xvimagesink_navigation_send_event):
Various event updates and cleanups
2005-07-27 18:34:29 +00:00
|
|
|
} else {
|
2004-12-19 13:16:24 +00:00
|
|
|
gst_videorate_blank_data (videorate);
|
2005-05-09 14:03:20 +00:00
|
|
|
videorate->first_ts = start;
|
2004-12-19 13:16:24 +00:00
|
|
|
}
|
2005-05-09 14:03:20 +00:00
|
|
|
GST_STREAM_UNLOCK (pad);
|
|
|
|
|
|
|
|
break;
|
2004-12-19 13:16:24 +00:00
|
|
|
}
|
2005-05-09 14:03:20 +00:00
|
|
|
default:
|
|
|
|
break;
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
}
|
2005-05-09 14:03:20 +00:00
|
|
|
done:
|
|
|
|
return gst_pad_event_default (pad, event);
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstFlowReturn
|
|
|
|
gst_videorate_chain (GstPad * pad, GstBuffer * buffer)
|
|
|
|
{
|
|
|
|
GstVideorate *videorate;
|
|
|
|
GstFlowReturn res = GST_FLOW_OK;
|
|
|
|
|
|
|
|
videorate = GST_VIDEORATE (GST_PAD_PARENT (pad));
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
|
2005-05-09 14:03:20 +00:00
|
|
|
if (videorate->from_fps == 0)
|
|
|
|
return GST_FLOW_NOT_NEGOTIATED;
|
|
|
|
|
|
|
|
if (videorate->to_fps == 0)
|
|
|
|
return GST_FLOW_NOT_NEGOTIATED;
|
|
|
|
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
/* pull in 2 buffers */
|
|
|
|
if (videorate->prevbuf == NULL) {
|
2004-12-19 13:16:24 +00:00
|
|
|
/* We're sure it's a GstBuffer here */
|
2005-05-09 14:03:20 +00:00
|
|
|
videorate->prevbuf = buffer;
|
|
|
|
videorate->next_ts = videorate->first_ts = GST_BUFFER_TIMESTAMP (buffer);
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
} else {
|
|
|
|
GstClockTime prevtime, intime;
|
|
|
|
gint count = 0;
|
|
|
|
gint64 diff1, diff2;
|
|
|
|
|
|
|
|
prevtime = GST_BUFFER_TIMESTAMP (videorate->prevbuf);
|
2004-12-19 13:16:24 +00:00
|
|
|
/* If it's a GstEvent, we give him the time of the next outputed frame */
|
2005-05-09 14:03:20 +00:00
|
|
|
#if 0
|
2004-12-19 13:16:24 +00:00
|
|
|
intime = (GST_IS_EVENT (data))
|
|
|
|
? videorate->next_ts +
|
2005-05-09 14:03:20 +00:00
|
|
|
(1 / videorate->to_fps * GST_SECOND) : GST_BUFFER_TIMESTAMP (buffer);
|
|
|
|
#endif
|
|
|
|
intime = GST_BUFFER_TIMESTAMP (buffer);
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
|
2004-06-24 12:45:27 +00:00
|
|
|
GST_LOG_OBJECT (videorate,
|
2004-06-26 15:43:55 +00:00
|
|
|
"prev buf %" GST_TIME_FORMAT " new buf %" GST_TIME_FORMAT
|
|
|
|
" outgoing ts %" GST_TIME_FORMAT, GST_TIME_ARGS (prevtime),
|
2004-06-24 12:45:27 +00:00
|
|
|
GST_TIME_ARGS (intime), GST_TIME_ARGS (videorate->next_ts));
|
|
|
|
|
2005-05-09 14:03:20 +00:00
|
|
|
videorate->in++;
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
|
|
|
|
/* got 2 buffers, see which one is the best */
|
|
|
|
do {
|
2004-06-26 15:43:55 +00:00
|
|
|
diff1 = prevtime - videorate->next_ts;
|
|
|
|
diff2 = intime - videorate->next_ts;
|
2004-06-24 12:45:27 +00:00
|
|
|
|
|
|
|
/* take absolute values, beware: abs and ABS don't work for gint64 */
|
|
|
|
if (diff1 < 0)
|
|
|
|
diff1 = -diff1;
|
|
|
|
if (diff2 < 0)
|
|
|
|
diff2 = -diff2;
|
|
|
|
|
|
|
|
GST_LOG_OBJECT (videorate,
|
2004-06-26 15:43:55 +00:00
|
|
|
"diff with prev %" GST_TIME_FORMAT " diff with new %"
|
|
|
|
GST_TIME_FORMAT " outgoing ts %" GST_TIME_FORMAT,
|
2004-06-24 12:45:27 +00:00
|
|
|
GST_TIME_ARGS (diff1), GST_TIME_ARGS (diff2),
|
|
|
|
GST_TIME_ARGS (videorate->next_ts));
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
|
|
|
|
/* output first one when its the best */
|
2004-06-26 15:58:35 +00:00
|
|
|
if (diff1 < diff2) {
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
GstBuffer *outbuf;
|
|
|
|
|
|
|
|
count++;
|
|
|
|
outbuf =
|
|
|
|
gst_buffer_create_sub (videorate->prevbuf, 0,
|
|
|
|
GST_BUFFER_SIZE (videorate->prevbuf));
|
|
|
|
GST_BUFFER_TIMESTAMP (outbuf) = videorate->next_ts;
|
|
|
|
videorate->out++;
|
2004-12-19 13:16:24 +00:00
|
|
|
videorate->next_ts =
|
|
|
|
videorate->first_ts +
|
|
|
|
(videorate->out / videorate->to_fps * GST_SECOND);
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
GST_BUFFER_DURATION (outbuf) =
|
|
|
|
videorate->next_ts - GST_BUFFER_TIMESTAMP (outbuf);
|
2005-05-09 14:03:20 +00:00
|
|
|
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (videorate->srcpad));
|
|
|
|
|
|
|
|
if ((res = gst_pad_push (videorate->srcpad, outbuf)) != GST_FLOW_OK)
|
|
|
|
goto done;
|
2004-06-24 12:45:27 +00:00
|
|
|
|
|
|
|
GST_LOG_OBJECT (videorate,
|
2004-06-26 15:43:55 +00:00
|
|
|
"old is best, dup, outgoing ts %" GST_TIME_FORMAT,
|
2004-06-24 12:45:27 +00:00
|
|
|
GST_TIME_ARGS (videorate->next_ts));
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
}
|
|
|
|
/* continue while the first one was the best */
|
|
|
|
}
|
2004-06-26 15:58:35 +00:00
|
|
|
while (diff1 < diff2);
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
|
|
|
|
/* if we outputed the first buffer more then once, we have dups */
|
2004-06-17 17:07:50 +00:00
|
|
|
if (count > 1) {
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
videorate->dup += count - 1;
|
2004-06-22 11:19:46 +00:00
|
|
|
if (!videorate->silent)
|
|
|
|
g_object_notify (G_OBJECT (videorate), "duplicate");
|
2004-06-17 17:07:50 +00:00
|
|
|
}
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
/* if we didn't output the first buffer, we have a drop */
|
2004-06-17 17:07:50 +00:00
|
|
|
else if (count == 0) {
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
videorate->drop++;
|
2004-06-22 11:19:46 +00:00
|
|
|
if (!videorate->silent)
|
|
|
|
g_object_notify (G_OBJECT (videorate), "drop");
|
2004-06-24 12:45:27 +00:00
|
|
|
GST_LOG_OBJECT (videorate,
|
2004-06-26 15:43:55 +00:00
|
|
|
"new is best, old never used, drop, outgoing ts %"
|
|
|
|
GST_TIME_FORMAT, GST_TIME_ARGS (videorate->next_ts));
|
2004-06-17 17:07:50 +00:00
|
|
|
}
|
2004-06-24 12:45:27 +00:00
|
|
|
GST_LOG_OBJECT (videorate,
|
2004-06-26 15:43:55 +00:00
|
|
|
"left loop, putting new in old, diff1 %" GST_TIME_FORMAT
|
2004-12-19 13:16:24 +00:00
|
|
|
", diff2 %" GST_TIME_FORMAT ", next_ts %" GST_TIME_FORMAT
|
2004-06-26 15:43:55 +00:00
|
|
|
", in %lld, out %lld, drop %lld, dup %lld", GST_TIME_ARGS (diff1),
|
2004-12-19 13:16:24 +00:00
|
|
|
GST_TIME_ARGS (diff2), GST_TIME_ARGS (videorate->next_ts),
|
|
|
|
videorate->in, videorate->out, videorate->drop, videorate->dup);
|
|
|
|
|
2005-05-09 14:03:20 +00:00
|
|
|
/* swap in new one when it's the best */
|
|
|
|
gst_buffer_unref (videorate->prevbuf);
|
|
|
|
videorate->prevbuf = buffer;
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
}
|
2005-05-09 14:03:20 +00:00
|
|
|
done:
|
|
|
|
|
|
|
|
return res;
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_videorate_set_property (GObject * object,
|
|
|
|
guint prop_id, const GValue * value, GParamSpec * pspec)
|
|
|
|
{
|
2004-06-22 11:19:46 +00:00
|
|
|
GstVideorate *videorate = GST_VIDEORATE (object);
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
2004-06-22 11:19:46 +00:00
|
|
|
case ARG_SILENT:
|
|
|
|
videorate->silent = g_value_get_boolean (value);
|
|
|
|
break;
|
|
|
|
case ARG_NEW_PREF:
|
|
|
|
videorate->new_pref = g_value_get_double (value);
|
|
|
|
break;
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_videorate_get_property (GObject * object,
|
|
|
|
guint prop_id, GValue * value, GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstVideorate *videorate = GST_VIDEORATE (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case ARG_IN:
|
|
|
|
g_value_set_uint64 (value, videorate->in);
|
|
|
|
break;
|
|
|
|
case ARG_OUT:
|
|
|
|
g_value_set_uint64 (value, videorate->out);
|
|
|
|
break;
|
|
|
|
case ARG_DUP:
|
|
|
|
g_value_set_uint64 (value, videorate->dup);
|
|
|
|
break;
|
|
|
|
case ARG_DROP:
|
|
|
|
g_value_set_uint64 (value, videorate->drop);
|
|
|
|
break;
|
2004-06-22 11:19:46 +00:00
|
|
|
case ARG_SILENT:
|
|
|
|
g_value_set_boolean (value, videorate->silent);
|
|
|
|
break;
|
|
|
|
case ARG_NEW_PREF:
|
|
|
|
g_value_set_double (value, videorate->new_pref);
|
|
|
|
break;
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstElementStateReturn
|
|
|
|
gst_videorate_change_state (GstElement * element)
|
|
|
|
{
|
2005-05-09 14:03:20 +00:00
|
|
|
GstElementStateReturn ret;
|
|
|
|
GstVideorate *videorate;
|
|
|
|
gint transition;
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
|
2005-05-09 14:03:20 +00:00
|
|
|
videorate = GST_VIDEORATE (element);
|
|
|
|
transition = GST_STATE_TRANSITION (videorate);
|
|
|
|
|
|
|
|
switch (transition) {
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = parent_class->change_state (element);
|
|
|
|
|
|
|
|
switch (transition) {
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
case GST_STATE_PAUSED_TO_READY:
|
2005-05-09 14:03:20 +00:00
|
|
|
gst_videorate_blank_data (videorate);
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-05-09 14:03:20 +00:00
|
|
|
return ret;
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
plugin_init (GstPlugin * plugin)
|
|
|
|
{
|
2004-06-26 15:43:55 +00:00
|
|
|
GST_DEBUG_CATEGORY_INIT (videorate_debug, "videorate", 0,
|
|
|
|
"Videorate stream fixer");
|
|
|
|
|
gst/videorate/: Added a video timestamp corrector.
Original commit message from CVS:
* gst/videorate/Makefile.am:
* gst/videorate/gstvideorate.c: (gst_videorate_get_type),
(gst_videorate_base_init), (gst_videorate_class_init),
(gst_videorate_getcaps), (gst_videorate_link),
(gst_videorate_init), (gst_videorate_chain),
(gst_videorate_set_property), (gst_videorate_get_property),
(gst_videorate_change_state), (plugin_init):
Added a video timestamp corrector.
2004-06-16 09:39:02 +00:00
|
|
|
return gst_element_register (plugin, "videorate", GST_RANK_NONE,
|
|
|
|
GST_TYPE_VIDEORATE);
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
|
|
|
GST_VERSION_MINOR,
|
|
|
|
"videorate",
|
|
|
|
"Adjusts video frames",
|
|
|
|
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE, GST_ORIGIN)
|