From dbba1f6107daaf716f15675e26bfd20ce8e91122 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Tue, 24 Jan 2012 10:21:45 +0100 Subject: [PATCH] decoder: allow slices to be attached to pictures later. --- gst-libs/gst/vaapi/gstvaapidecoder.c | 10 +++++++++- gst-libs/gst/vaapi/gstvaapidecoder_priv.h | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/vaapi/gstvaapidecoder.c b/gst-libs/gst/vaapi/gstvaapidecoder.c index da738efc23..b896847dc1 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder.c @@ -878,10 +878,18 @@ gst_vaapi_decoder_new_slice( slice = create_slice(decoder, buf, buf_size); if (!slice) return NULL; - g_ptr_array_add(picture->slices, slice); + + if (picture) + g_ptr_array_add(picture->slices, slice); return slice; } +void +gst_vaapi_decoder_free_slice(GstVaapiDecoder *decoder, GstVaapiSlice *slice) +{ + destroy_slice(decoder, slice); +} + gboolean gst_vaapi_decoder_decode_picture( GstVaapiDecoder *decoder, diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_priv.h b/gst-libs/gst/vaapi/gstvaapidecoder_priv.h index 402348f869..2d6d55d6a5 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_priv.h +++ b/gst-libs/gst/vaapi/gstvaapidecoder_priv.h @@ -285,6 +285,10 @@ gst_vaapi_decoder_new_slice( guint buf_size ) attribute_hidden; +void +gst_vaapi_decoder_free_slice(GstVaapiDecoder *decoder, GstVaapiSlice *slice) + attribute_hidden; + gboolean gst_vaapi_decoder_decode_picture( GstVaapiDecoder *decoder,