From a4f5db70882b71450cfe38a2b175c024b4281b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 5 Oct 2010 11:17:52 +0100 Subject: [PATCH] Revert "baseparse: add skip property" This reverts commit b5a3d60363d837a10f0533c141ec93d10b742312. Reverting this for now, since no one really seems to remember why this property exists or what it could possibly be good for. It seems to have been in the original mp3parse since the beginning of time and was back- ported from there. --- gst/audioparsers/gstbaseparse.c | 81 ++------------------------------- 1 file changed, 3 insertions(+), 78 deletions(-) diff --git a/gst/audioparsers/gstbaseparse.c b/gst/audioparsers/gstbaseparse.c index e880d4781d..51ed1f6425 100644 --- a/gst/audioparsers/gstbaseparse.c +++ b/gst/audioparsers/gstbaseparse.c @@ -274,10 +274,6 @@ struct _GstBaseParsePrivate GSList *buffers_queued; GstClockTime last_ts; gint64 last_offset; - - /* property */ - /* number of initial frames to discard */ - gint skip; }; typedef struct _GstBaseParseSeek @@ -288,23 +284,6 @@ typedef struct _GstBaseParseSeek GstClockTime start_ts; } GstBaseParseSeek; -/* signals and args */ -enum -{ - /* FILL ME */ - LAST_SIGNAL -}; - -enum -{ - PROP_0, - PROP_SKIP - /* FILL ME */ -}; - -#define PROP_DEFAULT_SKIP 0 - - static GstElementClass *parent_class = NULL; static void gst_base_parse_class_init (GstBaseParseClass * klass); @@ -343,10 +322,6 @@ static void gst_base_parse_reset (GstBaseParse * parse); static void gst_base_parse_set_index (GstElement * element, GstIndex * index); static GstIndex *gst_base_parse_get_index (GstElement * element); -static void gst_base_parse_set_property (GObject * object, guint prop_id, - const GValue * value, GParamSpec * pspec); -static void gst_base_parse_get_property (GObject * object, guint prop_id, - GValue * value, GParamSpec * pspec); static gboolean gst_base_parse_sink_activate (GstPad * sinkpad); static gboolean gst_base_parse_sink_activate_push (GstPad * pad, @@ -456,14 +431,6 @@ gst_base_parse_class_init (GstBaseParseClass * klass) gstelement_class->set_index = GST_DEBUG_FUNCPTR (gst_base_parse_set_index); gstelement_class->get_index = GST_DEBUG_FUNCPTR (gst_base_parse_get_index); - gobject_class->set_property = gst_base_parse_set_property; - gobject_class->get_property = gst_base_parse_get_property; - - g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SKIP, - g_param_spec_int ("skip", "skip", "Discard number of initial frames", - 0, G_MAXINT, PROP_DEFAULT_SKIP, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - /* Default handlers */ klass->check_valid_frame = gst_base_parse_check_frame; klass->parse_frame = gst_base_parse_parse_frame; @@ -521,7 +488,6 @@ gst_base_parse_init (GstBaseParse * parse, GstBaseParseClass * bclass) parse->adapter = gst_adapter_new (); parse->priv->pad_mode = GST_ACTIVATE_NONE; - parse->priv->skip = PROP_DEFAULT_SKIP; /* init state */ gst_base_parse_reset (parse); @@ -1576,15 +1542,9 @@ gst_base_parse_push_buffer (GstBaseParse * parse, GstBuffer * buffer) ret = GST_FLOW_OK; } else if (ret == GST_FLOW_OK) { if (parse->segment.rate > 0.0) { - if (G_LIKELY (!parse->priv->skip)) { - GST_LOG_OBJECT (parse, "frame (%d bytes) pushed: %s", - GST_BUFFER_SIZE (buffer), gst_flow_get_name (ret)); - ret = gst_pad_push (parse->srcpad, buffer); - } else { - GST_DEBUG_OBJECT (parse, "initial frame (%d bytes) discarded", - GST_BUFFER_SIZE (buffer)); - parse->priv->skip--; - } + GST_LOG_OBJECT (parse, "frame (%d bytes) pushed: %s", + GST_BUFFER_SIZE (buffer), gst_flow_get_name (ret)); + ret = gst_pad_push (parse->srcpad, buffer); } else { GST_LOG_OBJECT (parse, "frame (%d bytes) queued for now", GST_BUFFER_SIZE (buffer)); @@ -3158,41 +3118,6 @@ gst_base_parse_get_index (GstElement * element) return result; } -static void -gst_base_parse_set_property (GObject * object, guint prop_id, - const GValue * value, GParamSpec * pspec) -{ - GstBaseParse *parse; - - parse = GST_BASE_PARSE (object); - - switch (prop_id) { - case PROP_SKIP: - parse->priv->skip = g_value_get_int (value); - break; - default: - break; - } -} - -static void -gst_base_parse_get_property (GObject * object, guint prop_id, GValue * value, - GParamSpec * pspec) -{ - GstBaseParse *parse; - - parse = GST_BASE_PARSE (object); - - switch (prop_id) { - case PROP_SKIP: - g_value_set_int (value, parse->priv->skip); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - static GstStateChangeReturn gst_base_parse_change_state (GstElement * element, GstStateChange transition) {