提交 6cf33384 authored 作者: Mike Jerris's avatar Mike Jerris 提交者: root

FS-10458: [mod_av] temporarily silence warning when building against ffmpeg 3.2…

FS-10458: [mod_av] temporarily silence warning when building against ffmpeg 3.2 until we fix them properly
上级 9600fdd1
......@@ -369,7 +369,23 @@ SWITCH_END_EXTERN_C
#define _Out_opt_ptrdiff_cap_(x)
#define _Post_count_(x)
#endif
/* For Emacs:
#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402
#define GCC_DIAG_STR(s) #s
#define GCC_DIAG_JOINSTR(x,y) GCC_DIAG_STR(x ## y)
# define GCC_DIAG_DO_PRAGMA(x) _Pragma (#x)
# define GCC_DIAG_PRAGMA(x) GCC_DIAG_DO_PRAGMA(GCC diagnostic x)
# if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406
# define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(push) \
GCC_DIAG_PRAGMA(ignored GCC_DIAG_JOINSTR(-W,x))
# define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(pop)
# else
# define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(ignored GCC_DIAG_JOINSTR(-W,x))
# define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(warning GCC_DIAG_JOINSTR(-W,x))
# endif
#else
# define GCC_DIAG_OFF(x)
# define GCC_DIAG_ON(x)
#endif/* For Emacs:
* Local Variables:
* mode:c
* indent-tabs-mode:t
......
......@@ -1163,7 +1163,9 @@ static switch_status_t switch_h264_encode(switch_codec_t *codec, switch_frame_t
/* encode the image */
memset(context->nalus, 0, sizeof(context->nalus));
context->nalu_current_index = 0;
GCC_DIAG_OFF(deprecated-declarations)
ret = avcodec_encode_video2(avctx, pkt, avframe, got_output);
GCC_DIAG_ON(deprecated-declarations)
if (ret < 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Encoding Error %d\n", ret);
......@@ -1288,7 +1290,9 @@ static switch_status_t switch_h264_decode(switch_codec_t *codec, switch_frame_t
if (!context->decoder_avframe) context->decoder_avframe = av_frame_alloc();
picture = context->decoder_avframe;
switch_assert(picture);
GCC_DIAG_OFF(deprecated-declarations)
decoded_len = avcodec_decode_video2(avctx, picture, &got_picture, &pkt);
GCC_DIAG_ON(deprecated-declarations)
// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "buffer: %d got pic: %d len: %d [%dx%d]\n", size, got_picture, decoded_len, picture->width, picture->height);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论