if (state->caps == NULL)
state->caps = gst_video_info_to_caps (&state->info);
+ if (state->allocation_caps == NULL)
+ state->allocation_caps = gst_caps_ref (state->caps);
GST_DEBUG_OBJECT (decoder, "setting caps %" GST_PTR_FORMAT, state->caps);
goto done;
decoder->priv->output_state_changed = FALSE;
/* Negotiate pool */
- ret = gst_video_decoder_negotiate_pool (decoder, state->caps);
+ ret = gst_video_decoder_negotiate_pool (decoder, state->allocation_caps);
done:
return ret;
encoder->priv->output_state_changed = FALSE;
}
+ if (state->allocation_caps == NULL)
+ state->allocation_caps = gst_caps_ref (state->caps);
+
/* Push all pending pre-caps events of the oldest frame before
* setting caps */
frame = encoder->priv->frames ? encoder->priv->frames->data : NULL;
if (!ret)
goto done;
- query = gst_query_new_allocation (state->caps, TRUE);
+ query = gst_query_new_allocation (state->allocation_caps, TRUE);
if (!gst_pad_peer_query (encoder->srcpad, query)) {
GST_DEBUG_OBJECT (encoder, "didn't get downstream ALLOCATION hints");
}
if (state->caps)
gst_caps_unref (state->caps);
+ if (state->allocation_caps)
+ gst_caps_unref (state->allocation_caps);
if (state->codec_data)
gst_buffer_unref (state->codec_data);
g_slice_free (GstVideoCodecState, state);
/**
* GstVideoCodecState:
* @info: The #GstVideoInfo describing the stream
- * @caps: The #GstCaps
+ * @caps: The #GstCaps used in the caps negotiation of the pad.
* @codec_data: a #GstBuffer corresponding to the
* 'codec_data' field of a stream, or NULL.
+ * @allocation_caps: The #GstCaps for allocation query and pool
+ * negotiation. Since: 1.10
*
* Structure representing the state of an incoming or outgoing video
* stream for encoders and decoders.
GstBuffer *codec_data;
+ GstCaps *allocation_caps;
+
/*< private >*/
- void *padding[GST_PADDING_LARGE];
+ void *padding[GST_PADDING_LARGE - 1];
};
/**