static gboolean gst_audio_decoder_negotiate_unlocked (GstAudioDecoder * dec);
static gboolean gst_audio_decoder_handle_gap (GstAudioDecoder * dec,
GstEvent * event);
+static gboolean gst_audio_decoder_sink_query_default (GstAudioDecoder * dec,
+ GstQuery * query);
+static gboolean gst_audio_decoder_src_query_default (GstAudioDecoder * dec,
+ GstQuery * query);
static GstElementClass *parent_class = NULL;
GST_DEBUG_FUNCPTR (gst_audio_decoder_decide_allocation_default);
audiodecoder_class->negotiate =
GST_DEBUG_FUNCPTR (gst_audio_decoder_negotiate_default);
+ audiodecoder_class->sink_query =
+ GST_DEBUG_FUNCPTR (gst_audio_decoder_sink_query_default);
+ audiodecoder_class->src_query =
+ GST_DEBUG_FUNCPTR (gst_audio_decoder_src_query_default);
}
static void
return caps;
}
-
static gboolean
-gst_audio_decoder_sink_query (GstPad * pad, GstObject * parent,
- GstQuery * query)
+gst_audio_decoder_sink_query_default (GstAudioDecoder * dec, GstQuery * query)
{
+ GstPad *pad = GST_AUDIO_DECODER_SINK_PAD (dec);
gboolean res = FALSE;
- GstAudioDecoder *dec;
-
- dec = GST_AUDIO_DECODER (parent);
GST_LOG_OBJECT (dec, "handling query: %" GST_PTR_FORMAT, query);
/* fall-through */
}
default:
- res = gst_pad_query_default (pad, parent, query);
+ res = gst_pad_query_default (pad, GST_OBJECT_CAST (dec), query);
break;
}
return res;
}
+static gboolean
+gst_audio_decoder_sink_query (GstPad * pad, GstObject * parent,
+ GstQuery * query)
+{
+ GstAudioDecoderClass *dec_class;
+ GstAudioDecoder *dec;
+ gboolean ret = FALSE;
+
+ dec = GST_AUDIO_DECODER (parent);
+ dec_class = GST_AUDIO_DECODER_GET_CLASS (dec);
+
+ GST_DEBUG_OBJECT (pad, "received query %" GST_PTR_FORMAT, query);
+
+ if (dec_class->sink_query)
+ ret = dec_class->sink_query (dec, query);
+
+ return ret;
+}
+
/* FIXME ? are any of these queries (other than latency) a decoder's business ??
* also, the conversion stuff might seem to make sense, but seems to not mind
* segment stuff etc at all
* Supposedly that's backward compatibility ... */
static gboolean
-gst_audio_decoder_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
+gst_audio_decoder_src_query_default (GstAudioDecoder * dec, GstQuery * query)
{
- GstAudioDecoder *dec;
+ GstPad *pad = GST_AUDIO_DECODER_SRC_PAD (dec);
gboolean res = FALSE;
- dec = GST_AUDIO_DECODER (parent);
-
GST_LOG_OBJECT (dec, "handling query: %" GST_PTR_FORMAT, query);
switch (GST_QUERY_TYPE (query)) {
GstFormat format;
/* upstream in any case */
- if ((res = gst_pad_query_default (pad, parent, query)))
+ if ((res = gst_pad_query_default (pad, GST_OBJECT_CAST (dec), query)))
break;
gst_query_parse_duration (query, &format, NULL);
break;
}
default:
- res = gst_pad_query_default (pad, parent, query);
+ res = gst_pad_query_default (pad, GST_OBJECT_CAST (dec), query);
break;
}
}
static gboolean
+gst_audio_decoder_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
+{
+ GstAudioDecoder *dec;
+ GstAudioDecoderClass *dec_class;
+ gboolean ret = FALSE;
+
+ dec = GST_AUDIO_DECODER (parent);
+ dec_class = GST_AUDIO_DECODER_GET_CLASS (dec);
+
+ GST_DEBUG_OBJECT (pad, "received query %" GST_PTR_FORMAT, query);
+
+ if (dec_class->src_query)
+ ret = dec_class->src_query (dec, query);
+
+ return ret;
+}
+
+static gboolean
gst_audio_decoder_stop (GstAudioDecoder * dec)
{
GstAudioDecoderClass *klass;
* Propose buffer allocation parameters for upstream elements.
* Subclasses should chain up to the parent implementation to
* invoke the default handler.
+ * @sink_query: Optional.
+ * Query handler on the sink pad. This function should
+ * return TRUE if the query could be performed. Subclasses
+ * should chain up to the parent implementation to invoke the
+ * default handler. Since 1.6
+ * @src_query: Optional.
+ * Query handler on the source pad. This function should
+ * return TRUE if the query could be performed. Subclasses
+ * should chain up to the parent implementation to invoke the
+ * default handler. Since 1.6
* @getcaps: Optional.
* Allows for a custom sink getcaps implementation.
* If not implemented,
gboolean (*propose_allocation) (GstAudioDecoder *dec,
GstQuery * query);
+ gboolean (*sink_query) (GstAudioDecoder *dec, GstQuery *query);
+
+ gboolean (*src_query) (GstAudioDecoder *dec, GstQuery *query);
+
GstCaps * (*getcaps) (GstAudioDecoder * dec,
GstCaps * filter);
/*< private >*/
- gpointer _gst_reserved[GST_PADDING_LARGE - 1];
+ gpointer _gst_reserved[GST_PADDING_LARGE - 3];
};
GType gst_audio_decoder_get_type (void);