MSFilter *set_MSFilter(EndPoint *endpoint, int type, FlowDirections *fdir){ MSFilter *filter; RtpSession *rtps; switch(endpoint->protocol){ case MEDIA_RTP: rtps = rtp_session_new(RTP_SESSION_RECVONLY); rtp_session_set_local_addr(rtps,"0.0.0.0",8000); rtp_session_set_scheduling_mode(rtps,0); rtp_session_set_blocking_mode(rtps,0); if(type == 1){ filter = ms_rtp_recv_new(); ms_rtp_recv_set_session(MS_RTP_RECV(filter), rtps); fdir->rtpSessions = g_list_append(fdir->rtpSessions, rtps); return filter; } else{ //ms_rtp_send_new } case MEDIA_OSS: if(type == 1){ filter = ms_oss_read_new(); ms_sound_read_set_device(MS_SOUND_READ(filter),0); return filter; } else{ filter = ms_oss_write_new(); ms_sound_write_set_device(MS_SOUND_WRITE(filter),0); return filter; } case MEDIA_FILE: if(type == 1){ filter = ms_read_new(endpoint->file); return filter; } if(type == 0){ filter = ms_write_new(endpoint->file); return filter; } } }
MSFilter *jack_card_create_write_filter(JackCard *card) { MSFilter *f=ms_oss_write_new(); ms_oss_write_set_device(MS_OSS_WRITE(f),SND_CARD(card)->index); return f; }