From: Sameer Naik Date: Sun, 28 Sep 2008 17:33:43 +0000 (+0000) Subject: ext/mpeg2dec/gstmpeg2dec.*: Fix compilation with --disable-index. Fixes bug #554150. X-Git-Tag: 1.19.3~505^2~1530 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c9da8b4d0ce522c1775a6408027bf77c314613c2;p=platform%2Fupstream%2Fgstreamer.git ext/mpeg2dec/gstmpeg2dec.*: Fix compilation with --disable-index. Fixes bug #554150. Original commit message from CVS: Patch by: Sameer Naik * ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_class_init), (handle_slice), (gst_mpeg2dec_sink_event), (gst_mpeg2dec_src_event): * ext/mpeg2dec/gstmpeg2dec.h: Fix compilation with --disable-index. Fixes bug #554150. --- diff --git a/ChangeLog b/ChangeLog index 312e7aa..3cc1d09 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,16 @@ Patch by: Sameer Naik + * ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_class_init), + (handle_slice), (gst_mpeg2dec_sink_event), + (gst_mpeg2dec_src_event): + * ext/mpeg2dec/gstmpeg2dec.h: + Fix compilation with --disable-index. Fixes bug #554150. + +2008-09-28 Sebastian Dröge + + Patch by: Sameer Naik + * ext/mad/gstmad.c: (gst_mad_class_init), (gst_mad_dispose), (gst_mad_src_event), (gst_mad_chain): * ext/mad/gstmad.h: diff --git a/ext/mpeg2dec/gstmpeg2dec.c b/ext/mpeg2dec/gstmpeg2dec.c index 11c7873..e46ff1a 100644 --- a/ext/mpeg2dec/gstmpeg2dec.c +++ b/ext/mpeg2dec/gstmpeg2dec.c @@ -95,8 +95,11 @@ static void gst_mpeg2dec_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_mpeg2dec_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); + +#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); @@ -193,8 +196,10 @@ 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 @@ -281,6 +286,7 @@ gst_mpeg2dec_qos_reset (GstMpeg2dec * mpeg2dec) GST_OBJECT_UNLOCK (mpeg2dec); } +#ifndef GST_DISABLE_INDEX static void gst_mpeg2dec_set_index (GstElement * element, GstIndex * index) { @@ -298,6 +304,7 @@ gst_mpeg2dec_get_index (GstElement * element) return mpeg2dec->index; } +#endif /* see gst-plugins/gst/games/gstvideoimage.c, paint_setup_I420() */ #define I420_Y_ROWSTRIDE(width) (GST_ROUND_UP_4(width)) @@ -917,12 +924,14 @@ 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 : 0), GST_FORMAT_BYTES, GST_BUFFER_OFFSET (outbuf), GST_FORMAT_TIME, GST_BUFFER_TIMESTAMP (outbuf), 0); } +#endif if (picture->flags & PIC_FLAG_SKIP) goto skip; @@ -1261,9 +1270,11 @@ 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: @@ -1526,6 +1537,7 @@ gst_mpeg2dec_get_event_masks (GstPad * pad) } #endif +#ifndef GST_DISABLE_INDEX static gboolean index_seek (GstPad * pad, GstEvent * event) { @@ -1592,7 +1604,7 @@ index_seek (GstPad * pad, GstEvent * event) } return FALSE; } - +#endif static gboolean normal_seek (GstPad * pad, GstEvent * event) @@ -1678,9 +1690,11 @@ 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 7e77cef..37a6e5c 100644 --- a/ext/mpeg2dec/gstmpeg2dec.h +++ b/ext/mpeg2dec/gstmpeg2dec.h @@ -107,8 +107,10 @@ struct _GstMpeg2dec { gint fps_d; gboolean need_sequence; +#ifndef GST_DISABLE_INDEX GstIndex *index; gint index_id; +#endif gint error_count; gboolean can_allocate_aligned;