From d35aae71ead05b26b5e00b25de4f6ed11f11ad13 Mon Sep 17 00:00:00 2001
From: k-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>
Date: Mon, 4 Jan 2010 23:51:10 +0000
Subject: correction of some misplaced fields + some editorial changes + update
 to current

git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2067 b956fd51-792f-4845-bead-9b4dfca2ff2c
---
 src/lib/ffmpeg/avcodec.pas     | 247 +++++++++++++++++++++--------------------
 src/lib/ffmpeg/avformat.pas    |   7 +-
 src/lib/ffmpeg/avio.pas        |   8 +-
 src/lib/ffmpeg/avutil.pas      |  47 ++++++--
 src/lib/ffmpeg/mathematics.pas |   2 +-
 src/lib/ffmpeg/opt.pas         |   9 +-
 src/lib/ffmpeg/rational.pas    |   5 +-
 src/lib/ffmpeg/swscale.pas     |   2 +-
 8 files changed, 179 insertions(+), 148 deletions(-)

(limited to 'src')

diff --git a/src/lib/ffmpeg/avcodec.pas b/src/lib/ffmpeg/avcodec.pas
index 49859a0a..3766ab1f 100644
--- a/src/lib/ffmpeg/avcodec.pas
+++ b/src/lib/ffmpeg/avcodec.pas
@@ -28,12 +28,11 @@
  * Conversion of libavcodec/avcodec.h
  * Min. version: 51.16.0, revision 6577, Sat Oct 7 15:30:46 2006 UTC 
  * Max. version: 52.11.0, revision 16912, Sun Feb 1 02:00:19 2009 UTC 
- *)
-{
+ *
  * update to
- * Max. version: 52.45.0, Tue Dec 29 00:25:00 2009 CET 
+ * Max. version: 52.45.0, Mon Jan 4 2010 00:25:00 CET 
  * MiSchi
-}
+ *)
 
 unit avcodec;
 
@@ -494,6 +493,7 @@ const
 {$IF LIBAVCODEC_VERSION >= 52038001} // >= 52.38.1
   CH_LAYOUT_NATIVE          = $8000000000000000;
 {$IFEND}
+
   {* Audio channel convenience macros *}
   CH_LAYOUT_MONO            = (CH_FRONT_CENTER);
   CH_LAYOUT_STEREO          = (CH_FRONT_LEFT or CH_FRONT_RIGHT);
@@ -525,9 +525,7 @@ const
                                CH_FRONT_RIGHT_OF_CENTER);
   CH_LAYOUT_STEREO_DOWNMIX  = (CH_STEREO_LEFT or CH_STEREO_RIGHT);
 
