c sdk支持pcm输入:#363

This commit is contained in:
xiongziliang 2020-06-24 11:18:04 +08:00
parent 575b84beee
commit e89caa2385
2 changed files with 7 additions and 7 deletions

View File

@ -98,16 +98,15 @@ API_EXPORT void API_CALL mk_media_input_h265(mk_media ctx, void *data, int len,
*/
API_EXPORT void API_CALL mk_media_input_aac(mk_media ctx, void *data, int len, uint32_t dts, void *adts);
#ifdef ENABLE_FAAC
/**
* PCM音频
* PCM音频,ENABLE_FAAC编译时
* @param ctx
* @param data PCM数据
* @param len PCM数据字节数
* @param dts
*/
API_EXPORT void API_CALL mk_media_input_PCM(mk_media ctx, void *Data, int len, uint32_t pts);
#endif //ENABLE_FAAC
API_EXPORT void API_CALL mk_media_input_pcm(mk_media ctx, void *data, int len, uint32_t pts);
/**
* G711音频
* @param ctx

View File

@ -157,14 +157,15 @@ API_EXPORT void API_CALL mk_media_input_aac(mk_media ctx, void *data, int len, u
(*obj)->getChannel()->inputAAC((char *) data, len, dts, (char *) adts);
}
API_EXPORT void API_CALL mk_media_input_pcm(mk_media ctx, void *data , int len, uint32_t pts){
#ifdef ENABLE_FAAC
API_EXPORT void API_CALL mk_media_input_PCM(mk_media ctx, void *data , int len, uint32_t pts)
{
assert(ctx && data && len > 0);
MediaHelper::Ptr* obj = (MediaHelper::Ptr*) ctx;
(*obj)->getChannel()->inputPCM((char*)data, len, pts);
}
#else
WarnL << "aac编码未启用,该方法无效,编译时请打开ENABLE_FAAC选项";
#endif //ENABLE_FAAC
}
API_EXPORT void API_CALL mk_media_input_g711(mk_media ctx, void* data, int len, uint32_t dts){
assert(ctx && data && len > 0);