Merge pull request #1108 from brokensword2018/fix_warning

去除非第三方库的编译告警
This commit is contained in:
夏楚 2021-09-16 17:39:55 +08:00 committed by GitHub
commit 2b3d32f6c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 18 deletions

View File

@ -75,7 +75,7 @@ API_EXPORT void API_CALL mk_media_init_complete(mk_media ctx);
* @param dts * @param dts
* @param pts * @param pts
*/ */
API_EXPORT void API_CALL mk_media_input_h264(mk_media ctx, void *data, int len, uint32_t dts, uint32_t pts); API_EXPORT void API_CALL mk_media_input_h264(mk_media ctx, const void *data, int len, uint32_t dts, uint32_t pts);
/** /**
* H265视频00 00 01,00 00 00 01 * H265视频00 00 01,00 00 00 01
@ -85,7 +85,7 @@ API_EXPORT void API_CALL mk_media_input_h264(mk_media ctx, void *data, int len,
* @param dts * @param dts
* @param pts * @param pts
*/ */
API_EXPORT void API_CALL mk_media_input_h265(mk_media ctx, void *data, int len, uint32_t dts, uint32_t pts); API_EXPORT void API_CALL mk_media_input_h265(mk_media ctx, const void *data, int len, uint32_t dts, uint32_t pts);
/** /**
* AAC音频(adts头) * AAC音频(adts头)
@ -95,7 +95,7 @@ API_EXPORT void API_CALL mk_media_input_h265(mk_media ctx, void *data, int len,
* @param dts * @param dts
* @param adts adts头null * @param adts adts头null
*/ */
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, const void *data, int len, uint32_t dts, void *adts);
/** /**
* PCM音频,ENABLE_FAAC编译时 * PCM音频,ENABLE_FAAC编译时
@ -113,7 +113,7 @@ API_EXPORT void API_CALL mk_media_input_pcm(mk_media ctx, void *data, int len, u
* @param len * @param len
* @param dts * @param dts
*/ */
API_EXPORT void API_CALL mk_media_input_audio(mk_media ctx, void* data, int len, uint32_t dts); API_EXPORT void API_CALL mk_media_input_audio(mk_media ctx, const void* data, int len, uint32_t dts);
/** /**
* MediaSource.close() * MediaSource.close()

View File

@ -202,22 +202,22 @@ API_EXPORT void API_CALL mk_media_init_complete(mk_media ctx){
(*obj)->getChannel()->addTrackCompleted(); (*obj)->getChannel()->addTrackCompleted();
} }
API_EXPORT void API_CALL mk_media_input_h264(mk_media ctx, void *data, int len, uint32_t dts, uint32_t pts) { API_EXPORT void API_CALL mk_media_input_h264(mk_media ctx, const void *data, int len, uint32_t dts, 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()->inputH264((char *) data, len, dts, pts); (*obj)->getChannel()->inputH264((const char *) data, len, dts, pts);
} }
API_EXPORT void API_CALL mk_media_input_h265(mk_media ctx, void *data, int len, uint32_t dts, uint32_t pts) { API_EXPORT void API_CALL mk_media_input_h265(mk_media ctx, const void *data, int len, uint32_t dts, 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()->inputH265((char *) data, len, dts, pts); (*obj)->getChannel()->inputH265((const char *) data, len, dts, pts);
} }
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, const void *data, int len, uint32_t dts, void *adts) {
assert(ctx && data && len > 0 && adts); assert(ctx && data && len > 0 && adts);
MediaHelper::Ptr *obj = (MediaHelper::Ptr *) ctx; MediaHelper::Ptr *obj = (MediaHelper::Ptr *) ctx;
(*obj)->getChannel()->inputAAC((char *) data, len, dts, (char *) adts); (*obj)->getChannel()->inputAAC((const 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){ API_EXPORT void API_CALL mk_media_input_pcm(mk_media ctx, void *data , int len, uint32_t pts){
@ -226,10 +226,10 @@ API_EXPORT void API_CALL mk_media_input_pcm(mk_media ctx, void *data , int len,
(*obj)->getChannel()->inputPCM((char*)data, len, pts); (*obj)->getChannel()->inputPCM((char*)data, len, pts);
} }
API_EXPORT void API_CALL mk_media_input_audio(mk_media ctx, void* data, int len, uint32_t dts){ API_EXPORT void API_CALL mk_media_input_audio(mk_media ctx, const void* data, int len, uint32_t dts){
assert(ctx && data && len > 0); assert(ctx && data && len > 0);
MediaHelper::Ptr* obj = (MediaHelper::Ptr*) ctx; MediaHelper::Ptr* obj = (MediaHelper::Ptr*) ctx;
(*obj)->getChannel()->inputAudio((char*)data, len, dts); (*obj)->getChannel()->inputAudio((const char*)data, len, dts);
} }
API_EXPORT void API_CALL mk_media_start_send_rtp(mk_media ctx, const char *dst_url, uint16_t dst_port, const char *ssrc, int is_udp, on_mk_media_send_rtp_result cb, void *user_data){ API_EXPORT void API_CALL mk_media_start_send_rtp(mk_media ctx, const char *dst_url, uint16_t dst_port, const char *ssrc, int is_udp, on_mk_media_send_rtp_result cb, void *user_data){

View File

@ -83,7 +83,7 @@ int AudioSRC::getPCMData(char *buf, int size) {
if (_audio_cvt.len_cvt) { if (_audio_cvt.len_cvt) {
_target_buf.append(_buf.get(), _audio_cvt.len_cvt); _target_buf.append(_buf.get(), _audio_cvt.len_cvt);
} }
if (_target_buf.size() < size) { if (_target_buf.size() < (size_t)size) {
return 0; return 0;
} }
memcpy(buf, _target_buf.data(), size); memcpy(buf, _target_buf.data(), size);
@ -122,7 +122,7 @@ int AudioPlayer::getPCMChannel() {
int AudioPlayer::getPCMData(char *buf, int size) { int AudioPlayer::getPCMData(char *buf, int size) {
lock_guard<mutex> lck(_mtx); lock_guard<mutex> lck(_mtx);
if (_buffer.size() < size) { if (_buffer.size() < (size_t)size) {
return 0; return 0;
} }
memcpy(buf, _buffer.data(), size); memcpy(buf, _buffer.data(), size);

View File

@ -102,7 +102,7 @@ FFmpegSwr::~FFmpegSwr() {
FFmpegFrame::Ptr FFmpegSwr::inputFrame(const FFmpegFrame::Ptr &frame) { FFmpegFrame::Ptr FFmpegSwr::inputFrame(const FFmpegFrame::Ptr &frame) {
if (frame->get()->format == _target_format && if (frame->get()->format == _target_format &&
frame->get()->channels == _target_channels && frame->get()->channels == _target_channels &&
frame->get()->channel_layout == _target_channel_layout && frame->get()->channel_layout == (uint64_t)_target_channel_layout &&
frame->get()->sample_rate == _target_samplerate) { frame->get()->sample_rate == _target_samplerate) {
//不转格式 //不转格式
return frame; return frame;

View File

@ -712,7 +712,6 @@ static inline int decodeVuiParameters(void *pvBuf, T_SPS *ptSps)
{ {
int iAspectRatioInfoPresentFlag; int iAspectRatioInfoPresentFlag;
unsigned int uiAspectRatioIdc; unsigned int uiAspectRatioIdc;
int iChromaSampleLocation;
iAspectRatioInfoPresentFlag = getOneBit(pvBuf); iAspectRatioInfoPresentFlag = getOneBit(pvBuf);
@ -759,8 +758,7 @@ static inline int decodeVuiParameters(void *pvBuf, T_SPS *ptSps)
/* chroma_location_info_present_flag */ /* chroma_location_info_present_flag */
if (getOneBit(pvBuf)) if (getOneBit(pvBuf))
{ {
/* chroma_sample_location_type_top_field */ parseUe(pvBuf); /* chroma_sample_location_type_top_field */
iChromaSampleLocation = parseUe(pvBuf);
parseUe(pvBuf); /* chroma_sample_location_type_bottom_field */ parseUe(pvBuf); /* chroma_sample_location_type_bottom_field */
} }
if(getBitsLeft(pvBuf) < 10) if(getBitsLeft(pvBuf) < 10)