mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-06 21:58:57 -04:00
Fix libav version check
- Off-by-one error in the #ifs - Libav actually contains the old constants and functions as well, marked as deprecated. Just the CodecID enum was removed completely.
This commit is contained in:
parent
cd2dce3e3e
commit
d6f50c71f2
1 changed files with 4 additions and 4 deletions
|
@ -325,7 +325,7 @@ FFmpegVideo::FFmpegVideo()
|
||||||
|
|
||||||
//AVCodecID codec_id = AV_CODEC_ID_H264 ;
|
//AVCodecID codec_id = AV_CODEC_ID_H264 ;
|
||||||
//AVCodecID codec_id = AV_CODEC_ID_MPEG2VIDEO;
|
//AVCodecID codec_id = AV_CODEC_ID_MPEG2VIDEO;
|
||||||
#if LIBAVCODEC_VERSION_MAJOR < 55
|
#if LIBAVCODEC_VERSION_MAJOR < 54
|
||||||
CodecID codec_id = CODEC_ID_MPEG4;
|
CodecID codec_id = CODEC_ID_MPEG4;
|
||||||
#else
|
#else
|
||||||
AVCodecID codec_id = AV_CODEC_ID_MPEG4;
|
AVCodecID codec_id = AV_CODEC_ID_MPEG4;
|
||||||
|
@ -388,7 +388,7 @@ FFmpegVideo::FFmpegVideo()
|
||||||
*/
|
*/
|
||||||
encoding_context->gop_size = 100;
|
encoding_context->gop_size = 100;
|
||||||
//encoding_context->max_b_frames = 1;
|
//encoding_context->max_b_frames = 1;
|
||||||
#if LIBAVCODEC_VERSION_MAJOR < 55
|
#if LIBAVCODEC_VERSION_MAJOR < 54
|
||||||
encoding_context->pix_fmt = PIX_FMT_YUV420P; //context->pix_fmt = PIX_FMT_RGB24;
|
encoding_context->pix_fmt = PIX_FMT_YUV420P; //context->pix_fmt = PIX_FMT_RGB24;
|
||||||
if (codec_id == CODEC_ID_H264) {
|
if (codec_id == CODEC_ID_H264) {
|
||||||
#else
|
#else
|
||||||
|
@ -436,7 +436,7 @@ FFmpegVideo::FFmpegVideo()
|
||||||
|
|
||||||
decoding_context->width = encoding_context->width;
|
decoding_context->width = encoding_context->width;
|
||||||
decoding_context->height = encoding_context->height;
|
decoding_context->height = encoding_context->height;
|
||||||
#if LIBAVCODEC_VERSION_MAJOR < 55
|
#if LIBAVCODEC_VERSION_MAJOR < 54
|
||||||
decoding_context->pix_fmt = PIX_FMT_YUV420P;
|
decoding_context->pix_fmt = PIX_FMT_YUV420P;
|
||||||
#else
|
#else
|
||||||
decoding_context->pix_fmt = AV_PIX_FMT_YUV420P;
|
decoding_context->pix_fmt = AV_PIX_FMT_YUV420P;
|
||||||
|
@ -548,7 +548,7 @@ bool FFmpegVideo::encodeData(const QImage& image, uint32_t target_encoding_bitra
|
||||||
|
|
||||||
AVPacket pkt ;
|
AVPacket pkt ;
|
||||||
av_init_packet(&pkt);
|
av_init_packet(&pkt);
|
||||||
#if LIBAVCODEC_VERSION_MAJOR < 55
|
#if LIBAVCODEC_VERSION_MAJOR < 54
|
||||||
pkt.size = avpicture_get_size(encoding_context->pix_fmt, encoding_context->width, encoding_context->height);
|
pkt.size = avpicture_get_size(encoding_context->pix_fmt, encoding_context->width, encoding_context->height);
|
||||||
pkt.data = (uint8_t*)av_malloc(pkt.size);
|
pkt.data = (uint8_t*)av_malloc(pkt.size);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue