summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorHe Junyan <junyan.he@hotmail.com>2020-04-18 19:32:24 +0800
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2020-05-16 19:18:46 +0200
commitf20bd8bfd1c916c979319d134dbfc2ca5ef00167 (patch)
treefd0ef4954ac7d99cbd83a79f2587776335930bb9 /gst
parent808247a96325f689f88f98708ef8ecd287057022 (diff)
libs: texture: Make texture a standard GstMiniObject.
We store GstVaapiTextureGLX and GstVaapiTextureEGL's private data in the qdata of miniobject and avoid extending the base texture class. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/317>
Diffstat (limited to 'gst')
-rw-r--r--gst/vaapi/gstvaapivideometa_texture.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gst/vaapi/gstvaapivideometa_texture.c b/gst/vaapi/gstvaapivideometa_texture.c
index 68da63f0..f840de78 100644
--- a/gst/vaapi/gstvaapivideometa_texture.c
+++ b/gst/vaapi/gstvaapivideometa_texture.c
@@ -125,7 +125,7 @@ meta_texture_free (GstVaapiVideoMetaTexture * meta)
if (G_UNLIKELY (!meta))
return;
- gst_vaapi_texture_replace (&meta->texture, NULL);
+ gst_mini_object_replace ((GstMiniObject **) & meta->texture, NULL);
g_slice_free (GstVaapiVideoMetaTexture, meta);
}
@@ -164,7 +164,9 @@ meta_texture_copy (GstVaapiVideoMetaTexture * meta)
copy->gl_format = meta->gl_format;
copy->width = meta->width;
copy->height = meta->height;
- gst_vaapi_texture_replace (&copy->texture, meta->texture);
+
+ gst_mini_object_replace ((GstMiniObject **) & copy->texture,
+ (GstMiniObject *) meta->texture);
return copy;
}
@@ -186,8 +188,7 @@ gst_vaapi_texture_upload (GstVideoGLTextureUploadMeta * meta,
if (meta_texture->texture
/* Check whether VA display changed */
- && gst_vaapi_object_get_display
- (GST_VAAPI_OBJECT (meta_texture->texture)) == dpy
+ && GST_VAAPI_TEXTURE_DISPLAY (meta_texture->texture) == dpy
/* Check whether texture id changed */
&& (gst_vaapi_texture_get_id (meta_texture->texture) == texture_id[0])) {
texture = meta_texture->texture;
@@ -202,7 +203,8 @@ gst_vaapi_texture_upload (GstVideoGLTextureUploadMeta * meta,
}
if (meta_texture->texture != texture) {
- gst_vaapi_texture_replace (&meta_texture->texture, texture);
+ gst_mini_object_replace ((GstMiniObject **) & meta_texture->texture,
+ (GstMiniObject *) texture);
}
if (!texture)