PJMEDIA conference bridge - direct port?

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

 



Hi Alex,

On 19-Dec-11 12:54, Alex Balashov wrote:
> On 12/19/2011 06:00 AM, Alain Totouom wrote:
>>  From what i can now guess, you don't need an extra merge_port as you
>> can directly use the decoded RTP buffer buffer in your pseudo-code
>> like this...
> 
> I created the merge_port because that is how I understood your
> initial step #2, "create a custom (playback) port with the needed
> callbacks put_frame/get_frame/on_destroy".  Where should I put these
> overrides?
> 
>> while(RTP decode into PCM frames and such into&frame) {
>>     pjmedia_frame frame;
>>     frame.buf = your RTP buffer
>>     frame.size= the size of the current frame, rtp payload size
>>     frame.type = PJMEDIA_FRAME_TYPE_AUDIO;
>>        pjmedia_put_frame(rev,&frame);
>>     }
> 
> Hmm.  That yields the same problem as before
> (../src/pjmedia/splitcomb.c:742: rport_put_frame: Assertion
> `frame->size == this_port->info.bytes_per_frame' failed.).  Let me
> try to enhance the clarity a little bit.
> 

What does the stack says:

frame->size = ?
this_port->info.bytes_per_frame = ?
Are you writing (PCAP/RTP) partial frames to port?
All pjmedia_put_frame calls to the reverse channel are faulty?


> First, I am creating a conference bridge:
> 
>    pjmedia_port *conf = NULL;
>    ...
>    pjmedia_conf_create(pool, 3, 8000, 1,
>       (8000 * PTIME) / 1000, PJMEDIA_CONF_NO_DEVICE, &conf);
> 
> Then, I am creating the splitcomb:
> 
>    pjmedia_port *split_comb = NULL;
>    ...
>    pjmedia_splitcomb_create(pool, 8000, 1, (8000 * PTIME) / 1000,
>       16, 0, &split_comb);
> 
> 
> Then, I'm creating the reverse channel in channel slot 0:
> 
>    pjmedia_port *conf_port = NULL;
>    ...
>    pjmedia_splitcomb_create_rev_channel(pool, split_comb, 0,
>       0, &conf_port);
> 
> Then, I connect the splitcomb itself (not the reverse channel) to
> the bridge, by adding the conf port and then connecting it:
> 
>    unsigned split_comb_slot = 0;
>    ...
>    pjmedia_conf_add_port(conf, pool, split_comb, NULL,
>       &split_comb_slot);
> 
>    pjmedia_conf_connect_port(conf, split_comb_slot, 0, 0));
> 
> Then, I iterate through my RTP acquisition loop, in ways that more
> or less exactly mimic pjsip-apps/src/samples/pcaputil.c, and, as you
> suggest, end up with PCM frames.  I tried your suggestion:
> 
>    pjmedia_port_put_frame(conf_port, &pcm_frame);
> 
> And got the same blank frame/assertion issue as before.
> 
> Am I misunderstanding the flow here?  Also, where does the "custom"
> port fit in?
> 

The custom port is NOT needed in your case since it would just
forward your put_frame/get_frame to the reverse channel. It's more a
design foo.

Hm lacking some info, your brdige is created without a sound device,
who is the timing provider? Null sound device & null port?

If I'm correct the splitter is actually the only port connected to
your bridge? If that is the case where does the mixing occurs? Who
triggers the data flow with the splitter port?
You can contact me off-list..

Cheers,
Alain

-- 
                            ""
                          (o)(o)
                _____o00o__(__)__o00o_____
3072D/146D10DE 2011-09-29    Alain Totouom  <totouom at gmx.de>
PGP Fingerprint 39A4F092 FFA7C746 CC305CB0 69091911 146D10DE



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux