aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/config.inc.in2
-rw-r--r--src/lib/ffmpeg-1.2/avcodec.pas2
-rw-r--r--src/media/UVideo.pas14
-rw-r--r--src/switches.inc1
4 files changed, 18 insertions, 1 deletions
diff --git a/src/config.inc.in b/src/config.inc.in
index aa336a1d..97b0f604 100644
--- a/src/config.inc.in
+++ b/src/config.inc.in
@@ -26,6 +26,8 @@
{$IFEND}
{$ENDIF}
{$IF Defined(IncludeConstants)}
+ FFMPEG_VERSION_INT = @FFMPEG_VERSION_INT@;
+
av__codec = 'libavcodec';
LIBAVCODEC_VERSION_MAJOR = @libavcodec_VERSION_MAJOR@;
LIBAVCODEC_VERSION_MINOR = @libavcodec_VERSION_MINOR@;
diff --git a/src/lib/ffmpeg-1.2/avcodec.pas b/src/lib/ffmpeg-1.2/avcodec.pas
index 0f4ac469..b1b266d2 100644
--- a/src/lib/ffmpeg-1.2/avcodec.pas
+++ b/src/lib/ffmpeg-1.2/avcodec.pas
@@ -36,6 +36,8 @@ unit avcodec;
{$MINENUMSIZE 4} (* use 4-byte enums *)
{$ENDIF}
+{$I switches.inc} (* for ffmpeg defines *)
+
{$IFDEF DARWIN}
{$linklib libavcodec}
{$ENDIF}
diff --git a/src/media/UVideo.pas b/src/media/UVideo.pas
index 1c4f065d..5e083b9a 100644
--- a/src/media/UVideo.pas
+++ b/src/media/UVideo.pas
@@ -81,7 +81,11 @@ uses
const
{$IFDEF PIXEL_FMT_BGR}
PIXEL_FMT_OPENGL = GL_BGR;
+ {$IF FFMPEG_VERSION_INT < 1001000}
PIXEL_FMT_FFMPEG = PIX_FMT_BGR24;
+ {$ELSE}
+ PIXEL_FMT_FFMPEG = AV_PIX_FMT_BGR24;
+ {$ENDIF}
PIXEL_FMT_SIZE = 3;
// looks strange on linux:
@@ -91,7 +95,11 @@ const
{$ELSE}
// looks strange on linux:
PIXEL_FMT_OPENGL = GL_RGB;
- PIXEL_FMT_FFMPEG = PIX_FMT_RGB24;
+ {$IF FFMPEG_VERSION_INT < 1001000}
+ PIXEL_FMT_FFMPEG = PIX_FMT_BGR24;
+ {$ELSE}
+ PIXEL_FMT_FFMPEG = AV_PIX_FMT_BGR24;
+ {$ENDIF}
PIXEL_FMT_SIZE = 3;
{$ENDIF}
@@ -634,7 +642,11 @@ function TVideo_FFmpeg.DecodeFrame(): boolean;
var
FrameFinished: Integer;
VideoPktPts: int64;
+ {$IF FFMPEG_VERSION_INT < 1001000}
pbIOCtx: PByteIOContext;
+ {$ELSE}
+ pbIOCtx: PAVIOContext;
+ {$ENDIF}
errnum: integer;
AVPacket: TAVPacket;
pts: double;
diff --git a/src/switches.inc b/src/switches.inc
index 64ebb5c2..e54bbcfa 100644
--- a/src/switches.inc
+++ b/src/switches.inc
@@ -97,6 +97,7 @@
{$IFDEF HaveFFmpeg}
{$DEFINE UseFFmpegDecoder}
{$DEFINE UseFFmpegResample}
+ {$DEFINE FF_API_AVCODEC_RESAMPLE}
{$DEFINE UseFFmpegVideo}
{$IFDEF HaveSWScale}
{$DEFINE UseSWScale}