From b3c04da6c3f598c9d28e4bbd4bf8c175bdccde5c Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Mon, 21 Feb 2011 11:05:31 +0200 Subject: [PATCH] index: remove conditional index support Index support cannot be disabled since commit 4bfb1fe70c6f0d5e29c17a8eeffb02f7fd083f11 in core, which removed the configure flags to disable index. --- ext/mad/gstmad.c | 14 -------------- ext/mad/gstmad.h | 2 -- ext/mpeg2dec/gstmpeg2dec.c | 14 -------------- ext/mpeg2dec/gstmpeg2dec.h | 8 +++----- 4 files changed, 3 insertions(+), 35 deletions(-) diff --git a/ext/mad/gstmad.c b/ext/mad/gstmad.c index d6e4485..35efbb5 100644 --- a/ext/mad/gstmad.c +++ b/ext/mad/gstmad.c @@ -100,10 +100,8 @@ static GstFlowReturn gst_mad_chain_reverse (GstMad * mad, GstBuffer * buf); static GstStateChangeReturn gst_mad_change_state (GstElement * element, GstStateChange transition); -#ifndef GST_DISABLE_INDEX static void gst_mad_set_index (GstElement * element, GstIndex * index); static GstIndex *gst_mad_get_index (GstElement * element); -#endif static GstTagList *gst_mad_id3_to_tag_list (const struct id3_tag *tag); @@ -200,10 +198,8 @@ gst_mad_class_init (GstMadClass * klass) gobject_class->dispose = gst_mad_dispose; gstelement_class->change_state = gst_mad_change_state; -#ifndef GST_DISABLE_INDEX gstelement_class->set_index = gst_mad_set_index; gstelement_class->get_index = gst_mad_get_index; -#endif /* init properties */ /* currently, string representations are used, we might want to change that */ @@ -287,9 +283,7 @@ gst_mad_dispose (GObject * object) { GstMad *mad = GST_MAD (object); -#ifndef GST_DISABLE_INDEX gst_mad_set_index (GST_ELEMENT (object), NULL); -#endif g_free (mad->tempbuffer); mad->tempbuffer = NULL; @@ -301,7 +295,6 @@ gst_mad_dispose (GObject * object) G_OBJECT_CLASS (parent_class)->dispose (object); } -#ifndef GST_DISABLE_INDEX static void gst_mad_set_index (GstElement * element, GstIndex * index) { @@ -320,7 +313,6 @@ gst_mad_get_index (GstElement * element) return mad->index; } -#endif static gboolean gst_mad_convert_sink (GstPad * pad, GstFormat src_format, gint64 src_value, @@ -604,7 +596,6 @@ error: return FALSE; } -#ifndef GST_DISABLE_INDEX static gboolean index_seek (GstMad * mad, GstPad * pad, GstEvent * event) { @@ -681,7 +672,6 @@ index_seek (GstMad * mad, GstPad * pad, GstEvent * event) return FALSE; } -#endif static gboolean normal_seek (GstMad * mad, GstPad * pad, GstEvent * event) @@ -807,11 +797,9 @@ gst_mad_src_event (GstPad * pad, GstEvent * event) /* the all-formats seek logic, ref the event, we need it later */ gst_event_ref (event); if (!(res = gst_pad_push_event (mad->sinkpad, event))) { -#ifndef GST_DISABLE_INDEX if (mad->index) res = index_seek (mad, pad, event); else -#endif res = normal_seek (mad, pad, event); } gst_event_unref (event); @@ -1672,7 +1660,6 @@ gst_mad_chain (GstPad * pad, GstBuffer * buffer) GST_SECOND, mad->rate) - time_offset; } -#ifndef GST_DISABLE_INDEX if (mad->index) { guint64 x_bytes = mad->base_byte_offset + mad->bytes_consumed; @@ -1680,7 +1667,6 @@ gst_mad_chain (GstPad * pad, GstBuffer * buffer) GST_ASSOCIATION_FLAG_DELTA_UNIT, GST_FORMAT_BYTES, x_bytes, GST_FORMAT_TIME, time_offset, NULL); } -#endif if (mad->segment_start <= (time_offset == GST_CLOCK_TIME_NONE ? 0 : time_offset)) { diff --git a/ext/mad/gstmad.h b/ext/mad/gstmad.h index 63e1afa..3acc7e2 100644 --- a/ext/mad/gstmad.h +++ b/ext/mad/gstmad.h @@ -86,10 +86,8 @@ struct _GstMad gint times_pending; gboolean caps_set; /* used to keep track of whether to change/update caps */ -#ifndef GST_DISABLE_INDEX GstIndex *index; gint index_id; -#endif gboolean check_for_xing; gboolean xing_found; diff --git a/ext/mpeg2dec/gstmpeg2dec.c b/ext/mpeg2dec/gstmpeg2dec.c index a6efa14..6766d92 100644 --- a/ext/mpeg2dec/gstmpeg2dec.c +++ b/ext/mpeg2dec/gstmpeg2dec.c @@ -85,10 +85,8 @@ static void gst_mpeg2dec_init (GstMpeg2dec * mpeg2dec); static void gst_mpeg2dec_finalize (GObject * object); static void gst_mpeg2dec_reset (GstMpeg2dec * mpeg2dec); -#ifndef GST_DISABLE_INDEX static void gst_mpeg2dec_set_index (GstElement * element, GstIndex * index); static GstIndex *gst_mpeg2dec_get_index (GstElement * element); -#endif static gboolean gst_mpeg2dec_src_event (GstPad * pad, GstEvent * event); static const GstQueryType *gst_mpeg2dec_get_src_query_types (GstPad * pad); @@ -187,10 +185,8 @@ gst_mpeg2dec_class_init (GstMpeg2decClass * klass) gobject_class->finalize = gst_mpeg2dec_finalize; gstelement_class->change_state = gst_mpeg2dec_change_state; -#ifndef GST_DISABLE_INDEX gstelement_class->set_index = gst_mpeg2dec_set_index; gstelement_class->get_index = gst_mpeg2dec_get_index; -#endif } static void @@ -291,7 +287,6 @@ gst_mpeg2dec_qos_reset (GstMpeg2dec * mpeg2dec) GST_OBJECT_UNLOCK (mpeg2dec); } -#ifndef GST_DISABLE_INDEX static void gst_mpeg2dec_set_index (GstElement * element, GstIndex * index) { @@ -317,7 +312,6 @@ gst_mpeg2dec_get_index (GstElement * element) return (mpeg2dec->index) ? gst_object_ref (mpeg2dec->index) : NULL; } -#endif static GstFlowReturn gst_mpeg2dec_crop_buffer (GstMpeg2dec * dec, GstBuffer ** buf) @@ -887,7 +881,6 @@ handle_slice (GstMpeg2dec * mpeg2dec, const mpeg2_info_t * info) picture->nb_fields, GST_BUFFER_OFFSET (outbuf), GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (outbuf))); -#ifndef GST_DISABLE_INDEX if (mpeg2dec->index) { gst_index_add_association (mpeg2dec->index, mpeg2dec->index_id, (key_frame ? GST_ASSOCIATION_FLAG_KEY_UNIT : @@ -895,7 +888,6 @@ handle_slice (GstMpeg2dec * mpeg2dec, const mpeg2_info_t * info) GST_FORMAT_BYTES, GST_BUFFER_OFFSET (outbuf), GST_FORMAT_TIME, GST_BUFFER_TIMESTAMP (outbuf), 0); } -#endif if (picture->flags & PIC_FLAG_SKIP) goto skip; @@ -1248,11 +1240,9 @@ gst_mpeg2dec_sink_event (GstPad * pad, GstEvent * event) break; } case GST_EVENT_EOS: -#ifndef GST_DISABLE_INDEX if (mpeg2dec->index && mpeg2dec->closed) { gst_index_commit (mpeg2dec->index, mpeg2dec->index_id); } -#endif ret = gst_pad_push_event (mpeg2dec->srcpad, event); break; default: @@ -1545,7 +1535,6 @@ gst_mpeg2dec_get_event_masks (GstPad * pad) } #endif -#ifndef GST_DISABLE_INDEX static gboolean index_seek (GstPad * pad, GstEvent * event) { @@ -1612,7 +1601,6 @@ index_seek (GstPad * pad, GstEvent * event) } return FALSE; } -#endif static gboolean normal_seek (GstPad * pad, GstEvent * event) @@ -1698,11 +1686,9 @@ gst_mpeg2dec_src_event (GstPad * pad, GstEvent * event) case GST_EVENT_SEEK:{ gst_event_ref (event); if (!(res = gst_pad_push_event (mpeg2dec->sinkpad, event))) { -#ifndef GST_DISABLE_INDEX if (mpeg2dec->index) res = index_seek (pad, event); else -#endif res = normal_seek (pad, event); } gst_event_unref (event); diff --git a/ext/mpeg2dec/gstmpeg2dec.h b/ext/mpeg2dec/gstmpeg2dec.h index 19c22f6..43ba42d 100644 --- a/ext/mpeg2dec/gstmpeg2dec.h +++ b/ext/mpeg2dec/gstmpeg2dec.h @@ -45,7 +45,7 @@ G_BEGIN_DECLS typedef struct _GstMpeg2dec GstMpeg2dec; typedef struct _GstMpeg2decClass GstMpeg2decClass; -typedef enum +typedef enum { MPEG2DEC_DISC_NONE = 0, MPEG2DEC_DISC_NEW_PICTURE, @@ -95,17 +95,15 @@ struct _GstMpeg2dec { gint v_offs; guint8 *dummybuf[4]; - + guint64 offset; gint fps_n; gint fps_d; gboolean need_sequence; -#ifndef GST_DISABLE_INDEX GstIndex *index; gint index_id; -#endif - + gint error_count; gboolean can_allocate_aligned; -- 2.7.4