-
-const
-  {* in bytes *}
+{* in bytes *}
   AVCODEC_MAX_AUDIO_FRAME_SIZE = 192000; // 1 second of 48khz 32bit audio
 
 {**
@@ -718,7 +716,6 @@ const
 (* /Fx *)
 (* codec capabilities *)
 
-const
   CODEC_CAP_DRAW_HORIZ_BAND = $0001; ///< decoder can use draw_horiz_band callback
   (**
    * Codec uses get_buffer() for allocating buffers.
@@ -1015,11 +1012,11 @@ const
 
   FF_COMPRESSION_DEFAULT = -1;
 
+{$IF LIBAVCODEC_MAX_VERSION_MAJOR < 53}
 const
   AVPALETTE_SIZE = 1024;
   AVPALETTE_COUNT = 256;
 
-{$IF LIBAVCODEC_MAX_VERSION_MAJOR < 53}
 type
 (**
  * AVPaletteControl
@@ -1352,118 +1349,11 @@ type
      *)
     hwaccel_data_private: pointer;
     {$IFEND}
+
     {$IF LIBAVCODEC_VERSION >= 52022000} // >= 52.22.0
     hwaccel_picture_private: pointer;
     {$IFEND}
 
-    {$IF LIBAVCODEC_VERSION >= 51070000} // >= 51.70.0
-    (**
-     * Bits per sample/pixel of internal libavcodec pixel/sample format.
-     * This field is applicable only when sample_fmt is SAMPLE_FMT_S32.
-     * - encoding: set by user.
-     * - decoding: set by libavcodec.
-     *)
-    bits_per_raw_sample: cint;
-    {$IFEND}
-
-    {$IF LIBAVCODEC_VERSION >= 52002000} // >= 52.2.0
-    (**
-     * Audio channel layout.
-     * - encoding: set by user.
-     * - decoding: set by libavcodec.
-     *)
-    channel_layout: cint64;
-
-    (**
-     * Request decoder to use this channel layout if it can (0 for default)
-     * - encoding: unused
-     * - decoding: Set by user.
-     *)
-    request_channel_layout: cint64;
-    {$IFEND}
-
-    {$IF LIBAVCODEC_VERSION >= 52004000} // >= 52.4.0
-    (**
-     * Ratecontrol attempt to use, at maximum, <value> of what can be used without an underflow.
-     * - encoding: Set by user.
-     * - decoding: unused.
-     *)
-    rc_max_available_vbv_use: cfloat;
-
-    (**
-     * Ratecontrol attempt to use, at least, <value> times the amount needed to prevent a vbv overflow.
-     * - encoding: Set by user.
-     * - decoding: unused.
-     *)
-    rc_min_vbv_overflow_use: cfloat;
-    {$IFEND}
-    {$IF LIBAVCODEC_VERSION >= 52018000} // >= 52.18.0
-    (**
-     * Hardware accelerator in use
-     * - encoding: unused.
-     * - decoding: Set by libavcodec
-     *)
-    hwaccel: PAVHWAccel;
-    {$IFEND}
-    {$IF LIBAVCODEC_VERSION >= 52020000} // >= 52.20.0
-    (**
-     * For some codecs, the time base is closer to the field rate than the frame rate.
-     * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration
-     * if no telecine is used ...
-     *
-     * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2.
-     *)
-    ticks_per_frame: cint;
-    {$IFEND}
-    {$IF LIBAVCODEC_VERSION >= 52021000} // >= 52.21.0
-    (**
-     * Hardware accelerator context.
-     * For some hardware accelerators, a global context needs to be
-     * provided by the user. In that case, this holds display-dependent
-     * data FFmpeg cannot instantiate itself. Please refer to the
-     * FFmpeg HW accelerator documentation to know how to fill this
-     * is. e.g. for VA API, this is a struct vaapi_context.
-     * - encoding: unused
-     * - decoding: Set by user
-     *)
-    hwaccel_context: pointer;
-    {$IFEND}
-    {$IF LIBAVCODEC_VERSION >= 52028000} // >= 52.28.0
-    (**
-     * Chromaticity coordinates of the source primaries.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     *)
-    color_primaries: TAVColorPrimaries;
-
-    (**
-     * Color Transfer Characteristic.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     *)
-    color_trc: TAVColorTransferCharacteristic;
-
-    (**
-     * YUV colorspace type.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     *)
-    colorspace: TAVColorSpace;
-
-    (**
-     * MPEG vs JPEG YUV range.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     *)
-    color_range: TAVColorRange;
-
-    (**
-     * This defines the location of chroma samples.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     *)
-    chroma_sample_location: TAVChromaLocation;
-    {$IFEND}
   end;
 
   (**
@@ -2790,7 +2680,111 @@ type
     reordered_opaque: cint64;
     {$IFEND}
     
-    {$IF LIBAVCODEC_VERSION >= 52028000} // 52.28.0
+    {$IF LIBAVCODEC_VERSION >= 51069000} // 51.69.0
+    (**
+     * Bits per sample/pixel of internal libavcodec pixel/sample format.
+     * This field is applicable only when sample_fmt is SAMPLE_FMT_S32.
+     * - encoding: set by user.
+     * - decoding: set by libavcodec.
+     *)
+    bits_per_raw_sample: cint;
+    {$IFEND}
+
+    {$IF LIBAVCODEC_VERSION >= 52002000} // 52.2.0
+    (**
+     * Audio channel layout.
+     * - encoding: set by user.
+     * - decoding: set by libavcodec.
+     *)
+    channel_layout: cint64;
+
+    (**
+     * Request decoder to use this channel layout if it can (0 for default)
+     * - encoding: unused
+     * - decoding: Set by user.
+     *)
+    request_channel_layout: cint64;
+    {$IFEND}
+
+    {$IF LIBAVCODEC_VERSION >= 52004000} // >= 52.4.0
+    (**
+     * Ratecontrol attempt to use, at maximum, <value> of what can be used without an underflow.
+     * - encoding: Set by user.
+     * - decoding: unused.
+     *)
+    rc_max_available_vbv_use: cfloat;
+
+    (**
+     * Ratecontrol attempt to use, at least, <value> times the amount needed to prevent a vbv overflow.
+     * - encoding: Set by user.
+     * - decoding: unused.
+     *)
+    rc_min_vbv_overflow_use: cfloat;
+    {$IFEND}
+
+    {$IF LIBAVCODEC_VERSION >= 52018000} // >= 52.18.0
+    (**
+     * Hardware accelerator in use
+     * - encoding: unused.
+     * - decoding: Set by libavcodec
+     *)
+    hwaccel: PAVHWAccel;
+    {$IFEND}
+
+    {$IF LIBAVCODEC_VERSION >= 52020000} // >= 52.20.0
+    (**
+     * For some codecs, the time base is closer to the field rate than the frame rate.
+     * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration
+     * if no telecine is used ...
+     *
+     * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2.
+     *)
+    ticks_per_frame: cint;
+    {$IFEND}
+
+    {$IF LIBAVCODEC_VERSION >= 52021000} // >= 52.21.0
+    (**
+     * Hardware accelerator context.
+     * For some hardware accelerators, a global context needs to be
+     * provided by the user. In that case, this holds display-dependent
+     * data FFmpeg cannot instantiate itself. Please refer to the
+     * FFmpeg HW accelerator documentation to know how to fill this
+     * is. e.g. for VA API, this is a struct vaapi_context.
+     * - encoding: unused
+     * - decoding: Set by user
+     *)
+    hwaccel_context: pointer;
+    {$IFEND}
+
+    {$IF LIBAVCODEC_VERSION >= 52028000} // >= 52.28.0
+    (**
+     * Chromaticity coordinates of the source primaries.
+     * - encoding: Set by user
+     * - decoding: Set by libavcodec
+     *)
+    color_primaries: TAVColorPrimaries;
+
+    (**
+     * Color Transfer Characteristic.
+     * - encoding: Set by user
+     * - decoding: Set by libavcodec
+     *)
+    color_trc: TAVColorTransferCharacteristic;
+
+    (**
+     * YUV colorspace type.
+     * - encoding: Set by user
+     * - decoding: Set by libavcodec
+     *)
+    colorspace: TAVColorSpace;
+
+    (**
+     * MPEG vs JPEG YUV range.
+     * - encoding: Set by user
+     * - decoding: Set by libavcodec
+     *)
+    color_range: TAVColorRange;
+
     (**
      * This defines the location of chroma samples.
      * - encoding: Set by user
@@ -2798,6 +2792,7 @@ type
      *)
      chroma_sample_location: TAVChromaLocation;
     {$IFEND}
+
     {$IF LIBAVCODEC_VERSION >= 52037000} // >= 52.37.0
     (**
      * The codec may call this to execute several independent things.
@@ -2819,6 +2814,7 @@ type
      *)
       execute2: function (c: PAVCodecContext; func: TExecute2Func; arg2: Pointer; ret: Pcint; count: cint): cint; cdecl;
     {$IFEND}
+
     {$IF LIBAVCODEC_VERSION >= 52042000} // >= 52.42.0
     (**
      * explicit P-frame weighted prediction analysis method
@@ -3317,7 +3313,12 @@ procedure avcodec_set_dimensions(s: PAVCodecContext; width: cint; height: cint);
 function avcodec_get_pix_fmt(name: {const} PAnsiChar): TAVPixelFormat;
   cdecl; external av__codec;
 
-function avcodec_pix_fmt_to_codec_tag(p: TAVPixelFormat): cuint;
+(**
+ * Returns a value representing the fourCC code associated to the
+ * pixel format pix_fmt, or 0 if no associated fourCC code can be
+ * found.
+ *)
+function avcodec_pix_fmt_to_codec_tag(pix_fmt: TAVPixelFormat): cuint;
   cdecl; external av__codec;
 
 const
@@ -4087,9 +4088,10 @@ type
     codec_ids: array [0..4] of cint; (* several codec IDs are permitted *)
     priv_data_size: cint;
     parser_init: function(s: PAVCodecParserContext): cint; cdecl;
-    parser_parse: function(s: PAVCodecParserContext; avctx: PAVCodecContext;
-                            poutbuf: {const} PPointer; poutbuf_size: PCint;
-                            buf: {const} PByteArray; buf_size: cint): cint; cdecl;
+    parser_parse: function(s: PAVCodecParserContext;
+                           avctx: PAVCodecContext;
+                           poutbuf: {const} PPointer; poutbuf_size: PCint;
+                           buf: {const} PByteArray; buf_size: cint): cint; cdecl;
     parser_close: procedure(s: PAVCodecParserContext); cdecl;
     split: function(avctx: PAVCodecContext; buf: {const} PByteArray;
                     buf_size: cint): cint; cdecl;
@@ -4212,6 +4214,7 @@ function av_bitstream_filter_filter(bsfc: PAVBitStreamFilterContext;
                                poutbuf: PPointer; poutbuf_size: PCint;
                                buf: PByte; buf_size: cint; keyframe: cint): cint;
   cdecl; external av__codec;
+
 procedure av_bitstream_filter_close(bsf: PAVBitStreamFilterContext);
   cdecl; external av__codec;
 
diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas
index f9776cb9..261ce8f6 100644
--- a/src/lib/ffmpeg/avformat.pas
+++ b/src/lib/ffmpeg/avformat.pas
@@ -28,12 +28,11 @@
  * Conversion of libavformat/avformat.h
  * Min. version: 50.5.0 , revision 6577,  Sat Oct 7 15:30:46 2006 UTC
  * Max. version: 52.25.0, revision 16986, Wed Feb 4 05:56:39 2009 UTC 
- *)
-{
+ *
  * update to
- * Max. version: 52.46.0, Mo Jan 4 0:40:00 2009 CET 
+ * Max. version: 52.46.0, Mo Jan 4 2010 0:40:00 CET 
  * MiSchi
-}
+ *)
 
 unit avformat;
 
diff --git a/src/lib/ffmpeg/avio.pas b/src/lib/ffmpeg/avio.pas
index fe55fa0e..1a37e556 100644
--- a/src/lib/ffmpeg/avio.pas
+++ b/src/lib/ffmpeg/avio.pas
@@ -33,13 +33,11 @@
  *
  * @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.44.0, Tue Dec 29 0:40:00 2009 CET 
+ * Max. avformat version: 52.46.0, Mon Jan 4 2010 0:40:00 CET 
  * MiSchi
-}
+ *)
 
 unit avio;
 
