rtpsession: marshal GstBuffer as a MiniObject instead of a pointer

https://bugzilla.gnome.org/show_bug.cgi?id=622553
This commit is contained in:
Olivier Crête 2011-02-01 16:23:52 -05:00 committed by Tim-Philipp Müller
parent 41f3b30010
commit 5ccd964d86
2 changed files with 73 additions and 6 deletions

View file

@ -7,6 +7,4 @@ VOID:UINT
VOID:UINT,UINT
VOID:OBJECT,OBJECT
UINT64:BOOL,UINT64
BOOL:POINTER,BOOL
VOID:UINT,UINT,UINT,UINT,POINTER
VOID:UINT64

View file

@ -130,6 +130,75 @@ accumulate_trues (GSignalInvocationHint * ihint, GValue * return_accu,
return TRUE;
}
static void
gst_rtp_bin_marshal_BOOLEAN__MINIOBJECT_BOOLEAN (GClosure * closure,
GValue * return_value G_GNUC_UNUSED, guint n_param_values,
const GValue * param_values, gpointer invocation_hint G_GNUC_UNUSED,
gpointer marshal_data)
{
typedef gboolean (*GMarshalFunc_BOOLEAN__MINIOBJECT_BOOLEAN) (gpointer data1,
gpointer arg_1, gboolean arg_2, gpointer data2);
register GMarshalFunc_BOOLEAN__MINIOBJECT_BOOLEAN callback;
register GCClosure *cc = (GCClosure *) closure;
register gpointer data1, data2;
gboolean v_return;
g_return_if_fail (return_value != NULL);
g_return_if_fail (n_param_values == 3);
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_BOOLEAN__MINIOBJECT_BOOLEAN) (marshal_data ? marshal_data :
cc->callback);
v_return = callback (data1,
gst_value_get_mini_object (param_values + 1),
g_value_get_boolean (param_values + 2), data2);
g_value_set_boolean (return_value, v_return);
}
static void
gst_rtp_bin_marshal_VOID__UINT_UINT_UINT_UINT_MINIOBJECT (GClosure * closure,
GValue * return_value G_GNUC_UNUSED, guint n_param_values,
const GValue * param_values, gpointer invocation_hint G_GNUC_UNUSED,
gpointer marshal_data)
{
typedef void (*GMarshalFunc_VOID__UINT_UINT_UINT_UINT_MINIOBJECT) (gpointer
data1, guint arg_1, guint arg_2, guint arg_3, guint arg_4, gpointer arg_5,
gpointer data2);
register GMarshalFunc_VOID__UINT_UINT_UINT_UINT_MINIOBJECT callback;
register GCClosure *cc = (GCClosure *) closure;
register gpointer data1, data2;
g_return_if_fail (n_param_values == 6);
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__UINT_UINT_UINT_UINT_MINIOBJECT) (marshal_data ?
marshal_data : cc->callback);
callback (data1,
g_value_get_uint (param_values + 1),
g_value_get_uint (param_values + 2),
g_value_get_uint (param_values + 3),
g_value_get_uint (param_values + 4),
gst_value_get_mini_object (param_values + 5), data2);
}
static void
rtp_session_class_init (RTPSessionClass * klass)
{
@ -278,8 +347,8 @@ rtp_session_class_init (RTPSessionClass * klass)
rtp_session_signals[SIGNAL_ON_SENDING_RTCP] =
g_signal_new ("on-sending-rtcp", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (RTPSessionClass, on_sending_rtcp),
accumulate_trues, NULL, gst_rtp_bin_marshal_BOOLEAN__POINTER_BOOLEAN,
G_TYPE_BOOLEAN, 2, G_TYPE_POINTER, G_TYPE_BOOLEAN);
accumulate_trues, NULL, gst_rtp_bin_marshal_BOOLEAN__MINIOBJECT_BOOLEAN,
G_TYPE_BOOLEAN, 2, GST_TYPE_BUFFER, G_TYPE_BOOLEAN);
/**
* RTPSession::on-feedback-rtcp:
@ -298,9 +367,9 @@ rtp_session_class_init (RTPSessionClass * klass)
rtp_session_signals[SIGNAL_ON_FEEDBACK_RTCP] =
g_signal_new ("on-feedback-rtcp", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (RTPSessionClass, on_feedback_rtcp),
NULL, NULL, gst_rtp_bin_marshal_VOID__UINT_UINT_UINT_UINT_POINTER,
NULL, NULL, gst_rtp_bin_marshal_VOID__UINT_UINT_UINT_UINT_MINIOBJECT,
G_TYPE_NONE, 4, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT,
G_TYPE_POINTER);
GST_TYPE_BUFFER);
/**
* RTPSession::send-rtcp: