Sending my own audio frames

RM
Rafael Maia
Fri, Jan 9, 2009 2:24 PM

Hi,

i made a media player in DirectShow that captures PCM audio frames from mp3 audio files.

I need to send this audio frames to PJSIP. Can anyone help me?

I have tried adding a passive_port to the conference bridge and it did not worked.

Now i am trying to use splitcomb. And i can send some noise.

Here's a code sample:

// 1º pjmedia_splitcom_create
pj_status_t status = pjmedia_splitcomb_create(pool_vars, nSamplesPerSec, nChannels, samplesPerFrame, wBitsPerSample, 0, &p_splitcomb);
// for each channel
for(unsigned int i = 0; i < nChannels; i++)  {
unsigned int p_slot;
pjmedia_port* p_port;

 // 2º pjmedia_splitcom_create_rev_channel
 status = pjmedia_splitcomb_create_rev_channel(pool_vars, p_splitcomb, i, 0, &p_port);

 // 3º pjmedia_conf_add_port
 status = pjmedia_conf_add_port(conference_bridge, pool_vars, p_port, NULL, &p_slot);

}

And then, when i want to send an audio frame i do the following:

pjmedia_port_put_frame(p_splitcomb, &frame);

What is wrong with my code?
Am i using splitcom correctly?

Any help would be appreciated...

Rafael Maia


Mais do que emails! Confira tudo o que Windows Live™ pode oferecer.
http://www.microsoft.com/windows/windowslive/

Hi, i made a media player in DirectShow that captures PCM audio frames from mp3 audio files. I need to send this audio frames to PJSIP. Can anyone help me? I have tried adding a passive_port to the conference bridge and it did not worked. Now i am trying to use splitcomb. And i can send some noise. Here's a code sample: // 1º pjmedia_splitcom_create pj_status_t status = pjmedia_splitcomb_create(pool_vars, nSamplesPerSec, nChannels, samplesPerFrame, wBitsPerSample, 0, &p_splitcomb); // for each channel for(unsigned int i = 0; i < nChannels; i++) { unsigned int p_slot; pjmedia_port* p_port; // 2º pjmedia_splitcom_create_rev_channel status = pjmedia_splitcomb_create_rev_channel(pool_vars, p_splitcomb, i, 0, &p_port); // 3º pjmedia_conf_add_port status = pjmedia_conf_add_port(conference_bridge, pool_vars, p_port, NULL, &p_slot); } And then, when i want to send an audio frame i do the following: pjmedia_port_put_frame(p_splitcomb, &frame); What is wrong with my code? Am i using splitcom correctly? Any help would be appreciated... Rafael Maia _________________________________________________________________ Mais do que emails! Confira tudo o que Windows Live™ pode oferecer. http://www.microsoft.com/windows/windowslive/
RI
Rawshan Iajdani
Fri, Jan 9, 2009 4:54 PM

How does APS implementation works in Symbian_ua?

Does g711,gsm,speex all works fine?

APS->G711->PCM->gsm

Or

APS->gsm??

Does it do the transcoding or it just only works for g711 and not gsm and
speex?

thanks

How does APS implementation works in Symbian_ua? Does g711,gsm,speex all works fine? APS->G711->PCM->gsm Or APS->gsm?? Does it do the transcoding or it just only works for g711 and not gsm and speex? thanks
NF
Norman Franke
Fri, Jan 9, 2009 5:17 PM

I use pjmedia_port_info_init to create a player port. Something like
this:

 pool = pjsua_pool_create("MyPlayerPool", 4000, 4000);
 pj_strdup2(pool, &base.info.name, "MyPlayer");

 base.get_frame = &file_get_frame_get;
 base.put_frame = &file_put_frame_get;
 base.on_destroy = &file_on_destroy_get;

 pjmedia_port_info_init(&base.info, &name, SIGNATURE,  

sampling_rate, channel_count, bits_per_sample, samples_per_frame);

This works well for playing files in a non-standard format that I need
to support. You put your sample generation code in file_get_frame_get.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Jan 9, 2009, at 9:24 AM, Rafael Maia wrote:

Hi,

i made a media player in DirectShow that captures PCM audio frames
from mp3 audio files.

I need to send this audio frames to PJSIP. Can anyone help me?

I have tried adding a passive_port to the conference bridge and it
did not worked.

Now i am trying to use splitcomb. And i can send some noise.

Here's a code sample:

// 1º pjmedia_splitcom_create
pj_status_t status = pjmedia_splitcomb_create(pool_vars,
nSamplesPerSec, nChannels, samplesPerFrame, wBitsPerSample, 0,
&p_splitcomb);
// for each channel
for(unsigned int i = 0; i < nChannels; i++)  {
unsigned int p_slot;
pjmedia_port* p_port;

  // 2º pjmedia_splitcom_create_rev_channel
  status = pjmedia_splitcomb_create_rev_channel(pool_vars,  

p_splitcomb, i, 0, &p_port);

  // 3º pjmedia_conf_add_port
  status = pjmedia_conf_add_port(conference_bridge, pool_vars,  

p_port, NULL, &p_slot);
}

And then, when i want to send an audio frame i do the following:

pjmedia_port_put_frame(p_splitcomb, &frame);

What is wrong with my code?
Am i using splitcom correctly?

Any help would be appreciated...

Rafael Maia

O jeito mais fácil de manter a sua lista de amigos sempre em ordem!
Organize seus contatos!


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

I use pjmedia_port_info_init to create a player port. Something like this: pool = pjsua_pool_create("MyPlayerPool", 4000, 4000); pj_strdup2(pool, &base.info.name, "MyPlayer"); base.get_frame = &file_get_frame_get; base.put_frame = &file_put_frame_get; base.on_destroy = &file_on_destroy_get; pjmedia_port_info_init(&base.info, &name, SIGNATURE, sampling_rate, channel_count, bits_per_sample, samples_per_frame); This works well for playing files in a non-standard format that I need to support. You put your sample generation code in file_get_frame_get. Norman Franke Answering Service for Directors, Inc. www.myasd.com On Jan 9, 2009, at 9:24 AM, Rafael Maia wrote: > > Hi, > > i made a media player in DirectShow that captures PCM audio frames > from mp3 audio files. > > I need to send this audio frames to PJSIP. Can anyone help me? > > I have tried adding a passive_port to the conference bridge and it > did not worked. > > Now i am trying to use splitcomb. And i can send some noise. > > Here's a code sample: > > // 1º pjmedia_splitcom_create > pj_status_t status = pjmedia_splitcomb_create(pool_vars, > nSamplesPerSec, nChannels, samplesPerFrame, wBitsPerSample, 0, > &p_splitcomb); > // for each channel > for(unsigned int i = 0; i < nChannels; i++) { > unsigned int p_slot; > pjmedia_port* p_port; > > // 2º pjmedia_splitcom_create_rev_channel > status = pjmedia_splitcomb_create_rev_channel(pool_vars, > p_splitcomb, i, 0, &p_port); > > // 3º pjmedia_conf_add_port > status = pjmedia_conf_add_port(conference_bridge, pool_vars, > p_port, NULL, &p_slot); > } > > > And then, when i want to send an audio frame i do the following: > > pjmedia_port_put_frame(p_splitcomb, &frame); > > > > What is wrong with my code? > Am i using splitcom correctly? > > Any help would be appreciated... > > Rafael Maia > > > O jeito mais fácil de manter a sua lista de amigos sempre em ordem! > Organize seus contatos! > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
PP
Pai Peng
Fri, Jan 9, 2009 6:19 PM

Hi,

in source symbian_sound_aps.cpp:

void CPjAudioEngine::RecCb(TAPSCommBuffer &buffer)
{
...
buf[i] = pjmedia_alaw2linear(iBuffer[i]);
...
}

TInt CPjAudioEngine::StartStreamL()
{
....
iSession.SetEncoderMode(EALawOr20ms);
iSession.SetDecoderMode(EALawOr20ms);
...
}

audio is in G711-A Format.

The  APS supports the following codecs: AMR, G711, G729 and iLBC.

If you like use other codec for encoding or decoding, you should change the
SetEncoderMode() and SetDecoderMode().

Pai

On Fri, Jan 9, 2009 at 5:54 PM, Rawshan Iajdani iajdani@provati.com wrote:

How does APS implementation works in Symbian_ua?

Does g711,gsm,speex all works fine?

APS->G711->PCM->gsm

Or

APS->gsm??

Does it do the transcoding or it just only works for g711 and not gsm and
speex?

thanks


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

Hi, in source symbian_sound_aps.cpp: void CPjAudioEngine::RecCb(TAPSCommBuffer &buffer) { ... buf[i] = pjmedia_alaw2linear(iBuffer[i]); ... } TInt CPjAudioEngine::StartStreamL() { .... iSession.SetEncoderMode(EALawOr20ms); iSession.SetDecoderMode(EALawOr20ms); ... } audio is in G711-A Format. The APS supports the following codecs: AMR, G711, G729 and iLBC. If you like use other codec for encoding or decoding, you should change the SetEncoderMode() and SetDecoderMode(). Pai On Fri, Jan 9, 2009 at 5:54 PM, Rawshan Iajdani <iajdani@provati.com> wrote: > How does APS implementation works in Symbian_ua? > > Does g711,gsm,speex all works fine? > > > > APS->G711->PCM->gsm > > Or > > APS->gsm?? > > > > Does it do the transcoding or it just only works for g711 and not gsm and > speex? > > > > thanks > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > >
RM
Rafael Maia
Fri, Jan 9, 2009 6:27 PM

Thanks for your anwser Norman.

You are using a very diferent approach from mine. Could you provide some more information ( or some source code ) ?

My DirectShow sound reading routines are pushing audio frames that i need to send throw PJSIP.

So i need to call put_frame on a media port.
How did you created this "Passive" port ?

You also add it to the conference bridge, right ?

Thanks in advance...

Rafael Maia

From: norman@myasd.comTo: pjsip@lists.pjsip.orgDate: Fri, 9 Jan 2009 12:17:19 -0500Subject: Re: [pjsip] Sending my own audio framesI use pjmedia_port_info_init to create a player port. Something like this:

pool = pjsua_pool_create("MyPlayerPool", 4000, 4000);
pj_strdup2(pool, &base.info.name, "MyPlayer");

base.get_frame = &file_get_frame_get;
base.put_frame = &file_put_frame_get;
base.on_destroy = &file_on_destroy_get;

pjmedia_port_info_init(&base.info, &name, SIGNATURE, sampling_rate, channel_count, bits_per_sample, samples_per_frame);

This works well for playing files in a non-standard format that I need to support. You put your sample generation code in file_get_frame_get.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Jan 9, 2009, at 9:24 AM, Rafael Maia wrote:

Hi, i made a media player in DirectShow that captures PCM audio frames from mp3 audio files. I need to send this audio frames to PJSIP. Can anyone help me? I have tried adding a passive_port to the conference bridge and it did not worked. Now i am trying to use splitcomb. And i can send some noise. Here's a code sample: // 1º pjmedia_splitcom_createpj_status_t status = pjmedia_splitcomb_create(pool_vars, nSamplesPerSec, nChannels, samplesPerFrame, wBitsPerSample, 0, &p_splitcomb);// for each channelfor(unsigned int i = 0; i < nChannels; i++)  {    unsigned int p_slot;    pjmedia_port* p_port;      // 2º pjmedia_splitcom_create_rev_channel    status = pjmedia_splitcomb_create_rev_channel(pool_vars, p_splitcomb, i, 0, &p_port);      // 3º pjmedia_conf_add_port    status = pjmedia_conf_add_port(conference_bridge, pool_vars, p_port, NULL, &p_slot);}  And then, when i want to send an audio frame i do the following: pjmedia_port_put_frame(p_splitcomb, &frame);  What is wrong with my code?Am i using splitcom correctly? Any help would be appreciated... Rafael Maia

O jeito mais fácil de manter a sua lista de amigos sempre em ordem! Organize seus contatos!_______________________________________________Visit our blog: http://blog.pjsip.orgpjsip mailing listpjsip@lists.pjsip.orghttp://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


Confira vídeos com notícias do NY Times, gols direto do Lance, videocassetadas e muito mais no MSN Video!
http://video.msn.com/?mkt=pt-br

Thanks for your anwser Norman. You are using a very diferent approach from mine. Could you provide some more information ( or some source code ) ? My DirectShow sound reading routines are pushing audio frames that i need to send throw PJSIP. So i need to call put_frame on a media port. How did you created this "Passive" port ? You also add it to the conference bridge, right ? Thanks in advance... Rafael Maia From: norman@myasd.comTo: pjsip@lists.pjsip.orgDate: Fri, 9 Jan 2009 12:17:19 -0500Subject: Re: [pjsip] Sending my own audio framesI use pjmedia_port_info_init to create a player port. Something like this: pool = pjsua_pool_create("MyPlayerPool", 4000, 4000); pj_strdup2(pool, &base.info.name, "MyPlayer"); base.get_frame = &file_get_frame_get; base.put_frame = &file_put_frame_get; base.on_destroy = &file_on_destroy_get; pjmedia_port_info_init(&base.info, &name, SIGNATURE, sampling_rate, channel_count, bits_per_sample, samples_per_frame); This works well for playing files in a non-standard format that I need to support. You put your sample generation code in file_get_frame_get. Norman Franke Answering Service for Directors, Inc. www.myasd.com On Jan 9, 2009, at 9:24 AM, Rafael Maia wrote: Hi, i made a media player in DirectShow that captures PCM audio frames from mp3 audio files. I need to send this audio frames to PJSIP. Can anyone help me? I have tried adding a passive_port to the conference bridge and it did not worked. Now i am trying to use splitcomb. And i can send some noise. Here's a code sample: // 1º pjmedia_splitcom_createpj_status_t status = pjmedia_splitcomb_create(pool_vars, nSamplesPerSec, nChannels, samplesPerFrame, wBitsPerSample, 0, &p_splitcomb);// for each channelfor(unsigned int i = 0; i < nChannels; i++) { unsigned int p_slot; pjmedia_port* p_port; // 2º pjmedia_splitcom_create_rev_channel status = pjmedia_splitcomb_create_rev_channel(pool_vars, p_splitcomb, i, 0, &p_port); // 3º pjmedia_conf_add_port status = pjmedia_conf_add_port(conference_bridge, pool_vars, p_port, NULL, &p_slot);} And then, when i want to send an audio frame i do the following: pjmedia_port_put_frame(p_splitcomb, &frame); What is wrong with my code?Am i using splitcom correctly? Any help would be appreciated... Rafael Maia O jeito mais fácil de manter a sua lista de amigos sempre em ordem! Organize seus contatos!_______________________________________________Visit our blog: http://blog.pjsip.orgpjsip mailing listpjsip@lists.pjsip.orghttp://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org _________________________________________________________________ Confira vídeos com notícias do NY Times, gols direto do Lance, videocassetadas e muito mais no MSN Video! http://video.msn.com/?mkt=pt-br
RI
Rawshan Iajdani
Fri, Jan 9, 2009 10:06 PM

Well what I want to use my own implementation of G729. I am interested in APS only to use earpiece in place of loud speaker. Do I need to do anything else other than just enable APS? Does built in GSM and Speex of sumbian_ua working with APS?

From: pjsip-bounces@lists.pjsip.org [mailto:pjsip-bounces@lists.pjsip.org] On Behalf Of Pai Peng
Sent: Saturday, January 10, 2009 12:19 AM
To: pjsip list
Subject: Re: [pjsip] APS Implementation

Hi,

in source symbian_sound_aps.cpp:

void CPjAudioEngine::RecCb(TAPSCommBuffer &buffer)
{
...
buf[i] = pjmedia_alaw2linear(iBuffer[i]);
...
}

TInt CPjAudioEngine::StartStreamL()
{
....
iSession.SetEncoderMode(EALawOr20ms);
iSession.SetDecoderMode(EALawOr20ms);
...
}

audio is in G711-A Format.

The  APS supports the following codecs: AMR, G711, G729 and iLBC.

If you like use other codec for encoding or decoding, you should change the SetEncoderMode() and SetDecoderMode().

Pai

On Fri, Jan 9, 2009 at 5:54 PM, Rawshan Iajdani iajdani@provati.com wrote:

How does APS implementation works in Symbian_ua?

Does g711,gsm,speex all works fine?

APS->G711->PCM->gsm

Or

APS->gsm??

Does it do the transcoding or it just only works for g711 and not gsm and speex?

thanks


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

