Commit b134a97d authored by Gwenole Beauchesne's avatar Gwenole Beauchesne

vc1: don't create GstBuffers for all decoder units.

Don't create temporary GstBuffers for all decoder units, even if they
are lightweight "sub-buffers", since it is not really necessary to keep
the buffer data around.
parent ec3c4576
......@@ -1008,15 +1008,10 @@ decode_ebdu(GstVaapiDecoderVC1 *decoder, GstVC1BDU *ebdu)
}
static GstVaapiDecoderStatus
decode_buffer(GstVaapiDecoderVC1 *decoder, GstBuffer *buffer)
decode_buffer(GstVaapiDecoderVC1 *decoder, guchar *buf, guint buf_size)
{
GstVaapiDecoderVC1Private * const priv = decoder->priv;
GstVC1BDU ebdu;
guchar *buf;
guint buf_size;
buf = GST_BUFFER_DATA(buffer);
buf_size = GST_BUFFER_SIZE(buffer);
if (priv->has_codec_data) {
ebdu.type = GST_VC1_FRAME;
......@@ -1224,13 +1219,9 @@ gst_vaapi_decoder_vc1_decode(GstVaapiDecoder *base_decoder,
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
return status;
unit->buffer = gst_buffer_create_sub(
GST_VAAPI_DECODER_CODEC_FRAME(decoder)->input_buffer,
unit->offset, unit->size);
if (!unit->buffer)
return GST_VAAPI_DECODER_STATUS_ERROR_ALLOCATION_FAILED;
status = decode_buffer(decoder, unit->buffer);
status = decode_buffer(decoder,
(GST_BUFFER_DATA(GST_VAAPI_DECODER_CODEC_FRAME(decoder)->input_buffer) +
unit->offset), unit->size);
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
return status;
return GST_VAAPI_DECODER_STATUS_SUCCESS;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment