Skip to content
Snippets Groups Projects
Commit 7339c2bd authored by Philippe Gorley's avatar Philippe Gorley Committed by Adrien Béraud
Browse files

media: fix build warnings

Change-Id: I3b377854857eee866929d3c4228c21a3c81461cf
parent 780a9d57
No related branches found
No related tags found
No related merge requests found
...@@ -36,7 +36,7 @@ AudioStream::AudioStream(pa_context *c, ...@@ -36,7 +36,7 @@ AudioStream::AudioStream(pa_context *c,
const PaDeviceInfos* infos, const PaDeviceInfos* infos,
bool ec, bool ec,
OnReady onReady) OnReady onReady)
: audiostream_(0), mainloop_(m), onReady_(std::move(onReady)) : onReady_(std::move(onReady)), audiostream_(0), mainloop_(m)
{ {
const pa_channel_map channel_map = infos->channel_map; const pa_channel_map channel_map = infos->channel_map;
......
...@@ -48,6 +48,7 @@ av_frame_new_side_data_from_buf(AVFrame* frame, enum AVFrameSideDataType type, A ...@@ -48,6 +48,7 @@ av_frame_new_side_data_from_buf(AVFrame* frame, enum AVFrameSideDataType type, A
side_data->buf = buf; side_data->buf = buf;
side_data->data = side_data->buf->data; side_data->data = side_data->buf->data;
side_data->size = side_data->buf->size; side_data->size = side_data->buf->size;
return side_data;
} }
#endif #endif
} }
......
...@@ -247,7 +247,7 @@ MediaEncoder::initStream(const SystemCodecInfo& systemCodecInfo, AVBufferRef* fr ...@@ -247,7 +247,7 @@ MediaEncoder::initStream(const SystemCodecInfo& systemCodecInfo, AVBufferRef* fr
// Streaming => VBV (constrained encoding) + CRF (Constant Rate Factor) // Streaming => VBV (constrained encoding) + CRF (Constant Rate Factor)
if (crf == SystemCodecInfo::DEFAULT_NO_QUALITY) if (crf == SystemCodecInfo::DEFAULT_NO_QUALITY)
crf = 30; // good value for H264-720p@30 crf = 30; // good value for H264-720p@30
JAMI_DBG("H264 encoder setup: crf=%u, maxrate=%u, bufsize=%u", crf, maxBitrate, bufSize); JAMI_DBG("H264 encoder setup: crf=%u, maxrate=%lu, bufsize=%lu", crf, maxBitrate, bufSize);
libav_utils::setDictValue(&options_, "crf", std::to_string(crf)); libav_utils::setDictValue(&options_, "crf", std::to_string(crf));
av_opt_set_int(encoderCtx, "crf", crf, AV_OPT_SEARCH_CHILDREN); av_opt_set_int(encoderCtx, "crf", crf, AV_OPT_SEARCH_CHILDREN);
encoderCtx->rc_buffer_size = bufSize; encoderCtx->rc_buffer_size = bufSize;
...@@ -277,7 +277,7 @@ MediaEncoder::initStream(const SystemCodecInfo& systemCodecInfo, AVBufferRef* fr ...@@ -277,7 +277,7 @@ MediaEncoder::initStream(const SystemCodecInfo& systemCodecInfo, AVBufferRef* fr
av_opt_set_int(encoderCtx, "crf", crf, AV_OPT_SEARCH_CHILDREN); av_opt_set_int(encoderCtx, "crf", crf, AV_OPT_SEARCH_CHILDREN);
JAMI_DBG("Using quality factor %d", crf); JAMI_DBG("Using quality factor %d", crf);
} else { } else {
JAMI_DBG("Using Max bitrate %d", maxBitrate); JAMI_DBG("Using Max bitrate %lu", maxBitrate);
} }
} else if (systemCodecInfo.avcodecId == AV_CODEC_ID_MPEG4) { } else if (systemCodecInfo.avcodecId == AV_CODEC_ID_MPEG4) {
// For MPEG4 : // For MPEG4 :
...@@ -285,11 +285,11 @@ MediaEncoder::initStream(const SystemCodecInfo& systemCodecInfo, AVBufferRef* fr ...@@ -285,11 +285,11 @@ MediaEncoder::initStream(const SystemCodecInfo& systemCodecInfo, AVBufferRef* fr
// Use CBR (set bitrate) // Use CBR (set bitrate)
encoderCtx->rc_buffer_size = maxBitrate; encoderCtx->rc_buffer_size = maxBitrate;
encoderCtx->bit_rate = encoderCtx->rc_min_rate = encoderCtx->rc_max_rate = maxBitrate; encoderCtx->bit_rate = encoderCtx->rc_min_rate = encoderCtx->rc_max_rate = maxBitrate;
JAMI_DBG("Using Max bitrate %d", maxBitrate); JAMI_DBG("Using Max bitrate %lu", maxBitrate);
} else if (systemCodecInfo.avcodecId == AV_CODEC_ID_H263) { } else if (systemCodecInfo.avcodecId == AV_CODEC_ID_H263) {
encoderCtx->bit_rate = encoderCtx->rc_max_rate = maxBitrate; encoderCtx->bit_rate = encoderCtx->rc_max_rate = maxBitrate;
encoderCtx->rc_buffer_size = maxBitrate; encoderCtx->rc_buffer_size = maxBitrate;
JAMI_DBG("Using Max bitrate %d", maxBitrate); JAMI_DBG("Using Max bitrate %lu", maxBitrate);
} }
// add video stream to outputformat context // add video stream to outputformat context
...@@ -522,7 +522,7 @@ MediaEncoder::send(AVPacket& pkt, int streamIdx) ...@@ -522,7 +522,7 @@ MediaEncoder::send(AVPacket& pkt, int streamIdx)
} }
if (streamIdx < 0) if (streamIdx < 0)
streamIdx = currentStreamIdx_; streamIdx = currentStreamIdx_;
if (streamIdx >= 0 and streamIdx < encoders_.size()) { if (streamIdx >= 0 and static_cast<size_t>(streamIdx) < encoders_.size()) {
auto encoderCtx = encoders_[streamIdx]; auto encoderCtx = encoders_[streamIdx];
pkt.stream_index = streamIdx; pkt.stream_index = streamIdx;
if (pkt.pts != AV_NOPTS_VALUE) if (pkt.pts != AV_NOPTS_VALUE)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment