mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
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.
This commit is contained in:
parent
ec3c4576c0
commit
b134a97d42
1 changed files with 4 additions and 13 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue