From b26c4dbe4eabf78d823023cb3e03d6bbcbdc8cc0 Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Thu, 18 Jul 2013 01:42:31 +0200 Subject: [PATCH] [773/906] glfilters: Mark writable-only properties as readable as well https://bugzilla.gnome.org/show_bug.cgi?id=704429 --- gst-libs/gst/gl/gstglfilter.c | 7 +++++-- gst/gl/gstglfiltercube.c | 37 ++++++++++++++++++++++++++++++------- gst/gl/gstglfilterreflectedscreen.c | 21 +++++++++++++++++---- 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; -- 2.7.4