Well what I want to use my own implementation of G729. I am interested in APS only to use earpiece in place of loud speaker. Do I need to do anything else other than just enable APS? Does built in GSM and Speex of sumbian_ua working with APS? From: pjsip-bounces@lists.pjsip.org [mailto:pjsip-bounces@lists.pjsip.org] On Behalf Of Pai Peng Sent: Saturday, January 10, 2009 12:19 AM To: pjsip list Subject: Re: [pjsip] APS Implementation Hi, in source symbian_sound_aps.cpp: void CPjAudioEngine::RecCb(TAPSCommBuffer &buffer) { ... buf[i] = pjmedia_alaw2linear(iBuffer[i]); ... } TInt CPjAudioEngine::StartStreamL() { .... iSession.SetEncoderMode(EALawOr20ms); iSession.SetDecoderMode(EALawOr20ms); ... } audio is in G711-A Format. The APS supports the following codecs: AMR, G711, G729 and iLBC. If you like use other codec for encoding or decoding, you should change the SetEncoderMode() and SetDecoderMode(). Pai On Fri, Jan 9, 2009 at 5:54 PM, Rawshan Iajdani <iajdani@provati.com> wrote: How does APS implementation works in Symbian_ua? Does g711,gsm,speex all works fine? APS->G711->PCM->gsm Or APS->gsm?? Does it do the transcoding or it just only works for g711 and not gsm and speex? thanks _______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
NF
Norman Franke
Fri, Jan 9, 2009 11:48 PM

You can use pjmedia_splitcomb_create_rev_channel to reverse the put/
get semantics. I do that elsewhere and it works.

I did then add it to the conference bridge.

Sadly, my code isn't easy to extract and is very C++ using boost and a
custom string library.

typedef bool (*GetSamplesPtr)(void * inBuf, uint32_t * ioByteSize,
pj_timestamp * inTime);

PlayPort::PlayPort(
unsigned sampling_rate,
unsigned channel_count,
unsigned samples_per_frame,
unsigned bits_per_sample
)
: pool(NULL), mCallIndex(INVALID_CALL_INDEX)
{
const pj_str_t name = pj_str("file");

 pool = pjsua_pool_create("asd_player", 4000, 4000);
 assert(pool);

 pj_strdup2(pool, &base.info.name, "asd_player");

 base.get_frame = &file_get_frame_get;
 base.put_frame = &file_put_frame_get;
 base.on_destroy = &file_on_destroy_get;

 pjmedia_port_info_init(&base.info, &name, SIGNATURE,  

sampling_rate, channel_count, bits_per_sample, samples_per_frame);

 port_is_open = true;
 options = 0;

}

PlayPort::~PlayPort()
{
Close();

 if (pool) {
     pj_pool_release(pool);
     pool = NULL;
 }

}

pj_status_t PlayPort::Open(SInt32 inCallIndex, float inVolume,
GetSamplesPtr inFunc)
{
pj_status_t status;

 status = pjsua_conf_add_port(pool, &base, &slot);
 if (status != PJ_SUCCESS) {
     pjmedia_port_destroy(&base);
     return status;
 }

 mCallIndex = inCallIndex;

 status = pjsua_conf_adjust_rx_level(slot, inVolume);

 port_func = inFunc;

 return status;

}

void PlayPort::Close(void)
{
file_on_destroy_get(&base);
}

bool PlayPort::IsOpen(void)
{
return port_is_open && slot >= 0;
}

pj_status_t PlayPort::ConnectTo(int inSlot)
{
return pjsua_conf_connect(slot, inSlot);
}

pj_status_t PlayPort::DisconnectFrom(int inSlot)
{
return pjsua_conf_disconnect(slot, inSlot);
}

// Class static
pj_status_t PlayPort::file_on_destroy_get(pjmedia_port *this_port)
{
// As the first element in a non-virtual class...
PlayPort *fport = (PlayPort *) this_port;
boost::recursive_mutex::scoped_lock l(fport->m);

 pj_assert(this_port->info.signature == SIGNATURE);

 if (fport->port_is_open) {
 	fport->port_is_open = false; // Prevents a recursive callback

     fport->port_func = NULL;
     pjsua_conf_remove_port(fport->slot); // If it's already  

removed, e.g. audio device changed, this crashes.
fport->slot = 0;
pjmedia_port_destroy(&fport->base);
}

 return PJ_SUCCESS;

}

// Class static
pj_status_t PlayPort::file_get_frame_get(pjmedia_port *this_port,
pjmedia_frame *frame)
{
// As the first element in a non-virtual class...
PlayPort *fport = (PlayPort *) this_port;

 pj_assert(this_port->info.signature == SIGNATURE);

 if (frame->size == 0) return PJ_SUCCESS;
 if (! fport->port_func) return PJ_EEOF;

 pj_size_t frame_size = frame->size;
 if ((*fport->port_func)(frame->buf, &frame_size, (PJSUA_Timestamp  

) &frame->timestamp)) {
if (frame_size < frame->size) {
bzero((UInt8
)frame->buf + frame_size, frame->size -
frame_size);
}
frame->timestamp.u64 = 0;
frame->type = PJMEDIA_FRAME_TYPE_AUDIO;
return PJ_SUCCESS;
}
file_on_destroy_get(this_port);
return PJ_EEOF;
}

// Class static
pj_status_t PlayPort::file_put_frame_get(pjmedia_port *this_port,
const pjmedia_frame *frame)
{
return PJ_EINVALIDOP;
}

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Jan 9, 2009, at 1:27 PM, Rafael Maia wrote:

Thanks for your anwser Norman.

You are using a very diferent approach from mine. Could you provide
some more information ( or some source code ) ?

My DirectShow sound reading routines are pushing audio frames that i
need to send throw PJSIP.

So i need to call put_frame on a media port.
How did you created this "Passive" port ?

You also add it to the conference bridge, right ?

Thanks in advance...

Rafael Maia

From: norman@myasd.com
To: pjsip@lists.pjsip.org
Date: Fri, 9 Jan 2009 12:17:19 -0500
Subject: Re: [pjsip] Sending my own audio frames

I use pjmedia_port_info_init to create a player port. Something like
this:

 pool = pjsua_pool_create("MyPlayerPool", 4000, 4000);
 pj_strdup2(pool, &base.info.name, "MyPlayer");

 base.get_frame = &file_get_frame_get;
 base.put_frame = &file_put_frame_get;
 base.on_destroy = &file_on_destroy_get;

 pjmedia_port_info_init(&base.info, &name, SIGNATURE,  

sampling_rate, channel_count, bits_per_sample, samples_per_frame);

This works well for playing files in a non-standard format that I
need to support. You put your sample generation code in
file_get_frame_get.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Jan 9, 2009, at 9:24 AM, Rafael Maia wrote:

Hi,

i made a media player in DirectShow that captures PCM audio frames
from mp3 audio files.

I need to send this audio frames to PJSIP. Can anyone help me?

I have tried adding a passive_port to the conference bridge and it
did not worked.

Now i am trying to use splitcomb. And i can send some noise.

Here's a code sample:

// 1º pjmedia_splitcom_create
pj_status_t status = pjmedia_splitcomb_create(pool_vars,
nSamplesPerSec, nChannels, samplesPerFrame, wBitsPerSample, 0,
&p_splitcomb);
// for each channel
for(unsigned int i = 0; i < nChannels; i++)  {
unsigned int p_slot;
pjmedia_port* p_port;

  // 2º pjmedia_splitcom_create_rev_channel
  status = pjmedia_splitcomb_create_rev_channel(pool_vars,  

p_splitcomb, i, 0, &p_port);

  // 3º pjmedia_conf_add_port
  status = pjmedia_conf_add_port(conference_bridge, pool_vars,  

p_port, NULL, &p_slot);
}

And then, when i want to send an audio frame i do the following:

pjmedia_port_put_frame(p_splitcomb, &frame);

What is wrong with my code?
Am i using splitcom correctly?

Any help would be appreciated...

Rafael Maia

O jeito mais fácil de manter a sua lista de amigos sempre em ordem!
Organize seus contatos!


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

Notícias direto do New York Times, gols do Lance, videocassetadas e
muitos outros vídeos no MSN Videos! Confira já!


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

You can use pjmedia_splitcomb_create_rev_channel to reverse the put/ get semantics. I do that elsewhere and it works. I did then add it to the conference bridge. Sadly, my code isn't easy to extract and is very C++ using boost and a custom string library. typedef bool (*GetSamplesPtr)(void * inBuf, uint32_t * ioByteSize, pj_timestamp * inTime); PlayPort::PlayPort( unsigned sampling_rate, unsigned channel_count, unsigned samples_per_frame, unsigned bits_per_sample ) : pool(NULL), mCallIndex(INVALID_CALL_INDEX) { const pj_str_t name = pj_str("file"); pool = pjsua_pool_create("asd_player", 4000, 4000); assert(pool); pj_strdup2(pool, &base.info.name, "asd_player"); base.get_frame = &file_get_frame_get; base.put_frame = &file_put_frame_get; base.on_destroy = &file_on_destroy_get; pjmedia_port_info_init(&base.info, &name, SIGNATURE, sampling_rate, channel_count, bits_per_sample, samples_per_frame); port_is_open = true; options = 0; } PlayPort::~PlayPort() { Close(); if (pool) { pj_pool_release(pool); pool = NULL; } } pj_status_t PlayPort::Open(SInt32 inCallIndex, float inVolume, GetSamplesPtr inFunc) { pj_status_t status; status = pjsua_conf_add_port(pool, &base, &slot); if (status != PJ_SUCCESS) { pjmedia_port_destroy(&base); return status; } mCallIndex = inCallIndex; status = pjsua_conf_adjust_rx_level(slot, inVolume); port_func = inFunc; return status; } void PlayPort::Close(void) { file_on_destroy_get(&base); } bool PlayPort::IsOpen(void) { return port_is_open && slot >= 0; } pj_status_t PlayPort::ConnectTo(int inSlot) { return pjsua_conf_connect(slot, inSlot); } pj_status_t PlayPort::DisconnectFrom(int inSlot) { return pjsua_conf_disconnect(slot, inSlot); } // Class static pj_status_t PlayPort::file_on_destroy_get(pjmedia_port *this_port) { // As the first element in a non-virtual class... PlayPort *fport = (PlayPort *) this_port; boost::recursive_mutex::scoped_lock l(fport->m); pj_assert(this_port->info.signature == SIGNATURE); if (fport->port_is_open) { fport->port_is_open = false; // Prevents a recursive callback fport->port_func = NULL; pjsua_conf_remove_port(fport->slot); // If it's already removed, e.g. audio device changed, this crashes. fport->slot = 0; pjmedia_port_destroy(&fport->base); } return PJ_SUCCESS; } // Class static pj_status_t PlayPort::file_get_frame_get(pjmedia_port *this_port, pjmedia_frame *frame) { // As the first element in a non-virtual class... PlayPort *fport = (PlayPort *) this_port; pj_assert(this_port->info.signature == SIGNATURE); if (frame->size == 0) return PJ_SUCCESS; if (! fport->port_func) return PJ_EEOF; pj_size_t frame_size = frame->size; if ((*fport->port_func)(frame->buf, &frame_size, (PJSUA_Timestamp *) &frame->timestamp)) { if (frame_size < frame->size) { bzero((UInt8*)frame->buf + frame_size, frame->size - frame_size); } frame->timestamp.u64 = 0; frame->type = PJMEDIA_FRAME_TYPE_AUDIO; return PJ_SUCCESS; } file_on_destroy_get(this_port); return PJ_EEOF; } // Class static pj_status_t PlayPort::file_put_frame_get(pjmedia_port *this_port, const pjmedia_frame *frame) { return PJ_EINVALIDOP; } Norman Franke Answering Service for Directors, Inc. www.myasd.com On Jan 9, 2009, at 1:27 PM, Rafael Maia wrote: > > Thanks for your anwser Norman. > > You are using a very diferent approach from mine. Could you provide > some more information ( or some source code ) ? > > My DirectShow sound reading routines are pushing audio frames that i > need to send throw PJSIP. > > So i need to call put_frame on a media port. > How did you created this "Passive" port ? > > You also add it to the conference bridge, right ? > > Thanks in advance... > > Rafael Maia > > > > From: norman@myasd.com > To: pjsip@lists.pjsip.org > Date: Fri, 9 Jan 2009 12:17:19 -0500 > Subject: Re: [pjsip] Sending my own audio frames > > I use pjmedia_port_info_init to create a player port. Something like > this: > > pool = pjsua_pool_create("MyPlayerPool", 4000, 4000); > pj_strdup2(pool, &base.info.name, "MyPlayer"); > > base.get_frame = &file_get_frame_get; > base.put_frame = &file_put_frame_get; > base.on_destroy = &file_on_destroy_get; > > pjmedia_port_info_init(&base.info, &name, SIGNATURE, > sampling_rate, channel_count, bits_per_sample, samples_per_frame); > > > This works well for playing files in a non-standard format that I > need to support. You put your sample generation code in > file_get_frame_get. > > Norman Franke > Answering Service for Directors, Inc. > www.myasd.com > > On Jan 9, 2009, at 9:24 AM, Rafael Maia wrote: > > > Hi, > > i made a media player in DirectShow that captures PCM audio frames > from mp3 audio files. > > I need to send this audio frames to PJSIP. Can anyone help me? > > I have tried adding a passive_port to the conference bridge and it > did not worked. > > Now i am trying to use splitcomb. And i can send some noise. > > Here's a code sample: > > // 1º pjmedia_splitcom_create > pj_status_t status = pjmedia_splitcomb_create(pool_vars, > nSamplesPerSec, nChannels, samplesPerFrame, wBitsPerSample, 0, > &p_splitcomb); > // for each channel > for(unsigned int i = 0; i < nChannels; i++) { > unsigned int p_slot; > pjmedia_port* p_port; > > // 2º pjmedia_splitcom_create_rev_channel > status = pjmedia_splitcomb_create_rev_channel(pool_vars, > p_splitcomb, i, 0, &p_port); > > // 3º pjmedia_conf_add_port > status = pjmedia_conf_add_port(conference_bridge, pool_vars, > p_port, NULL, &p_slot); > } > > > And then, when i want to send an audio frame i do the following: > > pjmedia_port_put_frame(p_splitcomb, &frame); > > > > What is wrong with my code? > Am i using splitcom correctly? > > Any help would be appreciated... > > Rafael Maia > > > O jeito mais fácil de manter a sua lista de amigos sempre em ordem! > Organize seus contatos! > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > Notícias direto do New York Times, gols do Lance, videocassetadas e > muitos outros vídeos no MSN Videos! Confira já! > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
RI
Rawshan Iajdani
Sat, Jan 10, 2009 6:19 PM

Is there anyway I could test APS without a Publisher ID?

Is there anyway I could test APS without a Publisher ID?
SM
S. M. Nazmul Hasan (Opu)
Sun, Jan 11, 2009 9:36 AM

Hi Pai,

Can you please tell me if i want to g729 from Aps what should i need to do?

in the line of encoder mode

iSession.SetEncoderMode(EALawOr20ms);

is for g711 but i saw no encoding mode for g729 . should i block those line
if i want to use g729?

Thanks

On Sat, Jan 10, 2009 at 12:19 AM, Pai Peng sipaipv6@gmail.com wrote:

Hi,

in source symbian_sound_aps.cpp:

void CPjAudioEngine::RecCb(TAPSCommBuffer &buffer)
{
...
buf[i] = pjmedia_alaw2linear(iBuffer[i]);
...
}

TInt CPjAudioEngine::StartStreamL()
{
....
iSession.SetEncoderMode(EALawOr20ms);
iSession.SetDecoderMode(EALawOr20ms);
...
}

audio is in G711-A Format.

The  APS supports the following codecs: AMR, G711, G729 and iLBC.

If you like use other codec for encoding or decoding, you should change the
SetEncoderMode() and SetDecoderMode().

Pai

On Fri, Jan 9, 2009 at 5:54 PM, Rawshan Iajdani iajdani@provati.comwrote:

How does APS implementation works in Symbian_ua?

Does g711,gsm,speex all works fine?

APS->G711->PCM->gsm

Or

APS->gsm??

Does it do the transcoding or it just only works for g711 and not gsm and
speex?

thanks


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--
S. M. Nazmul Hasan Opu
Software Engineer
R & D Application
Dhaka, Bangladesh
Mob: +880 1712 901 764

Hi Pai, Can you please tell me if i want to g729 from Aps what should i need to do? in the line of encoder mode iSession.SetEncoderMode(EALawOr20ms); is for g711 but i saw no encoding mode for g729 . should i block those line if i want to use g729? Thanks On Sat, Jan 10, 2009 at 12:19 AM, Pai Peng <sipaipv6@gmail.com> wrote: > Hi, > > > in source symbian_sound_aps.cpp: > > void CPjAudioEngine::RecCb(TAPSCommBuffer &buffer) > { > ... > buf[i] = pjmedia_alaw2linear(iBuffer[i]); > ... > } > > TInt CPjAudioEngine::StartStreamL() > { > .... > iSession.SetEncoderMode(EALawOr20ms); > iSession.SetDecoderMode(EALawOr20ms); > ... > } > > audio is in G711-A Format. > > > The APS supports the following codecs: AMR, G711, G729 and iLBC. > > If you like use other codec for encoding or decoding, you should change the > SetEncoderMode() and SetDecoderMode(). > > > Pai > > > > On Fri, Jan 9, 2009 at 5:54 PM, Rawshan Iajdani <iajdani@provati.com>wrote: > >> How does APS implementation works in Symbian_ua? >> >> Does g711,gsm,speex all works fine? >> >> >> >> APS->G711->PCM->gsm >> >> Or >> >> APS->gsm?? >> >> >> >> Does it do the transcoding or it just only works for g711 and not gsm and >> speex? >> >> >> >> thanks >> >> >> >> _______________________________________________ >> Visit our blog: http://blog.pjsip.org >> >> pjsip mailing list >> pjsip@lists.pjsip.org >> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >> >> > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > -- S. M. Nazmul Hasan Opu Software Engineer R & D Application Dhaka, Bangladesh Mob: +880 1712 901 764
RI
Rawshan Iajdani
Sun, Jan 11, 2009 9:46 AM

