diff options
author | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-01-11 03:26:05 +0000 |
---|---|---|
committer | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2008-01-11 03:26:05 +0000 |
commit | 9ddb8c2b7c851d82922342ee8873267f0f1ae310 (patch) | |
tree | 5bd532af8f9b468b312b0b21cbf4c38d69bae331 | |
parent | fc79f056741619c9432fe5f5e99f861e82705a2e (diff) | |
download | usdx-9ddb8c2b7c851d82922342ee8873267f0f1ae310.tar.gz usdx-9ddb8c2b7c851d82922342ee8873267f0f1ae310.tar.xz usdx-9ddb8c2b7c851d82922342ee8873267f0f1ae310.zip |
there were some changes in the ffmpeg interface (for example TAVFormatContext's pb member is a pointer now).
To better track version changes, version numbers of the dlls are now managed by the version.inc file.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@779 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r-- | Game/Code/lib/ffmpeg/avcodec.pas | 22 | ||||
-rw-r--r-- | Game/Code/lib/ffmpeg/avformat.pas | 23 | ||||
-rw-r--r-- | Game/Code/lib/ffmpeg/avio.pas | 12 | ||||
-rw-r--r-- | Game/Code/lib/ffmpeg/avutil.pas | 15 | ||||
-rw-r--r-- | Game/Code/lib/ffmpeg/mathematics.pas | 11 | ||||
-rw-r--r-- | Game/Code/lib/ffmpeg/opt.pas | 11 | ||||
-rw-r--r-- | Game/Code/lib/ffmpeg/rational.pas | 10 | ||||
-rw-r--r-- | Game/Code/lib/ffmpeg/version.inc | 102 |
8 files changed, 121 insertions, 85 deletions
diff --git a/Game/Code/lib/ffmpeg/avcodec.pas b/Game/Code/lib/ffmpeg/avcodec.pas index 4182b979..88447ffc 100644 --- a/Game/Code/lib/ffmpeg/avcodec.pas +++ b/Game/Code/lib/ffmpeg/avcodec.pas @@ -24,8 +24,8 @@ unit avcodec; {$IFDEF FPC}
{$IFDEF LINUX}
- {$LINKLIB libavutil}
- {$LINKLIB libavcodec}
+ {$LINKLIB libavutil}
+ {$LINKLIB libavcodec}
{$ENDIF}
{$MODE DELPHI } (* CAT *)
@@ -38,23 +38,9 @@ interface uses
avutil, rational, opt; // CAT
-const
-
-{$IFDEF MSWINDOWS}
- av__format = 'avformat-50.dll';
-{$ENDIF}
-{$IFDEF LINUX}
- av__format = 'libavformat.so';
-{$ENDIF}
-{$IFDEF DARWIN}
- av__format = 'libavformat.dylib';
-{$ENDIF}
-
-
- LIBAVUTIL_VERSION_INT = ((51 shl 16) + (12 shl 8) + 1);
- LIBAVUTIL_VERSION = '51.12.1';
- LIBAVUTIL_BUILD = LIBAVUTIL_VERSION_INT;
+{$I version.inc}
+const
AV_NOPTS_VALUE: int64 = $8000000000000000;
AV_TIME_BASE = 1000000;
AV_TIME_BASE_Q : TAVRational = (num:1; den:AV_TIME_BASE); (* added by CAT *)
diff --git a/Game/Code/lib/ffmpeg/avformat.pas b/Game/Code/lib/ffmpeg/avformat.pas index 091b8fe0..174542b3 100644 --- a/Game/Code/lib/ffmpeg/avformat.pas +++ b/Game/Code/lib/ffmpeg/avformat.pas @@ -41,22 +41,9 @@ uses rational, avutil; (* CAT *) -const - -{$IFDEF MSWINDOWS} - av__format = 'avformat-50.dll'; -{$ENDIF} -{$IFDEF LINUX} - av__format = 'libavformat.so'; -{$ENDIF} -{$IFDEF DARWIN} - av__format = 'libavformat.dylib'; -{$ENDIF} - - LIBAVUTIL_VERSION_INT = ((51 shl 16) + (12 shl 8) + 1); - LIBAVUTIL_VERSION = '51.12.1'; - LIBAVUTIL_BUILD = LIBAVUTIL_VERSION_INT; +{$I version.inc} +const MAXINT64 = $7fffffffffffffff; MININT64 = $8000000000000000; @@ -315,8 +302,12 @@ type iformat: PAVInputFormat; oformat: PAVOutputFormat; priv_data: pointer; - + + {$IF (LIBAVFORMAT_VERSION >= 52)} pb: PByteIOContext; + {$ELSE} + pb: TByteIOContext; + {$IFEND} nb_streams: cardinal; (* CAT#3 *) streams: array [0..MAX_STREAMS - 1] of PAVStream; diff --git a/Game/Code/lib/ffmpeg/avio.pas b/Game/Code/lib/ffmpeg/avio.pas index 5e40bd4e..fa65b6fa 100644 --- a/Game/Code/lib/ffmpeg/avio.pas +++ b/Game/Code/lib/ffmpeg/avio.pas @@ -30,17 +30,9 @@ unit avio; interface (* Widows unit is deleted by CAT *) -const -(* version numbers are changed by The Creative CAT *) - -{$IFDEF win32} - av__format = 'avformat-50.dll';
-{$ELSE}
- av__format = 'libavformat.so'; // .0d
-//av__format = 'libavformat.51';
-{$ENDIF} - +{$I version.inc} +const URL_RDONLY = 0; URL_WRONLY = 1; URL_RDWR = 2; diff --git a/Game/Code/lib/ffmpeg/avutil.pas b/Game/Code/lib/ffmpeg/avutil.pas index ff833ad4..48c5f4c2 100644 --- a/Game/Code/lib/ffmpeg/avutil.pas +++ b/Game/Code/lib/ffmpeg/avutil.pas @@ -28,20 +28,7 @@ unit avutil; interface
-const
-{$IFDEF MSWINDOWS}
- av__util = 'avutil-49.dll';
-{$ENDIF}
-{$IFDEF LINUX}
- av__util = 'libavutil.so'; // .0d
-{$ENDIF}
-{$IFDEF DARWIN}
- av__util = 'libavutil.dylib';
-{$ENDIF}
-
- LIBAVUTIL_VERSION_INT = ((49 shl 16) + (4 shl 8) + 1);
- LIBAVUTIL_VERSION = '49.4.1';
- LIBAVUTIL_BUILD = LIBAVUTIL_VERSION_INT;
+{$I version.inc}
type
(**
diff --git a/Game/Code/lib/ffmpeg/mathematics.pas b/Game/Code/lib/ffmpeg/mathematics.pas index 42a30925..3beef517 100644 --- a/Game/Code/lib/ffmpeg/mathematics.pas +++ b/Game/Code/lib/ffmpeg/mathematics.pas @@ -36,16 +36,7 @@ in the source codes *) uses rational; (* CAT *) -const -{$IFDEF MSWINDOWS} - av__util = 'avutil-49.dll'; -{$ENDIF} -{$IFDEF LINUX} - av__util = 'libavutil.so'; // .0d -{$ENDIF} -{$IFDEF DARWIN} - av__util = 'libavutil.dylib'; -{$ENDIF} +{$I version.inc} type TAVRounding = ( diff --git a/Game/Code/lib/ffmpeg/opt.pas b/Game/Code/lib/ffmpeg/opt.pas index e70d77ad..bd3f14fd 100644 --- a/Game/Code/lib/ffmpeg/opt.pas +++ b/Game/Code/lib/ffmpeg/opt.pas @@ -32,6 +32,8 @@ interface uses rational; (* CAT *) +{$I version.inc} + type TAVOptionType = ( FF_OPT_TYPE_FLAGS, @@ -45,15 +47,6 @@ type ); const - -{$IFDEF win32} - av__codec = 'avcodec-51.dll';
-{$ELSE}
- av__codec = 'avcodec.so'; // .0d
- // av__codec = 'libavcodec.51';
-{$ENDIF}
- - AV_OPT_FLAG_ENCODING_PARAM = 1; ///< a generic parameter which can be set by the user for muxing or encoding AV_OPT_FLAG_DECODING_PARAM = 2; ///< a generic parameter which can be set by the user for demuxing or decoding AV_OPT_FLAG_METADATA = 4; ///< some data extracted or inserted into the file like title, comment, ... diff --git a/Game/Code/lib/ffmpeg/rational.pas b/Game/Code/lib/ffmpeg/rational.pas index 8fb3cbd8..86dbf8a4 100644 --- a/Game/Code/lib/ffmpeg/rational.pas +++ b/Game/Code/lib/ffmpeg/rational.pas @@ -29,15 +29,9 @@ unit rational; interface (* unit windows is deleted by CAT *) -const - {$IFDEF win32} - av__util = 'avutil-49.dll';
- {$ELSE}
- av__util = 'libavutil.so'; // .0d
-// av__util = 'libavutil.49';
- {$ENDIF} -type +{$I version.inc} +type (* * Rational number num/den. *) PAVRational = ^TAVRational; diff --git a/Game/Code/lib/ffmpeg/version.inc b/Game/Code/lib/ffmpeg/version.inc new file mode 100644 index 00000000..2944e643 --- /dev/null +++ b/Game/Code/lib/ffmpeg/version.inc @@ -0,0 +1,102 @@ +const
+{$IFDEF MSWINDOWS}
+ av__codec = 'avcodec-51.dll'; + LIBAVCODEC_MAJOR_VERSION = 51; + LIBAVCODEC_MINOR_VERSION = 0; + LIBAVCODEC_SUB_VERSION = 0; + + av__format = 'avformat-50.dll'; + LIBAVFORMAT_MAJOR_VERSION = 50; + LIBAVFORMAT_MINOR_VERSION = 0; + LIBAVFORMAT_SUB_VERSION = 0; + + av__util = 'avutil-49.dll'; + LIBAVUTIL_MAJOR_VERSION = 49; + LIBAVUTIL_MINOR_VERSION = 0; + LIBAVUTIL_SUB_VERSION = 0; +{$ENDIF} +{$IFDEF LINUX} + av__codec = 'libavcodec.so'; + LIBAVCODEC_MAJOR_VERSION = 51; + LIBAVCODEC_MINOR_VERSION = 0; + LIBAVCODEC_SUB_VERSION = 0; + + av__format = 'libavformat.so'; +//av__format = 'libavformat.51'; + LIBAVFORMAT_MAJOR_VERSION = 51; + LIBAVFORMAT_MINOR_VERSION = 0; + LIBAVFORMAT_SUB_VERSION = 0; + + av__util = 'libavutil.so'; + LIBAVUTIL_MAJOR_VERSION = 49; + LIBAVUTIL_MINOR_VERSION = 0; + LIBAVUTIL_SUB_VERSION = 0; +{$ENDIF} +{$IFDEF DARWIN} + av__format = 'libavcodec.dylib'; + LIBAVCODEC_MAJOR_VERSION = 51; + LIBAVCODEC_MINOR_VERSION = 0; + LIBAVCODEC_SUB_VERSION = 0; + + av__format = 'libavformat.dylib'; + LIBAVFORMAT_MAJOR_VERSION = 52; + LIBAVFORMAT_MINOR_VERSION = 0; + LIBAVFORMAT_SUB_VERSION = 0; + + av__util = 'libavutil.dylib'; + LIBAVUTIL_MAJOR_VERSION = 49; + LIBAVUTIL_MINOR_VERSION = 0; + LIBAVUTIL_SUB_VERSION = 0; +{$ENDIF} + +(* Max. supported version by this header *) +(* TODO: someone has to check the changes up to version 52, add some IFDEFS and increase this version number *) + +LIBAVCODEC_MAX_MAJOR_VERSION = 51; +LIBAVCODEC_MAX_MINOR_VERSION = 12; +LIBAVCODEC_MAX_SUB_VERSION = 1; +LIBAVCODEC_MAX_VERSION = LIBAVCODEC_MAX_MAJOR_VERSION + + (LIBAVCODEC_MAX_MINOR_VERSION * 0.01) + + (LIBAVCODEC_MAX_SUB_VERSION * 0.0001); + +LIBAVFORMAT_MAX_MAJOR_VERSION = 51; +LIBAVFORMAT_MAX_MINOR_VERSION = 12; +LIBAVFORMAT_MAX_SUB_VERSION = 1; +LIBAVFORMAT_MAX_VERSION = LIBAVFORMAT_MAX_MAJOR_VERSION + + (LIBAVFORMAT_MAX_MINOR_VERSION * 0.01) + + (LIBAVFORMAT_MAX_SUB_VERSION * 0.0001); + +LIBAVUTIL_MAX_MAJOR_VERSION = 49; +LIBAVUTIL_MAX_MINOR_VERSION = 4; +LIBAVUTIL_MAX_SUB_VERSION = 1; +LIBAVUTIL_MAX_VERSION = LIBAVUTIL_MAX_MAJOR_VERSION + + (LIBAVUTIL_MAX_MINOR_VERSION * 0.01) + + (LIBAVUTIL_MAX_SUB_VERSION * 0.0001); + +(* Calc linked version *) + +LIBAVCODEC_VERSION = LIBAVCODEC_MAJOR_VERSION + + (LIBAVCODEC_MINOR_VERSION * 0.01) + + (LIBAVCODEC_SUB_VERSION * 0.0001); + +LIBAVFORMAT_VERSION = LIBAVFORMAT_MAJOR_VERSION + + (LIBAVFORMAT_MINOR_VERSION * 0.01) + + (LIBAVFORMAT_SUB_VERSION * 0.0001); + +LIBAVUTIL_VERSION = LIBAVUTIL_MAJOR_VERSION + + (LIBAVUTIL_MINOR_VERSION * 0.01) + + (LIBAVUTIL_SUB_VERSION * 0.0001); + +(* Check if linked versions are supported *) + +{$IF (LIBAVCODEC_VERSION > LIBAVCODEC_MAX_VERSION)} + {$MESSAGE Warn 'Linked version of libavcodec may be unsupported!'} +{$IFEND} + +{$IF (LIBAVFORMAT_VERSION > LIBAVFORMAT_MAX_VERSION)} + {$MESSAGE Warn 'Linked version of libavformat may be unsupported!'} +{$IFEND} +
+{$IF (LIBAVUTIL_VERSION > LIBAVUTIL_MAX_VERSION)}
+ {$MESSAGE Warn 'Linked version of libavutil may be unsupported!'} +{$IFEND} |