[773/906] glfilters: Mark writable-only properties as readable as well
authorMathieu Duponchelle <mathieu.duponchelle@epitech.eu>
Wed, 17 Jul 2013 23:42:31 +0000 (01:42 +0200)
committerMatthew Waters <ystreet00@gmail.com>
Sat, 15 Mar 2014 17:37:00 +0000 (18:37 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=704429

gst-libs/gst/gl/gstglfilter.c
gst/gl/gstglfiltercube.c
gst/gl/gstglfilterreflectedscreen.c

index 85b12de..cd6eba5 100644 (file)
@@ -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;
index ee1f5fb..96c040c 100644 (file)
@@ -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;
index f2251c0..da6a12d 100644 (file)
@@ -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;