[pjsip] Resampling module add

Gianluca Crucillà crucilla at gmail.com
Wed Nov 21 05:16:38 EST 2007


Hi all,

I'm working on an application with PJMEDIA under uClinux on Nios2
environment.

I have a stream audio with codec L16 48000 stereo and mono.This works good.

Now I must added Resampling and I saw that for make this I have 2 way:
1-  Resample module add
2-  Conference module add

I read some documents and the two example (confsample.c and resampleplay.c)
but I don't have clear this.
I tried all two ways but they didn't work

In attach there is my source code.


In normal mode (without resampling) I make this:

    status = pjmedia_session_create( g_med_endpt, &sess_info,
                     &g_med_transport, NULL, &g_med_session );
    if (status != PJ_SUCCESS) {
    app_perror( THIS_FILE, "Unable to create media session", status);
    return;
    }

    pjmedia_session_get_port(g_med_session, 0, &media_port);

    status = pjmedia_snd_port_create(
                     inv->pool,              // pool
                     -1,
                     -1,
                     media_port->info.clock_rate,        // clock rate

                     media_port->info.channel_count,     // channel count

                     media_port->info.samples_per_frame, // samples per
frame
                     media_port->info.bits_per_sample,   // bits per sample

                     0,                                  // options
                     &g_snd_player);

    if (status != PJ_SUCCESS) printf("\n=====>
pjmedia_snd_port_create()....... [ KO ]\n");


    status = pjmedia_snd_port_connect(g_snd_player, media_port);
    if (status != PJ_SUCCESS) printf("\n=====>
pjmedia_snd_port_connect()...... [ KO ]\n");

Now I tried to make this

    status = pjmedia_session_create( g_med_endpt, &sess_info,
                     &g_med_transport, NULL, &g_med_session );
    if (status != PJ_SUCCESS) {
    app_perror( THIS_FILE, "Unable to create media session", status);
    return;
    }

    pjmedia_session_get_port(g_med_session, 0, &media_port);

    status = pjmedia_conf_create( inv->pool,                          //
pool
                                  3,                                  // max
port count
                                  media_port->info.clock_rate,        //
clock rate
                                  media_port->info.channel_count,     //
channel count
                                  media_port->info.samples_per_frame, //
samples per frame
                                  media_port->info.bits_per_sample,   //
bits per sample
                                  0,                                  //
option
                                  &conf
                                  );
    if (status != PJ_SUCCESS) {
      printf("\n=====> UNABLE TO CREATE CONFERENCE BRIDGE !!!\n");
      return 1;
    }

    status = pjmedia_conf_add_port(conf,inv->pool,media_port,NULL,NULL);
    if (status != PJ_SUCCESS) {
      printf("\n=====> UNABLE TO ADD CONFERENCE PORT !!!\n");
      return 1;
    }

but this don't work..

I tried with pjmedia_resample_port_create but this don't work..


WHAT I MAKE WRONG?

Can somebody help me?

Thanks Gianluca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20071121/fc619795/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: str.c
Type: text/x-csrc
Size: 22584 bytes
Desc: not available
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20071121/fc619795/attachment.c>


More information about the pjsip mailing list