decoder: allow slices to be attached to pictures later.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Tue, 24 Jan 2012 09:21:45 +0000 (10:21 +0100)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Tue, 24 Jan 2012 09:21:45 +0000 (10:21 +0100)
gst-libs/gst/vaapi/gstvaapidecoder.c
gst-libs/gst/vaapi/gstvaapidecoder_priv.h

index da738ef..b896847 100644 (file)
@@ -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,
index 402348f..2d6d55d 100644 (file)
@@ -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,