I don't think you can with this current wrapper.

So far I understood, the current wrapper just take PCM and convert that to
g.711 and pass it to APS and vice versa. You still need your own g.729
implementation. This wrapper just take PCM as input and output..

Correct me if I were wrong..

From: pjsip-bounces@lists.pjsip.org [mailto:pjsip-bounces@lists.pjsip.org]
On Behalf Of S. M. Nazmul Hasan (Opu)
Sent: Sunday, January 11, 2009 3:36 PM
To: pjsip list
Subject: Re: [pjsip] APS Implementation

Hi Pai,

Can you please tell me if i want to g729 from Aps what should i need to do?

in the line of encoder mode

iSession.SetEncoderMode(EALawOr20ms);

is for g711 but i saw no encoding mode for g729 . should i block those line
if i want to use g729?

Thanks

On Sat, Jan 10, 2009 at 12:19 AM, Pai Peng sipaipv6@gmail.com wrote:

Hi,

in source symbian_sound_aps.cpp:

void CPjAudioEngine::RecCb(TAPSCommBuffer &buffer)
{
...
buf[i] = pjmedia_alaw2linear(iBuffer[i]);
...
}

TInt CPjAudioEngine::StartStreamL()
{
....
iSession.SetEncoderMode(EALawOr20ms);
iSession.SetDecoderMode(EALawOr20ms);
...
}

audio is in G711-A Format.

The  APS supports the following codecs: AMR, G711, G729 and iLBC.

If you like use other codec for encoding or decoding, you should change the
SetEncoderMode() and SetDecoderMode().

Pai

On Fri, Jan 9, 2009 at 5:54 PM, Rawshan Iajdani iajdani@provati.com wrote:

How does APS implementation works in Symbian_ua?

Does g711,gsm,speex all works fine?

APS->G711->PCM->gsm

Or

APS->gsm??

Does it do the transcoding or it just only works for g711 and not gsm and
speex?

thanks


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--
S. M. Nazmul Hasan Opu
Software Engineer
R & D Application
Dhaka, Bangladesh
Mob: +880 1712 901 764

I don't think you can with this current wrapper. So far I understood, the current wrapper just take PCM and convert that to g.711 and pass it to APS and vice versa. You still need your own g.729 implementation. This wrapper just take PCM as input and output.. Correct me if I were wrong.. From: pjsip-bounces@lists.pjsip.org [mailto:pjsip-bounces@lists.pjsip.org] On Behalf Of S. M. Nazmul Hasan (Opu) Sent: Sunday, January 11, 2009 3:36 PM To: pjsip list Subject: Re: [pjsip] APS Implementation Hi Pai, Can you please tell me if i want to g729 from Aps what should i need to do? in the line of encoder mode iSession.SetEncoderMode(EALawOr20ms); is for g711 but i saw no encoding mode for g729 . should i block those line if i want to use g729? Thanks On Sat, Jan 10, 2009 at 12:19 AM, Pai Peng <sipaipv6@gmail.com> wrote: Hi, in source symbian_sound_aps.cpp: void CPjAudioEngine::RecCb(TAPSCommBuffer &buffer) { ... buf[i] = pjmedia_alaw2linear(iBuffer[i]); ... } TInt CPjAudioEngine::StartStreamL() { .... iSession.SetEncoderMode(EALawOr20ms); iSession.SetDecoderMode(EALawOr20ms); ... } audio is in G711-A Format. The APS supports the following codecs: AMR, G711, G729 and iLBC. If you like use other codec for encoding or decoding, you should change the SetEncoderMode() and SetDecoderMode(). Pai On Fri, Jan 9, 2009 at 5:54 PM, Rawshan Iajdani <iajdani@provati.com> wrote: How does APS implementation works in Symbian_ua? Does g711,gsm,speex all works fine? APS->G711->PCM->gsm Or APS->gsm?? Does it do the transcoding or it just only works for g711 and not gsm and speex? thanks _______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org _______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org -- S. M. Nazmul Hasan Opu Software Engineer R & D Application Dhaka, Bangladesh Mob: +880 1712 901 764
SM
S. M. Nazmul Hasan (Opu)
Sun, Jan 11, 2009 1:01 PM

I dont think APS implementation(G729) is so hard as you think. APS already
has G729 codec support that is if i use APS i must get the implementation of
g729 innerly . i just have to change the procedure to use g729 codec....like
some parameter and encoding decoding technique. ...

APS use 24byte data ...thats a point also...

On Sun, Jan 11, 2009 at 3:46 PM, Rawshan Iajdani iajdani@provati.comwrote:

I don't think you can with this current wrapper.

So far I understood, the current wrapper just take PCM and convert that to
g.711 and pass it to APS and vice versa. You still need your own g.729
implementation. This wrapper just take PCM as input and output..

Correct me if I were wrong..

From: pjsip-bounces@lists.pjsip.org [mailto:
pjsip-bounces@lists.pjsip.org] *On Behalf Of *S. M. Nazmul Hasan (Opu)
Sent: Sunday, January 11, 2009 3:36 PM
To: pjsip list
Subject: Re: [pjsip] APS Implementation

Hi Pai,

Can you please tell me if i want to g729 from Aps what should i need to do?

in the line of encoder mode

iSession.SetEncoderMode(EALawOr20ms);

is for g711 but i saw no encoding mode for g729 . should i block those line
if i want to use g729?

Thanks

On Sat, Jan 10, 2009 at 12:19 AM, Pai Peng sipaipv6@gmail.com wrote:

Hi,

in source symbian_sound_aps.cpp:

void CPjAudioEngine::RecCb(TAPSCommBuffer &buffer)
{
...
buf[i] = pjmedia_alaw2linear(iBuffer[i]);
...
}

TInt CPjAudioEngine::StartStreamL()
{
....
iSession.SetEncoderMode(EALawOr20ms);
iSession.SetDecoderMode(EALawOr20ms);
...
}

audio is in G711-A Format.

The  APS supports the following codecs: AMR, G711, G729 and iLBC.

If you like use other codec for encoding or decoding, you should change the
SetEncoderMode() and SetDecoderMode().

Pai

On Fri, Jan 9, 2009 at 5:54 PM, Rawshan Iajdani iajdani@provati.com
wrote:

How does APS implementation works in Symbian_ua?

Does g711,gsm,speex all works fine?

APS->G711->PCM->gsm

Or

APS->gsm??

Does it do the transcoding or it just only works for g711 and not gsm and
speex?

thanks


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--
S. M. Nazmul Hasan Opu
Software Engineer
R & D Application
Dhaka, Bangladesh
Mob: +880 1712 901 764


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--
S. M. Nazmul Hasan Opu
Software Engineer
R & D Application
Dhaka, Bangladesh
Mob: +880 1712 901 764

I dont think APS implementation(G729) is so hard as you think. APS already has G729 codec support that is if i use APS i must get the implementation of g729 innerly . i just have to change the procedure to use g729 codec....like some parameter and encoding decoding technique. ... APS use 24byte data ...thats a point also... On Sun, Jan 11, 2009 at 3:46 PM, Rawshan Iajdani <iajdani@provati.com>wrote: > I don't think you can with this current wrapper. > > So far I understood, the current wrapper just take PCM and convert that to > g.711 and pass it to APS and vice versa. You still need your own g.729 > implementation. This wrapper just take PCM as input and output.. > > > > Correct me if I were wrong.. > > > > > > > > *From:* pjsip-bounces@lists.pjsip.org [mailto: > pjsip-bounces@lists.pjsip.org] *On Behalf Of *S. M. Nazmul Hasan (Opu) > *Sent:* Sunday, January 11, 2009 3:36 PM > *To:* pjsip list > *Subject:* Re: [pjsip] APS Implementation > > > > Hi Pai, > > > Can you please tell me if i want to g729 from Aps what should i need to do? > > in the line of encoder mode > > iSession.SetEncoderMode(EALawOr20ms); > > is for g711 but i saw no encoding mode for g729 . should i block those line > if i want to use g729? > > Thanks > > On Sat, Jan 10, 2009 at 12:19 AM, Pai Peng <sipaipv6@gmail.com> wrote: > > Hi, > > > in source symbian_sound_aps.cpp: > > void CPjAudioEngine::RecCb(TAPSCommBuffer &buffer) > { > ... > buf[i] = pjmedia_alaw2linear(iBuffer[i]); > ... > } > > TInt CPjAudioEngine::StartStreamL() > { > .... > iSession.SetEncoderMode(EALawOr20ms); > iSession.SetDecoderMode(EALawOr20ms); > ... > } > > audio is in G711-A Format. > > > The APS supports the following codecs: AMR, G711, G729 and iLBC. > > If you like use other codec for encoding or decoding, you should change the > SetEncoderMode() and SetDecoderMode(). > > > Pai > > > On Fri, Jan 9, 2009 at 5:54 PM, Rawshan Iajdani <iajdani@provati.com> > wrote: > > How does APS implementation works in Symbian_ua? > > Does g711,gsm,speex all works fine? > > > > APS->G711->PCM->gsm > > Or > > APS->gsm?? > > > > Does it do the transcoding or it just only works for g711 and not gsm and > speex? > > > > thanks > > > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > > -- > S. M. Nazmul Hasan Opu > Software Engineer > R & D Application > Dhaka, Bangladesh > Mob: +880 1712 901 764 > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > -- S. M. Nazmul Hasan Opu Software Engineer R & D Application Dhaka, Bangladesh Mob: +880 1712 901 764
RI
Rawshan Iajdani
Sun, Jan 11, 2009 1:19 PM

Well its nothing to do with APS. I was talking about the wrapper. If you
want to implement the  g729 you need to rewrite the wrapper itself and some
changes should be made in the PJMEDIA codec itself.

This wrapper does not pass g.711 directly to the PJMEDIA rather convert that
to PCM and pass that. If you even use g729 of APS, you still need to convert
that to PCM before passing that to PJMEDIA. PJMEDIA will again have to
convert this PCM to g.729.

So what is the use????

From: pjsip-bounces@lists.pjsip.org [mailto:pjsip-bounces@lists.pjsip.org]
On Behalf Of S. M. Nazmul Hasan (Opu)
Sent: Sunday, January 11, 2009 7:01 PM
To: pjsip list
Subject: Re: [pjsip] APS Implementation

I dont think APS implementation(G729) is so hard as you think. APS already
has G729 codec support that is if i use APS i must get the implementation of
g729 innerly . i just have to change the procedure to use g729 codec....like
some parameter and encoding decoding technique. ...

APS use 24byte data ...thats a point also...

On Sun, Jan 11, 2009 at 3:46 PM, Rawshan Iajdani iajdani@provati.com
wrote:

I don't think you can with this current wrapper.

So far I understood, the current wrapper just take PCM and convert that to
g.711 and pass it to APS and vice versa. You still need your own g.729
implementation. This wrapper just take PCM as input and output..

Correct me if I were wrong..

From: pjsip-bounces@lists.pjsip.org [mailto:pjsip-bounces@lists.pjsip.org]
On Behalf Of S. M. Nazmul Hasan (Opu)
Sent: Sunday, January 11, 2009 3:36 PM

To: pjsip list
Subject: Re: [pjsip] APS Implementation

Hi Pai,

Can you please tell me if i want to g729 from Aps what should i need to do?

in the line of encoder mode

iSession.SetEncoderMode(EALawOr20ms);

is for g711 but i saw no encoding mode for g729 . should i block those line
if i want to use g729?

Thanks

On Sat, Jan 10, 2009 at 12:19 AM, Pai Peng sipaipv6@gmail.com wrote:

Hi,

in source symbian_sound_aps.cpp:

void CPjAudioEngine::RecCb(TAPSCommBuffer &buffer)
{
...
buf[i] = pjmedia_alaw2linear(iBuffer[i]);
...
}

TInt CPjAudioEngine::StartStreamL()
{
....
iSession.SetEncoderMode(EALawOr20ms);
iSession.SetDecoderMode(EALawOr20ms);
...
}

audio is in G711-A Format.

The  APS supports the following codecs: AMR, G711, G729 and iLBC.

If you like use other codec for encoding or decoding, you should change the
SetEncoderMode() and SetDecoderMode().

Pai

On Fri, Jan 9, 2009 at 5:54 PM, Rawshan Iajdani iajdani@provati.com wrote:

How does APS implementation works in Symbian_ua?

Does g711,gsm,speex all works fine?

APS->G711->PCM->gsm

Or

APS->gsm??

Does it do the transcoding or it just only works for g711 and not gsm and
speex?

thanks


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--
S. M. Nazmul Hasan Opu
Software Engineer
R & D Application
Dhaka, Bangladesh
Mob: +880 1712 901 764


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--
S. M. Nazmul Hasan Opu
Software Engineer
R & D Application
Dhaka, Bangladesh
Mob: +880 1712 901 764

Well its nothing to do with APS. I was talking about the wrapper. If you want to implement the g729 you need to rewrite the wrapper itself and some changes should be made in the PJMEDIA codec itself. This wrapper does not pass g.711 directly to the PJMEDIA rather convert that to PCM and pass that. If you even use g729 of APS, you still need to convert that to PCM before passing that to PJMEDIA. PJMEDIA will again have to convert this PCM to g.729. So what is the use???? From: pjsip-bounces@lists.pjsip.org [mailto:pjsip-bounces@lists.pjsip.org] On Behalf Of S. M. Nazmul Hasan (Opu) Sent: Sunday, January 11, 2009 7:01 PM To: pjsip list Subject: Re: [pjsip] APS Implementation I dont think APS implementation(G729) is so hard as you think. APS already has G729 codec support that is if i use APS i must get the implementation of g729 innerly . i just have to change the procedure to use g729 codec....like some parameter and encoding decoding technique. ... APS use 24byte data ...thats a point also... On Sun, Jan 11, 2009 at 3:46 PM, Rawshan Iajdani <iajdani@provati.com> wrote: I don't think you can with this current wrapper. So far I understood, the current wrapper just take PCM and convert that to g.711 and pass it to APS and vice versa. You still need your own g.729 implementation. This wrapper just take PCM as input and output.. Correct me if I were wrong.. From: pjsip-bounces@lists.pjsip.org [mailto:pjsip-bounces@lists.pjsip.org] On Behalf Of S. M. Nazmul Hasan (Opu) Sent: Sunday, January 11, 2009 3:36 PM To: pjsip list Subject: Re: [pjsip] APS Implementation Hi Pai, Can you please tell me if i want to g729 from Aps what should i need to do? in the line of encoder mode iSession.SetEncoderMode(EALawOr20ms); is for g711 but i saw no encoding mode for g729 . should i block those line if i want to use g729? Thanks On Sat, Jan 10, 2009 at 12:19 AM, Pai Peng <sipaipv6@gmail.com> wrote: Hi, in source symbian_sound_aps.cpp: void CPjAudioEngine::RecCb(TAPSCommBuffer &buffer) { ... buf[i] = pjmedia_alaw2linear(iBuffer[i]); ... } TInt CPjAudioEngine::StartStreamL() { .... iSession.SetEncoderMode(EALawOr20ms); iSession.SetDecoderMode(EALawOr20ms); ... } audio is in G711-A Format. The APS supports the following codecs: AMR, G711, G729 and iLBC. If you like use other codec for encoding or decoding, you should change the SetEncoderMode() and SetDecoderMode(). Pai On Fri, Jan 9, 2009 at 5:54 PM, Rawshan Iajdani <iajdani@provati.com> wrote: How does APS implementation works in Symbian_ua? Does g711,gsm,speex all works fine? APS->G711->PCM->gsm Or APS->gsm?? Does it do the transcoding or it just only works for g711 and not gsm and speex? thanks _______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org _______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org -- S. M. Nazmul Hasan Opu Software Engineer R & D Application Dhaka, Bangladesh Mob: +880 1712 901 764 _______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org -- S. M. Nazmul Hasan Opu Software Engineer R & D Application Dhaka, Bangladesh Mob: +880 1712 901 764
FP
Fabio Pietrosanti (naif)
Mon, Jan 12, 2009 8:54 AM

It's a never ending story, a hook inside PJMEDIA framework to handle
direct hardware encoding have to be written in order to leverage Nokia
S60 hardware code.

And it has to be written considering that APS on FP2+ is already
deprecated and will need to be changed to VAS.

Hardware codec will provide royalty-paid codec for free (already
licensed on S60 platform) and precious battery saving, but will remove
some features like conference calling.

It's something that could be estimated in 20-30 man working days
depending on the expertise on pjsip platform.

Of the player of the discussion is there someone willing to invest such
time?

Waiting for yours

Fabio Pietrosanti

Rawshan Iajdani wrote:

Well its nothing to do with APS. I was talking about the wrapper. If
you want to implement the  g729 you need to rewrite the wrapper itself
and some changes should be made in the PJMEDIA codec itself.

This wrapper does not pass g.711 directly to the PJMEDIA rather
convert that to PCM and pass that. If you even use g729 of APS, you
still need to convert that to PCM before passing that to PJMEDIA.
PJMEDIA will again have to convert this PCM to g.729.

So what is the use????

From: pjsip-bounces@lists.pjsip.org
[mailto:pjsip-bounces@lists.pjsip.org] *On Behalf Of *S. M. Nazmul
Hasan (Opu)
Sent: Sunday, January 11, 2009 7:01 PM
To: pjsip list
Subject: Re: [pjsip] APS Implementation

I dont think APS implementation(G729) is so hard as you think. APS
already has G729 codec support that is if i use APS i must get the
implementation of g729 innerly . i just have to change the procedure
to use g729 codec....like some parameter and encoding decoding
technique. ...

APS use 24byte data ...thats a point also...

On Sun, Jan 11, 2009 at 3:46 PM, Rawshan Iajdani <iajdani@provati.com
mailto:iajdani@provati.com> wrote:

I don't think you can with this current wrapper.

So far I understood, the current wrapper just take PCM and convert
that to g.711 and pass it to APS and vice versa. You still need your
own g.729 implementation. This wrapper just take PCM as input and output..

Correct me if I were wrong..

From: pjsip-bounces@lists.pjsip.org
mailto:pjsip-bounces@lists.pjsip.org
[mailto:pjsip-bounces@lists.pjsip.org
mailto:pjsip-bounces@lists.pjsip.org] *On Behalf Of *S. M. Nazmul
Hasan (Opu)
Sent: Sunday, January 11, 2009 3:36 PM

To: pjsip list
Subject: Re: [pjsip] APS Implementation

Hi Pai,

Can you please tell me if i want to g729 from Aps what should i need
to do?

in the line of encoder mode

iSession.SetEncoderMode(EALawOr20ms);

is for g711 but i saw no encoding mode for g729 . should i block those
line if i want to use g729?

Thanks

On Sat, Jan 10, 2009 at 12:19 AM, Pai Peng <sipaipv6@gmail.com
mailto:sipaipv6@gmail.com> wrote:

Hi,

in source symbian_sound_aps.cpp:

void CPjAudioEngine::RecCb(TAPSCommBuffer &buffer)
{
...
buf[i] = pjmedia_alaw2linear(iBuffer[i]);
...
}

TInt CPjAudioEngine::StartStreamL()
{
....
iSession.SetEncoderMode(EALawOr20ms);
iSession.SetDecoderMode(EALawOr20ms);
...
}

audio is in G711-A Format.

The  APS supports the following codecs: AMR, G711, G729 and iLBC.

If you like use other codec for encoding or decoding, you should
change the SetEncoderMode() and SetDecoderMode().

Pai

On Fri, Jan 9, 2009 at 5:54 PM, Rawshan Iajdani <iajdani@provati.com
mailto:iajdani@provati.com> wrote:

 How does APS implementation works in Symbian_ua?

 Does g711,gsm,speex all works fine?

  

 APS->G711->PCM->gsm

 Or

 APS->gsm??

  

 Does it do the transcoding or it just only works for g711 and not
 gsm and speex?

  

 thanks

  

  

 _______________________________________________
 Visit our blog: http://blog.pjsip.org

 pjsip mailing list
 pjsip@lists.pjsip.org <mailto:pjsip@lists.pjsip.org>
 http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org mailto:pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--
S. M. Nazmul Hasan Opu
Software Engineer
R & D Application
Dhaka, Bangladesh
Mob: +880 1712 901 764


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org mailto:pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--
S. M. Nazmul Hasan Opu
Software Engineer
R & D Application
Dhaka, Bangladesh
Mob: +880 1712 901 764



Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

It's a never ending story, a hook inside PJMEDIA framework to handle direct hardware encoding have to be written in order to leverage Nokia S60 hardware code. And it has to be written considering that APS on FP2+ is already deprecated and will need to be changed to VAS. Hardware codec will provide royalty-paid codec for free (already licensed on S60 platform) and precious battery saving, but will remove some features like conference calling. It's something that could be estimated in 20-30 man working days depending on the expertise on pjsip platform. Of the player of the discussion is there someone willing to invest such time? Waiting for yours Fabio Pietrosanti Rawshan Iajdani wrote: > > Well its nothing to do with APS. I was talking about the wrapper. If > you want to implement the g729 you need to rewrite the wrapper itself > and some changes should be made in the PJMEDIA codec itself. > > This wrapper does not pass g.711 directly to the PJMEDIA rather > convert that to PCM and pass that. If you even use g729 of APS, you > still need to convert that to PCM before passing that to PJMEDIA. > PJMEDIA will again have to convert this PCM to g.729. > > So what is the use???? > > > > > > *From:* pjsip-bounces@lists.pjsip.org > [mailto:pjsip-bounces@lists.pjsip.org] *On Behalf Of *S. M. Nazmul > Hasan (Opu) > *Sent:* Sunday, January 11, 2009 7:01 PM > *To:* pjsip list > *Subject:* Re: [pjsip] APS Implementation > > > > I dont think APS implementation(G729) is so hard as you think. APS > already has G729 codec support that is if i use APS i must get the > implementation of g729 innerly . i just have to change the procedure > to use g729 codec....like some parameter and encoding decoding > technique. ... > > APS use 24byte data ...thats a point also... > > On Sun, Jan 11, 2009 at 3:46 PM, Rawshan Iajdani <iajdani@provati.com > <mailto:iajdani@provati.com>> wrote: > > I don't think you can with this current wrapper. > > So far I understood, the current wrapper just take PCM and convert > that to g.711 and pass it to APS and vice versa. You still need your > own g.729 implementation. This wrapper just take PCM as input and output.. > > > > Correct me if I were wrong.. > > > > > > > > *From:* pjsip-bounces@lists.pjsip.org > <mailto:pjsip-bounces@lists.pjsip.org> > [mailto:pjsip-bounces@lists.pjsip.org > <mailto:pjsip-bounces@lists.pjsip.org>] *On Behalf Of *S. M. Nazmul > Hasan (Opu) > *Sent:* Sunday, January 11, 2009 3:36 PM > > > *To:* pjsip list > *Subject:* Re: [pjsip] APS Implementation > > > > Hi Pai, > > > > Can you please tell me if i want to g729 from Aps what should i need > to do? > > in the line of encoder mode > > iSession.SetEncoderMode(EALawOr20ms); > > is for g711 but i saw no encoding mode for g729 . should i block those > line if i want to use g729? > > Thanks > > On Sat, Jan 10, 2009 at 12:19 AM, Pai Peng <sipaipv6@gmail.com > <mailto:sipaipv6@gmail.com>> wrote: > > Hi, > > > in source symbian_sound_aps.cpp: > > void CPjAudioEngine::RecCb(TAPSCommBuffer &buffer) > { > ... > buf[i] = pjmedia_alaw2linear(iBuffer[i]); > ... > } > > TInt CPjAudioEngine::StartStreamL() > { > .... > iSession.SetEncoderMode(EALawOr20ms); > iSession.SetDecoderMode(EALawOr20ms); > ... > } > > audio is in G711-A Format. > > > The APS supports the following codecs: AMR, G711, G729 and iLBC. > > If you like use other codec for encoding or decoding, you should > change the SetEncoderMode() and SetDecoderMode(). > > > Pai > > On Fri, Jan 9, 2009 at 5:54 PM, Rawshan Iajdani <iajdani@provati.com > <mailto:iajdani@provati.com>> wrote: > > How does APS implementation works in Symbian_ua? > > Does g711,gsm,speex all works fine? > > > > APS->G711->PCM->gsm > > Or > > APS->gsm?? > > > > Does it do the transcoding or it just only works for g711 and not > gsm and speex? > > > > thanks > > > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org <mailto:pjsip@lists.pjsip.org> > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org <mailto:pjsip@lists.pjsip.org> > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > > -- > S. M. Nazmul Hasan Opu > Software Engineer > R & D Application > Dhaka, Bangladesh > Mob: +880 1712 901 764 > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org <mailto:pjsip@lists.pjsip.org> > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > > -- > S. M. Nazmul Hasan Opu > Software Engineer > R & D Application > Dhaka, Bangladesh > Mob: +880 1712 901 764 > > ------------------------------------------------------------------------ > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >
PP
Pai Peng
Mon, Jan 12, 2009 9:09 AM

Hello,

check apsclientsession.h:

// (' ', 'A', 'M', 'R')
const TUint32 KMCPFourCCIdAMRNB = 0x524d4120;

// ('G', '7', '1', '1')
const TUint32 KMCPFourCCIdG711 = 0x31313747;

// ('G', '7', '2', '9')
const TUint32 KMCPFourCCIdG729 = 0x39323747;

// ('i', 'L', 'B', 'C')
const TUint32 KMCPFourCCIdILBC = 0x43424c49;

// ( 'D', 'T', 'M', 'F' )
const TUint32 KMCPFourCCIdDTMF = 0x464d5444;

and

void CPjAudioEngine::ConstructL()
{
iSettings.iFourCC            = TFourCC(KMCPFourCCIdG711); // <- change
to KMCPFourCCIdG729
iSettings.iGlobal            = APP_UID;
iSettings.iPriority            = TMdaPriority(100);
iSettings.iPreference        = TMdaPriorityPreference(0x05210001);
iSettings.iSettings.iChannels  = EMMFMono;
iSettings.iSettings.iSampleRate = EMMFSampleRate8000Hz;
iSettings.iSettings.iVolume        = 0;
}

There is also an example for APS, you can figure it out about how to use all
codecs with APS.

Pai

On Sun, Jan 11, 2009 at 10:36 AM, S. M. Nazmul Hasan (Opu) <apus29@gmail.com

wrote:

Hi Pai,

Can you please tell me if i want to g729 from Aps what should i need to do?

in the line of encoder mode

iSession.SetEncoderMode(EALawOr20ms);

is for g711 but i saw no encoding mode for g729 . should i block those line
if i want to use g729?

Thanks

On Sat, Jan 10, 2009 at 12:19 AM, Pai Peng sipaipv6@gmail.com wrote:

Hi,

in source symbian_sound_aps.cpp:

void CPjAudioEngine::RecCb(TAPSCommBuffer &buffer)
{
...
buf[i] = pjmedia_alaw2linear(iBuffer[i]);
...
}

TInt CPjAudioEngine::StartStreamL()
{
....
iSession.SetEncoderMode(EALawOr20ms);
iSession.SetDecoderMode(EALawOr20ms);
...
}

audio is in G711-A Format.

The  APS supports the following codecs: AMR, G711, G729 and iLBC.

If you like use other codec for encoding or decoding, you should change
the SetEncoderMode() and SetDecoderMode().

Pai

On Fri, Jan 9, 2009 at 5:54 PM, Rawshan Iajdani iajdani@provati.comwrote:

How does APS implementation works in Symbian_ua?

Does g711,gsm,speex all works fine?

APS->G711->PCM->gsm

Or

APS->gsm??

Does it do the transcoding or it just only works for g711 and not gsm and
speex?

thanks


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--
S. M. Nazmul Hasan Opu
Software Engineer
R & D Application
Dhaka, Bangladesh
Mob: +880 1712 901 764


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

Hello, check apsclientsession.h: // (' ', 'A', 'M', 'R') const TUint32 KMCPFourCCIdAMRNB = 0x524d4120; // ('G', '7', '1', '1') const TUint32 KMCPFourCCIdG711 = 0x31313747; // ('G', '7', '2', '9') const TUint32 KMCPFourCCIdG729 = 0x39323747; // ('i', 'L', 'B', 'C') const TUint32 KMCPFourCCIdILBC = 0x43424c49; // ( 'D', 'T', 'M', 'F' ) const TUint32 KMCPFourCCIdDTMF = 0x464d5444; and void CPjAudioEngine::ConstructL() { iSettings.iFourCC = TFourCC(KMCPFourCCIdG711); // <- change to KMCPFourCCIdG729 iSettings.iGlobal = APP_UID; iSettings.iPriority = TMdaPriority(100); iSettings.iPreference = TMdaPriorityPreference(0x05210001); iSettings.iSettings.iChannels = EMMFMono; iSettings.iSettings.iSampleRate = EMMFSampleRate8000Hz; iSettings.iSettings.iVolume = 0; } There is also an example for APS, you can figure it out about how to use all codecs with APS. Pai On Sun, Jan 11, 2009 at 10:36 AM, S. M. Nazmul Hasan (Opu) <apus29@gmail.com > wrote: > Hi Pai, > > Can you please tell me if i want to g729 from Aps what should i need to do? > > in the line of encoder mode > > iSession.SetEncoderMode(EALawOr20ms); > > is for g711 but i saw no encoding mode for g729 . should i block those line > if i want to use g729? > > Thanks > > > > On Sat, Jan 10, 2009 at 12:19 AM, Pai Peng <sipaipv6@gmail.com> wrote: > >> Hi, >> >> >> in source symbian_sound_aps.cpp: >> >> void CPjAudioEngine::RecCb(TAPSCommBuffer &buffer) >> { >> ... >> buf[i] = pjmedia_alaw2linear(iBuffer[i]); >> ... >> } >> >> TInt CPjAudioEngine::StartStreamL() >> { >> .... >> iSession.SetEncoderMode(EALawOr20ms); >> iSession.SetDecoderMode(EALawOr20ms); >> ... >> } >> >> audio is in G711-A Format. >> >> >> The APS supports the following codecs: AMR, G711, G729 and iLBC. >> >> If you like use other codec for encoding or decoding, you should change >> the SetEncoderMode() and SetDecoderMode(). >> >> >> Pai >> >> >> >> On Fri, Jan 9, 2009 at 5:54 PM, Rawshan Iajdani <iajdani@provati.com>wrote: >> >>> How does APS implementation works in Symbian_ua? >>> >>> Does g711,gsm,speex all works fine? >>> >>> >>> >>> APS->G711->PCM->gsm >>> >>> Or >>> >>> APS->gsm?? >>> >>> >>> >>> Does it do the transcoding or it just only works for g711 and not gsm and >>> speex? >>> >>> >>> >>> thanks >>> >>> >>> >>> _______________________________________________ >>> Visit our blog: http://blog.pjsip.org >>> >>> pjsip mailing list >>> pjsip@lists.pjsip.org >>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >>> >>> >> >> _______________________________________________ >> Visit our blog: http://blog.pjsip.org >> >> pjsip mailing list >> pjsip@lists.pjsip.org >> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >> >> > > > -- > S. M. Nazmul Hasan Opu > Software Engineer > R & D Application > Dhaka, Bangladesh > Mob: +880 1712 901 764 > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > >
RM
Rafael Maia
Mon, Jan 12, 2009 7:15 PM

Thanks alot for your source code Norman, it has been a big boost to my code development...

I am having a diferent problem now.
I can ear the sound frames i added on my sound speakers, but i am not sending them in the RTP session.
I did the following:

pjmedia_conf_add_port(conference_bridge, pool_vars, &port, NULL, &slot);
pjmedia_conf_connect_port(conference_bridge, slot, inSlot, 0);

I have tested putting frames on the master_port directly, and the saound frames are sent throw RTP:

pjmedia_port* master = pjmedia_conf_get_master_port(conference_bridge);
pjmedia_port_put_frame(master, &frame);

...but i don't think this is the proper way to do it

Can anyone help?
How should i send the audio frames?

Thanks in advance for any help....

Rafael Maia

From: norman@myasd.comTo: pjsip@lists.pjsip.orgDate: Fri, 9 Jan 2009 18:48:10 -0500Subject: Re: [pjsip] Sending my own audio framesYou can use pjmedia_splitcomb_create_rev_channel to reverse the put/get semantics. I do that elsewhere and it works.

I did then add it to the conference bridge.

Sadly, my code isn't easy to extract and is very C++ using boost and a custom string library.

typedef bool (*GetSamplesPtr)(void * inBuf, uint32_t * ioByteSize, pj_timestamp * inTime);

PlayPort::PlayPort(
unsigned sampling_rate,
unsigned channel_count,
unsigned samples_per_frame,
unsigned bits_per_sample
)
: pool(NULL), mCallIndex(INVALID_CALL_INDEX)
{
const pj_str_t name = pj_str("file");

pool = pjsua_pool_create("asd_player", 4000, 4000);
assert(pool);

pj_strdup2(pool, &base.info.name, "asd_player");

base.get_frame = &file_get_frame_get;
base.put_frame = &file_put_frame_get;
base.on_destroy = &file_on_destroy_get;

pjmedia_port_info_init(&base.info, &name, SIGNATURE, sampling_rate, channel_count, bits_per_sample, samples_per_frame);

port_is_open = true;
options = 0;

}

PlayPort::~PlayPort()
{
Close();

if (pool) {
    pj_pool_release(pool);
    pool = NULL;
}

}

pj_status_t PlayPort::Open(SInt32 inCallIndex, float inVolume, GetSamplesPtr inFunc)
{
pj_status_t status;

status = pjsua_conf_add_port(pool, &base, &slot);
if (status != PJ_SUCCESS) {
    pjmedia_port_destroy(&base);
    return status;
}

mCallIndex = inCallIndex;

status = pjsua_conf_adjust_rx_level(slot, inVolume);

port_func = inFunc;

return status;

}

