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 void
_do_init (GType type)
gst_static_pad_template_get (&mad_src_template_factory));
gst_element_class_set_details (element_class, &gst_mad_details);
}
+
static void
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 */
{
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;
G_OBJECT_CLASS (parent_class)->dispose (object);
}
+#ifndef GST_DISABLE_INDEX
static void
gst_mad_set_index (GstElement * element, GstIndex * index)
{
return mad->index;
}
+#endif
static gboolean
gst_mad_convert_sink (GstPad * pad, GstFormat src_format, gint64 src_value,
return FALSE;
}
+#ifndef GST_DISABLE_INDEX
static gboolean
index_seek (GstMad * mad, GstPad * pad, GstEvent * event)
{
return FALSE;
}
+#endif
static gboolean
normal_seek (GstMad * mad, GstPad * pad, GstEvent * event)
case GST_EVENT_SEEK:
gst_event_ref (event);
if (!(res = gst_pad_event_default (pad, event))) {
+#ifndef GST_DISABLE_INDEX
if (mad->index)
res = index_seek (mad, pad, event);
else
+#endif
res = normal_seek (mad, pad, event);
}
break;
break;
}
}
+
static void
gst_mad_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
GST_SECOND, mad->rate) - time_offset;
}
+#ifndef GST_DISABLE_INDEX
if (mad->index) {
guint64 x_bytes = mad->base_byte_offset + mad->bytes_consumed;
gst_index_add_association (mad->index, mad->index_id, 0,
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)) {