mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-09 07:52:36 +00:00
va: allocator: remove GstVideoInfo from GstVaBufferSurface
Don't store it them anymore since it is related with the negotiated stream and not the concrete buffer. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1667>
This commit is contained in:
parent
67eb0a9440
commit
30281af83f
1 changed files with 9 additions and 12 deletions
|
@ -326,7 +326,6 @@ typedef struct _GstVaBufferSurface GstVaBufferSurface;
|
||||||
struct _GstVaBufferSurface
|
struct _GstVaBufferSurface
|
||||||
{
|
{
|
||||||
GstVaDisplay *display;
|
GstVaDisplay *display;
|
||||||
GstVideoInfo info;
|
|
||||||
VASurfaceID surface;
|
VASurfaceID surface;
|
||||||
volatile gint ref_count;
|
volatile gint ref_count;
|
||||||
};
|
};
|
||||||
|
@ -355,7 +354,6 @@ gst_va_buffer_surface_new (VASurfaceID surface, GstVideoFormat format,
|
||||||
g_atomic_int_set (&buf->ref_count, 0);
|
g_atomic_int_set (&buf->ref_count, 0);
|
||||||
buf->surface = surface;
|
buf->surface = surface;
|
||||||
buf->display = NULL;
|
buf->display = NULL;
|
||||||
gst_video_info_set_format (&buf->info, format, width, height);
|
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
@ -560,7 +558,7 @@ gst_va_dmabuf_allocator_setup_buffer (GstAllocator * allocator,
|
||||||
}
|
}
|
||||||
|
|
||||||
buf = gst_va_buffer_surface_new (surface, format, desc.width, desc.height);
|
buf = gst_va_buffer_surface_new (surface, format, desc.width, desc.height);
|
||||||
GST_VIDEO_INFO_SIZE (&buf->info) = 0;
|
GST_VIDEO_INFO_SIZE (¶ms->info) = 0;
|
||||||
|
|
||||||
for (i = 0; i < desc.num_objects; i++) {
|
for (i = 0; i < desc.num_objects; i++) {
|
||||||
gint fd = desc.objects[i].fd;
|
gint fd = desc.objects[i].fd;
|
||||||
|
@ -581,20 +579,19 @@ gst_va_dmabuf_allocator_setup_buffer (GstAllocator * allocator,
|
||||||
gst_mini_object_set_qdata (GST_MINI_OBJECT (mem), gst_va_drm_mod_quark (),
|
gst_mini_object_set_qdata (GST_MINI_OBJECT (mem), gst_va_drm_mod_quark (),
|
||||||
drm_mod, g_free);
|
drm_mod, g_free);
|
||||||
|
|
||||||
GST_VIDEO_INFO_SIZE (&buf->info) += size;
|
GST_VIDEO_INFO_SIZE (¶ms->info) += size;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < desc.num_layers; i++) {
|
for (i = 0; i < desc.num_layers; i++) {
|
||||||
g_assert (desc.layers[i].num_planes == 1);
|
g_assert (desc.layers[i].num_planes == 1);
|
||||||
GST_VIDEO_INFO_PLANE_OFFSET (&buf->info, i) = desc.layers[i].offset[0];
|
GST_VIDEO_INFO_PLANE_OFFSET (¶ms->info, i) = desc.layers[i].offset[0];
|
||||||
GST_VIDEO_INFO_PLANE_STRIDE (&buf->info, i) = desc.layers[i].pitch[0];
|
GST_VIDEO_INFO_PLANE_STRIDE (¶ms->info, i) = desc.layers[i].pitch[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_LOG_OBJECT (self, "Created surface %#x [%dx%d] size %" G_GSIZE_FORMAT,
|
GST_LOG_OBJECT (self, "Created surface %#x [%dx%d] size %" G_GSIZE_FORMAT,
|
||||||
buf->surface, GST_VIDEO_INFO_WIDTH (&buf->info),
|
buf->surface, GST_VIDEO_INFO_WIDTH (¶ms->info),
|
||||||
GST_VIDEO_INFO_HEIGHT (&buf->info), GST_VIDEO_INFO_SIZE (&buf->info));
|
GST_VIDEO_INFO_HEIGHT (¶ms->info),
|
||||||
|
GST_VIDEO_INFO_SIZE (¶ms->info));
|
||||||
params->info = buf->info;
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
@ -731,7 +728,6 @@ gst_va_dmabuf_memories_setup (GstVaDisplay * display, GstVideoInfo * info,
|
||||||
|
|
||||||
buf = gst_va_buffer_surface_new (surface, rt_format, ext_buf.width,
|
buf = gst_va_buffer_surface_new (surface, rt_format, ext_buf.width,
|
||||||
ext_buf.height);
|
ext_buf.height);
|
||||||
buf->info = *info;
|
|
||||||
buf->display = gst_object_ref (display);
|
buf->display = gst_object_ref (display);
|
||||||
|
|
||||||
for (i = 0; i < n_planes; i++) {
|
for (i = 0; i < n_planes; i++) {
|
||||||
|
@ -1149,7 +1145,8 @@ gst_va_allocator_alloc (GstAllocator * allocator,
|
||||||
GST_MINI_OBJECT (mem)->dispose = gst_va_memory_release;
|
GST_MINI_OBJECT (mem)->dispose = gst_va_memory_release;
|
||||||
|
|
||||||
GST_LOG_OBJECT (self, "Created surface %#x [%dx%d]", mem->surface,
|
GST_LOG_OBJECT (self, "Created surface %#x [%dx%d]", mem->surface,
|
||||||
GST_VIDEO_INFO_WIDTH (&mem->info), GST_VIDEO_INFO_HEIGHT (&mem->info));
|
GST_VIDEO_INFO_WIDTH (¶ms->info),
|
||||||
|
GST_VIDEO_INFO_HEIGHT (¶ms->info));
|
||||||
|
|
||||||
return GST_MEMORY_CAST (mem);
|
return GST_MEMORY_CAST (mem);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue