[asterisk-dev] Accessing next frames via jitterbuffer
Tilghman Lesher
tilghman at meg.abyt.es
Mon Oct 22 18:39:28 CDT 2012
On Mon, Oct 22, 2012 at 6:06 PM, Todd Mortimer <todd.mortimer at gmail.com> wrote:
> Hello,
>
> I am wondering if it is possible for a translator module to access subsequent frames from the jitter buffer. The reason I ask is because I have been working on a SILK translator:
>
> https://github.com/mordak/codec_silk
>
> And am interested in implementing the SILK FEC, which puts redundant information about frame (n) in the (n+1) and (n+2) frames. I've done some looking on this mailing list and searched the web some but have not seen any examples of how to do this, and am hoping that someone can point me in the right direction.
>
> Looking at ast_frame->frame_list leads me to believe that I might be able to access the next frame(s) through there, but I am not sure. I understand that the jb will indicate to the translator that it needs to generate a missing frame by passing a frame with datalen = 0, but am not sure how to optionally check for subsequent frames from within the _framein or _frameout functions in a translator.
>
> Can someone point me in the right direction?
There is a structure passed into each call to the codec translation
routine; within that, there's a pvt structure element, the initial
size of which must be set in the registered structure (in desc_size).
You are more than welcome to store _copies_ of previous frames in that
structure, if you choose. You may not, however, simply copy the
pointers, because the pointers may be deallocated and (most likely)
may point to unrelated frames later (or even completely unrelated
structures).
-Tilghman
More information about the asterisk-dev
mailing list