From e89caa23851dd7fc763115347deb59562cf97375 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Wed, 24 Jun 2020 11:18:04 +0800 Subject: [PATCH] =?UTF-8?q?c=20sdk=E6=94=AF=E6=8C=81pcm=E8=BE=93=E5=85=A5:?= =?UTF-8?q?#363?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/include/mk_media.h | 7 +++---- api/source/mk_media.cpp | 7 ++++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/api/include/mk_media.h b/api/include/mk_media.h index ff85cf47..3337b59f 100755 --- a/api/include/mk_media.h +++ b/api/include/mk_media.h @@ -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 对象指针 diff --git a/api/source/mk_media.cpp b/api/source/mk_media.cpp index c6bdaf19..91761829 100755 --- a/api/source/mk_media.cpp +++ b/api/source/mk_media.cpp @@ -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);