diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-05-13 22:46:23 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-05-13 22:46:23 +0000 |
commit | b4ff87018aef719a1427c47da854d0108b9ed6c4 (patch) | |
tree | f117b651f2daeea1824eca14945668df7d4898a3 /pjsip-apps/src/samples | |
parent | 19d4fb0b0f2d39538018f16323c4b6a52c07903d (diff) |
Another major modifications in PJMEDIA:
- handle multiple frames in one packet
- split stream creation into two steps to allow customization
- PLC framework and implementation with G.711 and speex
- stream returns NO_FRAME correctly.
- added ptime argument in pjsua
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@438 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps/src/samples')
-rw-r--r-- | pjsip-apps/src/samples/debug.c | 2 | ||||
-rw-r--r-- | pjsip-apps/src/samples/playfile.c | 6 | ||||
-rw-r--r-- | pjsip-apps/src/samples/simpleua.c | 21 | ||||
-rw-r--r-- | pjsip-apps/src/samples/siprtp.c | 4 |
4 files changed, 26 insertions, 7 deletions
diff --git a/pjsip-apps/src/samples/debug.c b/pjsip-apps/src/samples/debug.c index ed6f2e9f..a3974046 100644 --- a/pjsip-apps/src/samples/debug.c +++ b/pjsip-apps/src/samples/debug.c @@ -27,5 +27,5 @@ * E.g.: * #include "playfile.c" */ -#include "streamutil.c" +#include "sndinfo.c" diff --git a/pjsip-apps/src/samples/playfile.c b/pjsip-apps/src/samples/playfile.c index 06f4c1f2..5b26cd57 100644 --- a/pjsip-apps/src/samples/playfile.c +++ b/pjsip-apps/src/samples/playfile.c @@ -76,7 +76,11 @@ int main(int argc, char *argv[]) pj_status_t status; - PJ_UNUSED_ARG(argc); + if (argc != 2) { + puts("Error: filename required"); + puts(desc); + return 1; + } /* Must init PJLIB first: */ diff --git a/pjsip-apps/src/samples/simpleua.c b/pjsip-apps/src/samples/simpleua.c index 59991af7..c55c3e99 100644 --- a/pjsip-apps/src/samples/simpleua.c +++ b/pjsip-apps/src/samples/simpleua.c @@ -585,6 +585,7 @@ static pj_bool_t on_rx_request( pjsip_rx_data *rdata ) static void call_on_media_update( pjsip_inv_session *inv, pj_status_t status) { + pjmedia_session_info sess_info; const pjmedia_sdp_session *local_sdp; const pjmedia_sdp_session *remote_sdp; pjmedia_port *media_port; @@ -607,13 +608,27 @@ static void call_on_media_update( pjsip_inv_session *inv, status = pjmedia_sdp_neg_get_active_remote(inv->neg, &remote_sdp); + /* Create session info based on the two SDPs. + * We only support one stream per session for now. + */ + status = pjmedia_session_info_from_sdp(inv->dlg->pool, g_med_endpt, 1, + &sess_info, &g_med_skinfo, + local_sdp, remote_sdp); + if (status != PJ_SUCCESS) { + app_perror( THIS_FILE, "Unable to create media session", status); + return; + } + + /* If required, we can also change some settings in the session info, + * (such as jitter buffer settings, codec settings, etc) before we + * create the session. + */ + /* Create new media session, passing the two SDPs, and also the * media socket that we created earlier. * The media session is active immediately. */ - status = pjmedia_session_create( g_med_endpt, 1, - &g_med_skinfo, - local_sdp, remote_sdp, + status = pjmedia_session_create( g_med_endpt, &sess_info, NULL, &g_med_session ); if (status != PJ_SUCCESS) { app_perror( THIS_FILE, "Unable to create media session", status); diff --git a/pjsip-apps/src/samples/siprtp.c b/pjsip-apps/src/samples/siprtp.c index 24bc6dc4..4bc1f76b 100644 --- a/pjsip-apps/src/samples/siprtp.c +++ b/pjsip-apps/src/samples/siprtp.c @@ -1168,7 +1168,7 @@ static int media_thread(void *arg) 0, /* marker bit */ strm->bytes_per_frame, strm->samples_per_frame, - &hdr, &hdrlen); + (const void**)&hdr, &hdrlen); if (status == PJ_SUCCESS) { /* Copy RTP header to packet */ @@ -1266,7 +1266,7 @@ static void call_on_media_update( pjsip_inv_session *inv, pjmedia_sdp_neg_get_active_remote(inv->neg, &remote_sdp); status = pjmedia_stream_info_from_sdp(&audio->si, inv->pool, app.med_endpt, - local_sdp, remote_sdp, 0); + NULL, local_sdp, remote_sdp, 0); if (status != PJ_SUCCESS) { app_perror(THIS_FILE, "Error creating stream info from SDP", status); return; |