Skip to content

Commit

Permalink
fix build error if no avfilter
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Apr 4, 2016
1 parent 9f62d3a commit c6f5b8a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/AVCompat.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/******************************************************************************
QtAV: Media play library based on Qt and FFmpeg
QtAV: Multimedia framework based on Qt and FFmpeg
Copyright (C) 2012-2016 Wang Bin <[email protected]>
* This file is part of QtAV
Expand Down Expand Up @@ -345,6 +345,7 @@ const char *get_codec_long_name(enum AVCodecID id)
return "unknown_codec";
}

#if QTAV_HAVE(AVFILTER)
#if !AV_MODULE_CHECK(LIBAVFILTER, 2, 22, 0, 79, 100) //FF_API_AVFILTERPAD_PUBLIC
const char *avfilter_pad_get_name(const AVFilterPad *pads, int pad_idx)
{
Expand All @@ -356,3 +357,4 @@ enum AVMediaType avfilter_pad_get_type(const AVFilterPad *pads, int pad_idx)
return pads[pad_idx].type;
}
#endif
#endif //QTAV_HAVE(AVFILTER)
8 changes: 6 additions & 2 deletions src/QtAV/private/AVCompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#define AV_ENSURE(FUNC, ...) AV_RUN_CHECK(FUNC, return, __VA_ARGS__)
#define AV_WARN(FUNC) AV_RUN_CHECK(FUNC, void)

#include "QtAV_Global.h"
#include "QtAV/QtAV_Global.h"
#ifdef __cplusplus
extern "C"
{
Expand Down Expand Up @@ -395,12 +395,14 @@ void av_packet_free_side_data(AVPacket *pkt);
void avcodec_free_context(AVCodecContext **avctx);
#endif

#if QTAV_HAVE(AVFILTER)
// ffmpeg2.0 2013-07-03 - 838bd73 - lavfi 3.78.100 - avfilter.h
#if QTAV_USE_LIBAV(LIBAVFILTER)
#define avfilter_graph_parse_ptr(pGraph, pFilters, ppInputs, ppOutputs, pLog) avfilter_graph_parse(pGraph, pFilters, *ppInputs, *ppOutputs, pLog)
#elif !FFMPEG_MODULE_CHECK(LIBAVFILTER, 3, 78, 100)
#define avfilter_graph_parse_ptr(pGraph, pFilters, ppInputs, ppOutputs, pLog) avfilter_graph_parse(pGraph, pFilters, ppInputs, ppOutputs, pLog)
#endif
#endif //QTAV_USE_LIBAV(LIBAVFILTER)

//ffmpeg1.0 2012-06-12 - c7b9eab / 84b9fbe - lavfi 2.79.100 / 2.22.0 - avfilter.h
#if !AV_MODULE_CHECK(LIBAVFILTER, 2, 22, 0, 79, 100) //FF_API_AVFILTERPAD_PUBLIC
const char *avfilter_pad_get_name(const AVFilterPad *pads, int pad_idx);
Expand All @@ -417,6 +419,8 @@ int avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src);
}
#endif /* __cplusplus */
#endif
#endif //QTAV_HAVE(AVFILTER)

/* helper functions */
const char *get_codec_long_name(AVCodecID id);

Expand Down

0 comments on commit c6f5b8a

Please sign in to comment.