gst-libs/gst/interfaces/mixeroptions.*: API: add GstMixerOptions::get_values vfunc...
authorTim-Philipp Müller <tim@centricular.net>
Mon, 3 Mar 2008 13:50:18 +0000 (13:50 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Mon, 3 Mar 2008 13:50:18 +0000 (13:50 +0000)
Original commit message from CVS:
* gst-libs/gst/interfaces/mixeroptions.c: (gst_mixer_options_init),
(gst_mixer_options_get_values):
* gst-libs/gst/interfaces/mixeroptions.h:
(GST_MIXER_OPTIONS_GET_CLASS), (GstMixerOptionsClass),
(_GstMixerOptions), (_GstMixerOptionsClass):
API: add GstMixerOptions::get_values vfunc (#519906)

ChangeLog
gst-libs/gst/interfaces/mixeroptions.c
gst-libs/gst/interfaces/mixeroptions.h

index bd5e484..89c874d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-03-03  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * gst-libs/gst/interfaces/mixeroptions.c: (gst_mixer_options_init),
+         (gst_mixer_options_get_values):
+       * gst-libs/gst/interfaces/mixeroptions.h:
+         (GST_MIXER_OPTIONS_GET_CLASS), (GstMixerOptionsClass),
+         (_GstMixerOptions), (_GstMixerOptionsClass):
+         API: add GstMixerOptions::get_values vfunc (#519906)
+
 2008-03-03  Peter Kjellerstedt  <pkj@axis.com>
 
        * configure.ac:
index 6a1ccb8..b04f892 100644 (file)
@@ -98,16 +98,27 @@ gst_mixer_options_init (GstMixerOptions * mixer_options)
  *
  * Get the values for the mixer option.
  *
- * Returns: A list of all the possible values for the mixer option.
+ * Returns: A list of strings with all the possible values for the mixer
+ *     option. You must not free or modify the list or its contents, it belongs
+ *     to the @mixer_options object.
  */
-
 GList *
 gst_mixer_options_get_values (GstMixerOptions * mixer_options)
 {
-  if (!mixer_options->values)
-    return NULL;
+  GstMixerOptionsClass *klass;
+  GList *ret = NULL;
+
+  g_return_val_if_fail (GST_IS_MIXER_OPTIONS (mixer_options), NULL);
+
+  klass = GST_MIXER_OPTIONS_GET_CLASS (mixer_options);
+
+  if (klass->get_values != NULL) {
+    ret = klass->get_values (mixer_options);
+  } else {
+    ret = mixer_options->values;
+  }
 
-  return (GList *) mixer_options->values;
+  return ret;
 }
 
 
index 832c5bc..2724da5 100644 (file)
@@ -34,6 +34,8 @@ G_BEGIN_DECLS
 #define GST_MIXER_OPTIONS(obj) \
   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MIXER_OPTIONS, \
                                GstMixerOptions))
+#define GST_MIXER_OPTIONS_GET_CLASS(obj) \
+  (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MIXER_OPTIONS, GstMixerOptionsClass))
 #define GST_MIXER_OPTIONS_CLASS(klass) \
   (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MIXER_OPTIONS, \
                             GstMixerOptionsClass))
@@ -45,30 +47,44 @@ G_BEGIN_DECLS
 typedef struct _GstMixerOptions GstMixerOptions;
 typedef struct _GstMixerOptionsClass GstMixerOptionsClass;
 
+/**
+ * GstMixerOptions:
+ * @parent: Parent object
+ * @values: List of option strings. Do not access this member directly,
+ *     always use gst_mixer_options_get_values() instead.
+ */
 struct _GstMixerOptions {
   GstMixerTrack parent;
 
-  /* list of strings */
+  /* list of strings (do not access directly) (FIXME 0.11: make private) */
   GList        *values;
 
   gpointer _gst_reserved[GST_PADDING];
 };
 
+/**
+ * GstMixerOptionsClass:
+ * @parent: Parent class
+ * @get_values: Optional implementation of gst_mixer_options_get_values().
+ *    (Since: 0.10.18)
+ */
 struct _GstMixerOptionsClass {
   GstMixerTrackClass parent;
 
 #ifdef GST_MIXER_NEED_DEPRECATED
   /* signals */
-  void (* option_changed) (GstMixerOptions *opts,
-                           gchar           *value);
+  void    (* option_changed) (GstMixerOptions *opts,
+                              gchar           *value);
 #endif /* GST_MIXER_NEED_DEPRECATED */
 
-  gpointer _gst_reserved[GST_PADDING];
+  GList * (* get_values)     (GstMixerOptions *opts);
+
+  gpointer _gst_reserved[GST_PADDING-1];
 };
 
-GType           gst_mixer_options_get_type      (void);
+GType           gst_mixer_options_get_type (void);
 
-GList * gst_mixer_options_get_values (GstMixerOptions *mixer_options);
+GList         * gst_mixer_options_get_values (GstMixerOptions *mixer_options);
 
 G_END_DECLS