void PlayPort::Close(void)
{
file_on_destroy_get(&base);
}

bool PlayPort::IsOpen(void)
{
return port_is_open && slot >= 0;
}

pj_status_t PlayPort::ConnectTo(int inSlot)
{
return pjsua_conf_connect(slot, inSlot);
}

pj_status_t PlayPort::DisconnectFrom(int inSlot)
{
return pjsua_conf_disconnect(slot, inSlot);
}

// Class static
pj_status_t PlayPort::file_on_destroy_get(pjmedia_port *this_port)
{
// As the first element in a non-virtual class...
PlayPort *fport = (PlayPort *) this_port;
boost::recursive_mutex::scoped_lock l(fport->m);

pj_assert(this_port->info.signature == SIGNATURE);

if (fport->port_is_open) {
 fport->port_is_open = false; // Prevents a recursive callback

    fport->port_func = NULL;
    pjsua_conf_remove_port(fport->slot); // If it's already removed, e.g. audio device changed, this crashes. 
    fport->slot = 0;
    pjmedia_port_destroy(&fport->base);
}

return PJ_SUCCESS;

}

// Class static
pj_status_t PlayPort::file_get_frame_get(pjmedia_port *this_port, pjmedia_frame *frame)
{
// As the first element in a non-virtual class...
PlayPort *fport = (PlayPort *) this_port;

pj_assert(this_port->info.signature == SIGNATURE);

if (frame->size == 0) return PJ_SUCCESS;
if (! fport->port_func) return PJ_EEOF;

pj_size_t frame_size = frame->size;
if ((*fport->port_func)(frame->buf, &frame_size, (PJSUA_Timestamp *) &frame->timestamp)) {
    if (frame_size < frame->size) {
        bzero((UInt8*)frame->buf + frame_size, frame->size - frame_size);
    }
    frame->timestamp.u64 = 0;
    frame->type = PJMEDIA_FRAME_TYPE_AUDIO;
    return PJ_SUCCESS;
}
file_on_destroy_get(this_port);
return PJ_EEOF;

}

// Class static
pj_status_t PlayPort::file_put_frame_get(pjmedia_port *this_port, const pjmedia_frame *frame)
{
return PJ_EINVALIDOP;
}

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Jan 9, 2009, at 1:27 PM, Rafael Maia wrote:

Thanks for your anwser Norman. You are using a very diferent approach from mine. Could you provide some more information ( or some source code ) ? My DirectShow sound reading routines are pushing audio frames that i need to send throw PJSIP. So i need to call put_frame on a media port.How did you created this "Passive" port ? You also add it to the conference bridge, right ? Thanks in advance... Rafael Maia

From: norman@myasd.comTo: pjsip@lists.pjsip.orgDate: Fri, 9 Jan 2009 12:17:19 -0500Subject: Re: [pjsip] Sending my own audio framesI use pjmedia_port_info_init to create a player port. Something like this:

pool = pjsua_pool_create("MyPlayerPool", 4000, 4000);
pj_strdup2(pool, &base.info.name, "MyPlayer");

base.get_frame = &file_get_frame_get;
base.put_frame = &file_put_frame_get;
base.on_destroy = &file_on_destroy_get;

pjmedia_port_info_init(&base.info, &name, SIGNATURE, sampling_rate, channel_count, bits_per_sample, samples_per_frame);

This works well for playing files in a non-standard format that I need to support. You put your sample generation code in file_get_frame_get.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Jan 9, 2009, at 9:24 AM, Rafael Maia wrote:

Hi, i made a media player in DirectShow that captures PCM audio frames from mp3 audio files. I need to send this audio frames to PJSIP. Can anyone help me? I have tried adding a passive_port to the conference bridge and it did not worked. Now i am trying to use splitcomb. And i can send some noise. Here's a code sample: // 1º pjmedia_splitcom_createpj_status_t status = pjmedia_splitcomb_create(pool_vars, nSamplesPerSec, nChannels, samplesPerFrame, wBitsPerSample, 0, &p_splitcomb);// for each channelfor(unsigned int i = 0; i < nChannels; i++)  {    unsigned int p_slot;    pjmedia_port* p_port;      // 2º pjmedia_splitcom_create_rev_channel    status = pjmedia_splitcomb_create_rev_channel(pool_vars, p_splitcomb, i, 0, &p_port);      // 3º pjmedia_conf_add_port    status = pjmedia_conf_add_port(conference_bridge, pool_vars, p_port, NULL, &p_slot);}  And then, when i want to send an audio frame i do the following: pjmedia_port_put_frame(p_splitcomb, &frame);  What is wrong with my code?Am i using splitcom correctly? Any help would be appreciated... Rafael Maia

O jeito mais fácil de manter a sua lista de amigos sempre em ordem! Organize seus contatos!_______________________________________________Visit our blog: http://blog.pjsip.orgpjsip mailing listpjsip@lists.pjsip.orghttp://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

Notícias direto do New York Times, gols do Lance, videocassetadas e muitos outros vídeos no MSN Videos! Confira já! _______________________________________________Visit our blog: http://blog.pjsip.orgpjsip mailing listpjsip@lists.pjsip.orghttp://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


Mais do que emails! Confira tudo o que Windows Live™ pode oferecer.
http://www.microsoft.com/windows/windowslive/

Thanks alot for your source code Norman, it has been a big boost to my code development... I am having a diferent problem now. I can ear the sound frames i added on my sound speakers, but i am not sending them in the RTP session. I did the following: pjmedia_conf_add_port(conference_bridge, pool_vars, &port, NULL, &slot); pjmedia_conf_connect_port(conference_bridge, slot, inSlot, 0); I have tested putting frames on the master_port directly, and the saound frames are sent throw RTP: pjmedia_port* master = pjmedia_conf_get_master_port(conference_bridge); pjmedia_port_put_frame(master, &frame); ...but i don't think this is the proper way to do it Can anyone help? How should i send the audio frames? Thanks in advance for any help.... Rafael Maia From: norman@myasd.comTo: pjsip@lists.pjsip.orgDate: Fri, 9 Jan 2009 18:48:10 -0500Subject: Re: [pjsip] Sending my own audio framesYou can use pjmedia_splitcomb_create_rev_channel to reverse the put/get semantics. I do that elsewhere and it works. I did then add it to the conference bridge. Sadly, my code isn't easy to extract and is very C++ using boost and a custom string library. typedef bool (*GetSamplesPtr)(void * inBuf, uint32_t * ioByteSize, pj_timestamp * inTime); PlayPort::PlayPort( unsigned sampling_rate, unsigned channel_count, unsigned samples_per_frame, unsigned bits_per_sample ) : pool(NULL), mCallIndex(INVALID_CALL_INDEX) { const pj_str_t name = pj_str("file"); pool = pjsua_pool_create("asd_player", 4000, 4000); assert(pool); pj_strdup2(pool, &base.info.name, "asd_player"); base.get_frame = &file_get_frame_get; base.put_frame = &file_put_frame_get; base.on_destroy = &file_on_destroy_get; pjmedia_port_info_init(&base.info, &name, SIGNATURE, sampling_rate, channel_count, bits_per_sample, samples_per_frame); port_is_open = true; options = 0; } PlayPort::~PlayPort() { Close(); if (pool) { pj_pool_release(pool); pool = NULL; } } pj_status_t PlayPort::Open(SInt32 inCallIndex, float inVolume, GetSamplesPtr inFunc) { pj_status_t status; status = pjsua_conf_add_port(pool, &base, &slot); if (status != PJ_SUCCESS) { pjmedia_port_destroy(&base); return status; } mCallIndex = inCallIndex; status = pjsua_conf_adjust_rx_level(slot, inVolume); port_func = inFunc; return status; } void PlayPort::Close(void) { file_on_destroy_get(&base); } bool PlayPort::IsOpen(void) { return port_is_open && slot >= 0; } pj_status_t PlayPort::ConnectTo(int inSlot) { return pjsua_conf_connect(slot, inSlot); } pj_status_t PlayPort::DisconnectFrom(int inSlot) { return pjsua_conf_disconnect(slot, inSlot); } // Class static pj_status_t PlayPort::file_on_destroy_get(pjmedia_port *this_port) { // As the first element in a non-virtual class... PlayPort *fport = (PlayPort *) this_port; boost::recursive_mutex::scoped_lock l(fport->m); pj_assert(this_port->info.signature == SIGNATURE); if (fport->port_is_open) { fport->port_is_open = false; // Prevents a recursive callback fport->port_func = NULL; pjsua_conf_remove_port(fport->slot); // If it's already removed, e.g. audio device changed, this crashes. fport->slot = 0; pjmedia_port_destroy(&fport->base); } return PJ_SUCCESS; } // Class static pj_status_t PlayPort::file_get_frame_get(pjmedia_port *this_port, pjmedia_frame *frame) { // As the first element in a non-virtual class... PlayPort *fport = (PlayPort *) this_port; pj_assert(this_port->info.signature == SIGNATURE); if (frame->size == 0) return PJ_SUCCESS; if (! fport->port_func) return PJ_EEOF; pj_size_t frame_size = frame->size; if ((*fport->port_func)(frame->buf, &frame_size, (PJSUA_Timestamp *) &frame->timestamp)) { if (frame_size < frame->size) { bzero((UInt8*)frame->buf + frame_size, frame->size - frame_size); } frame->timestamp.u64 = 0; frame->type = PJMEDIA_FRAME_TYPE_AUDIO; return PJ_SUCCESS; } file_on_destroy_get(this_port); return PJ_EEOF; } // Class static pj_status_t PlayPort::file_put_frame_get(pjmedia_port *this_port, const pjmedia_frame *frame) { return PJ_EINVALIDOP; } Norman Franke Answering Service for Directors, Inc. www.myasd.com On Jan 9, 2009, at 1:27 PM, Rafael Maia wrote: Thanks for your anwser Norman. You are using a very diferent approach from mine. Could you provide some more information ( or some source code ) ? My DirectShow sound reading routines are pushing audio frames that i need to send throw PJSIP. So i need to call put_frame on a media port.How did you created this "Passive" port ? You also add it to the conference bridge, right ? Thanks in advance... Rafael Maia From: norman@myasd.comTo: pjsip@lists.pjsip.orgDate: Fri, 9 Jan 2009 12:17:19 -0500Subject: Re: [pjsip] Sending my own audio framesI use pjmedia_port_info_init to create a player port. Something like this: pool = pjsua_pool_create("MyPlayerPool", 4000, 4000); pj_strdup2(pool, &base.info.name, "MyPlayer"); base.get_frame = &file_get_frame_get; base.put_frame = &file_put_frame_get; base.on_destroy = &file_on_destroy_get; pjmedia_port_info_init(&base.info, &name, SIGNATURE, sampling_rate, channel_count, bits_per_sample, samples_per_frame); This works well for playing files in a non-standard format that I need to support. You put your sample generation code in file_get_frame_get. Norman Franke Answering Service for Directors, Inc. www.myasd.com On Jan 9, 2009, at 9:24 AM, Rafael Maia wrote: Hi, i made a media player in DirectShow that captures PCM audio frames from mp3 audio files. I need to send this audio frames to PJSIP. Can anyone help me? I have tried adding a passive_port to the conference bridge and it did not worked. Now i am trying to use splitcomb. And i can send some noise. Here's a code sample: // 1º pjmedia_splitcom_createpj_status_t status = pjmedia_splitcomb_create(pool_vars, nSamplesPerSec, nChannels, samplesPerFrame, wBitsPerSample, 0, &p_splitcomb);// for each channelfor(unsigned int i = 0; i < nChannels; i++) { unsigned int p_slot; pjmedia_port* p_port; // 2º pjmedia_splitcom_create_rev_channel status = pjmedia_splitcomb_create_rev_channel(pool_vars, p_splitcomb, i, 0, &p_port); // 3º pjmedia_conf_add_port status = pjmedia_conf_add_port(conference_bridge, pool_vars, p_port, NULL, &p_slot);} And then, when i want to send an audio frame i do the following: pjmedia_port_put_frame(p_splitcomb, &frame); What is wrong with my code?Am i using splitcom correctly? Any help would be appreciated... Rafael Maia O jeito mais fácil de manter a sua lista de amigos sempre em ordem! Organize seus contatos!_______________________________________________Visit our blog: http://blog.pjsip.orgpjsip mailing listpjsip@lists.pjsip.orghttp://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org Notícias direto do New York Times, gols do Lance, videocassetadas e muitos outros vídeos no MSN Videos! Confira já! _______________________________________________Visit our blog: http://blog.pjsip.orgpjsip mailing listpjsip@lists.pjsip.orghttp://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org _________________________________________________________________ Mais do que emails! Confira tudo o que Windows Live™ pode oferecer. http://www.microsoft.com/windows/windowslive/
NF
Norman Franke
Mon, Jan 12, 2009 9:09 PM

You need to connect it to the port associated with the active call as
well. PJ is very flexible with audio routing, so you need to
explicitly connect up everything that should "hear" your source. Your
player should connect to the user's speakers and the call or calls in
progress.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Jan 12, 2009, at 2:15 PM, Rafael Maia wrote:

Thanks alot for your source code Norman, it has been a big boost to
my code development...

I am having a diferent problem now.
I can ear the sound frames i added on my sound speakers, but i am
not sending them in the RTP session.
I did the following:

pjmedia_conf_add_port(conference_bridge, pool_vars, &port, NULL,
&slot);
pjmedia_conf_connect_port(conference_bridge, slot, inSlot, 0);

I have tested putting frames on the master_port directly, and the
saound frames are sent throw RTP:

pjmedia_port* master =
pjmedia_conf_get_master_port(conference_bridge);
pjmedia_port_put_frame(master, &frame);

...but i don't think this is the proper way to do it

Can anyone help?
How should i send the audio frames?

Thanks in advance for any help....

Rafael Maia

From: norman@myasd.com
To: pjsip@lists.pjsip.org
Date: Fri, 9 Jan 2009 18:48:10 -0500
Subject: Re: [pjsip] Sending my own audio frames

You can use pjmedia_splitcomb_create_rev_channel to reverse the put/
get semantics. I do that elsewhere and it works.

I did then add it to the conference bridge.

Sadly, my code isn't easy to extract and is very C++ using boost and
a custom string library.

typedef bool (*GetSamplesPtr)(void * inBuf, uint32_t * ioByteSize,
pj_timestamp * inTime);

PlayPort::PlayPort(
unsigned sampling_rate,
unsigned channel_count,
unsigned samples_per_frame,
unsigned bits_per_sample
)
: pool(NULL), mCallIndex(INVALID_CALL_INDEX)
{
const pj_str_t name = pj_str("file");

 pool = pjsua_pool_create("asd_player", 4000, 4000);
 assert(pool);

 pj_strdup2(pool, &base.info.name, "asd_player");

 base.get_frame = &file_get_frame_get;
 base.put_frame = &file_put_frame_get;
 base.on_destroy = &file_on_destroy_get;

 pjmedia_port_info_init(&base.info, &name, SIGNATURE,  

sampling_rate, channel_count, bits_per_sample, samples_per_frame);

 port_is_open = true;
 options = 0;

}

PlayPort::~PlayPort()
{
Close();

 if (pool) {
     pj_pool_release(pool);
     pool = NULL;
 }

}

pj_status_t PlayPort::Open(SInt32 inCallIndex, float inVolume,
GetSamplesPtr inFunc)
{
pj_status_t status;

 status = pjsua_conf_add_port(pool, &base, &slot);
 if (status != PJ_SUCCESS) {
     pjmedia_port_destroy(&base);
     return status;
 }

 mCallIndex = inCallIndex;

 status = pjsua_conf_adjust_rx_level(slot, inVolume);

 port_func = inFunc;
 return status;

}

void PlayPort::Close(void)
{
file_on_destroy_get(&base);
}

bool PlayPort::IsOpen(void)
{
return port_is_open && slot >= 0;
}

pj_status_t PlayPort::ConnectTo(int inSlot)
{
return pjsua_conf_connect(slot, inSlot);
}

pj_status_t PlayPort::DisconnectFrom(int inSlot)
{
return pjsua_conf_disconnect(slot, inSlot);
}

// Class static
pj_status_t PlayPort::file_on_destroy_get(pjmedia_port *this_port)
{
// As the first element in a non-virtual class...
PlayPort *fport = (PlayPort *) this_port;
boost::recursive_mutex::scoped_lock l(fport->m);

 pj_assert(this_port->info.signature == SIGNATURE);

 if (fport->port_is_open) {
  fport->port_is_open = false; // Prevents a recursive callback

     fport->port_func = NULL;
     pjsua_conf_remove_port(fport->slot); // If it's already  

removed, e.g. audio device changed, this crashes.
fport->slot = 0;
pjmedia_port_destroy(&fport->base);
}

 return PJ_SUCCESS;

}

