mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 04:31:37 +08:00
自动计算264前缀大小
This commit is contained in:
parent
08c3c8e5b5
commit
274dab6e1d
@ -84,10 +84,21 @@ void DevChannel::inputPCM(char* pcData, int iDataLen, uint32_t uiStamp) {
|
|||||||
}
|
}
|
||||||
#endif //ENABLE_FAAC
|
#endif //ENABLE_FAAC
|
||||||
|
|
||||||
void DevChannel::inputH264(const char* pcData, int iDataLen, uint32_t uiStamp , int prefixeSize) {
|
void DevChannel::inputH264(const char* pcData, int iDataLen, uint32_t uiStamp) {
|
||||||
if(uiStamp == 0){
|
if(uiStamp == 0){
|
||||||
uiStamp = (uint32_t)_aTicker[0].elapsedTime();
|
uiStamp = (uint32_t)_aTicker[0].elapsedTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int prefixeSize;
|
||||||
|
|
||||||
|
if (memcmp("\x00\x00\x00\x01", pcData, 4) == 0) {
|
||||||
|
prefixeSize = 4;
|
||||||
|
} else if (memcmp("\x00\x00\x01", pcData, 3) == 0) {
|
||||||
|
prefixeSize = 3;
|
||||||
|
} else {
|
||||||
|
prefixeSize = 0;
|
||||||
|
}
|
||||||
|
|
||||||
inputFrame(std::make_shared<H264FrameNoCopyAble>((char *)pcData,iDataLen,uiStamp,prefixeSize));
|
inputFrame(std::make_shared<H264FrameNoCopyAble>((char *)pcData,iDataLen,uiStamp,prefixeSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,9 +99,8 @@ public:
|
|||||||
* @param pcData 264单帧数据指针
|
* @param pcData 264单帧数据指针
|
||||||
* @param iDataLen 数据指针长度
|
* @param iDataLen 数据指针长度
|
||||||
* @param uiStamp 时间戳,单位毫秒;等于0时内部会自动生成时间戳
|
* @param uiStamp 时间戳,单位毫秒;等于0时内部会自动生成时间戳
|
||||||
* @param prefixSize 264 其实头字节数,起始头可以是0x00 00 00 01 或 0x 00 00 01 或者没有起始头
|
|
||||||
*/
|
*/
|
||||||
void inputH264(const char *pcData, int iDataLen, uint32_t uiStamp,int prefixSize = 4);
|
void inputH264(const char *pcData, int iDataLen, uint32_t uiStamp);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 输入可能带adts头的aac帧
|
* 输入可能带adts头的aac帧
|
||||||
|
Loading…
Reference in New Issue
Block a user