From 2e0d1efb0ea5863bfccbf40bf96fc6ef15ad8ae9 Mon Sep 17 00:00:00 2001 From: Youness Alaoui Date: Fri, 11 Jan 2008 16:45:57 +0000 Subject: gst/rtpmanager/: Make it possible to use different user_data for each of the callbacks. Original commit message from CVS: Patch by: Youness Alaoui * gst/rtpmanager/gstrtpsession.c: (gst_rtp_session_clock_rate): * gst/rtpmanager/rtpsession.c: (rtp_session_set_callbacks), (rtp_session_set_process_rtp_callback), (rtp_session_set_send_rtp_callback), (rtp_session_set_send_rtcp_callback), (rtp_session_set_sync_rtcp_callback), (rtp_session_set_clock_rate_callback), (rtp_session_set_reconsider_callback), (source_push_rtp), (source_clock_rate), (rtp_session_process_bye), (rtp_session_process_rtcp), (rtp_session_send_bye), (rtp_session_on_timeout): * gst/rtpmanager/rtpsession.h: Make it possible to use different user_data for each of the callbacks. Fixes #508587. --- gst/rtpmanager/rtpsession.h | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'gst/rtpmanager/rtpsession.h') diff --git a/gst/rtpmanager/rtpsession.h b/gst/rtpmanager/rtpsession.h index 12dd1603..59703300 100644 --- a/gst/rtpmanager/rtpsession.h +++ b/gst/rtpmanager/rtpsession.h @@ -85,10 +85,10 @@ typedef GstFlowReturn (*RTPSessionSendRTCP) (RTPSession *sess, RTPSource *src, G * RTPSessionSyncRTCP: * @sess: an #RTPSession * @src: the #RTPSource - * @buffer: the RTCP buffer ready for sending + * @buffer: the RTCP buffer ready for synchronisation * @user_data: user data specified when registering * - * This callback will be called when @sess has and SR @buffer ready for doing + * This callback will be called when @sess has an SR @buffer ready for doing * synchronisation between streams. * * Returns: a #GstFlowReturn. @@ -133,8 +133,8 @@ typedef void (*RTPSessionReconsider) (RTPSession *sess, gpointer user_data); typedef struct { RTPSessionProcessRTP process_rtp; RTPSessionSendRTP send_rtp; - RTPSessionSendRTCP send_rtcp; RTPSessionSyncRTCP sync_rtcp; + RTPSessionSendRTCP send_rtcp; RTPSessionClockRate clock_rate; RTPSessionReconsider reconsider; } RTPSessionCallbacks; @@ -177,8 +177,13 @@ struct _RTPSession { gchar *bye_reason; gboolean sent_bye; - RTPSessionCallbacks callbacks; - gpointer user_data; + RTPSessionCallbacks callbacks; + gpointer process_rtp_user_data; + gpointer send_rtp_user_data; + gpointer send_rtcp_user_data; + gpointer sync_rtcp_user_data; + gpointer clock_rate_user_data; + gpointer reconsider_user_data; RTPSessionStats stats; @@ -211,9 +216,27 @@ GType rtp_session_get_type (void); /* create and configure */ RTPSession* rtp_session_new (void); -void rtp_session_set_callbacks (RTPSession *sess, +void rtp_session_set_callbacks (RTPSession *sess, RTPSessionCallbacks *callbacks, gpointer user_data); +void rtp_session_set_process_rtp_callback (RTPSession * sess, + RTPSessionProcessRTP callback, + gpointer user_data); +void rtp_session_set_send_rtp_callback (RTPSession * sess, + RTPSessionSendRTP callback, + gpointer user_data); +void rtp_session_set_send_rtcp_callback (RTPSession * sess, + RTPSessionSendRTCP callback, + gpointer user_data); +void rtp_session_set_sync_rtcp_callback (RTPSession * sess, + RTPSessionSyncRTCP callback, + gpointer user_data); +void rtp_session_set_clock_rate_callback (RTPSession * sess, + RTPSessionClockRate callback, + gpointer user_data); +void rtp_session_set_reconsider_callback (RTPSession * sess, + RTPSessionReconsider callback, + gpointer user_data); void rtp_session_set_bandwidth (RTPSession *sess, gdouble bandwidth); gdouble rtp_session_get_bandwidth (RTPSession *sess); void rtp_session_set_rtcp_fraction (RTPSession *sess, gdouble fraction); -- cgit v1.2.1