From 115255f6a3c2be422680710b5d6ba4226c3383a6 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Tue, 15 Jun 2010 21:28:52 +0000 Subject: merged trunk r2528 into us_maker branch git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@2530 b956fd51-792f-4845-bead-9b4dfca2ff2c --- us_maker_edition/src/lib/ffmpeg/avcodec.pas | 59 +++++++--- us_maker_edition/src/lib/ffmpeg/avformat.pas | 18 ++-- us_maker_edition/src/lib/ffmpeg/avio.pas | 10 +- us_maker_edition/src/lib/ffmpeg/avutil.pas | 138 +++++------------------- us_maker_edition/src/lib/ffmpeg/error.pas | 113 +++++++++++++++++++ us_maker_edition/src/lib/ffmpeg/mathematics.pas | 10 +- us_maker_edition/src/lib/ffmpeg/opt.pas | 6 +- us_maker_edition/src/lib/ffmpeg/rational.pas | 10 +- us_maker_edition/src/lib/ffmpeg/swscale.pas | 10 +- 9 files changed, 210 insertions(+), 164 deletions(-) create mode 100644 us_maker_edition/src/lib/ffmpeg/error.pas (limited to 'us_maker_edition/src/lib/ffmpeg') diff --git a/us_maker_edition/src/lib/ffmpeg/avcodec.pas b/us_maker_edition/src/lib/ffmpeg/avcodec.pas index 066910a3..a441232d 100644 --- a/us_maker_edition/src/lib/ffmpeg/avcodec.pas +++ b/us_maker_edition/src/lib/ffmpeg/avcodec.pas @@ -14,20 +14,16 @@ * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - *) - -(* + * * This is a part of Pascal porting of ffmpeg. * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT * in the source codes. * - Changes and updates by the UltraStar Deluxe Team - *) - -(* + * * Conversion of libavcodec/avcodec.h * Min. version: 51.16.0, revision 6577, Sat Oct 7 15:30:46 2006 UTC - * Max. version: 52.67.0, revision 23057, Tue May 11 18:30 2010 CET + * Max. version: 52.72.0, revision 23338, Sun May 30 20:55 2010 CET * *) @@ -86,7 +82,7 @@ const *) (* Max. supported version by this header *) LIBAVCODEC_MAX_VERSION_MAJOR = 52; - LIBAVCODEC_MAX_VERSION_MINOR = 67; + LIBAVCODEC_MAX_VERSION_MINOR = 72; LIBAVCODEC_MAX_VERSION_RELEASE = 0; LIBAVCODEC_MAX_VERSION = (LIBAVCODEC_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVCODEC_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -307,6 +303,9 @@ type {$IF LIBAVCODEC_VERSION >= 52062000} // >= 52.62.0 CODEC_ID_YOP, {$IFEND} +{$IF LIBAVCODEC_VERSION >= 52067002} // >= 52.67.2 + CODEC_ID_VP8, +{$IFEND} //* various PCM "codecs" */ CODEC_ID_PCM_S16LE= $10000, @@ -848,6 +847,14 @@ const * as a last resort. *) CODEC_CAP_SUBFRAMES = $0100; + {$IFEND} + + {$IF LIBAVCODEC_VERSION >= 52071000} // >= 52.71.0 + (** + * Codec is experimental and is thus avoided in favor of non experimental + * encoders + *) + CODEC_CAP_EXPERIMENTAL = $0200; {$IFEND} //the following defines may change, don't expect compatibility if you use them @@ -1256,6 +1263,16 @@ type *) log_level_offset_offset: cint; {$IFEND} + +{$IF LIBAVUTIL_VERSION >= 50015003} // 50.15.3 + (** + * Offset in the structure where a pointer to the parent context for loging is stored. + * for example a decoder that uses eval.c could pass its AVCodecContext to eval as such + * parent context. And a av_log() implementation could then display the parent context + * can be NULL of course + *) + parent_log_context_offset: cint; +{$IFEND} end; {** @@ -3012,7 +3029,11 @@ type *) crf_max: cfloat; {$IFEND} - end; + + {$IF LIBAVCODEC_VERSION >= 52067002} // >= 52.67.2 + log_level_offset: cint; + {$IFEND} + end; {TAVCodecContext} (** * AVCodec. @@ -3852,6 +3873,10 @@ function avcodec_get_edge_width(): cuint; * Modifies width and height values so that they will result in a memory * buffer that is acceptable for the codec if you do not use any horizontal * padding. + * + * May only be used if a codec with CODEC_CAP_DR1 has been opened. + * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased + * according to avcodec_get_edge_width() before. *) procedure avcodec_align_dimensions(s: PAVCodecContext; width: PCint; height: PCint); cdecl; external av__codec; @@ -3861,6 +3886,10 @@ procedure avcodec_align_dimensions(s: PAVCodecContext; width: PCint; height: PCi * Modifies width and height values so that they will result in a memory * buffer that is acceptable for the codec if you also ensure that all * line sizes are a multiple of the respective linesize_align[i]. + * + * May only be used if a codec with CODEC_CAP_DR1 has been opened. + * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased + * according to avcodec_get_edge_width() before. *) procedure avcodec_align_dimensions2(s: PAVCodecContext; width: PCint; height: PCint; linesize_align: PQuadIntArray); @@ -4212,6 +4241,9 @@ function av_get_bits_per_sample_format(sample_fmt: TSampleFormat): cint; const AV_PARSER_PTS_NB = 4; PARSER_FLAG_COMPLETE_FRAMES = $0001; +{$IF LIBAVCODEC_VERSION >= 52070000} // 52.70.0 + PARSER_FLAG_ONCE = $0002; +{$IFEND} type {* frame parsing *} @@ -4694,20 +4726,19 @@ const {$ENDIF} (** - * We need the sign of of the error, because some platforms have + * We need the sign of the error, because some platforms have * E* and errno already negated. The previous version failed - * with Delphi, because it needs EINVAL defined. + * with Delphi, because it needed EINVAL defined. * Warning: This code is platform dependent and assumes constants * to be 32 bit. * This version does the following steps: * 1) shr 30: shifts the sign bit to bit position 2 * 2) and $00000002: sets all other bits to zero * positive EINVAL gives 0, negative gives 2 - * 3) not: inverts all bits. This gives -1 and -3 - * 4) + 2: positive EINVAL gives 1, negative -1 + * 3) - 1: positive EINVAL gives -1, negative 1 *) const - AVERROR_SIGN = not((EINVAL shr 30) and $00000002) + 2; + AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; (* #if EINVAL > 0 diff --git a/us_maker_edition/src/lib/ffmpeg/avformat.pas b/us_maker_edition/src/lib/ffmpeg/avformat.pas index a217263d..34142125 100644 --- a/us_maker_edition/src/lib/ffmpeg/avformat.pas +++ b/us_maker_edition/src/lib/ffmpeg/avformat.pas @@ -14,20 +14,16 @@ * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - *) - -(* + * * This is a part of Pascal porting of ffmpeg. * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT * in the source codes. * - Changes and updates by the UltraStar Deluxe Team - *) - -(* + * * Conversion of libavformat/avformat.h * Min. version: 50.5.0 , revision 6577, Sat Oct 7 15:30:46 2006 UTC - * Max. version: 52.62.0, revision 23102, Thu May 13 1:15:00 2010 CET + * Max. version: 52.67.0, revision 23357, Sun May 30 21:30:00 2010 CET *) unit avformat; @@ -85,7 +81,7 @@ const *) (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 62; + LIBAVFORMAT_MAX_VERSION_MINOR = 67; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -405,6 +401,9 @@ const AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container AVFMT_FLAG_NOPARSE = $0020; ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled {$IFEND} +{$IF LIBAVFORMAT_VERSION >= 52063000} // >= 52.63.0 + AVFMT_FLAG_RTP_HINT = $0040; ///< Add RTP hinting to the output file +{$IFEND} // used by AVStream MAX_REORDER_DELAY = 16; @@ -671,6 +670,9 @@ type AVSTREAM_PARSE_FULL, (**< full parsing and repack *) AVSTREAM_PARSE_HEADERS, (**< Only parse headers, do not repack. *) AVSTREAM_PARSE_TIMESTAMPS (**< full parsing and interpolation of timestamps for frames not starting on a packet boundary *) + {$IF LIBAVFORMAT_VERSION >= 52066000} // 52.66.0 + , AVSTREAM_PARSE_FULL_ONCE (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) + {$IFEND} ); TAVIndexEntry = record diff --git a/us_maker_edition/src/lib/ffmpeg/avio.pas b/us_maker_edition/src/lib/ffmpeg/avio.pas index 4863ee39..0ebca5fa 100644 --- a/us_maker_edition/src/lib/ffmpeg/avio.pas +++ b/us_maker_edition/src/lib/ffmpeg/avio.pas @@ -15,24 +15,20 @@ * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - *) - -(* + * * This is a part of Pascal porting of ffmpeg. * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT * in the source codes. * - Changes and updates by the UltraStar Deluxe Team - *) - -(* + * * Conversion of libavformat/avio.h * unbuffered I/O operations * @warning This file has to be considered an internal but installed * header, so it should not be directly included in your projects. * * update to - * Max. avformat version: 52.62.0, revision 23004, Tue May 11 19:29:00 2010 CET + * Max. avformat version: 52.67.0, revision 23357, Sun May 30 21:30:00 2010 CET *) unit avio; diff --git a/us_maker_edition/src/lib/ffmpeg/avutil.pas b/us_maker_edition/src/lib/ffmpeg/avutil.pas index 959e8fda..5387a0f1 100644 --- a/us_maker_edition/src/lib/ffmpeg/avutil.pas +++ b/us_maker_edition/src/lib/ffmpeg/avutil.pas @@ -14,22 +14,18 @@ * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - *) - -(* + * * This is a part of Pascal porting of ffmpeg. * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT * in the source codes. * - Changes and updates by the UltraStar Deluxe Team - *) - -(* + * * Conversions of * * libavutil/avutil.h: * Min. version: 49.0.1, revision 6577, Sat Oct 7 15:30:46 2006 UTC - * Max. version: 50.15.2, revision 23059, Tue May 11 22:05:00 2010 CET + * Max. version: 50.16.0, revision 23255, Sun May 30 22:05:00 2010 CET * * libavutil/mem.h: * revision 16590, Tue Jan 13 23:44:16 2009 UTC @@ -96,7 +92,7 @@ const *) (* Max. supported version by this header *) LIBAVUTIL_MAX_VERSION_MAJOR = 50; - LIBAVUTIL_MAX_VERSION_MINOR = 15; + LIBAVUTIL_MAX_VERSION_MINOR = 16; LIBAVUTIL_MAX_VERSION_RELEASE = 0; LIBAVUTIL_MAX_VERSION = (LIBAVUTIL_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVUTIL_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -124,7 +120,7 @@ const * Returns the LIBAVUTIL_VERSION_INT constant. *) function avutil_version(): cuint; - cdecl; external av__format; + cdecl; external av__util; {$IFEND} {$IF LIBAVUTIL_VERSION >= 50004000} // >= 50.4.0 @@ -132,13 +128,13 @@ function avutil_version(): cuint; * Returns the libavutil build-time configuration. *) function avutil_configuration(): PAnsiChar; - cdecl; external av__format; + cdecl; external av__util; (** * Returns the libavutil license. *) function avutil_license(): PAnsiChar; - cdecl; external av__format; + cdecl; external av__util; {$IFEND} { @@ -158,98 +154,9 @@ type ); } -(* libavutil/error.h *) +{$INCLUDE error.pas} -{$IF LIBAVUTIL_VERSION >= 50012000} // >= 50.12.0 - -{* error handling *} - -const -{$IFDEF UNIX} - ENOENT = ESysENOENT; - EIO = ESysEIO; - ENOMEM = ESysENOMEM; - EINVAL = ESysEINVAL; - EDOM = ESysEDOM; - ENOSYS = ESysENOSYS; - EILSEQ = ESysEILSEQ; - EPIPE = ESysEPIPE; -{$ELSE} - ENOENT = 2; - EIO = 5; - ENOMEM = 12; - EINVAL = 22; - EPIPE = 32; // just an assumption. needs to be checked. - EDOM = 33; - {$IFDEF MSWINDOWS} - // Note: we assume that ffmpeg was compiled with MinGW. - // This must be changed if DLLs were compiled with cygwin. - ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 - EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 - {$ENDIF} -{$ENDIF} - -(** - * We need the sign of of the error, because some platforms have - * E* and errno already negated. The previous version failed - * with Delphi, because it needs EINVAL defined. - * Warning: This code is platform dependent and assumes constants - * to be 32 bit. - * This version does the following steps: - * 1) shr 30: shifts the sign bit to bit position 2 - * 2) and $00000002: sets all other bits to zero - * positive EINVAL gives 0, negative gives 2 - * 3) not: inverts all bits. This gives -1 and -3 - * 4) + 2: positive EINVAL gives 1, negative -1 - *) -const - AVERROR_SIGN = not((EINVAL shr 30) and $00000002) + 2; - -(* -#if EINVAL > 0 -#define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} -#define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} -#else -{* Some platforms have E* and errno already negated. *} -#define AVERROR(e) (e) -#define AVUNERROR(e) (e) -#endif -*) - -const - AVERROR_UNKNOWN = AVERROR_SIGN * EINVAL; (**< unknown error *) - AVERROR_IO = AVERROR_SIGN * EIO; (**< I/O error *) - AVERROR_NUMEXPECTED = AVERROR_SIGN * EDOM; (**< Number syntax expected in filename. *) - AVERROR_INVALIDDATA = AVERROR_SIGN * EINVAL; (**< invalid data found *) - AVERROR_NOMEM = AVERROR_SIGN * ENOMEM; (**< not enough memory *) - AVERROR_NOFMT = AVERROR_SIGN * EILSEQ; (**< unknown format *) - AVERROR_NOTSUPP = AVERROR_SIGN * ENOSYS; (**< Operation not supported. *) - AVERROR_NOENT = AVERROR_SIGN * ENOENT; (**< No such file or directory. *) -{$IF LIBAVCODEC_VERSION >= 52017000} // 52.17.0 - AVERROR_EOF = AVERROR_SIGN * EPIPE; (**< End of file. *) -{$IFEND} - // Note: function calls as constant-initializers are invalid - //AVERROR_PATCHWELCOME = -MKTAG('P','A','W','E'); {**< Not yet implemented in FFmpeg. Patches welcome. *} - AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); -{$IFEND} - -{$IF LIBAVUTIL_VERSION >= 50013000} // >= 50.13.0 -(* - * Puts a description of the AVERROR code errnum in errbuf. - * In case of failure the global variable errno is set to indicate the - * error. Even in case of failure av_strerror() will print a generic - * error message indicating the errnum provided to errbuf. - * - * @param errbuf_size the size in bytes of errbuf - * @return 0 on success, a negative value if a description for errnum - * cannot be found - *) - -function av_strerror(errnum: cint; errbuf: Pchar; errbuf_size: cint): cint; - cdecl; external av__util; -{$IFEND} - -(* libavutil/pixfmt.h *) +(* libavutil/pixfmt.h up to revision 23144, May 16 2010 *) type (** @@ -298,8 +205,8 @@ type PIX_FMT_RGB555, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), in CPU endianness, most significant bit to 0 {$IFEND} PIX_FMT_GRAY8, ///< Y , 8bpp - PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black - PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white + PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb + PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG) PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG) @@ -316,12 +223,12 @@ type PIX_FMT_BGR555, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), in CPU endianness, most significant bit to 1 {$IFEND} PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) - PIX_FMT_BGR4, ///< packed RGB 1:2:1, 4bpp, (msb)1B 2G 1R(lsb) + PIX_FMT_BGR4, ///< packed RGB 1:2:1, bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) - PIX_FMT_RGB4, ///< packed RGB 1:2:1, 4bpp, (msb)1R 2G 1B(lsb) + PIX_FMT_RGB4, ///< packed RGB 1:2:1, bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) - PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 for UV + PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) PIX_FMT_NV21, ///< as above, but U and V bytes are swapped {$IF LIBAVUTIL_VERSION <= 50001000} // 50.01.0 PIX_FMT_RGB32_1, ///< packed RGB 8:8:8, 32bpp, (msb)8R 8G 8B 8A(lsb), in CPU endianness @@ -343,8 +250,8 @@ type PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers {$IF LIBAVUTIL_VERSION >= 49015000} // 49.15.0 - PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, big-endian - PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, little-endian + PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian + PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian {$IFEND} {$IF LIBAVUTIL_VERSION >= 50001000} // 50.01.0 PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian @@ -417,9 +324,10 @@ const PIX_FMT_YUV422 = PIX_FMT_YUYV422; {$IFEND} -(* libavutil/common.h *) // until now MKTAG is all from common.h KMS 9/6/2009 +(* libavutil/common.h *) // until now MKTAG and MKBETAG is all from common.h KMS 19/5/2010 function MKTAG(a, b, c, d: AnsiChar): integer; +function MKBETAG(a, b, c, d: AnsiChar): integer; (* libavutil/mem.h *) @@ -574,6 +482,11 @@ void av_log_set_callback(void (*)(void*, int, const char*, va_list)); void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl); **} +{$IF LIBAVUTIL_VERSION >= 50015003} // 50.15.3 +function av_default_item_name (ctx: pointer): Pchar; + cdecl; external av__util; +{$IFEND} + implementation (* libavutil/common.h *) @@ -583,4 +496,9 @@ begin Result := (ord(a) or (ord(b) shl 8) or (ord(c) shl 16) or (ord(d) shl 24)); end; +function MKBETAG(a, b, c, d: AnsiChar): integer; +begin + Result := (ord(d) or (ord(c) shl 8) or (ord(b) shl 16) or (ord(a) shl 24)); +end; + end. diff --git a/us_maker_edition/src/lib/ffmpeg/error.pas b/us_maker_edition/src/lib/ffmpeg/error.pas new file mode 100644 index 00000000..c142f6e1 --- /dev/null +++ b/us_maker_edition/src/lib/ffmpeg/error.pas @@ -0,0 +1,113 @@ +(* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * This is a part of the Pascal port of ffmpeg. + * - Changes and updates by the UltraStar Deluxe Team + * + * Conversion of libavutil/error.h + * Max. avutil version: 50.16.0, revision 23255, Sun May 30 22:05:00 2010 CET + * + *) + +{$IF LIBAVUTIL_VERSION >= 50012000} // >= 50.12.0 + +{* error handling *} + +const +{$IFDEF UNIX} + ENOENT = ESysENOENT; + EIO = ESysEIO; + ENOMEM = ESysENOMEM; + EINVAL = ESysEINVAL; + EDOM = ESysEDOM; + ENOSYS = ESysENOSYS; + EILSEQ = ESysEILSEQ; + EPIPE = ESysEPIPE; +{$ELSE} + ENOENT = 2; + EIO = 5; + ENOMEM = 12; + EINVAL = 22; + EPIPE = 32; // just an assumption. needs to be checked. + EDOM = 33; + {$IFDEF MSWINDOWS} + // Note: we assume that ffmpeg was compiled with MinGW. + // This must be changed if DLLs were compiled with cygwin. + ENOSYS = 40; // MSVC/MINGW: 40, CYGWIN: 88, LINUX/FPC: 38 + EILSEQ = 42; // MSVC/MINGW: 42, CYGWIN: 138, LINUX/FPC: 84 + {$ENDIF} +{$ENDIF} + +(** + * We need the sign of the error, because some platforms have + * E* and errno already negated. The previous version failed + * with Delphi, because it needed EINVAL defined. + * Warning: This code is platform dependent and assumes constants + * to be 32 bit. + * This version does the following steps: + * 1) shr 30: shifts the sign bit to bit position 2 + * 2) and $00000002: sets all other bits to zero + * positive EINVAL gives 0, negative gives 2 + * 3) not: inverts all bits. This gives -1 and -3 + * 3) - 1: positive EINVAL gives -1, negative 1 + *) +const + AVERROR_SIGN = (EINVAL shr 30) and $00000002 - 1; + +(* +#if EINVAL > 0 +#define AVERROR(e) (-(e)) {**< Returns a negative error code from a POSIX error code, to return from library functions. *} +#define AVUNERROR(e) (-(e)) {**< Returns a POSIX error code from a library function error return value. *} +#else +{* Some platforms have E* and errno already negated. *} +#define AVERROR(e) (e) +#define AVUNERROR(e) (e) +#endif +*) + +const + AVERROR_UNKNOWN = AVERROR_SIGN * EINVAL; (**< unknown error *) + AVERROR_IO = AVERROR_SIGN * EIO; (**< I/O error *) + AVERROR_NUMEXPECTED = AVERROR_SIGN * EDOM; (**< Number syntax expected in filename. *) + AVERROR_INVALIDDATA = AVERROR_SIGN * EINVAL; (**< invalid data found *) + AVERROR_NOMEM = AVERROR_SIGN * ENOMEM; (**< not enough memory *) + AVERROR_NOFMT = AVERROR_SIGN * EILSEQ; (**< unknown format *) + AVERROR_NOTSUPP = AVERROR_SIGN * ENOSYS; (**< Operation not supported. *) + AVERROR_NOENT = AVERROR_SIGN * ENOENT; (**< No such file or directory. *) +{$IF LIBAVCODEC_VERSION >= 52017000} // 52.17.0 + AVERROR_EOF = AVERROR_SIGN * EPIPE; (**< End of file. *) +{$IFEND} + // Note: function calls as constant-initializers are invalid + //AVERROR_PATCHWELCOME = -MKTAG('P','A','W','E'); {**< Not yet implemented in FFmpeg. Patches welcome. *} + AVERROR_PATCHWELCOME = -(ord('P') or (ord('A') shl 8) or (ord('W') shl 16) or (ord('E') shl 24)); +{$IFEND} + +{$IF LIBAVUTIL_VERSION >= 50013000} // >= 50.13.0 +(* + * Puts a description of the AVERROR code errnum in errbuf. + * In case of failure the global variable errno is set to indicate the + * error. Even in case of failure av_strerror() will print a generic + * error message indicating the errnum provided to errbuf. + * + * @param errbuf_size the size in bytes of errbuf + * @return 0 on success, a negative value if a description for errnum + * cannot be found + *) + +function av_strerror(errnum: cint; errbuf: Pchar; errbuf_size: cint): cint; + cdecl; external av__util; +{$IFEND} diff --git a/us_maker_edition/src/lib/ffmpeg/mathematics.pas b/us_maker_edition/src/lib/ffmpeg/mathematics.pas index 3a1f6a2c..a2a59107 100644 --- a/us_maker_edition/src/lib/ffmpeg/mathematics.pas +++ b/us_maker_edition/src/lib/ffmpeg/mathematics.pas @@ -14,19 +14,15 @@ * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - *) - -(* + * * This is a part of Pascal porting of ffmpeg. * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT * in the source codes. * - Changes and updates by the UltraStar Deluxe Team - *) - -(* + * * Conversion of libavutil/mathematics.h - * avutil max. version 50.15.2, revision 23059, Tue May 11 22:10:00 2010 CET + * avutil max. version 50.16.0, revision 23255, Sun May 30 22:05:00 2010 CET * *) diff --git a/us_maker_edition/src/lib/ffmpeg/opt.pas b/us_maker_edition/src/lib/ffmpeg/opt.pas index c755ed35..0e73726f 100644 --- a/us_maker_edition/src/lib/ffmpeg/opt.pas +++ b/us_maker_edition/src/lib/ffmpeg/opt.pas @@ -15,9 +15,7 @@ * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - *) - -(* + * * This is a part of Pascal porting of ffmpeg. * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT @@ -25,7 +23,7 @@ * - Changes and updates by the UltraStar Deluxe Team * * Conversion of libavcodec/opt.h - * Max. avcodec version: 52.67.0, revision 23057, Tue May 11 18:17 2010 CET + * Max. avcodec version: 52.72.0, revision 23338, Sun May 30 20:55 2010 CET * *) diff --git a/us_maker_edition/src/lib/ffmpeg/rational.pas b/us_maker_edition/src/lib/ffmpeg/rational.pas index 6ca9c0d1..e96fccd6 100644 --- a/us_maker_edition/src/lib/ffmpeg/rational.pas +++ b/us_maker_edition/src/lib/ffmpeg/rational.pas @@ -15,19 +15,15 @@ * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - *) - -(* + * * This is a part of Pascal porting of ffmpeg. * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. * - For Mac OS X, some modifications were made by The Creative CAT, denoted as CAT * in the source codes. * - Changes and updates by the UltraStar Deluxe Team - *) - -(* + * * Conversion of libavutil/rational.h - * avutil max. version 50.15.2, revision 23059, Tue May 11 22:10:00 2010 CET + * avutil max. version 50.16.0, revision 23255, Sun May 30 22:05:00 2010 CET * *) diff --git a/us_maker_edition/src/lib/ffmpeg/swscale.pas b/us_maker_edition/src/lib/ffmpeg/swscale.pas index 4f923f04..f7c11d0d 100644 --- a/us_maker_edition/src/lib/ffmpeg/swscale.pas +++ b/us_maker_edition/src/lib/ffmpeg/swscale.pas @@ -14,16 +14,12 @@ * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - *) - -(* + * * FFmpeg Pascal port * - Ported by the UltraStar Deluxe Team - *) - -(* + * * Conversion of libswscale/swscale.h - * Max. version: 0.10.0, revision 31050, Tue May 11 19:40:00 2010 CET + * Max. version: 0.10.0, revision 31279, Tue May 30 20:25:00 2010 CET *) unit swscale; -- cgit v1.2.3