SearchSearch  Log in to check your private messagesLog in to check your private messages  recent posts Recent Posts
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
poyoexOffline



Joined: Oct 13, 2009
Posts: 1

Status: Offline
Posted: Oct 13, 2009 - 06:08 AM Reply with quote Back to top
Hi All,

I'm new in SIP and PjSip. Wonder if somebody here have experience using and adding new codec to PjSip.

They got it explained in FAQ (in PjSip.org) only that its a bit difficult for me to understand the codec framework and how to integrate a new codec to the framework.

In my project I have a tetra codec to be added to PjMedia. I have copy my codec source code to the "pjmedia/src/Pjmedia-codec/" in the Pjproject dir then I added tetra.c by editing gsm.c file like in the FAQ. I also added portion related to my codec in :

pjmedia/include/pjmedia-codec.h :
Code:
#include <pjmedia-codec/tetra.h>


pjmedia/include/pjmedia-codec/config.h :
Code:
#ifndef PJMEDIA_HAS_TETRA_CODEC
#   define PJMEDIA_HAS_TETRA_CODEC    1
#endif


pjmedia/include/pjmedia-codec/config_auto.h :
Code:
#ifndef PJMEDIA_HAS_TETRA_CODEC
/* #undef PJMEDIA_HAS_TETRA_CODEC */
#endif


pjmedia/include/pjmedia-codec/config_auto.h.in :
Code:
#ifndef PJMEDIA_HAS_TETRA_CODEC
#undef PJMEDIA_HAS_TETRA_CODEC
#endif


For the enum i added in pjmedia/include/pjmedia-codec/types.h
Code:
PJMEDIA_RTP_PT_TETRA


And lastly added pjmedia/include/pjmedia-codec/tetra.h containing the init an deinit function declaration for tetra.c.

My first concern is are these all the file needed for adding new codec to the framework or there are any other that needs to be add/edited?

Secondly in the tetra.c there will be 3 functions :

1)
Code:
/*
 * Get frames in the packet.
 */
static pj_status_t  tetra_codec_parse( pjmedia_codec *codec,
                                     void *pkt,
                                     pj_size_t pkt_size,
                                     const pj_timestamp *ts,
                                     unsigned *frame_cnt,
                                     pjmedia_frame frames[])
{
}


2)
Code:
/*
 * Encode frame.
 */
static pj_status_t tetra_codec_encode( pjmedia_codec *codec,
                                     const struct  pjmedia_frame *input,
                                     unsigned output_buf_len,
                                     struct pjmedia_frame *output)
{
}


and

3)
Code:
/*
 * Decode frame.
 */
static pj_status_t tetra_codec_decode( pjmedia_codec *codec,
                                     const struct pjmedia_frame *input,
                                     unsigned output_buf_len,
                                     struct pjmedia_frame *output)
{
}

are tetra_codec_parse() going to be use by both encode and decode functions? since encode input length is different than decode input length. So I'm confuse on how to edit the parse function.

Hope someone can point me to the right direction.
View user's profile Send private message


View previous topic Printable version Log in to check your private messages View next topic

Post new topic   Reply to topic
Forum Rules and Guidelines | About VoIP User | Privacy Policy


All logos and trademarks in this site are property of their respective owner.
Comments and posts are property of the poster, all the rest (c) 2003-2008 VoIP User Limited.

VoIP User Limited is incorporated in England and Wales under Company Number 6694577.

No part of this site may be reproduced without our prior consent.