Problem with adding new codec EVRC to PJMEDIA

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

 



How can I add new codec to PJMEDIA?
?<http://trac.pjsip.org/repos/wiki/FAQ#adding-codec>

First of all, read the Codec
Framework<http://www.pjsip.org/pjmedia/docs/html/group__PJMEDIA__CODEC.htm>documentation.
Then, the easiest is to take other codec source file in
pjmedia-codec directory, such as
gsm.c<http://www.pjsip.org/trac/browser/pjproject/trunk/pjmedia/src/pjmedia-codec/gsm.c>,
and replace GSM specific function calls with the functions that are provided
by your codec library.

There are two "classes" to implement:

   - The codec factory
(pjmedia_codec_factory<http://www.pjsip.org/pjmedia/docs/html/structpjmedia__codec__factory.htm>)
   - Codec factory will be queried by PJMEDIA to see if it can instantiate a
   codec instance based on a codec descriptor
(pjmedia_codec_info<http://www.pjsip.org/pjmedia/docs/html/structpjmedia__codec__info.htm>).
   Codec factory also provides information about what particular codecs it
   supports, so that PJMEDIA can list these codecs in the local SDP capability
   descriptor.
   - The codec itself
(pjmedia_codec<http://www.pjsip.org/pjmedia/docs/html/structpjmedia__codec.htm>)
   - The codec instance provides functions to parse, encode and decode audio
   frames. Optionally it may provide a function to recover lost frames (known
   as *Packet Lost Concealment* feature, or PLC).

Once it's finished, you should end up with just two public APIs exported by
the implementation: an initialization function, and a deinitialization
function. The initialization function's primary task is to register the
codec factory to PJMEDIA's codec manager, so that PJMEDIA knows about this
new codec. While the deinitialization function is to unregister the codec
factory, and to release resources, if any.

Then call the codec initialization function in the application. After this,
the codec should be picked up automagically by the rest of PJMEDIA framework
(that is, PJSIP should advertise the codec in outgoing SDP and negotiate it
with remote's SDP, and encode/decode audio frames with the codec, if the
codec is selected for the session).



I'm not able to add EVRC specific code instead of GSM Specific code.Because
in GSM,  gsm_state is defined with several parameters.How could I define
evrc_state? Is it really required?


Because in GSM,  open( ),encode( ),decode()..........these functions are
having gsm_state and somehow getting values.

http://www.pjsip.org/pjmedia/docs/html/structpjmedia__codec__op.htm

Can anyone please temme how open() is working?

gsm_state is structure which defines parameters like


struct gsm_state {

    word        dp0[ 280 ];
    word        e[ 50 ];    /* code.c             */

    word        z1;        /* preprocessing.c, Offset_com. */
    longword    L_z2;        /*                  Offset_com. */
    int        mp;        /*                  Preemphasis    */

    word        u[8];        /* short_term_aly_filter.c    */
    word        LARpp[2][8];     /*                              */
    word        j;        /*                              */

    word            ltp_cut;        /* long_term.c, LTP crosscorr.  */
    word        nrp; /* 40 */    /* long_term.c, synthesis    */
    word        v[9];        /* short_term.c, synthesis    */
    word        msr;        /* decoder.c,    Postprocessing    */

    char        verbose;    /* only used if !NDEBUG        */
    char        fast;        /* only used if FAST        */

    char        wav_fmt;    /* only used if WAV49 defined    */
    unsigned char    frame_index;    /*            odd/even chaining    */
    unsigned char    frame_chain;    /*   half-byte to carry forward    */
};

what are these variables?

What would be the similarity with EVRC_STATE?


Please help!
-- 
Thanks and Regards.
Sameer Prajapati
Final year Undergraduate Student
IIIT,Allahabad.
#91-9999708959
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20090206/5393e4ac/attachment.html>


[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