Regarding G729 integration in pjsip

纵然是瞬间 提交于 2020-01-16 18:45:28

问题


I am querying on this because I am not a C expert .See if any one who has worked around it could help.I am integrating g729 in pjsip lib and I got g729 codec files from here.Here are I steps I have followed :

First I have registered g729 in 'pjmedia/src/pjmedia-codec/audio_codecs.c' by putting this

#if PJMEDIA_HAS_G729_CODEC
    /* Register G729 */
    status = pjmedia_codec_g729_init(endpt);
    if (status != PJ_SUCCESS){

    return status;
     }
#endif

Now I have two files 'pj_g729.c' and 'pj_g729.h' that I have to copy in pjsip lib as per my knowledge. So I have copied 'pj_g729.c' in 'pjmedia/src/pjmedia-codec' & 'pj_g729.h' in '/root/pjsip/trunk_2_allloweversionsuccess_and_widssl_g729/pjmedia/include/pjmedia-codec'.

After doing this I am running make it is giving error :' undefined reference at status = pjmedia_codec_g729_init(endpt);'.

Also I have doubt about 'PJMEDIA_HAS_G729_CODEC' as I haven't find this variable declared in library.So do I have to declare it ??I am struggling over it for a long time.Any help will be appreciable.


回答1:


you can follow the steps as how g7221 added in pjsip.Find out the files in which g722 mentioned and add extra lines for g729 codec too.You can paste g729.a file in thirtparty library of pjsip.




回答2:


From the fact that the compiler sees the line with the error, it follows that PJMEDIA_HAS_G729_CODEC is in fact defined somewhere. Otherwise the line would have been skipped outright.

The problem is that in C, header files must be #included to declare functions. This connects two source files. Here audio_codecs.c and pj_g729.c should both include pj_g729.h.




回答3:


You need to include pj_g729.h into pjmedia-codec.h .

#include <pjmedia-codec/pj_g729.h>

This will include g729 header file into pjmedia-codec.h header and will avoid the error of undefined reference at status = pjmedia_codec_g729_init(endpt);'.



来源:https://stackoverflow.com/questions/24970927/regarding-g729-integration-in-pjsip

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!