// Class static
pj_status_t PlayPort::file_get_frame_get(pjmedia_port *this_port,
pjmedia_frame *frame)
{
// As the first element in a non-virtual class...
PlayPort *fport = (PlayPort *) this_port;

 pj_assert(this_port->info.signature == SIGNATURE);

 if (frame->size == 0) return PJ_SUCCESS;
 if (! fport->port_func) return PJ_EEOF;

 pj_size_t frame_size = frame->size;
 if ((*fport->port_func)(frame->buf, &frame_size,  

(PJSUA_Timestamp ) &frame->timestamp)) {
if (frame_size < frame->size) {
bzero((UInt8
)frame->buf + frame_size, frame->size -
frame_size);
}
frame->timestamp.u64 = 0;
frame->type = PJMEDIA_FRAME_TYPE_AUDIO;
return PJ_SUCCESS;
}
file_on_destroy_get(this_port);
return PJ_EEOF;
}

// Class static
pj_status_t PlayPort::file_put_frame_get(pjmedia_port *this_port,
const pjmedia_frame *frame)
{
return PJ_EINVALIDOP;
}

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Jan 9, 2009, at 1:27 PM, Rafael Maia wrote:

Thanks for your anwser Norman.

You are using a very diferent approach from mine. Could you provide
some more information ( or some source code ) ?

My DirectShow sound reading routines are pushing audio frames that i
need to send throw PJSIP.

So i need to call put_frame on a media port.
How did you created this "Passive" port ?

You also add it to the conference bridge, right ?

Thanks in advance...

Rafael Maia

From: norman@myasd.com
To: pjsip@lists.pjsip.org
Date: Fri, 9 Jan 2009 12:17:19 -0500
Subject: Re: [pjsip] Sending my own audio frames

I use pjmedia_port_info_init to create a player port. Something like
this:

 pool = pjsua_pool_create("MyPlayerPool", 4000, 4000);
 pj_strdup2(pool, &base.info.name, "MyPlayer");

 base.get_frame = &file_get_frame_get;
 base.put_frame = &file_put_frame_get;
 base.on_destroy = &file_on_destroy_get;

 pjmedia_port_info_init(&base.info, &name, SIGNATURE,  

sampling_rate, channel_count, bits_per_sample, samples_per_frame);

This works well for playing files in a non-standard format that I
need to support. You put your sample generation code in
file_get_frame_get.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Jan 9, 2009, at 9:24 AM, Rafael Maia wrote:

Hi,

i made a media player in DirectShow that captures PCM audio frames
from mp3 audio files.

I need to send this audio frames to PJSIP. Can anyone help me?

I have tried adding a passive_port to the conference bridge and it
did not worked.

Now i am trying to use splitcomb. And i can send some noise.

Here's a code sample:

// 1º pjmedia_splitcom_create
pj_status_t status = pjmedia_splitcomb_create(pool_vars,
nSamplesPerSec, nChannels, samplesPerFrame, wBitsPerSample, 0,
&p_splitcomb);
// for each channel
for(unsigned int i = 0; i < nChannels; i++)  {
unsigned int p_slot;
pjmedia_port* p_port;

  // 2º pjmedia_splitcom_create_rev_channel
  status = pjmedia_splitcomb_create_rev_channel(pool_vars,  

p_splitcomb, i, 0, &p_port);

  // 3º pjmedia_conf_add_port
  status = pjmedia_conf_add_port(conference_bridge, pool_vars,  

p_port, NULL, &p_slot);
}

And then, when i want to send an audio frame i do the following:

pjmedia_port_put_frame(p_splitcomb, &frame);

What is wrong with my code?
Am i using splitcom correctly?

Any help would be appreciated...

Rafael Maia

O jeito mais fácil de manter a sua lista de amigos sempre em ordem!
Organize seus contatos!


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

Notícias direto do New York Times, gols do Lance, videocassetadas e
muitos outros vídeos no MSN Videos! Confira já!


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

O jeito mais fácil de manter a sua lista de amigos sempre em ordem!
Organize seus contatos!_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

You need to connect it to the port associated with the active call as well. PJ is very flexible with audio routing, so you need to explicitly connect up everything that should "hear" your source. Your player should connect to the user's speakers and the call or calls in progress. Norman Franke Answering Service for Directors, Inc. www.myasd.com On Jan 12, 2009, at 2:15 PM, Rafael Maia wrote: > > Thanks alot for your source code Norman, it has been a big boost to > my code development... > > > I am having a diferent problem now. > I can ear the sound frames i added on my sound speakers, but i am > not sending them in the RTP session. > I did the following: > > pjmedia_conf_add_port(conference_bridge, pool_vars, &port, NULL, > &slot); > pjmedia_conf_connect_port(conference_bridge, slot, inSlot, 0); > > > I have tested putting frames on the master_port directly, and the > saound frames are sent throw RTP: > > pjmedia_port* master = > pjmedia_conf_get_master_port(conference_bridge); > pjmedia_port_put_frame(master, &frame); > > > ...but i don't think this is the proper way to do it > > Can anyone help? > How should i send the audio frames? > > Thanks in advance for any help.... > > > Rafael Maia > > > > > > From: norman@myasd.com > To: pjsip@lists.pjsip.org > Date: Fri, 9 Jan 2009 18:48:10 -0500 > Subject: Re: [pjsip] Sending my own audio frames > > You can use pjmedia_splitcomb_create_rev_channel to reverse the put/ > get semantics. I do that elsewhere and it works. > > I did then add it to the conference bridge. > > Sadly, my code isn't easy to extract and is very C++ using boost and > a custom string library. > > typedef bool (*GetSamplesPtr)(void * inBuf, uint32_t * ioByteSize, > pj_timestamp * inTime); > > PlayPort::PlayPort( > unsigned sampling_rate, > unsigned channel_count, > unsigned samples_per_frame, > unsigned bits_per_sample > ) > : pool(NULL), mCallIndex(INVALID_CALL_INDEX) > { > const pj_str_t name = pj_str("file"); > > pool = pjsua_pool_create("asd_player", 4000, 4000); > assert(pool); > > pj_strdup2(pool, &base.info.name, "asd_player"); > > base.get_frame = &file_get_frame_get; > base.put_frame = &file_put_frame_get; > base.on_destroy = &file_on_destroy_get; > > pjmedia_port_info_init(&base.info, &name, SIGNATURE, > sampling_rate, channel_count, bits_per_sample, samples_per_frame); > > port_is_open = true; > options = 0; > } > > PlayPort::~PlayPort() > { > Close(); > > if (pool) { > pj_pool_release(pool); > pool = NULL; > } > } > > pj_status_t PlayPort::Open(SInt32 inCallIndex, float inVolume, > GetSamplesPtr inFunc) > { > pj_status_t status; > > status = pjsua_conf_add_port(pool, &base, &slot); > if (status != PJ_SUCCESS) { > pjmedia_port_destroy(&base); > return status; > } > > mCallIndex = inCallIndex; > > status = pjsua_conf_adjust_rx_level(slot, inVolume); > > port_func = inFunc; > return status; > } > > void PlayPort::Close(void) > { > file_on_destroy_get(&base); > } > > bool PlayPort::IsOpen(void) > { > return port_is_open && slot >= 0; > } > > pj_status_t PlayPort::ConnectTo(int inSlot) > { > return pjsua_conf_connect(slot, inSlot); > } > > pj_status_t PlayPort::DisconnectFrom(int inSlot) > { > return pjsua_conf_disconnect(slot, inSlot); > } > > // Class static > pj_status_t PlayPort::file_on_destroy_get(pjmedia_port *this_port) > { > // As the first element in a non-virtual class... > PlayPort *fport = (PlayPort *) this_port; > boost::recursive_mutex::scoped_lock l(fport->m); > > pj_assert(this_port->info.signature == SIGNATURE); > > if (fport->port_is_open) { > fport->port_is_open = false; // Prevents a recursive callback > > fport->port_func = NULL; > pjsua_conf_remove_port(fport->slot); // If it's already > removed, e.g. audio device changed, this crashes. > fport->slot = 0; > pjmedia_port_destroy(&fport->base); > } > > return PJ_SUCCESS; > } > > // Class static > pj_status_t PlayPort::file_get_frame_get(pjmedia_port *this_port, > pjmedia_frame *frame) > { > // As the first element in a non-virtual class... > PlayPort *fport = (PlayPort *) this_port; > > pj_assert(this_port->info.signature == SIGNATURE); > > if (frame->size == 0) return PJ_SUCCESS; > if (! fport->port_func) return PJ_EEOF; > > pj_size_t frame_size = frame->size; > if ((*fport->port_func)(frame->buf, &frame_size, > (PJSUA_Timestamp *) &frame->timestamp)) { > if (frame_size < frame->size) { > bzero((UInt8*)frame->buf + frame_size, frame->size - > frame_size); > } > frame->timestamp.u64 = 0; > frame->type = PJMEDIA_FRAME_TYPE_AUDIO; > return PJ_SUCCESS; > } > file_on_destroy_get(this_port); > return PJ_EEOF; > } > > // Class static > pj_status_t PlayPort::file_put_frame_get(pjmedia_port *this_port, > const pjmedia_frame *frame) > { > return PJ_EINVALIDOP; > } > > > Norman Franke > Answering Service for Directors, Inc. > www.myasd.com > > On Jan 9, 2009, at 1:27 PM, Rafael Maia wrote: > > > Thanks for your anwser Norman. > > You are using a very diferent approach from mine. Could you provide > some more information ( or some source code ) ? > > My DirectShow sound reading routines are pushing audio frames that i > need to send throw PJSIP. > > So i need to call put_frame on a media port. > How did you created this "Passive" port ? > > You also add it to the conference bridge, right ? > > Thanks in advance... > > Rafael Maia > > > > From: norman@myasd.com > To: pjsip@lists.pjsip.org > Date: Fri, 9 Jan 2009 12:17:19 -0500 > Subject: Re: [pjsip] Sending my own audio frames > > I use pjmedia_port_info_init to create a player port. Something like > this: > > pool = pjsua_pool_create("MyPlayerPool", 4000, 4000); > pj_strdup2(pool, &base.info.name, "MyPlayer"); > > base.get_frame = &file_get_frame_get; > base.put_frame = &file_put_frame_get; > base.on_destroy = &file_on_destroy_get; > > pjmedia_port_info_init(&base.info, &name, SIGNATURE, > sampling_rate, channel_count, bits_per_sample, samples_per_frame); > > > This works well for playing files in a non-standard format that I > need to support. You put your sample generation code in > file_get_frame_get. > > Norman Franke > Answering Service for Directors, Inc. > www.myasd.com > > On Jan 9, 2009, at 9:24 AM, Rafael Maia wrote: > > > Hi, > > i made a media player in DirectShow that captures PCM audio frames > from mp3 audio files. > > I need to send this audio frames to PJSIP. Can anyone help me? > > I have tried adding a passive_port to the conference bridge and it > did not worked. > > Now i am trying to use splitcomb. And i can send some noise. > > Here's a code sample: > > // 1º pjmedia_splitcom_create > pj_status_t status = pjmedia_splitcomb_create(pool_vars, > nSamplesPerSec, nChannels, samplesPerFrame, wBitsPerSample, 0, > &p_splitcomb); > // for each channel > for(unsigned int i = 0; i < nChannels; i++) { > unsigned int p_slot; > pjmedia_port* p_port; > > // 2º pjmedia_splitcom_create_rev_channel > status = pjmedia_splitcomb_create_rev_channel(pool_vars, > p_splitcomb, i, 0, &p_port); > > // 3º pjmedia_conf_add_port > status = pjmedia_conf_add_port(conference_bridge, pool_vars, > p_port, NULL, &p_slot); > } > > > And then, when i want to send an audio frame i do the following: > > pjmedia_port_put_frame(p_splitcomb, &frame); > > > > What is wrong with my code? > Am i using splitcom correctly? > > Any help would be appreciated... > > Rafael Maia > > > O jeito mais fácil de manter a sua lista de amigos sempre em ordem! > Organize seus contatos! > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > Notícias direto do New York Times, gols do Lance, videocassetadas e > muitos outros vídeos no MSN Videos! Confira já! > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > O jeito mais fácil de manter a sua lista de amigos sempre em ordem! > Organize seus contatos!_______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
RI
Rawshan Iajdani
Mon, Jan 12, 2009 9:47 PM

Opu,

You live Dhaka??

From: pjsip-bounces@lists.pjsip.org [mailto:pjsip-bounces@lists.pjsip.org]
On Behalf Of S. M. Nazmul Hasan (Opu)
Sent: Sunday, January 11, 2009 7:01 PM
To: pjsip list
Subject: Re: [pjsip] APS Implementation

I dont think APS implementation(G729) is so hard as you think. APS already
has G729 codec support that is if i use APS i must get the implementation of
g729 innerly . i just have to change the procedure to use g729 codec....like
some parameter and encoding decoding technique. ...

APS use 24byte data ...thats a point also...

On Sun, Jan 11, 2009 at 3:46 PM, Rawshan Iajdani iajdani@provati.com
wrote:

I don't think you can with this current wrapper.

So far I understood, the current wrapper just take PCM and convert that to
g.711 and pass it to APS and vice versa. You still need your own g.729
implementation. This wrapper just take PCM as input and output..

Correct me if I were wrong..

From: pjsip-bounces@lists.pjsip.org [mailto:pjsip-bounces@lists.pjsip.org]
On Behalf Of S. M. Nazmul Hasan (Opu)
Sent: Sunday, January 11, 2009 3:36 PM

To: pjsip list
Subject: Re: [pjsip] APS Implementation

Hi Pai,

Can you please tell me if i want to g729 from Aps what should i need to do?

in the line of encoder mode

iSession.SetEncoderMode(EALawOr20ms);

is for g711 but i saw no encoding mode for g729 . should i block those line
if i want to use g729?

Thanks

On Sat, Jan 10, 2009 at 12:19 AM, Pai Peng sipaipv6@gmail.com wrote:

Hi,

in source symbian_sound_aps.cpp:

void CPjAudioEngine::RecCb(TAPSCommBuffer &buffer)
{
...
buf[i] = pjmedia_alaw2linear(iBuffer[i]);
...
}

TInt CPjAudioEngine::StartStreamL()
{
....
iSession.SetEncoderMode(EALawOr20ms);
iSession.SetDecoderMode(EALawOr20ms);
...
}

audio is in G711-A Format.

The  APS supports the following codecs: AMR, G711, G729 and iLBC.

If you like use other codec for encoding or decoding, you should change the
SetEncoderMode() and SetDecoderMode().

Pai

On Fri, Jan 9, 2009 at 5:54 PM, Rawshan Iajdani iajdani@provati.com wrote:

How does APS implementation works in Symbian_ua?

Does g711,gsm,speex all works fine?

APS->G711->PCM->gsm

Or

APS->gsm??

Does it do the transcoding or it just only works for g711 and not gsm and
speex?

thanks


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--
S. M. Nazmul Hasan Opu
Software Engineer
R & D Application
Dhaka, Bangladesh
Mob: +880 1712 901 764


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--
S. M. Nazmul Hasan Opu
Software Engineer
R & D Application
Dhaka, Bangladesh
Mob: +880 1712 901 764

Opu, You live Dhaka?? From: pjsip-bounces@lists.pjsip.org [mailto:pjsip-bounces@lists.pjsip.org] On Behalf Of S. M. Nazmul Hasan (Opu) Sent: Sunday, January 11, 2009 7:01 PM To: pjsip list Subject: Re: [pjsip] APS Implementation I dont think APS implementation(G729) is so hard as you think. APS already has G729 codec support that is if i use APS i must get the implementation of g729 innerly . i just have to change the procedure to use g729 codec....like some parameter and encoding decoding technique. ... APS use 24byte data ...thats a point also... On Sun, Jan 11, 2009 at 3:46 PM, Rawshan Iajdani <iajdani@provati.com> wrote: I don't think you can with this current wrapper. So far I understood, the current wrapper just take PCM and convert that to g.711 and pass it to APS and vice versa. You still need your own g.729 implementation. This wrapper just take PCM as input and output.. Correct me if I were wrong.. From: pjsip-bounces@lists.pjsip.org [mailto:pjsip-bounces@lists.pjsip.org] On Behalf Of S. M. Nazmul Hasan (Opu) Sent: Sunday, January 11, 2009 3:36 PM To: pjsip list Subject: Re: [pjsip] APS Implementation Hi Pai, Can you please tell me if i want to g729 from Aps what should i need to do? in the line of encoder mode iSession.SetEncoderMode(EALawOr20ms); is for g711 but i saw no encoding mode for g729 . should i block those line if i want to use g729? Thanks On Sat, Jan 10, 2009 at 12:19 AM, Pai Peng <sipaipv6@gmail.com> wrote: Hi, in source symbian_sound_aps.cpp: void CPjAudioEngine::RecCb(TAPSCommBuffer &buffer) { ... buf[i] = pjmedia_alaw2linear(iBuffer[i]); ... } TInt CPjAudioEngine::StartStreamL() { .... iSession.SetEncoderMode(EALawOr20ms); iSession.SetDecoderMode(EALawOr20ms); ... } audio is in G711-A Format. The APS supports the following codecs: AMR, G711, G729 and iLBC. If you like use other codec for encoding or decoding, you should change the SetEncoderMode() and SetDecoderMode(). Pai On Fri, Jan 9, 2009 at 5:54 PM, Rawshan Iajdani <iajdani@provati.com> wrote: How does APS implementation works in Symbian_ua? Does g711,gsm,speex all works fine? APS->G711->PCM->gsm Or APS->gsm?? Does it do the transcoding or it just only works for g711 and not gsm and speex? thanks _______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org _______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org -- S. M. Nazmul Hasan Opu Software Engineer R & D Application Dhaka, Bangladesh Mob: +880 1712 901 764 _______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org -- S. M. Nazmul Hasan Opu Software Engineer R & D Application Dhaka, Bangladesh Mob: +880 1712 901 764
SM
S. M. Nazmul Hasan (Opu)
Tue, Jan 13, 2009 9:20 AM

yaap..

On Tue, Jan 13, 2009 at 3:47 AM, Rawshan Iajdani iajdani@provati.comwrote:

Opu,

You live Dhaka??

From: pjsip-bounces@lists.pjsip.org [mailto:
pjsip-bounces@lists.pjsip.org] *On Behalf Of *S. M. Nazmul Hasan (Opu)
Sent: Sunday, January 11, 2009 7:01 PM

To: pjsip list
Subject: Re: [pjsip] APS Implementation

I dont think APS implementation(G729) is so hard as you think. APS already
has G729 codec support that is if i use APS i must get the implementation of
g729 innerly . i just have to change the procedure to use g729 codec....like
some parameter and encoding decoding technique. ...

APS use 24byte data ...thats a point also...

On Sun, Jan 11, 2009 at 3:46 PM, Rawshan Iajdani iajdani@provati.com
wrote:

I don't think you can with this current wrapper.

So far I understood, the current wrapper just take PCM and convert that to
g.711 and pass it to APS and vice versa. You still need your own g.729
implementation. This wrapper just take PCM as input and output..

Correct me if I were wrong..

From: pjsip-bounces@lists.pjsip.org [mailto:
pjsip-bounces@lists.pjsip.org] *On Behalf Of *S. M. Nazmul Hasan (Opu)
Sent: Sunday, January 11, 2009 3:36 PM

To: pjsip list
Subject: Re: [pjsip] APS Implementation

Hi Pai,

Can you please tell me if i want to g729 from Aps what should i need to do?

in the line of encoder mode

iSession.SetEncoderMode(EALawOr20ms);

is for g711 but i saw no encoding mode for g729 . should i block those line
if i want to use g729?

Thanks

On Sat, Jan 10, 2009 at 12:19 AM, Pai Peng sipaipv6@gmail.com wrote:

Hi,

in source symbian_sound_aps.cpp:

void CPjAudioEngine::RecCb(TAPSCommBuffer &buffer)
{
...
buf[i] = pjmedia_alaw2linear(iBuffer[i]);
...
}

TInt CPjAudioEngine::StartStreamL()
{
....
iSession.SetEncoderMode(EALawOr20ms);
iSession.SetDecoderMode(EALawOr20ms);
...
}

audio is in G711-A Format.

The  APS supports the following codecs: AMR, G711, G729 and iLBC.

If you like use other codec for encoding or decoding, you should change the
SetEncoderMode() and SetDecoderMode().

Pai

On Fri, Jan 9, 2009 at 5:54 PM, Rawshan Iajdani iajdani@provati.com
wrote:

How does APS implementation works in Symbian_ua?

Does g711,gsm,speex all works fine?

APS->G711->PCM->gsm

Or

APS->gsm??

Does it do the transcoding or it just only works for g711 and not gsm and
speex?

thanks


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--
S. M. Nazmul Hasan Opu
Software Engineer
R & D Application
Dhaka, Bangladesh
Mob: +880 1712 901 764


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--
S. M. Nazmul Hasan Opu
Software Engineer
R & D Application
Dhaka, Bangladesh
Mob: +880 1712 901 764


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--
S. M. Nazmul Hasan Opu
Software Engineer
R & D Application
Dhaka, Bangladesh
Mob: +880 1712 901 764

yaap.. On Tue, Jan 13, 2009 at 3:47 AM, Rawshan Iajdani <iajdani@provati.com>wrote: > Opu, > > You live Dhaka?? > > > > > > > > *From:* pjsip-bounces@lists.pjsip.org [mailto: > pjsip-bounces@lists.pjsip.org] *On Behalf Of *S. M. Nazmul Hasan (Opu) > *Sent:* Sunday, January 11, 2009 7:01 PM > > *To:* pjsip list > *Subject:* Re: [pjsip] APS Implementation > > > > I dont think APS implementation(G729) is so hard as you think. APS already > has G729 codec support that is if i use APS i must get the implementation of > g729 innerly . i just have to change the procedure to use g729 codec....like > some parameter and encoding decoding technique. ... > > APS use 24byte data ...thats a point also... > > On Sun, Jan 11, 2009 at 3:46 PM, Rawshan Iajdani <iajdani@provati.com> > wrote: > > I don't think you can with this current wrapper. > > So far I understood, the current wrapper just take PCM and convert that to > g.711 and pass it to APS and vice versa. You still need your own g.729 > implementation. This wrapper just take PCM as input and output.. > > > > Correct me if I were wrong.. > > > > > > > > *From:* pjsip-bounces@lists.pjsip.org [mailto: > pjsip-bounces@lists.pjsip.org] *On Behalf Of *S. M. Nazmul Hasan (Opu) > *Sent:* Sunday, January 11, 2009 3:36 PM > > > *To:* pjsip list > *Subject:* Re: [pjsip] APS Implementation > > > > Hi Pai, > > > > Can you please tell me if i want to g729 from Aps what should i need to do? > > in the line of encoder mode > > iSession.SetEncoderMode(EALawOr20ms); > > is for g711 but i saw no encoding mode for g729 . should i block those line > if i want to use g729? > > Thanks > > On Sat, Jan 10, 2009 at 12:19 AM, Pai Peng <sipaipv6@gmail.com> wrote: > > Hi, > > > in source symbian_sound_aps.cpp: > > void CPjAudioEngine::RecCb(TAPSCommBuffer &buffer) > { > ... > buf[i] = pjmedia_alaw2linear(iBuffer[i]); > ... > } > > TInt CPjAudioEngine::StartStreamL() > { > .... > iSession.SetEncoderMode(EALawOr20ms); > iSession.SetDecoderMode(EALawOr20ms); > ... > } > > audio is in G711-A Format. > > > The APS supports the following codecs: AMR, G711, G729 and iLBC. > > If you like use other codec for encoding or decoding, you should change the > SetEncoderMode() and SetDecoderMode(). > > > Pai > > On Fri, Jan 9, 2009 at 5:54 PM, Rawshan Iajdani <iajdani@provati.com> > wrote: > > How does APS implementation works in Symbian_ua? > > Does g711,gsm,speex all works fine? > > > > APS->G711->PCM->gsm > > Or > > APS->gsm?? > > > > Does it do the transcoding or it just only works for g711 and not gsm and > speex? > > > > thanks > > > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > > -- > S. M. Nazmul Hasan Opu > Software Engineer > R & D Application > Dhaka, Bangladesh > Mob: +880 1712 901 764 > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > > -- > S. M. Nazmul Hasan Opu > Software Engineer > R & D Application > Dhaka, Bangladesh > Mob: +880 1712 901 764 > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > -- S. M. Nazmul Hasan Opu Software Engineer R & D Application Dhaka, Bangladesh Mob: +880 1712 901 764
RI
Rawshan Iajdani
Tue, Jan 13, 2009 9:49 AM

Great. I am currently in Dhaka. Which operator are you using to connect to
your server? Grameen or Banglalink?

Seems like both of them not working for me. They are using some sort of 10
series IP and I detect NAT? Did you face this?

From: pjsip-bounces@lists.pjsip.org [mailto:pjsip-bounces@lists.pjsip.org]
On Behalf Of S. M. Nazmul Hasan (Opu)
Sent: Tuesday, January 13, 2009 3:21 PM
To: pjsip list
Subject: Re: [pjsip] APS Implementation

yaap..

On Tue, Jan 13, 2009 at 3:47 AM, Rawshan Iajdani iajdani@provati.com
wrote:

Opu,

You live Dhaka??

From: pjsip-bounces@lists.pjsip.org [mailto:pjsip-bounces@lists.pjsip.org]
On Behalf Of S. M. Nazmul Hasan (Opu)
Sent: Sunday, January 11, 2009 7:01 PM

To: pjsip list
Subject: Re: [pjsip] APS Implementation

I dont think APS implementation(G729) is so hard as you think. APS already
has G729 codec support that is if i use APS i must get the implementation of
g729 innerly . i just have to change the procedure to use g729 codec....like
some parameter and encoding decoding technique. ...

APS use 24byte data ...thats a point also...

On Sun, Jan 11, 2009 at 3:46 PM, Rawshan Iajdani iajdani@provati.com
wrote:

I don't think you can with this current wrapper.

So far I understood, the current wrapper just take PCM and convert that to
g.711 and pass it to APS and vice versa. You still need your own g.729
implementation. This wrapper just take PCM as input and output..

Correct me if I were wrong..

From: pjsip-bounces@lists.pjsip.org [mailto:pjsip-bounces@lists.pjsip.org]
On Behalf Of S. M. Nazmul Hasan (Opu)
Sent: Sunday, January 11, 2009 3:36 PM

To: pjsip list
Subject: Re: [pjsip] APS Implementation

Hi Pai,

Can you please tell me if i want to g729 from Aps what should i need to do?

in the line of encoder mode

iSession.SetEncoderMode(EALawOr20ms);

is for g711 but i saw no encoding mode for g729 . should i block those line
if i want to use g729?

Thanks

On Sat, Jan 10, 2009 at 12:19 AM, Pai Peng sipaipv6@gmail.com wrote:

Hi,

in source symbian_sound_aps.cpp:

void CPjAudioEngine::RecCb(TAPSCommBuffer &buffer)
{
...
buf[i] = pjmedia_alaw2linear(iBuffer[i]);
...
}

TInt CPjAudioEngine::StartStreamL()
{
....
iSession.SetEncoderMode(EALawOr20ms);
iSession.SetDecoderMode(EALawOr20ms);
...
}

audio is in G711-A Format.

The  APS supports the following codecs: AMR, G711, G729 and iLBC.

If you like use other codec for encoding or decoding, you should change the
SetEncoderMode() and SetDecoderMode().

Pai

On Fri, Jan 9, 2009 at 5:54 PM, Rawshan Iajdani iajdani@provati.com wrote:

How does APS implementation works in Symbian_ua?

Does g711,gsm,speex all works fine?

APS->G711->PCM->gsm

Or

APS->gsm??

Does it do the transcoding or it just only works for g711 and not gsm and
speex?

thanks


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--
S. M. Nazmul Hasan Opu
Software Engineer
R & D Application
Dhaka, Bangladesh
Mob: +880 1712 901 764


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--
S. M. Nazmul Hasan Opu
Software Engineer
R & D Application
Dhaka, Bangladesh
Mob: +880 1712 901 764


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--
S. M. Nazmul Hasan Opu
Software Engineer
R & D Application
Dhaka, Bangladesh
Mob: +880 1712 901 764

Great. I am currently in Dhaka. Which operator are you using to connect to your server? Grameen or Banglalink? Seems like both of them not working for me. They are using some sort of 10 series IP and I detect NAT? Did you face this? From: pjsip-bounces@lists.pjsip.org [mailto:pjsip-bounces@lists.pjsip.org] On Behalf Of S. M. Nazmul Hasan (Opu) Sent: Tuesday, January 13, 2009 3:21 PM To: pjsip list Subject: Re: [pjsip] APS Implementation yaap.. On Tue, Jan 13, 2009 at 3:47 AM, Rawshan Iajdani <iajdani@provati.com> wrote: Opu, You live Dhaka?? From: pjsip-bounces@lists.pjsip.org [mailto:pjsip-bounces@lists.pjsip.org] On Behalf Of S. M. Nazmul Hasan (Opu) Sent: Sunday, January 11, 2009 7:01 PM To: pjsip list Subject: Re: [pjsip] APS Implementation I dont think APS implementation(G729) is so hard as you think. APS already has G729 codec support that is if i use APS i must get the implementation of g729 innerly . i just have to change the procedure to use g729 codec....like some parameter and encoding decoding technique. ... APS use 24byte data ...thats a point also... On Sun, Jan 11, 2009 at 3:46 PM, Rawshan Iajdani <iajdani@provati.com> wrote: I don't think you can with this current wrapper. So far I understood, the current wrapper just take PCM and convert that to g.711 and pass it to APS and vice versa. You still need your own g.729 implementation. This wrapper just take PCM as input and output.. Correct me if I were wrong.. From: pjsip-bounces@lists.pjsip.org [mailto:pjsip-bounces@lists.pjsip.org] On Behalf Of S. M. Nazmul Hasan (Opu) Sent: Sunday, January 11, 2009 3:36 PM To: pjsip list Subject: Re: [pjsip] APS Implementation Hi Pai, Can you please tell me if i want to g729 from Aps what should i need to do? in the line of encoder mode iSession.SetEncoderMode(EALawOr20ms); is for g711 but i saw no encoding mode for g729 . should i block those line if i want to use g729? Thanks On Sat, Jan 10, 2009 at 12:19 AM, Pai Peng <sipaipv6@gmail.com> wrote: Hi, in source symbian_sound_aps.cpp: void CPjAudioEngine::RecCb(TAPSCommBuffer &buffer) { ... buf[i] = pjmedia_alaw2linear(iBuffer[i]); ... } TInt CPjAudioEngine::StartStreamL() { .... iSession.SetEncoderMode(EALawOr20ms); iSession.SetDecoderMode(EALawOr20ms); ... } audio is in G711-A Format. The APS supports the following codecs: AMR, G711, G729 and iLBC. If you like use other codec for encoding or decoding, you should change the SetEncoderMode() and SetDecoderMode(). Pai On Fri, Jan 9, 2009 at 5:54 PM, Rawshan Iajdani <iajdani@provati.com> wrote: How does APS implementation works in Symbian_ua? Does g711,gsm,speex all works fine? APS->G711->PCM->gsm Or APS->gsm?? Does it do the transcoding or it just only works for g711 and not gsm and speex? thanks _______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org _______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org -- S. M. Nazmul Hasan Opu Software Engineer R & D Application Dhaka, Bangladesh Mob: +880 1712 901 764 _______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org -- S. M. Nazmul Hasan Opu Software Engineer R & D Application Dhaka, Bangladesh Mob: +880 1712 901 764 _______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org -- S. M. Nazmul Hasan Opu Software Engineer R & D Application Dhaka, Bangladesh Mob: +880 1712 901 764
RM
Rafael Maia
Tue, Jan 13, 2009 11:20 AM

It is finaly working. Thanks alot Norman for your help.

To anyone who is interested in sending PCM audio frames colected outside of pjsip:

// Create a pjmedia_port
pjmedia_port port;

// init it's info
pjmedia_port_info_init(&port.info, &name, signature, samplingRate, channelCount, bitsPerSample, samplesPerFrame);

// Set it's callback functions
port.get_frame = &get_frame;
port.put_frame = &put_frame;
port.on_destroy = &on_destroy;

// Add port to conference bridge
pjmedia_conf_add_port(conference_bridge, pool_vars, &port, NULL, &slot);

// Connect the port to the call's conference slot
pjmedia_conf_connect_port(SIPEngine::instance->conference_bridge, slot, call_port, 0);

// Implement the get_frame...the method called by pjsip to get new audio frames to send
pj_status_t get_frame(struct pjmedia_port* this_port, pjmedia_frame* frame) {

 .... code to get an audio frame to be sent

 return PJ_SUCCESS;

}

// The put_frame method is a simple one...because we only send frames
pj_status_t put_frame(struct pjmedia_port* this_port, const pjmedia_frame* frame) {
return PJ_EINVALIDOP;
}
// The on_destroy has to have the following lines of code
pj_status_t on_destroy(struct pjmedia_port* this_port) {

 ....

 pjmedia_conf_remove_port(conference_bridge, slot);

 ...

 pjmedia_port_destroy(port);

 ...

 return PJ_SUCCESS;

}

I hope this helps anyone who add the same problems has i did...

Rafael Maia

From: norman@myasd.comTo: pjsip@lists.pjsip.orgDate: Mon, 12 Jan 2009 16:09:50 -0500Subject: Re: [pjsip] Sending my own audio framesYou need to connect it to the port associated with the active call as well. PJ is very flexible with audio routing, so you need to explicitly connect up everything that should "hear" your source. Your player should connect to the user's speakers and the call or calls in progress.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Jan 12, 2009, at 2:15 PM, Rafael Maia wrote:

Thanks alot for your source code Norman, it has been a big boost to my code development...  I am having a diferent problem now.I can ear the sound frames i added on my sound speakers, but i am not sending them in the RTP session.I did the following: pjmedia_conf_add_port(conference_bridge, pool_vars, &port, NULL, &slot);pjmedia_conf_connect_port(conference_bridge, slot, inSlot, 0);  I have tested putting frames on the master_port directly, and the saound frames are sent throw RTP: pjmedia_port* master = pjmedia_conf_get_master_port(conference_bridge);pjmedia_port_put_frame(master, &frame);  ...but i don't think this is the proper way to do it Can anyone help?How should i send the audio frames? Thanks in advance for any help....  Rafael Maia

From: norman@myasd.comTo: pjsip@lists.pjsip.orgDate: Fri, 9 Jan 2009 18:48:10 -0500Subject: Re: [pjsip] Sending my own audio framesYou can use pjmedia_splitcomb_create_rev_channel to reverse the put/get semantics. I do that elsewhere and it works.

I did then add it to the conference bridge.

Sadly, my code isn't easy to extract and is very C++ using boost and a custom string library.

typedef bool (*GetSamplesPtr)(void * inBuf, uint32_t * ioByteSize, pj_timestamp * inTime);

PlayPort::PlayPort(
unsigned sampling_rate,
unsigned channel_count,
unsigned samples_per_frame,
unsigned bits_per_sample
)
: pool(NULL), mCallIndex(INVALID_CALL_INDEX)
{
const pj_str_t name = pj_str("file");

pool = pjsua_pool_create("asd_player", 4000, 4000);
assert(pool);

pj_strdup2(pool, &base.info.name, "asd_player");

base.get_frame = &file_get_frame_get;
base.put_frame = &file_put_frame_get;
base.on_destroy = &file_on_destroy_get;

pjmedia_port_info_init(&base.info, &name, SIGNATURE, sampling_rate, channel_count, bits_per_sample, samples_per_frame);

port_is_open = true;
options = 0;

}

PlayPort::~PlayPort()
{
Close();

if (pool) {
    pj_pool_release(pool);
    pool = NULL;
}

}

pj_status_t PlayPort::Open(SInt32 inCallIndex, float inVolume, GetSamplesPtr inFunc)
{
pj_status_t status;

status = pjsua_conf_add_port(pool, &base, &slot);
if (status != PJ_SUCCESS) {
    pjmedia_port_destroy(&base);
    return status;
}

mCallIndex = inCallIndex;

status = pjsua_conf_adjust_rx_level(slot, inVolume);

port_func = inFunc;

return status;

}

void PlayPort::Close(void)
{
file_on_destroy_get(&base);
}

bool PlayPort::IsOpen(void)
{
return port_is_open && slot >= 0;
}

pj_status_t PlayPort::ConnectTo(int inSlot)
{
return pjsua_conf_connect(slot, inSlot);
}

pj_status_t PlayPort::DisconnectFrom(int inSlot)
{
return pjsua_conf_disconnect(slot, inSlot);
}

// Class static
pj_status_t PlayPort::file_on_destroy_get(pjmedia_port *this_port)
{
// As the first element in a non-virtual class...
PlayPort *fport = (PlayPort *) this_port;
boost::recursive_mutex::scoped_lock l(fport->m);

pj_assert(this_port->info.signature == SIGNATURE);

if (fport->port_is_open) {
 fport->port_is_open = false; // Prevents a recursive callback

    fport->port_func = NULL;
    pjsua_conf_remove_port(fport->slot); // If it's already removed, e.g. audio device changed, this crashes. 
    fport->slot = 0;
    pjmedia_port_destroy(&fport->base);
}

return PJ_SUCCESS;

}

// Class static
pj_status_t PlayPort::file_get_frame_get(pjmedia_port *this_port, pjmedia_frame *frame)
{
// As the first element in a non-virtual class...
PlayPort *fport = (PlayPort *) this_port;

pj_assert(this_port->info.signature == SIGNATURE);

if (frame->size == 0) return PJ_SUCCESS;
if (! fport->port_func) return PJ_EEOF;

pj_size_t frame_size = frame->size;
if ((*fport->port_func)(frame->buf, &frame_size, (PJSUA_Timestamp *) &frame->timestamp)) {
    if (frame_size < frame->size) {
        bzero((UInt8*)frame->buf + frame_size, frame->size - frame_size);
    }
    frame->timestamp.u64 = 0;
    frame->type = PJMEDIA_FRAME_TYPE_AUDIO;
    return PJ_SUCCESS;
}
file_on_destroy_get(this_port);
return PJ_EEOF;

}

// Class static
pj_status_t PlayPort::file_put_frame_get(pjmedia_port *this_port, const pjmedia_frame *frame)
{
return PJ_EINVALIDOP;
}

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Jan 9, 2009, at 1:27 PM, Rafael Maia wrote:

Thanks for your anwser Norman. You are using a very diferent approach from mine. Could you provide some more information ( or some source code ) ? My DirectShow sound reading routines are pushing audio frames that i need to send throw PJSIP. So i need to call put_frame on a media port.How did you created this "Passive" port ? You also add it to the conference bridge, right ? Thanks in advance... Rafael Maia

From: norman@myasd.comTo: pjsip@lists.pjsip.orgDate: Fri, 9 Jan 2009 12:17:19 -0500Subject: Re: [pjsip] Sending my own audio framesI use pjmedia_port_info_init to create a player port. Something like this:

pool = pjsua_pool_create("MyPlayerPool", 4000, 4000);
pj_strdup2(pool, &base.info.name, "MyPlayer");

base.get_frame = &file_get_frame_get;
base.put_frame = &file_put_frame_get;
base.on_destroy = &file_on_destroy_get;

pjmedia_port_info_init(&base.info, &name, SIGNATURE, sampling_rate, channel_count, bits_per_sample, samples_per_frame);

This works well for playing files in a non-standard format that I need to support. You put your sample generation code in file_get_frame_get.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com

On Jan 9, 2009, at 9:24 AM, Rafael Maia wrote:

Hi, i made a media player in DirectShow that captures PCM audio frames from mp3 audio files. I need to send this audio frames to PJSIP. Can anyone help me? I have tried adding a passive_port to the conference bridge and it did not worked. Now i am trying to use splitcomb. And i can send some noise. Here's a code sample: // 1º pjmedia_splitcom_createpj_status_t status = pjmedia_splitcomb_create(pool_vars, nSamplesPerSec, nChannels, samplesPerFrame, wBitsPerSample, 0, &p_splitcomb);// for each channelfor(unsigned int i = 0; i < nChannels; i++)  {    unsigned int p_slot;    pjmedia_port* p_port;      // 2º pjmedia_splitcom_create_rev_channel    status = pjmedia_splitcomb_create_rev_channel(pool_vars, p_splitcomb, i, 0, &p_port);      // 3º pjmedia_conf_add_port    status = pjmedia_conf_add_port(conference_bridge, pool_vars, p_port, NULL, &p_slot);}  And then, when i want to send an audio frame i do the following: pjmedia_port_put_frame(p_splitcomb, &frame);  What is wrong with my code?Am i using splitcom correctly? Any help would be appreciated... Rafael Maia

O jeito mais fácil de manter a sua lista de amigos sempre em ordem! Organize seus contatos!_______________________________________________Visit our blog: http://blog.pjsip.orgpjsip mailing listpjsip@lists.pjsip.orghttp://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

Notícias direto do New York Times, gols do Lance, videocassetadas e muitos outros vídeos no MSN Videos! Confira já! _______________________________________________Visit our blog: http://blog.pjsip.orgpjsip mailing listpjsip@lists.pjsip.orghttp://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

O jeito mais fácil de manter a sua lista de amigos sempre em ordem! Organize seus contatos!_______________________________________________Visit our blog: http://blog.pjsip.orgpjsip mailing listpjsip@lists.pjsip.orghttp://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


Mais do que emails! Confira tudo o que Windows Live™ pode oferecer.
http://www.microsoft.com/windows/windowslive/

It is finaly working. Thanks alot Norman for your help. To anyone who is interested in sending PCM audio frames colected outside of pjsip: // Create a pjmedia_port pjmedia_port port; // init it's info pjmedia_port_info_init(&port.info, &name, signature, samplingRate, channelCount, bitsPerSample, samplesPerFrame); // Set it's callback functions port.get_frame = &get_frame; port.put_frame = &put_frame; port.on_destroy = &on_destroy; // Add port to conference bridge pjmedia_conf_add_port(conference_bridge, pool_vars, &port, NULL, &slot); // Connect the port to the call's conference slot pjmedia_conf_connect_port(SIPEngine::instance->conference_bridge, slot, call_port, 0); // Implement the get_frame...the method called by pjsip to get new audio frames to send pj_status_t get_frame(struct pjmedia_port* this_port, pjmedia_frame* frame) { .... code to get an audio frame to be sent return PJ_SUCCESS; } // The put_frame method is a simple one...because we only send frames pj_status_t put_frame(struct pjmedia_port* this_port, const pjmedia_frame* frame) { return PJ_EINVALIDOP; } // The on_destroy has to have the following lines of code pj_status_t on_destroy(struct pjmedia_port* this_port) { .... pjmedia_conf_remove_port(conference_bridge, slot); ... pjmedia_port_destroy(port); ... return PJ_SUCCESS; } I hope this helps anyone who add the same problems has i did... Rafael Maia From: norman@myasd.comTo: pjsip@lists.pjsip.orgDate: Mon, 12 Jan 2009 16:09:50 -0500Subject: Re: [pjsip] Sending my own audio framesYou need to connect it to the port associated with the active call as well. PJ is very flexible with audio routing, so you need to explicitly connect up everything that should "hear" your source. Your player should connect to the user's speakers and the call or calls in progress. Norman Franke Answering Service for Directors, Inc. www.myasd.com On Jan 12, 2009, at 2:15 PM, Rafael Maia wrote: Thanks alot for your source code Norman, it has been a big boost to my code development... I am having a diferent problem now.I can ear the sound frames i added on my sound speakers, but i am not sending them in the RTP session.I did the following: pjmedia_conf_add_port(conference_bridge, pool_vars, &port, NULL, &slot);pjmedia_conf_connect_port(conference_bridge, slot, inSlot, 0); I have tested putting frames on the master_port directly, and the saound frames are sent throw RTP: pjmedia_port* master = pjmedia_conf_get_master_port(conference_bridge);pjmedia_port_put_frame(master, &frame); ...but i don't think this is the proper way to do it Can anyone help?How should i send the audio frames? Thanks in advance for any help.... Rafael Maia From: norman@myasd.comTo: pjsip@lists.pjsip.orgDate: Fri, 9 Jan 2009 18:48:10 -0500Subject: Re: [pjsip] Sending my own audio framesYou can use pjmedia_splitcomb_create_rev_channel to reverse the put/get semantics. I do that elsewhere and it works. I did then add it to the conference bridge. Sadly, my code isn't easy to extract and is very C++ using boost and a custom string library. typedef bool (*GetSamplesPtr)(void * inBuf, uint32_t * ioByteSize, pj_timestamp * inTime); PlayPort::PlayPort( unsigned sampling_rate, unsigned channel_count, unsigned samples_per_frame, unsigned bits_per_sample ) : pool(NULL), mCallIndex(INVALID_CALL_INDEX) { const pj_str_t name = pj_str("file"); pool = pjsua_pool_create("asd_player", 4000, 4000); assert(pool); pj_strdup2(pool, &base.info.name, "asd_player"); base.get_frame = &file_get_frame_get; base.put_frame = &file_put_frame_get; base.on_destroy = &file_on_destroy_get; pjmedia_port_info_init(&base.info, &name, SIGNATURE, sampling_rate, channel_count, bits_per_sample, samples_per_frame); port_is_open = true; options = 0; } PlayPort::~PlayPort() { Close(); if (pool) { pj_pool_release(pool); pool = NULL; } } pj_status_t PlayPort::Open(SInt32 inCallIndex, float inVolume, GetSamplesPtr inFunc) { pj_status_t status; status = pjsua_conf_add_port(pool, &base, &slot); if (status != PJ_SUCCESS) { pjmedia_port_destroy(&base); return status; } mCallIndex = inCallIndex; status = pjsua_conf_adjust_rx_level(slot, inVolume); port_func = inFunc; return status; } void PlayPort::Close(void) { file_on_destroy_get(&base); } bool PlayPort::IsOpen(void) { return port_is_open && slot >= 0; } pj_status_t PlayPort::ConnectTo(int inSlot) { return pjsua_conf_connect(slot, inSlot); } pj_status_t PlayPort::DisconnectFrom(int inSlot) { return pjsua_conf_disconnect(slot, inSlot); } // Class static pj_status_t PlayPort::file_on_destroy_get(pjmedia_port *this_port) { // As the first element in a non-virtual class... PlayPort *fport = (PlayPort *) this_port; boost::recursive_mutex::scoped_lock l(fport->m); pj_assert(this_port->info.signature == SIGNATURE); if (fport->port_is_open) { fport->port_is_open = false; // Prevents a recursive callback fport->port_func = NULL; pjsua_conf_remove_port(fport->slot); // If it's already removed, e.g. audio device changed, this crashes. fport->slot = 0; pjmedia_port_destroy(&fport->base); } return PJ_SUCCESS; } // Class static pj_status_t PlayPort::file_get_frame_get(pjmedia_port *this_port, pjmedia_frame *frame) { // As the first element in a non-virtual class... PlayPort *fport = (PlayPort *) this_port; pj_assert(this_port->info.signature == SIGNATURE); if (frame->size == 0) return PJ_SUCCESS; if (! fport->port_func) return PJ_EEOF; pj_size_t frame_size = frame->size; if ((*fport->port_func)(frame->buf, &frame_size, (PJSUA_Timestamp *) &frame->timestamp)) { if (frame_size < frame->size) { bzero((UInt8*)frame->buf + frame_size, frame->size - frame_size); } frame->timestamp.u64 = 0; frame->type = PJMEDIA_FRAME_TYPE_AUDIO; return PJ_SUCCESS; } file_on_destroy_get(this_port); return PJ_EEOF; } // Class static pj_status_t PlayPort::file_put_frame_get(pjmedia_port *this_port, const pjmedia_frame *frame) { return PJ_EINVALIDOP; } Norman Franke Answering Service for Directors, Inc. www.myasd.com On Jan 9, 2009, at 1:27 PM, Rafael Maia wrote: Thanks for your anwser Norman. You are using a very diferent approach from mine. Could you provide some more information ( or some source code ) ? My DirectShow sound reading routines are pushing audio frames that i need to send throw PJSIP. So i need to call put_frame on a media port.How did you created this "Passive" port ? You also add it to the conference bridge, right ? Thanks in advance... Rafael Maia From: norman@myasd.comTo: pjsip@lists.pjsip.orgDate: Fri, 9 Jan 2009 12:17:19 -0500Subject: Re: [pjsip] Sending my own audio framesI use pjmedia_port_info_init to create a player port. Something like this: pool = pjsua_pool_create("MyPlayerPool", 4000, 4000); pj_strdup2(pool, &base.info.name, "MyPlayer"); base.get_frame = &file_get_frame_get; base.put_frame = &file_put_frame_get; base.on_destroy = &file_on_destroy_get; pjmedia_port_info_init(&base.info, &name, SIGNATURE, sampling_rate, channel_count, bits_per_sample, samples_per_frame); This works well for playing files in a non-standard format that I need to support. You put your sample generation code in file_get_frame_get. Norman Franke Answering Service for Directors, Inc. www.myasd.com On Jan 9, 2009, at 9:24 AM, Rafael Maia wrote: Hi, i made a media player in DirectShow that captures PCM audio frames from mp3 audio files. I need to send this audio frames to PJSIP. Can anyone help me? I have tried adding a passive_port to the conference bridge and it did not worked. Now i am trying to use splitcomb. And i can send some noise. Here's a code sample: // 1º pjmedia_splitcom_createpj_status_t status = pjmedia_splitcomb_create(pool_vars, nSamplesPerSec, nChannels, samplesPerFrame, wBitsPerSample, 0, &p_splitcomb);// for each channelfor(unsigned int i = 0; i < nChannels; i++) { unsigned int p_slot; pjmedia_port* p_port; // 2º pjmedia_splitcom_create_rev_channel status = pjmedia_splitcomb_create_rev_channel(pool_vars, p_splitcomb, i, 0, &p_port); // 3º pjmedia_conf_add_port status = pjmedia_conf_add_port(conference_bridge, pool_vars, p_port, NULL, &p_slot);} And then, when i want to send an audio frame i do the following: pjmedia_port_put_frame(p_splitcomb, &frame); What is wrong with my code?Am i using splitcom correctly? Any help would be appreciated... Rafael Maia O jeito mais fácil de manter a sua lista de amigos sempre em ordem! Organize seus contatos!_______________________________________________Visit our blog: http://blog.pjsip.orgpjsip mailing listpjsip@lists.pjsip.orghttp://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org Notícias direto do New York Times, gols do Lance, videocassetadas e muitos outros vídeos no MSN Videos! Confira já! _______________________________________________Visit our blog: http://blog.pjsip.orgpjsip mailing listpjsip@lists.pjsip.orghttp://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org O jeito mais fácil de manter a sua lista de amigos sempre em ordem! Organize seus contatos!_______________________________________________Visit our blog: http://blog.pjsip.orgpjsip mailing listpjsip@lists.pjsip.orghttp://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org _________________________________________________________________ Mais do que emails! Confira tudo o que Windows Live™ pode oferecer. http://www.microsoft.com/windows/windowslive/