linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] Streaming Rtp flow on local sound card


From: daniele elia
Subject: [Linphone-developers] Streaming Rtp flow on local sound card
Date: Fri, 2 Oct 2015 11:04:27 +0200

I have made a simple program to reproduce rtp traffic on sound cardo on linux environment. When I run the program not hear anything. Where I'm wrong? It's possible put all udp traffic of all ports and not only traffic declared on defined rtp port, how can I do?

Source code:

#include <stdio.h>
#include <stdlib.h>
#include "mscommon.h"
#include "mediastream.h"
//Not useful - Start
#include "msrtp.h"
#include "mstonedetector.h"
#include "logging.h"
#include "rtpsession.h"
#include "sessionset.h"
#include "payloadtype.h"
#include "rtpprofile.h"

//Stop
#define PCMA8_PAYLOAD_TYPE 8 #define RTP_PORT 15176 #define RTCP_PORT 15177 #define _IP "127.0.0.1" int main(void) { bool isAudioStreamEnabled = false; //Init media stream and ortp ms_init(); ms_filter_enable_statistics(TRUE); ortp_init();
    ortp_scheduler_init();
    ortp_set_log_level_mask(ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR);



RtpSession * rtpSession;
rtpsession
= rtp_session_new(RTP_SESSION_RECVONLY);
    rtp_session_set_scheduling_mode(rtpSession, 1);
    rtp_session_set_blocking_mode(rtpSession, 0);
    rtp_session_adaptive_jitter_compensation_enabled(rtpSession);
    rtp_session_set_local_addr(rtpSession, "127.0.0.1", -1, -1);
    rtp_session_set_payload_type(rtpSession, 8);

RtpProfile * profile = rtp_profile_new("default profile"); rtp_profile_set_payload (profile,PCMA8_PAYLOAD_TYPE,&payload_type_pcma8000);
    rtp_session_set_profile(rtpSession, profile);
    rtp_session_set_recv_profile(rtpSession, profile);
MSSndCard * defaultSoundCard = ms_snd_card_manager_get_default_card(ms_snd_card_manager_get ());

AudioStream * audioStream = audio_stream_new(RTP_PORT, RTCP_PORT, false);
audio_stream_start_full(audioStream, profile, _IP, RTP_PORT, _IP, RTCP_PORT, PCMA8_PAYLOAD_TYPE, 50, NULL, NULL, defaultSoundCard, NULL, false); sleep(10);

    rtp_session_destroy(rtpSession);
    ms_exit();
    ortp_exit();
    ortp_global_stats_display();



  return EXIT_SUCCESS; }
Thanks in advice.

Regards



--

Daniele Elia

______________________________________

ELMAN S.r.l.

Via di Valle Caia, 37 - Z.I. S. Palomba

00040 Pomezia (ROME) - ITALY

 (    +39.069194405

6   +39.069194306

þ   www.elmansrl.it

*   address@hidden

______________________________________


reply via email to

[Prev in Thread] Current Thread [Next in Thread]