Commit 2160bcf6 authored by Guillaume BIENKOWSKI's avatar Guillaume BIENKOWSKI

Change the rtp event callback prototype. This fixes issues in arm64 where the...

Change the rtp event callback prototype. This fixes issues in arm64 where the call conventions for variadic functions are messing up the stack and leads to a crash.
parent 93607074
......@@ -22,7 +22,7 @@
#define RTP_CALLBACK_TABLE_MAX_ENTRIES 5
typedef void (*RtpCallback)(struct _RtpSession *, ...);
typedef void (*RtpCallback)(struct _RtpSession *, unsigned long arg1, unsigned long arg2, void* userdata);
struct _RtpSignalTable
{
......
......@@ -46,40 +46,27 @@ int rtp_signal_table_add(RtpSignalTable *table,RtpCallback cb, unsigned long use
return -1;
}
void rtp_signal_table_emit(RtpSignalTable *table)
void rtp_signal_table_emit3(RtpSignalTable *table, unsigned long arg1, unsigned long arg2)
{
int i,c;
for (i=0,c=0;c<table->count;i++){
if (table->callback[i]!=NULL){
c++; /*I like it*/
table->callback[i](table->session,table->user_data[i]);
table->callback[i](table->session,arg1,arg2,table->user_data[i]);
}
}
}
void rtp_signal_table_emit2(RtpSignalTable *table,unsigned long arg)
void rtp_signal_table_emit(RtpSignalTable *table)
{
int i,c;
for (i=0,c=0;c<table->count;i++){
if (table->callback[i]!=NULL){
c++; /*I like it*/
table->callback[i](table->session,arg,table->user_data[i]);
}
}
return rtp_signal_table_emit3(table, NULL, NULL);
}
void rtp_signal_table_emit3(RtpSignalTable *table, unsigned long arg1, unsigned long arg2)
void rtp_signal_table_emit2(RtpSignalTable *table,unsigned long arg)
{
int i,c;
for (i=0,c=0;c<table->count;i++){
if (table->callback[i]!=NULL){
c++; /*I like it*/
table->callback[i](table->session,arg1,arg2,table->user_data[i]);
}
}
return rtp_signal_table_emit3(table, arg, NULL);
}
int rtp_signal_table_remove_by_callback(RtpSignalTable *table,RtpCallback cb)
......
......@@ -58,7 +58,7 @@ static char *help="usage: tevmrtprecv file_prefix local_port number_of_streams \
#define STREAMS_COUNT 1000
void recv_tev_cb(RtpSession *session,int type,long user_data)
void recv_tev_cb(RtpSession *session,unsigned long type, unsigned long dummy, void* user_data)
{
//printf("Receiving telephony event:%i\n",type);
if (type<16) printf("This is dtmf %c on channel %d\n",dtmf_tab[type],*(int *)user_data);
......
......@@ -43,7 +43,7 @@ static char *help="usage: test_tevrecv filename loc_port\n";
int dtmf_count=0;
void recv_tev_cb(RtpSession *session,int type,long user_data)
void recv_tev_cb(RtpSession *session,unsigned long type, unsigned long dummy, void* user_data)
{
printf("Receiving telephony event:%i\n",type);
if (type<16) printf("This is dtmf %c\n",dtmf_tab[type]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment