mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 10:40:05 +08:00
c sdk支持pcm输入:#363
This commit is contained in:
parent
575b84beee
commit
e89caa2385
@ -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);
|
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 ctx 对象指针
|
||||||
* @param data 单帧PCM数据
|
* @param data 单帧PCM数据
|
||||||
* @param len 单帧PCM数据字节数
|
* @param len 单帧PCM数据字节数
|
||||||
* @param dts 时间戳,毫秒
|
* @param dts 时间戳,毫秒
|
||||||
*/
|
*/
|
||||||
API_EXPORT void API_CALL mk_media_input_PCM(mk_media ctx, void *Data, int len, uint32_t pts);
|
API_EXPORT void API_CALL mk_media_input_pcm(mk_media ctx, void *data, int len, uint32_t pts);
|
||||||
#endif //ENABLE_FAAC
|
|
||||||
/**
|
/**
|
||||||
* 输入单帧G711音频
|
* 输入单帧G711音频
|
||||||
* @param ctx 对象指针
|
* @param ctx 对象指针
|
||||||
|
@ -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);
|
(*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
|
#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);
|
assert(ctx && data && len > 0);
|
||||||
MediaHelper::Ptr* obj = (MediaHelper::Ptr*) ctx;
|
MediaHelper::Ptr* obj = (MediaHelper::Ptr*) ctx;
|
||||||
(*obj)->getChannel()->inputPCM((char*)data, len, pts);
|
(*obj)->getChannel()->inputPCM((char*)data, len, pts);
|
||||||
}
|
#else
|
||||||
|
WarnL << "aac编码未启用,该方法无效,编译时请打开ENABLE_FAAC选项";
|
||||||
#endif //ENABLE_FAAC
|
#endif //ENABLE_FAAC
|
||||||
|
}
|
||||||
|
|
||||||
API_EXPORT void API_CALL mk_media_input_g711(mk_media ctx, void* data, int len, uint32_t dts){
|
API_EXPORT void API_CALL mk_media_input_g711(mk_media ctx, void* data, int len, uint32_t dts){
|
||||||
assert(ctx && data && len > 0);
|
assert(ctx && data && len > 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user