error: invalid conversion from ‘uint8_t* {aka unsigned char*}’ to ‘const char*’ [-fpermissive]

error: invalid conversion from ‘uint8_t* {aka unsigned char*}’ to ‘const char*’ [-fpermissive]
报错的程序:
AVTransSender_SendAudioData(pstPlayAttr->avSenderHandle, pkt.data,pkt.size, 0, 1);
其中
/// 媒体包.
struct MPacket
{
int type; ///
uint8_t data; /// 数据指针.*
int size; /// 数据长度.
int64_t pts; /// 时间戳.
int duration; /// 时长.
int flags; /// 标识.
};
AVTRANS_API void __stdcall AVTransSender_SendAudioData(void* modulePtr,
const char dataBuf*, int dataSize, long long timestamp, int markVal);

所以要将pkt.data强转为const char*
AVTransSender_SendAudioData(pstPlayAttr->avSenderHandle, (const char)pkt.data*, pkt.size, 0, 1);

你可能感兴趣的:(QT,linux,c++,qt)