diff options
author | Underground78 <underground78@users.sourceforge.net> | 2012-06-01 23:49:53 +0400 |
---|---|---|
committer | Underground78 <underground78@users.sourceforge.net> | 2012-06-01 23:49:53 +0400 |
commit | 9cd8193de506d13e18d88904abda658644f032d2 (patch) | |
tree | ab669f5a30d2d2c41fe0d457c652556650cf239a /src/filters/transform | |
parent | 19061127fe9b873b91e840d0ff01f420616060b7 (diff) |
Use C++ instead of C for FfmpegContext since it was the only C file in MPC-HC project.
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@4969 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/transform')
-rw-r--r-- | src/filters/transform/MPCVideoDec/DXVADecoder.cpp | 3 | ||||
-rw-r--r-- | src/filters/transform/MPCVideoDec/DXVADecoderH264.cpp | 3 | ||||
-rw-r--r-- | src/filters/transform/MPCVideoDec/DXVADecoderMpeg2.cpp | 3 | ||||
-rw-r--r-- | src/filters/transform/MPCVideoDec/DXVADecoderVC1.cpp | 3 | ||||
-rw-r--r-- | src/filters/transform/MPCVideoDec/FfmpegContext.cpp (renamed from src/filters/transform/MPCVideoDec/FfmpegContext.c) | 40 | ||||
-rw-r--r-- | src/filters/transform/MPCVideoDec/MPCVideoDec.vcxproj | 2 | ||||
-rw-r--r-- | src/filters/transform/MPCVideoDec/MPCVideoDec.vcxproj.filters | 6 | ||||
-rw-r--r-- | src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp | 2 |
8 files changed, 28 insertions, 34 deletions
diff --git a/src/filters/transform/MPCVideoDec/DXVADecoder.cpp b/src/filters/transform/MPCVideoDec/DXVADecoder.cpp index 41c7a6b45..e5b2ba6e2 100644 --- a/src/filters/transform/MPCVideoDec/DXVADecoder.cpp +++ b/src/filters/transform/MPCVideoDec/DXVADecoder.cpp @@ -29,10 +29,7 @@ #include "MPCVideoDecFilter.h"
#include "VideoDecDXVAAllocator.h"
-extern "C"
-{
#include "FfmpegContext.h"
-}
#define MAX_RETRY_ON_PENDING 50
#define DO_DXVA_PENDING_LOOP(x) nTry = 0; \
diff --git a/src/filters/transform/MPCVideoDec/DXVADecoderH264.cpp b/src/filters/transform/MPCVideoDec/DXVADecoderH264.cpp index e44f5b1bf..4e7fb9e17 100644 --- a/src/filters/transform/MPCVideoDec/DXVADecoderH264.cpp +++ b/src/filters/transform/MPCVideoDec/DXVADecoderH264.cpp @@ -27,10 +27,7 @@ #include "VideoDecDXVAAllocator.h"
#include <ffmpeg/libavcodec/avcodec.h>
-extern "C"
-{
#include "FfmpegContext.h"
-}
#if 0
#define TRACE_H264 TRACE
diff --git a/src/filters/transform/MPCVideoDec/DXVADecoderMpeg2.cpp b/src/filters/transform/MPCVideoDec/DXVADecoderMpeg2.cpp index e9f144b26..7f21aa75e 100644 --- a/src/filters/transform/MPCVideoDec/DXVADecoderMpeg2.cpp +++ b/src/filters/transform/MPCVideoDec/DXVADecoderMpeg2.cpp @@ -24,10 +24,7 @@ #include "DXVADecoderMpeg2.h"
#include "MPCVideoDecFilter.h"
-extern "C"
-{
#include "FfmpegContext.h"
-}
#if 0
#define TRACE_MPEG2 TRACE
diff --git a/src/filters/transform/MPCVideoDec/DXVADecoderVC1.cpp b/src/filters/transform/MPCVideoDec/DXVADecoderVC1.cpp index ce881686f..0f05301e6 100644 --- a/src/filters/transform/MPCVideoDec/DXVADecoderVC1.cpp +++ b/src/filters/transform/MPCVideoDec/DXVADecoderVC1.cpp @@ -25,10 +25,7 @@ #include "MPCVideoDecFilter.h"
#include <ffmpeg/libavcodec/avcodec.h>
-extern "C"
-{
#include "FfmpegContext.h"
-}
#if 0
#define TRACE_VC1 TRACE
diff --git a/src/filters/transform/MPCVideoDec/FfmpegContext.c b/src/filters/transform/MPCVideoDec/FfmpegContext.cpp index 24887fbbf..70831d2e8 100644 --- a/src/filters/transform/MPCVideoDec/FfmpegContext.c +++ b/src/filters/transform/MPCVideoDec/FfmpegContext.cpp @@ -29,30 +29,36 @@ #include <sys/timeb.h>
#include <time.h> // for the _time64 workaround
#include "FfmpegContext.h"
-#include <ffmpeg/libavcodec/dsputil.h>
-#include <ffmpeg/libavcodec/avcodec.h>
-#include <ffmpeg/libavcodec/mpegvideo.h>
-#include <ffmpeg/libavcodec/golomb.h>
-#include <ffmpeg/libavcodec/h264.h>
-#include <ffmpeg/libavcodec/h264data.h>
-#include <ffmpeg/libavcodec/vc1.h>
-#include <ffmpeg/libavcodec/mpeg12.h>
+extern "C" {
+ #include <ffmpeg/libavcodec/dsputil.h>
+ #include <ffmpeg/libavcodec/avcodec.h>
+// This is kind of an hack but it avoids using a C++ keyword as a struct member name
+#define class classFFMPEG
+ #include <ffmpeg/libavcodec/mpegvideo.h>
+#undef class
+ #include <ffmpeg/libavcodec/golomb.h>
+
+ #include <ffmpeg/libavcodec/h264.h>
+ #include <ffmpeg/libavcodec/h264data.h>
+ #include <ffmpeg/libavcodec/vc1.h>
+ #include <ffmpeg/libavcodec/mpeg12.h>
+
+ int av_h264_decode_frame(struct AVCodecContext* avctx, int* nOutPOC, int64_t* rtStartTime, uint8_t *buf, int buf_size);
+ int av_vc1_decode_frame(AVCodecContext *avctx, uint8_t *buf, int buf_size, int *nFrameSize);
+ void av_init_packet(AVPacket *pkt);
+
+ #ifdef _WIN64
+ // Hack to use MinGW64 from 2.x branch
+ void __mingw_raise_matherr(int typ, const char *name, double a1, double a2, double rslt) {}
+ #endif
+}
#if defined(REGISTER_FILTER) && _WIN64
void *__imp_toupper = toupper;
void *__imp_time64 = _time64;
#endif
-#ifdef _WIN64
-// Hack to use MinGW64 from 2.x branch
-void __mingw_raise_matherr(int typ, const char *name, double a1, double a2, double rslt) {}
-#endif
-
-int av_h264_decode_frame(struct AVCodecContext* avctx, int* nOutPOC, int64_t* rtStartTime, uint8_t *buf, int buf_size);
-int av_vc1_decode_frame(AVCodecContext *avctx, uint8_t *buf, int buf_size, int *nFrameSize);
-void av_init_packet(AVPacket *pkt);
-
const byte ZZ_SCAN[16] = {
0, 1, 4, 8,
5, 2, 3, 6,
diff --git a/src/filters/transform/MPCVideoDec/MPCVideoDec.vcxproj b/src/filters/transform/MPCVideoDec/MPCVideoDec.vcxproj index 4270913c9..ec6652b6d 100644 --- a/src/filters/transform/MPCVideoDec/MPCVideoDec.vcxproj +++ b/src/filters/transform/MPCVideoDec/MPCVideoDec.vcxproj @@ -239,7 +239,7 @@ <ClCompile Include="DXVADecoderMpeg2.cpp" />
<ClCompile Include="DXVADecoderVC1.cpp" />
<ClCompile Include="ffImgfmt.cpp" />
- <ClCompile Include="FfmpegContext.c">
+ <ClCompile Include="FfmpegContext.cpp">
<WarningLevel>Level1</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
diff --git a/src/filters/transform/MPCVideoDec/MPCVideoDec.vcxproj.filters b/src/filters/transform/MPCVideoDec/MPCVideoDec.vcxproj.filters index 54b0d34cd..98f3bc6e4 100644 --- a/src/filters/transform/MPCVideoDec/MPCVideoDec.vcxproj.filters +++ b/src/filters/transform/MPCVideoDec/MPCVideoDec.vcxproj.filters @@ -33,9 +33,6 @@ <ClCompile Include="ffImgfmt.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="FfmpegContext.c">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="MPCFfmpegDec.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -69,6 +66,9 @@ <ClCompile Include="H264RandomAccess.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="FfmpegContext.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="CpuId.h">
diff --git a/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp b/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp index 4bf4a5571..eed912381 100644 --- a/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp +++ b/src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp @@ -35,9 +35,9 @@ #include "CpuId.h"
#include "ffImgfmt.h"
+#include "FfmpegContext.h"
extern "C"
{
-#include "FfmpegContext.h"
#include <ffmpeg/libswscale/swscale.h>
}
|