[gst-devel] is my marshaller correct ?

Vincent Torri vtorri at univ-evry.fr
Sun Aug 20 00:09:16 CEST 2006


Hey,

I would like to create the following marshaller:

VOID:INT64,INT,POINTER

I've never written any marshaller, so my code may have a bug (I have a 
seg fault, and except the marshaller, I think that everything is 
correct). I've tried to mimic existing marshaller. Here is the code of the 
marshaller:

void
gst_marshal_VOID__INT64_INT_POINTER (GClosure     *closure,
                                      GValue       *return_value,
                                      guint         n_param_values,
                                      const GValue *param_values,
                                      gpointer      invocation_hint,
                                      gpointer      marshal_data)
{
   typedef void (*GMarshalFunc_VOID__INT64_INT_POINTER) (gpointer 
data1,
                                                         gint64 
arg_1,
                                                         gint 
arg_2,
                                                         gpointer 
arg_3,
                                                         gpointer 
data2);
   register GMarshalFunc_VOID__INT64_INT_POINTER callback;
   register GCClosure *cc = (GCClosure*) closure;
   register gpointer data1, data2;

   g_return_if_fail (n_param_values == 4);

   if (G_CCLOSURE_SWAP_DATA (closure))
     {
       data1 = closure->data;
       data2 = g_value_peek_pointer (param_values + 0);
     }
   else
     {
       data1 = g_value_peek_pointer (param_values + 0);
       data2 = closure->data;
     }
   callback = (GMarshalFunc_VOID__INT64_INT_POINTER) (marshal_data ? 
marshal_data : cc->callback);

   callback (data1,
             g_marshal_value_peek_int64 (param_values + 1),
             g_marshal_value_peek_int (param_values + 2),
             g_marshal_value_peek_pointer (param_values + 3),
             data2);
}

does someone find a bug ?

thank you

Vincent Torri




More information about the gstreamer-devel mailing list