|
From: | Iban Lopetegi Zinkunegi |
Subject: | RE: [Linphone-users] ortp issues |
Date: | Wed, 17 Feb 2010 18:16:45 +0000 |
sorry, I found out that i was doing printf ("seq ",*cseq_temp) twice!! So the code below actually gives me a good response for sequence numbers. Now, the sounds is choppy, and i really do not know why. Here is the code that i am using. I also tried my own jitter buffer but it is not helping. Here is my setting for the receiver: /*--------------Threads starts--------*/ session_rx=rtp_session_new(RTP_SESSION_RECVONLY); ndestport=atoi(destport); nsrcport=atoi(srcport); myip=myipaddr(ipbuffer); rtp_session_set_scheduling_mode(session_rx,1); rtp_session_set_blocking_mode(session_rx,0); rtp_session_set_local_addr(session_rx,"0.0.0.0",nsrcport); //rtp_session_set_symmetric_rtp(session_rx,FALSE); ?¿?¿ NOT SURE ABOUT THIS rtp_session_enable_adaptive_jitter_compensation(session_rx,FALSE); rtp_session_set_jitter_compensation(session_rx,0); // TRIED WITH 60 OR SIMILAR, NO DIFFERENCE rtp_session_set_payload_type(session_rx,0); rtp_session_signal_connect(session_rx,"ssrc_changed",(RtpCallback)ssrc_cb,0); rtp_session_signal_connect(session_rx,"ssrc_changed",(RtpCallback)rtp_session_reset,0); recv_session_set=session_set_new(); session_set_set(recv_session_set,session_rx); /*------------start receiving data------*/ int ret; while((runcond)||tracker!=0) { have_more=1; while (have_more==1) { ret=session_set_select(recv_session_set,NULL,NULL); if ((ret!=0)&& session_set_is_set(recv_session_set,session_rx)) { nrcv=my_rtp_session_recv_with_ts_v2(cseq_tmp,session_rx,payload,payloadsize,ts,&have_more); if (nrcv>0){ decode(decoded_buffer,buffer,sizeof(buffer)); writetospeaker(decoded_buffer);// this is pseudo code for rc = snd_pcm_writei(handle, buffer, frames); } } } } any thoughts on that? Thanks Lopetaz From: address@hidden To: address@hidden Subject: RE: [Linphone-users] ortp issues Date: Wed, 17 Feb 2010 17:16:03 +0000 Answering myself, just in case somebody comes up with the same question... ortp_init() should only be called once in your program, independently of how many threads you have. Simply put it in the main thread and it will do. ortp_scheduling() is independent of each session. If you have a receiveonly session and a sendonly session you need to set per each independently. if you have receivesend session the scheduling will be apply for both. I am still not sure how to deal with the sequence number. All i have so far is the next function, but still i get repeatitive sequence numbers. int my_rtp_session_recv_with_ts_v2 (int * cseq_tmp,RtpSession * session, uint8_t * buffer, int len, uint32_t ts, int * have_more){ mblk_t *mp=NULL; int plen,blen=0; *have_more=0; rtp_header_t *hdr; while(1){ if (session->pending){ mp=session->pending; session->pending=NULL; }else { mp=rtp_session_recvm_with_ts(session,ts); if (mp!=NULL) { hdr=(rtp_header_t*)mp->b_rptr; rtp_get_payload(mp,&mp->b_rptr); } } if (mp){ //hdr=(rtp_header_t*)mp->b_rptr; *cseq_tmp=hdr->seq_number; if (DEBUG)printf("csq%d",*cseq_tmp); plen=mp->b_wptr-mp->b_rptr; if (plen<=len){ memcpy(buffer,mp->b_rptr,plen); buffer+=plen; blen+=plen; len-=plen; freemsg(mp); mp=NULL; }else{ memcpy(buffer,mp->b_rptr,len); mp->b_rptr+=len; buffer+=len; blen+=len; len=0; session->pending=mp; *have_more=1; break; } }else break; } return blen; } As said this has outputs where seq number is repeated. So i still not sure how to deal with that. Any ideas? Thanks From: address@hidden To: address@hidden Subject: RE: [Linphone-users] ortp issues Date: Mon, 15 Feb 2010 19:15:20 +0000In Hi all, I am using rtp_session_recv_with_ts () and rtp_session_send_with_ts(). I would like to know which cseq has been sent and which cseq value has been received. I have used rtp_session_get_seq_number() , however, it either gives repetitive numbers or 0. I am using ortp 0.16.1 Thanks Lopetaz From: address@hidden To: address@hidden Date: Mon, 15 Feb 2010 15:45:28 +0000 Subject: [Linphone-users] ortp issues Hi all, Firstly I am not sure if posting an oRtp based question is right to be asked here. I am trying to user oRtp libraries for a gateway to a mobile network. For several reasons this is not working. Here is my main questions: If I have one thread for a ortp sendonly and another for ortp receiveonly, should i have ortp_init(), and ortp_schedulling() for each of this threads or one general one? thanks lopetaz Elige un juego de Messenger. Reta a un amigo. ¡Pruébalo ya! Navega con el navegador más seguro de todos. ¡Descárgatelo ya! Elige un juego de Messenger. Reta a un amigo. ¡Pruébalo ya! ¿Quieres tener a tus amigos de Facebook en Messenger? ¡Clic AQUÍ! |
[Prev in Thread] | Current Thread | [Next in Thread] |