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.
您可以按照g7221在pjsip中的添加步骤进行操作。查找g722中提到的文件,并为g729编解码器添加额外的行。您可以将g729.a文件粘贴到pjsip的第三方库中。
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 #include
d to declare functions. This connects two source files. Here audio_codecs.c
and pj_g729.c
should both include pj_g729.h
.
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);'.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.