mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 02:00:33 +00:00
[805/906] glfilter: rename external-opengl-context prop to other-context
It now requires a GstGLContext instead of a handle
This commit is contained in:
parent
cc38e16ef2
commit
0f8fc0881a
2 changed files with 15 additions and 11 deletions
|
@ -48,7 +48,7 @@ GST_STATIC_PAD_TEMPLATE ("sink",
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_EXTERNAL_OPENGL_CONTEXT
|
PROP_OTHER_CONTEXT
|
||||||
};
|
};
|
||||||
|
|
||||||
#define DEBUG_INIT \
|
#define DEBUG_INIT \
|
||||||
|
@ -112,11 +112,11 @@ gst_gl_filter_class_init (GstGLFilterClass * klass)
|
||||||
gst_gl_filter_decide_allocation;
|
gst_gl_filter_decide_allocation;
|
||||||
GST_BASE_TRANSFORM_CLASS (klass)->get_unit_size = gst_gl_filter_get_unit_size;
|
GST_BASE_TRANSFORM_CLASS (klass)->get_unit_size = gst_gl_filter_get_unit_size;
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class, PROP_EXTERNAL_OPENGL_CONTEXT,
|
g_object_class_install_property (gobject_class, PROP_OTHER_CONTEXT,
|
||||||
g_param_spec_uint64 ("external-opengl-context",
|
g_param_spec_object ("other-context",
|
||||||
"External OpenGL context",
|
"External OpenGL context",
|
||||||
"Give an external OpenGL context with which to share textures",
|
"Give an external OpenGL context with which to share textures",
|
||||||
0, G_MAXUINT64, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
GST_GL_TYPE_CONTEXT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_pad_template (element_class,
|
||||||
gst_static_pad_template_get (&gst_gl_filter_src_pad_template));
|
gst_static_pad_template_get (&gst_gl_filter_src_pad_template));
|
||||||
|
@ -147,9 +147,11 @@ gst_gl_filter_set_property (GObject * object, guint prop_id,
|
||||||
GstGLFilter *filter = GST_GL_FILTER (object);
|
GstGLFilter *filter = GST_GL_FILTER (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_EXTERNAL_OPENGL_CONTEXT:
|
case PROP_OTHER_CONTEXT:
|
||||||
{
|
{
|
||||||
filter->external_gl_context = g_value_get_uint64 (value);
|
if (filter->other_context)
|
||||||
|
gst_object_unref (filter->other_context);
|
||||||
|
filter->other_context = g_value_dup_object (value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -165,8 +167,8 @@ gst_gl_filter_get_property (GObject * object, guint prop_id,
|
||||||
GstGLFilter *filter = GST_GL_FILTER (object);
|
GstGLFilter *filter = GST_GL_FILTER (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_EXTERNAL_OPENGL_CONTEXT:
|
case PROP_OTHER_CONTEXT:
|
||||||
g_value_set_uint64 (value, filter->external_gl_context);
|
g_value_set_object (value, filter->other_context);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
@ -230,7 +232,9 @@ gst_gl_filter_reset (GstGLFilter * filter)
|
||||||
filter->fbo = 0;
|
filter->fbo = 0;
|
||||||
filter->depthbuffer = 0;
|
filter->depthbuffer = 0;
|
||||||
filter->default_shader = NULL;
|
filter->default_shader = NULL;
|
||||||
filter->external_gl_context = 0;
|
if (filter->other_context)
|
||||||
|
gst_object_unref (filter->other_context);
|
||||||
|
filter->other_context = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -265,7 +269,7 @@ gst_gl_filter_start (GstBaseTransform * bt)
|
||||||
gst_gl_display_set_context (filter->display, context);
|
gst_gl_display_set_context (filter->display, context);
|
||||||
gst_object_unref (context);
|
gst_object_unref (context);
|
||||||
|
|
||||||
if (!gst_gl_context_create (context, 0, &error)) {
|
if (!gst_gl_context_create (context, filter->other_context, &error)) {
|
||||||
GST_ELEMENT_ERROR (filter, RESOURCE, NOT_FOUND,
|
GST_ELEMENT_ERROR (filter, RESOURCE, NOT_FOUND,
|
||||||
("%s", error->message), (NULL));
|
("%s", error->message), (NULL));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -80,7 +80,7 @@ struct _GstGLFilter
|
||||||
|
|
||||||
GstGLShader *default_shader;
|
GstGLShader *default_shader;
|
||||||
|
|
||||||
guint64 external_gl_context;
|
GstGLContext *other_context;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue