PJMEDIA conference bridge - direct port?

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

 



Alain,

On 12/19/2011 05:20 AM, Alain Totouom wrote:

> the splitter port is the one connected to the bridge. That port is
> in sync with the bridge. You'll use it's slot ID to do the mixing.
> The reverse port is the port you'll async and exclusively read/write
> from/to.
> The bridge is just aware of the splitter (slot)...
>
> pjmedia_port* sc, *rev;
> int slot;
> pjmedia_splitcomb_create(...,&sc);
> pjmedia_splitcomb_create_rev_channel(pool,sc,..,&rev);
> pjsua_conf_add_port(.., sc,&slot);

Understood.  In that case, I understood your original post correctly 
and did all this.

> /* async write */
> pjmedia_frame rdf;
> rdf.buf = ..;
> rdf.size= ..;
> rdf.type= ..;
> pjmedia_port_put_frame (rev,&rdf);

I think here is where I am running into the problem.  I don't produce 
the frames endogenously within this async write function;  instead, 
they come from the outside, read from a PCAP packet capture, and 
RTP-decoded into PCM frames in the usual manner.  So, I'm doing 
something like this with the PCM frames in that capture processing loop:

    while(RTP decode into PCM frames and such into &frame) {
       pjmedia_put_frame(&merge_port, &frame);
    }

And here's how I have implemented the 'merge_port':

    pjmedia_port		merge_port;
    pj_str_t        merge_port_name = pj_str("merge");
    ...
    memset(&merge_port, 0, sizeof(pjmedia_port));
    ...
    pj_strdup2(pool, &merge_port.info.name, "merge_player");

    merge_port.get_frame = &merge_get_frame;
    merge_port.put_frame = &merge_put_frame;

    pjmedia_port_info_init(&merge_port.info, &merge_port_name,
                           0x1, 8000, 1, 16,  (8000 * PTIME) / 1000);

And the callbacks for 'merge_port':

static pj_status_t merge_get_frame(pjmedia_port *port,
                                    pjmedia_frame *f)
{
         return PJ_EINVALIDOP;
}

static pj_status_t merge_put_frame(pjmedia_port *port,
                                    const pjmedia_frame *f)
{
         if(f->size == 0)
                 return PJ_SUCCESS;

         return pjmedia_port_put_frame(conf_port, f);
}


And here is what I end up with:

recombine: ../src/pjmedia/splitcomb.c:742: rport_put_frame: Assertion 
`frame->size == this_port->info.bytes_per_frame' failed.

A little backtracing reveals:

#6  0x0000000000404d90 in merge_put_frame (port=0x241, f=0x0)
     at media_proc.c:653

So, for some reason it's getting a NULL frame.  Any idea what I'm 
doing wrong?

-- 
Alex Balashov - Principal
Evariste Systems LLC
260 Peachtree Street NW
Suite 2200
Atlanta, GA 30303
Tel: +1-678-954-0670
Fax: +1-404-961-1892
Web: http://www.evaristesys.com/



[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