Codebase list ortp / c6dbcc6
New upstream version 4.4.13 Bernhard Schmidt 3 years ago
4 changed file(s) with 9 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
394394 **/
395395 struct _RtpSession
396396 {
397 ortp_mutex_t main_mutex; /* To protect data that can be accessed simultaneously by a control thread and the real-time thread in charge of sending/receiving. */
397398 RtpSession *next; /* next RtpSession, when the session are enqueued by the scheduler */
398399 int mask_pos; /* the position in the scheduler mask of RtpSession : do not move this field: it is part of the ABI since the session_set macros use it*/
399400 struct {
4040 #cmakedefine ORTP_DEFAULT_THREAD_STACK_SIZE ${ORTP_DEFAULT_THREAD_STACK_SIZE}
4141 #cmakedefine POSIXTIMER_INTERVAL ${POSIXTIMER_INTERVAL}
4242 #cmakedefine __APPLE_USE_RFC_3542
43
44 #cmakedefine ENABLE_MICROSOFT_STORE_APP
232232 return;
233233 }
234234 memset (session, 0, sizeof (RtpSession));
235 ortp_mutex_init(&session->main_mutex, NULL);
235236 session->mode = (RtpSessionMode) mode;
236237 if ((mode == RTP_SESSION_RECVONLY) || (mode == RTP_SESSION_SENDRECV))
237238 {
16891690 freemsg(session->rtcp.tmmbr_info.received);
16901691 if (session->rtcp.send_algo.fb_packets)
16911692 freemsg(session->rtcp.send_algo.fb_packets);
1693 ortp_mutex_destroy(&session->main_mutex);
16921694 }
16931695
16941696 /**
928928 ortp_free(aux_rtp);
929929 ortp_free(aux_rtcp);
930930 }else{
931 ortp_mutex_lock(&session->main_mutex);
931932 session->rtp.gs.aux_destinations=o_list_append(session->rtp.gs.aux_destinations,aux_rtp);
932933 session->rtcp.gs.aux_destinations=o_list_append(session->rtcp.gs.aux_destinations,aux_rtcp);
934 ortp_mutex_unlock(&session->main_mutex);
933935 }
934936 }
935937 return err;
959961 }
960962
961963 void rtp_session_clear_aux_remote_addr(RtpSession * session){
964 ortp_mutex_lock(&session->main_mutex);
962965 ortp_stream_clear_aux_addresses(&session->rtp.gs);
963966 ortp_stream_clear_aux_addresses(&session->rtcp.gs);
967 ortp_mutex_unlock(&session->main_mutex);
964968 }
965969
966970 void rtp_session_set_sockets(RtpSession *session, int rtpfd, int rtcpfd){
14231427 /*first send to main destination*/
14241428 error=rtp_session_rtp_sendto(session,m,destaddr,destlen,FALSE);
14251429 /*then iterate over auxiliary destinations*/
1430 ortp_mutex_lock(&session->main_mutex);
14261431 for(elem=session->rtp.gs.aux_destinations;elem!=NULL;elem=elem->next){
14271432 OrtpAddress *addr=(OrtpAddress*)elem->data;
14281433 rtp_session_rtp_sendto(session,m,(struct sockaddr*)&addr->addr,addr->len,TRUE);
14291434 }
1435 ortp_mutex_unlock(&session->main_mutex);
14301436 freemsg(m);
14311437 return error;
14321438 }