gboolean do_plc;
gboolean do_estimate_rate;
gint max_errors;
+ GstCaps *allocation_caps;
/* MT-protected (with LOCK) */
GstClockTime min_latency;
GstClockTime max_latency;
gst_object_unref (dec->priv->ctx.allocator);
gst_caps_replace (&dec->priv->ctx.input_caps, NULL);
+ gst_caps_replace (&dec->priv->ctx.allocation_caps, NULL);
memset (&dec->priv->ctx, 0, sizeof (dec->priv->ctx));
klass = GST_AUDIO_DECODER_GET_CLASS (dec);
caps = gst_audio_info_to_caps (&dec->priv->ctx.info);
+ if (dec->priv->ctx.allocation_caps == NULL)
+ dec->priv->ctx.allocation_caps = gst_caps_ref (caps);
GST_DEBUG_OBJECT (dec, "setting src caps %" GST_PTR_FORMAT, caps);
goto done;
dec->priv->ctx.output_format_changed = FALSE;
- query = gst_query_new_allocation (caps, TRUE);
+ query = gst_query_new_allocation (dec->priv->ctx.allocation_caps, TRUE);
if (!gst_pad_peer_query (dec->srcpad, query)) {
GST_DEBUG_OBJECT (dec, "didn't get downstream ALLOCATION hints");
}
*eos = dec->priv->ctx.eos;
}
+/**
+ * gst_audio_decoder_set_allocation_caps:
+ * @dec: a #GstAudioDecoder
+ * @allocation_caps: (allow-none): a #GstCaps or %NULL
+ *
+ * Sets a caps in allocation query which are different from the set
+ * pad's caps. Use this function before calling
+ * gst_audio_decoder_negotiate(). Setting to %NULL the allocation
+ * query will use the caps from the pad.
+ *
+ * Since: 1.10
+ */
+void
+gst_audio_decoder_set_allocation_caps (GstAudioDecoder * dec,
+ GstCaps * allocation_caps)
+{
+ g_return_if_fail (GST_IS_AUDIO_DECODER (dec));
+
+ gst_caps_replace (&dec->priv->ctx.allocation_caps, allocation_caps);
+}
+
/**
* gst_audio_decoder_set_plc:
* @dec: a #GstAudioDecoder
gboolean * sync,
gboolean * eos);
+void gst_audio_decoder_set_allocation_caps (GstAudioDecoder * dec,
+ GstCaps * allocation_caps);
/* object properties */
void gst_audio_decoder_set_plc (GstAudioDecoder * dec,
/* output */
GstCaps *caps;
+ GstCaps *allocation_caps;
gboolean output_caps_changed;
gint frame_samples_min, frame_samples_max;
gint frame_max;
gst_caps_replace (&enc->priv->ctx.input_caps, NULL);
gst_caps_replace (&enc->priv->ctx.caps, NULL);
+ gst_caps_replace (&enc->priv->ctx.allocation_caps, NULL);
memset (&enc->priv->ctx, 0, sizeof (enc->priv->ctx));
gst_audio_info_init (&enc->priv->ctx.info);
enc->priv->ctx.new_headers = TRUE;
}
+/**
+ * gst_audio_encoder_set_allocation_caps:
+ * @enc: a #GstAudioEncoder
+ * @allocation_caps: (allow-none): a #GstCaps or %NULL
+ *
+ * Sets a caps in allocation query which are different from the set
+ * pad's caps. Use this function before calling
+ * gst_audio_encoder_negotiate(). Setting to %NULL the allocation
+ * query will use the caps from the pad.
+ *
+ * Since: 1.10
+ */
+void
+gst_audio_encoder_set_allocation_caps (GstAudioEncoder * enc,
+ GstCaps * allocation_caps)
+{
+ g_return_if_fail (GST_IS_AUDIO_ENCODER (enc));
+
+ gst_caps_replace (&enc->priv->ctx.allocation_caps, allocation_caps);
+}
+
/**
* gst_audio_encoder_set_mark_granule:
* @enc: a #GstAudioEncoder
klass = GST_AUDIO_ENCODER_GET_CLASS (enc);
caps = enc->priv->ctx.caps;
+ if (enc->priv->ctx.allocation_caps == NULL)
+ enc->priv->ctx.allocation_caps = gst_caps_ref (caps);
GST_DEBUG_OBJECT (enc, "Setting srcpad caps %" GST_PTR_FORMAT, caps);
goto done;
enc->priv->ctx.output_caps_changed = FALSE;
- query = gst_query_new_allocation (caps, TRUE);
+ query = gst_query_new_allocation (enc->priv->ctx.allocation_caps, TRUE);
if (!gst_pad_peer_query (enc->srcpad, query)) {
GST_DEBUG_OBJECT (enc, "didn't get downstream ALLOCATION hints");
}
void gst_audio_encoder_set_headers (GstAudioEncoder * enc,
GList * headers);
+void gst_audio_encoder_set_allocation_caps (GstAudioEncoder * enc,
+ GstCaps * allocation_caps);
+
/* object properties */
void gst_audio_encoder_set_mark_granule (GstAudioEncoder * enc,