summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu.duponchelle@epitech.eu>2013-07-18 01:42:31 +0200
committerSebastian Dröge <slomo@circular-chaos.org>2013-07-18 11:12:09 +0200
commitfe0c6ad9ba00b0b57196dd7c8ef6a2f71ebf5cd7 (patch)
tree99ffc15a1f3af3947b1b7746d188fec447f0ccd1
parent3f7e94398d89d8efc618a05930571ecfe309c893 (diff)
glfilters: Mark writable-only properties as readable as well
https://bugzilla.gnome.org/show_bug.cgi?id=704429
-rw-r--r--gst-libs/gst/gl/gstglfilter.c7
-rw-r--r--gst/gl/gstglfiltercube.c37
-rw-r--r--gst/gl/gstglfilterreflectedscreen.c21
3 files changed, 52 insertions, 13 deletions
diff --git a/gst-libs/gst/gl/gstglfilter.c b/gst-libs/gst/gl/gstglfilter.c
index 85b12de..cd6eba5 100644
--- a/gst-libs/gst/gl/gstglfilter.c
+++ b/gst-libs/gst/gl/gstglfilter.c
@@ -116,7 +116,7 @@ gst_gl_filter_class_init (GstGLFilterClass * klass)
g_param_spec_uint64 ("external-opengl-context",
"External OpenGL context",
"Give an external OpenGL context with which to share textures",
- 0, G_MAXUINT64, 0, G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
+ 0, G_MAXUINT64, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_gl_filter_src_pad_template));
@@ -162,9 +162,12 @@ static void
gst_gl_filter_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
- //GstGLFilter *filter = GST_GL_FILTER (object);
+ GstGLFilter *filter = GST_GL_FILTER (object);
switch (prop_id) {
+ case PROP_EXTERNAL_OPENGL_CONTEXT:
+ g_value_set_uint64 (value, filter->external_gl_context);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
diff --git a/gst/gl/gstglfiltercube.c b/gst/gl/gstglfiltercube.c
index ee1f5fb..96c040c 100644
--- a/gst/gl/gstglfiltercube.c
+++ b/gst/gl/gstglfiltercube.c
@@ -154,34 +154,34 @@ gst_gl_filter_cube_class_init (GstGLFilterCubeClass * klass)
g_object_class_install_property (gobject_class, PROP_RED,
g_param_spec_float ("red", "Red", "Background red color",
- 0.0f, 1.0f, 0.0f, G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
+ 0.0f, 1.0f, 0.0f, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_GREEN,
g_param_spec_float ("green", "Green", "Background reen color",
- 0.0f, 1.0f, 0.0f, G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
+ 0.0f, 1.0f, 0.0f, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_BLUE,
g_param_spec_float ("blue", "Blue", "Background blue color",
- 0.0f, 1.0f, 0.0f, G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
+ 0.0f, 1.0f, 0.0f, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_FOVY,
g_param_spec_double ("fovy", "Fovy", "Field of view angle in degrees",
- 0.0, 180.0, 45.0, G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
+ 0.0, 180.0, 45.0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_ASPECT,
g_param_spec_double ("aspect", "Aspect",
"Field of view in the x direction", 0.0, 100, 0.0,
- G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_ZNEAR,
g_param_spec_double ("znear", "Znear",
"Specifies the distance from the viewer to the near clipping plane",
- 0.0, 100.0, 0.1, G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
+ 0.0, 100.0, 0.1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_ZFAR,
g_param_spec_double ("zfar", "Zfar",
"Specifies the distance from the viewer to the far clipping plane",
- 0.0, 1000.0, 100.0, G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
+ 0.0, 1000.0, 100.0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
gst_element_class_set_metadata (element_class, "OpenGL cube filter",
"Filter/Effect/Video", "Map input texture on the 6 cube faces",
@@ -236,7 +236,30 @@ static void
gst_gl_filter_cube_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
+ GstGLFilterCube *filter = GST_GL_FILTER_CUBE (object);
+
switch (prop_id) {
+ case PROP_RED:
+ g_value_set_float (value, filter->red);
+ break;
+ case PROP_GREEN:
+ g_value_set_float (value, filter->green);
+ break;
+ case PROP_BLUE:
+ g_value_set_float (value, filter->blue);
+ break;
+ case PROP_FOVY:
+ g_value_set_double (value, filter->fovy);
+ break;
+ case PROP_ASPECT:
+ g_value_set_double (value, filter->aspect);
+ break;
+ case PROP_ZNEAR:
+ g_value_set_double (value, filter->znear);
+ break;
+ case PROP_ZFAR:
+ g_value_set_double (value, filter->zfar);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
diff --git a/gst/gl/gstglfilterreflectedscreen.c b/gst/gl/gstglfilterreflectedscreen.c
index f2251c0..da6a12d 100644
--- a/gst/gl/gstglfilterreflectedscreen.c
+++ b/gst/gl/gstglfilterreflectedscreen.c
@@ -117,22 +117,23 @@ gst_gl_filter_reflected_screen_class_init (GstGLFilterReflectedScreenClass *
g_object_class_install_property (gobject_class, PROP_FOVY,
g_param_spec_double ("fovy", "Fovy", "Field of view angle in degrees",
- 0.0, 180.0, 60, G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
+ 0.0, 180.0, 60, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_ASPECT,
g_param_spec_double ("aspect", "Aspect",
"Field of view in the x direction", 1.0, 100, 1.0,
- G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_ZNEAR,
g_param_spec_double ("znear", "Znear",
"Specifies the distance from the viewer to the near clipping plane",
- 0.0000000001, 100.0, 0.1, G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
+ 0.0000000001, 100.0, 0.1,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_ZFAR,
g_param_spec_double ("zfar", "Zfar",
"Specifies the distance from the viewer to the far clipping plane",
- 0.0, 1000.0, 100.0, G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
+ 0.0, 1000.0, 100.0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
gst_element_class_set_metadata (element_class,
"OpenGL Reflected Screen filter", "Filter/Effect/Video",
@@ -201,6 +202,18 @@ gst_gl_filter_reflected_screen_get_property (GObject * object, guint prop_id,
case PROP_SHOW_FLOOR:
g_value_set_boolean (value, filter->show_floor);
break;
+ case PROP_FOVY:
+ g_value_set_double (value, filter->fovy);
+ break;
+ case PROP_ASPECT:
+ g_value_set_double (value, filter->aspect);
+ break;
+ case PROP_ZNEAR:
+ g_value_set_double (value, filter->znear);
+ break;
+ case PROP_ZFAR:
+ g_value_set_double (value, filter->zfar);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;