problem with getting default attributes for EVRC Codec

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

 



Hi All,

I am trying to add EVRC codec with PJMEDIA-CODEC. but i am getting
some difficulties while following the gsm.c file.

1. while creating EVRC codec private data
what should i declare in replace of
  struct gsm_state    *encoder;
  struct gsm_state    *decoder;

Do I need to define EVRC_state with structures like struct evrc_state
*encoder   and struct evrc_state  *decoder ?

Can't I write my own open () function like this:

static pj_status_t evrc_codec_open( pjmedia_codec *codec,
				   pjmedia_codec_param *attr )
{
    struct evrc_data *evrc_data = (struct evrc_data*) codec->codec_data;

    pj_assert(evrc_data != NULL);

  //=Commented here....................SEE HERE
  /*  pj_assert(evrc_data->encoder == NULL && evrc_data->decoder == NULL);

    evrc_data->encoder = evrc_create();
    if (!evrc_data->encoder)
	return PJMEDIA_CODEC_EFAILED;

    evrc_data->decoder = evrc_create();
    if (!evrc_data->decoder)
	return PJMEDIA_CODEC_EFAILED;
  */

    evrc_data->vad_enabled = (attr->setting.vad != 0);
    evrc_data->plc_enabled = (attr->setting.plc != 0);

    return PJ_SUCCESS;
}


2.In Generate default attribute.
>
 i have changed the value to this. is it ok?

     attr->info.clock_rate = 8000;
    attr->info.channel_cnt = 1;
    attr->info.avg_bps = 8000;//check here
    attr->info.max_bps = 8000;//check here
    attr->info.pcm_bits_per_sample = 16;
    attr->info.frm_ptime = 20;
    attr->info.pt = PJMEDIA_RTP_PT_EVRC;

    attr->setting.frm_per_pkt = 1;
    attr->setting.vad = 1;
#if !PLC_DISABLED
    attr->setting.plc = 1;
#endif


 3. In gsm.c there is some hard coding in gsm_codec_parse(
 -- what will be the value in replace of "33" here  and also abt 320??


 while (pkt_size >= 33 && count < *frame_cnt) {
	frames[count].type = PJMEDIA_FRAME_TYPE_AUDIO;
	frames[count].buf = pkt;
	frames[count].size = 33;
	frames[count].timestamp.u64 = ts->u64 + count * 160;

	pkt = ((char*)pkt) + 33;
	pkt_size -= 33;

	++count;
    }


4. frame_size and sample_per_frame are also not clear to me..



Please help me out.I'm at the critical stage of my project.

 waiting for reply!



Thanks.




Thanks & Regards.
Sameer Prajapati | Software Engineer
Global Logic,Noida
Contact no.9953595878



[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