vadecoder: remove display reference in decode picture

Since it's possible to grab the VA display from the GstBuffer and
GstMemory, there's no need to keep a reference to it in
GstVaDecodePicture.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3066>
This commit is contained in:
Víctor Manuel Jáquez Leal 2022-09-22 18:53:30 +02:00 committed by GStreamer Marge Bot
parent 746e81fccf
commit 494169aad4
2 changed files with 5 additions and 7 deletions

View file

@ -725,15 +725,17 @@ gst_va_decoder_get_config (GstVaDecoder * self, VAProfile * profile,
static gboolean
_destroy_buffers (GstVaDecodePicture * pic)
{
GstVaDisplay *display;
VABufferID buffer;
VADisplay dpy;
VAStatus status;
guint i;
gboolean ret = TRUE;
g_return_val_if_fail (GST_IS_VA_DISPLAY (pic->display), FALSE);
dpy = gst_va_display_get_va_dpy (pic->display);
display = gst_va_buffer_peek_display (pic->gstbuffer);
if (!display)
return FALSE;
dpy = gst_va_display_get_va_dpy (display);
if (pic->buffers) {
for (i = 0; i < pic->buffers->len; i++) {
@ -777,7 +779,6 @@ gst_va_decode_picture_new (GstVaDecoder * self, GstBuffer * buffer)
pic->gstbuffer = gst_buffer_ref (buffer);
pic->buffers = g_array_sized_new (FALSE, FALSE, sizeof (VABufferID), 16);
pic->slices = g_array_sized_new (FALSE, FALSE, sizeof (VABufferID), 64);
pic->display = gst_object_ref (self->display);
return pic;
}
@ -810,7 +811,6 @@ gst_va_decode_picture_free (GstVaDecodePicture * pic)
gst_buffer_unref (pic->gstbuffer);
g_clear_pointer (&pic->buffers, g_array_unref);
g_clear_pointer (&pic->slices, g_array_unref);
gst_clear_object (&pic->display);
g_free (pic);
}
@ -824,7 +824,6 @@ gst_va_decode_picture_dup (GstVaDecodePicture * pic)
dup = g_new0 (GstVaDecodePicture, 1);
dup->display = gst_object_ref (pic->display);
/* dups only need gstbuffer */
dup->gstbuffer = gst_buffer_ref (pic->gstbuffer);
return dup;

View file

@ -28,7 +28,6 @@ G_BEGIN_DECLS
typedef struct _GstVaDecodePicture GstVaDecodePicture;
struct _GstVaDecodePicture
{
GstVaDisplay *display;
GArray *buffers;
GArray *slices;
GstBuffer *gstbuffer;