basecamerasrc: don't use class offsets for start/stop-capture signal handlers
authorRaluca Elena Podiuc <ralucaelena1985@gmail.com>
Tue, 26 Jul 2011 02:59:09 +0000 (05:59 +0300)
committerThiago Santos <thiago.sousa.santos@collabora.co.uk>
Tue, 2 Aug 2011 16:39:18 +0000 (13:39 -0300)
gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c
gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.h

index c113f34..26bdb85 100644 (file)
@@ -591,26 +591,19 @@ gst_base_camera_src_class_init (GstBaseCameraSrcClass * klass)
 
   /* Signals */
   basecamerasrc_signals[START_CAPTURE_SIGNAL] =
-      g_signal_new ("start-capture",
+      g_signal_new_class_handler ("start-capture",
       G_TYPE_FROM_CLASS (klass),
       G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
-      G_STRUCT_OFFSET (GstBaseCameraSrcClass, private_start_capture),
+      G_CALLBACK (gst_base_camera_src_start_capture),
       NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
 
   basecamerasrc_signals[STOP_CAPTURE_SIGNAL] =
-      g_signal_new ("stop-capture",
+      g_signal_new_class_handler ("stop-capture",
       G_TYPE_FROM_CLASS (klass),
       G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
-      G_STRUCT_OFFSET (GstBaseCameraSrcClass, private_stop_capture),
+      G_CALLBACK (gst_base_camera_src_stop_capture),
       NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
 
-  /* TODO these should be moved to a private struct
-   * that is allocated sequentially to the main struct as said at:
-   * http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#g-type-add-class-private
-   */
-  klass->private_start_capture = gst_base_camera_src_start_capture;
-  klass->private_stop_capture = gst_base_camera_src_stop_capture;
-
   gstelement_class->change_state = gst_base_camera_src_change_state;
 }
 
index f88daf0..2157bb4 100644 (file)
@@ -121,8 +121,6 @@ struct _GstBaseCameraSrcClass
   /* unused */
   GstCaps *   (*get_allowed_input_caps) (GstBaseCameraSrc * self);
 
-  void (*private_start_capture) (GstBaseCameraSrc * src);
-  void (*private_stop_capture) (GstBaseCameraSrc * src);
   /* Called by the handler for 'start-capture'. Mandatory. */
   gboolean (*start_capture) (GstBaseCameraSrc * src);