Skip to content

Commit

Permalink
undefine PixelFormat in AVCompat.h
Browse files Browse the repository at this point in the history
conflict with VideoFormat::PixelFormat only when ffmpeg header is used,
so move to AVCompat.h is better
  • Loading branch information
wang-bin committed Jul 20, 2015
1 parent 61be1d6 commit 678b4fc
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 43 deletions.
6 changes: 0 additions & 6 deletions src/QtAV/VideoFormat.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,8 @@
#include <QtGui/QImage>
#include <QtAV/QtAV_Global.h>

// FF_API_PIX_FMT
#ifdef PixelFormat
#undef PixelFormat
#endif

class QDebug;
namespace QtAV {

class VideoFormatPrivate;
class Q_AV_EXPORT VideoFormat
{
Expand Down
6 changes: 5 additions & 1 deletion src/QtAV/private/AVCompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ int64_t av_get_default_channel_layout(int nb_channels);
#ifdef AVRESAMPLE_MAX_CHANNELS
#define SWR_CH_MAX AVRESAMPLE_MAX_CHANNELS
#else
#define SWR_CH_MAX 32
#define SWR_CH_MAX 64
#endif //AVRESAMPLE_MAX_CHANNELS
#endif //SWR_CH_MAX
#define SwrContext AVAudioResampleContext
Expand Down Expand Up @@ -264,6 +264,10 @@ typedef enum PixelFormat AVPixelFormat; // so we must avoid using enum AVPixelF
typedef enum AVPixelFormat AVPixelFormat;
#define QTAV_PIX_FMT_C(X) AV_PIX_FMT_##X
#endif //AV_VERSION_INT(51, 42, 0)
// FF_API_PIX_FMT
#ifdef PixelFormat
#undef PixelFormat
#endif

// AV_PIX_FMT_FLAG_XXX was PIX_FMT_XXX before FFmpeg 2.0
// AV_PIX_FMT_FLAG_ALPHA was added at 52.2.0. but version.h not changed
Expand Down
5 changes: 0 additions & 5 deletions src/QtAV/private/AVEncoder_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
#include "QtAV/VideoFormat.h"
#include "QtAV/private/AVCompat.h"

// FF_API_PIX_FMT
#ifdef PixelFormat
#undef PixelFormat
#endif

namespace QtAV {

class Q_AV_PRIVATE_EXPORT AVEncoderPrivate : public DPtrPrivate<AVEncoder>
Expand Down
5 changes: 0 additions & 5 deletions src/VideoFormat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ extern "C" {
#include <libavutil/imgutils.h>
}

// FF_API_PIX_FMT
#ifdef PixelFormat
#undef PixelFormat
#endif

#define FF_HAS_YUV12BITS FFMPEG_MODULE_CHECK(LIBAVUTIL, 51, 73, 101)
#if (Q_BYTE_ORDER == Q_BIG_ENDIAN)
#define PIXFMT_NE(B, L) VideoFormat::Format_##B
Expand Down
5 changes: 0 additions & 5 deletions src/VideoFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@
#include "utils/GPUMemCopy.h"
#include "utils/Logger.h"

// FF_API_PIX_FMT
#ifdef PixelFormat
#undef PixelFormat
#endif

namespace QtAV {
namespace{
static const struct RegisterMetaTypes
Expand Down
5 changes: 0 additions & 5 deletions src/codec/video/VideoDecoderDXVA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@
#include "utils/DirectXHelper.h"

// d3d9ex: http://dxr.mozilla.org/mozilla-central/source/dom/media/wmf/DXVA2Manager.cpp
// TODO: add to QtAV_Compat.h?
// FF_API_PIX_FMT
#ifdef PixelFormat
#undef PixelFormat
#endif
// AV_CODEC_ID_H265 is a macro defined as AV_CODEC_ID_HEVC. so we can avoid libavcodec version check. (from ffmpeg 2.1)
#ifndef AV_CODEC_ID_H265
#ifdef _MSC_VER
Expand Down
6 changes: 0 additions & 6 deletions src/codec/video/VideoDecoderVAAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ extern "C" {
#include "vaapi/SurfaceInteropVAAPI.h"
#include "utils/Logger.h"

// TODO: add to AVCompat.h?
// FF_API_PIX_FMT
#ifdef PixelFormat
#undef PixelFormat
#endif

#define VERSION_CHK(major, minor, patch) \
(((major&0xff)<<16) | ((minor&0xff)<<8) | (patch&0xff))

Expand Down
5 changes: 0 additions & 5 deletions src/codec/video/VideoDecoderVDA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ extern "C" {
#include <VideoDecodeAcceleration/VDADecoder.h>
#include "utils/Logger.h"

// TODO: add to QtAV_Compat.h?
// FF_API_PIX_FMT
#ifdef PixelFormat
#undef PixelFormat
#endif
#ifdef MAC_OS_X_VERSION_MIN_REQUIRED
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 //MAC_OS_X_VERSION_10_7
#define OSX_TARGET_MIN_LION
Expand Down
5 changes: 0 additions & 5 deletions src/codec/video/VideoEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@
#include "QtAV/private/factory.h"
#include "utils/Logger.h"

// FF_API_PIX_FMT
#ifdef PixelFormat
#undef PixelFormat
#endif

namespace QtAV {

FACTORY_DEFINE(VideoEncoder)
Expand Down

0 comments on commit 678b4fc

Please sign in to comment.