diff --git a/src/lib/ffmpeg/avutil.pas b/src/lib/ffmpeg/avutil.pas
index c0428bef..a5e6b889 100644
--- a/src/lib/ffmpeg/avutil.pas
+++ b/src/lib/ffmpeg/avutil.pas
@@ -36,14 +36,15 @@
  *
  * libavutil/log.h:
  *  revision 16571, Tue Jan 13 00:14:43 2009 UTC
+ *
+ * Update changes auf avutil.h, mem.h and log.h
+ * Max. version 50.7.0, Tue, Dec 29 0:30:00 2009 UTC 
+ * include/keep pixfmt.h (change in revision 50.01.0)
+ * Maybe, the pixelformats are not needed, but it has not been checked.
+ * log.h is only partial.
+ *
+ * update Mon, Jan 4 2010
  *)
-{
- Update changes auf avutil.h, mem.h and log.h
- Max. version 50.7.0, Tue, Dec 29 0:30:00 2009 UTC 
- include/keep pixfmt.h (change in revision 50.01.0)
- Maybe, the pixelformats are not needed, but it has not been checked.
- log.h is only partial.
-}
 
 unit avutil;
 
@@ -115,6 +116,8 @@ function avutil_license(): PAnsiChar;
   cdecl; external av__format;
 {$IFEND}
 
