Commit 1ad38563 authored by johan's avatar johan

Merge remote-tracking branch 'origin/master' into dev_dtls

parents 29802b08 5ab29c50
......@@ -393,7 +393,7 @@ ORTP_PUBLIC void rtp_session_set_recv_profile(RtpSession *session,RtpProfile *pr
ORTP_PUBLIC RtpProfile *rtp_session_get_profile(RtpSession *session);
ORTP_PUBLIC RtpProfile *rtp_session_get_send_profile(RtpSession *session);
ORTP_PUBLIC RtpProfile *rtp_session_get_recv_profile(RtpSession *session);
ORTP_PUBLIC int rtp_session_signal_connect(RtpSession *session,const char *signal_name, RtpCallback cb, unsigned long user_data);
ORTP_PUBLIC int rtp_session_signal_connect(RtpSession *session,const char *signal_name, RtpCallback cb, void *user_data);
ORTP_PUBLIC int rtp_session_signal_disconnect_by_callback(RtpSession *session,const char *signal_name, RtpCallback cb);
ORTP_PUBLIC void rtp_session_set_ssrc(RtpSession *session, uint32_t ssrc);
ORTP_PUBLIC uint32_t rtp_session_get_send_ssrc(RtpSession* session);
......
......@@ -22,12 +22,12 @@
#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
{
RtpCallback callback[RTP_CALLBACK_TABLE_MAX_ENTRIES];
unsigned long user_data[RTP_CALLBACK_TABLE_MAX_ENTRIES];
void * user_data[RTP_CALLBACK_TABLE_MAX_ENTRIES];
struct _RtpSession *session;
const char *signal_name;
int count;
......@@ -37,7 +37,7 @@ typedef struct _RtpSignalTable RtpSignalTable;
void rtp_signal_table_init(RtpSignalTable *table,struct _RtpSession *session, const char *signal_name);
int rtp_signal_table_add(RtpSignalTable *table,RtpCallback cb, unsigned long user_data);
int rtp_signal_table_add(RtpSignalTable *table,RtpCallback cb, void *user_data);
void rtp_signal_table_emit(RtpSignalTable *table);
......
......@@ -544,7 +544,7 @@ void rtp_session_set_rtp_socket_recv_buffer_size(RtpSession * session, unsigned
**/
int
rtp_session_signal_connect (RtpSession * session, const char *signal_name,
RtpCallback cb, unsigned long user_data)
RtpCallback cb, void *user_data)
{
OList *elem;
for (elem=session->signal_tables;elem!=NULL;elem=o_list_next(elem)){
......
......@@ -31,7 +31,7 @@ void rtp_signal_table_init(RtpSignalTable *table,RtpSession *session, const char
session->signal_tables=o_list_append(session->signal_tables,(void*)table);
}
int rtp_signal_table_add(RtpSignalTable *table,RtpCallback cb, unsigned long user_data)
int rtp_signal_table_add(RtpSignalTable *table,RtpCallback cb, void *user_data)
{
int i;
......@@ -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, 0, 0);
}
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, 0);
}
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);
......@@ -126,7 +126,7 @@ int main(int argc, char *argv[])
p_channel_id[i] = i;
/* register for telephony events */
rtp_session_signal_connect(session[i],"telephone-event",(RtpCallback)recv_tev_cb,(long)&p_channel_id[i]);
rtp_session_signal_connect(session[i],"telephone-event",(RtpCallback)recv_tev_cb,&p_channel_id[i]);
port+=2;
}
......
......@@ -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