+(* libavutil/pixfmt.h *)
+
 type
 (**
  * Pixel format. Notes:
@@ -286,6 +289,7 @@ const
 function MKTAG(a, b, c, d: AnsiChar): integer;
 
 (* libavutil/mem.h *)
+
 (* memory handling functions *)
 
 (**
@@ -402,11 +406,40 @@ const
   AV_LOG_DEBUG   = 48;
 {$IFEND}
 
+(**
+ * Sends the specified message to the log if the level is less than or equal
+ * to the current av_log_level. By default, all logging messages are sent to
+ * stderr. This behavior can be altered by setting a different av_vlog callback
+ * function.
+ *
+ * @param avcl A pointer to an arbitrary struct of which the first field is a
+ * pointer to an AVClass struct.
+ * @param level The importance level of the message, lower values signifying
+ * higher importance.
+ * @param fmt The format string (printf-compatible) that specifies how
+ * subsequent arguments are converted to output.
+ * @see av_vlog
+ *)
+
+{** to be translated if needed
+#ifdef __GNUC__
+void av_log(void*, int level, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4)));
+#else
+void av_log(void*, int level, const char *fmt, ...);
+#endif
+ 
+void av_vlog(void*, int level, const char *fmt, va_list);
+**}
+
 function av_log_get_level(): cint;
   cdecl; external av__util;
 procedure av_log_set_level(level: cint);
   cdecl; external av__util;
 
+{** to be translated if needed
+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);
+**}
 
 implementation
 
diff --git a/src/lib/ffmpeg/mathematics.pas b/src/lib/ffmpeg/mathematics.pas
index 24c9e186..651c1404 100644
--- a/src/lib/ffmpeg/mathematics.pas
+++ b/src/lib/ffmpeg/mathematics.pas
@@ -33,7 +33,7 @@
  *)
 {
  * update to
- * avutil max. version 50.05.1, Sun, Dec 6 24:00:00 2009 UTC 
+ * avutil max. version 50.7.0, Mon, Jan 4 2010 24:00:00 UTC 
  * MiSchi
 }
 
diff --git a/src/lib/ffmpeg/opt.pas b/src/lib/ffmpeg/opt.pas
index 86144598..726e57ce 100644
--- a/src/lib/ffmpeg/opt.pas
+++ b/src/lib/ffmpeg/opt.pas
@@ -23,18 +23,15 @@
  * - 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/opt.h
  * revision 16912, Sun Feb 1 02:00:19 2009 UTC 
  *
  * update, MiSchi, no code change
  * Fri Jun 12 2009 21:50:00 UTC
- *)
-{
+ *
  * update to
- * Max. version: 52.42.0, Sun Dec 6 19:20:00 2009 CET 
+ * Max. avcodec version: 52.45.0, Mon Jan 4 2010 19:20:00 CET 
  * MiSchi
 }
 
diff --git a/src/lib/ffmpeg/rational.pas b/src/lib/ffmpeg/rational.pas
index 4b8a2dc8..0f7dd714 100644
--- a/src/lib/ffmpeg/rational.pas
+++ b/src/lib/ffmpeg/rational.pas
@@ -32,8 +32,9 @@
  * update, MiSchi, no code change
  * Fri Jun 12 2009 22:20:00 UTC
  *
- * update, MiSchi, no code change needed
- * Sun Dec 6 2009 22:20:00 UTC
+ * update to
+ * avutil max. version 50.7.0, Mon, Jan 4 2010 24:00:00 UTC 
+ * MiSchi
  *)
 
 unit rational;
diff --git a/src/lib/ffmpeg/swscale.pas b/src/lib/ffmpeg/swscale.pas
index 595e16ba..99a59a97 100644
--- a/src/lib/ffmpeg/swscale.pas
+++ b/src/lib/ffmpeg/swscale.pas
@@ -27,7 +27,7 @@
  *)
 {
  * update to
- * Max. version: 0.7.2, Sun Dec 6 22:20:00 2009 CET 
+ * Max. version: 0.7.2, Mon Jan 4 2010 22:20:00 CET 
  * MiSchi
 }
  
-- 
cgit v1.2.3