aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ffmpeg-0.11/libavutil
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ffmpeg-0.11/libavutil')
-rw-r--r--src/lib/ffmpeg-0.11/libavutil/cpu.pas40
-rw-r--r--src/lib/ffmpeg-0.11/libavutil/dict.pas4
-rw-r--r--src/lib/ffmpeg-0.11/libavutil/error.pas5
-rw-r--r--src/lib/ffmpeg-0.11/libavutil/log.pas4
-rw-r--r--src/lib/ffmpeg-0.11/libavutil/mathematics.pas9
-rw-r--r--src/lib/ffmpeg-0.11/libavutil/mem.pas2
-rw-r--r--src/lib/ffmpeg-0.11/libavutil/opt.pas205
-rw-r--r--src/lib/ffmpeg-0.11/libavutil/pixfmt.pas8
-rw-r--r--src/lib/ffmpeg-0.11/libavutil/samplefmt.pas96
9 files changed, 338 insertions, 35 deletions
diff --git a/src/lib/ffmpeg-0.11/libavutil/cpu.pas b/src/lib/ffmpeg-0.11/libavutil/cpu.pas
index c28441bf..c52c2b4e 100644
--- a/src/lib/ffmpeg-0.11/libavutil/cpu.pas
+++ b/src/lib/ffmpeg-0.11/libavutil/cpu.pas
@@ -19,7 +19,7 @@
* - Changes and updates by the UltraStar Deluxe Team
*
* Conversion of libavutil/cpu.h
- * avutil version 51.34.101
+ * avutil version 51.54.100
*
*)
@@ -47,11 +47,18 @@ const
AV_CPU_FLAG_SSE4 = $0100; ///< Penryn SSE4.1 functions
AV_CPU_FLAG_SSE42 = $0200; ///< Nehalem SSE4.2 functions
AV_CPU_FLAG_AVX = $4000; ///< AVX functions: requires OS support even if YMM registers aren't used
+ AV_CPU_FLAG_CMOV = $1000000; ///< supports cmov instruction
AV_CPU_FLAG_XOP = $0400; ///< Bulldozer XOP functions
AV_CPU_FLAG_FMA4 = $0800; ///< Bulldozer FMA4 functions
- AV_CPU_FLAG_IWMMXT = $0100; ///< XScale IWMMXT
AV_CPU_FLAG_ALTIVEC = $0001; ///< standard
+ AV_CPU_FLAG_ARMV5TE = (1 << 0);
+ AV_CPU_FLAG_ARMV6 = (1 << 1);
+ AV_CPU_FLAG_ARMV6T2 = (1 << 2);
+ AV_CPU_FLAG_VFP = (1 << 3);
+ AV_CPU_FLAG_VFPV3 = (1 << 4);
+ AV_CPU_FLAG_NEON = (1 << 5);
+
(**
* Return the flags which specify extensions supported by the CPU.
*)
@@ -60,10 +67,39 @@ function av_get_cpu_flags(): cint;
(**
* Disables cpu detection and forces the specified flags.
+ * -1 is a special case that disables forcing of specific flags.
*)
procedure av_force_cpu_flags(flags: cint);
cdecl; external av__util;
+(**
+ * Set a mask on flags returned by av_get_cpu_flags().
+ * This function is mainly useful for testing.
+ * Please use av_force_cpu_flags() and av_get_cpu_flags() instead which are more flexible
+ *
+ * @warning this function is not thread safe.
+ *)
+procedure av_set_cpu_flags_mask(mask: cint);
+ cdecl; external av__util; deprecated;
+
+(**
+ * Parse CPU flags from a string.
+ *
+ * The returned flags contain the specified flags as well as related unspecified flags.
+ *
+ * This function exists only for compatibility with libav.
+ * Please use av_parse_cpu_caps() when possible.
+ * @return a combination of AV_CPU_* flags, negative on error.
+ *)
+function av_parse_cpu_flags(s: {const} PAnsiChar): cint;
+
+(**
+ * Parse CPU caps from a string and update the given AV_CPU_* flags based on that.
+ *
+ * @return negative on error.
+ *)
+function av_parse_cpu_caps(flags: Pcuint, s: {const} PAnsiChar): cint;
+
(* The following CPU-specific functions shall not be called directly. *)
function ff_get_cpu_flags_arm(): cint;
cdecl; external av__util;
diff --git a/src/lib/ffmpeg-0.11/libavutil/dict.pas b/src/lib/ffmpeg-0.11/libavutil/dict.pas
index aa52861e..d141becb 100644
--- a/src/lib/ffmpeg-0.11/libavutil/dict.pas
+++ b/src/lib/ffmpeg-0.11/libavutil/dict.pas
@@ -19,7 +19,7 @@
* This is a part of the Pascal port of ffmpeg.
*
* Conversion of libavutil/dict.h
- * avutil version 51.34.101
+ * avutil version 51.54.100
*
*)
@@ -68,7 +68,7 @@ function av_dict_get(m: PAVDictionary; {const} key: PAnsiChar; {const} prev: PAV
* a dictionary struct is allocated and put in *pm.
* @param key entry key to add to *pm (will be av_strduped depending on flags)
* @param value entry value to add to *pm (will be av_strduped depending on flags).
- * Passing a NULL value will cause an existing tag to be deleted.
+ * Passing a NULL value will cause an existing entry to be deleted.
* @return >= 0 on success otherwise an error code <0
*)
function av_dict_set(var pm: PAVDictionary; {const} key: PAnsiChar; {const} value: PAnsiChar; flags: cint): cint;
diff --git a/src/lib/ffmpeg-0.11/libavutil/error.pas b/src/lib/ffmpeg-0.11/libavutil/error.pas
index da6cce6c..44ade13c 100644
--- a/src/lib/ffmpeg-0.11/libavutil/error.pas
+++ b/src/lib/ffmpeg-0.11/libavutil/error.pas
@@ -19,7 +19,7 @@
* - Changes and updates by the UltraStar Deluxe Team
*
* Conversion of libavutil/error.h
- * avutil version 51.34.101
+ * avutil version 51.54.100
*
*)
@@ -109,7 +109,8 @@ const
* This is semantically identical to AVERROR_BUG
* it has been introduced in Libav after our AVERROR_BUG and with a modified value.
*)
- AVERROR_BUG2 = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord(' ') shl 24));
+ AVERROR_BUG2 = -(ord('B') or (ord('U') shl 8) or (ord('G') shl 16) or (ord(' ') shl 24));
+ AVERROR_UNKNOWN = -(ord('U') or (ord('N') shl 8) or (ord('K') shl 16) or (ord('N') shl 24)); ///< Unknown error, typically from an external library
(*
* Put a description of the AVERROR code errnum in errbuf.
diff --git a/src/lib/ffmpeg-0.11/libavutil/log.pas b/src/lib/ffmpeg-0.11/libavutil/log.pas
index ecde0b87..e61f8f03 100644
--- a/src/lib/ffmpeg-0.11/libavutil/log.pas
+++ b/src/lib/ffmpeg-0.11/libavutil/log.pas
@@ -19,7 +19,7 @@
* - Changes and updates by the UltraStar Deluxe Team
*
* Conversion of libavutil/log.h
- * avutil version 51.34.101
+ * avutil version 51.54.100
*
*)
@@ -128,6 +128,8 @@ const
*)
AV_LOG_DEBUG = 48;
+ AV_LOG_MAX_OFFSET = (AV_LOG_DEBUG - AV_LOG_QUIET);
+
(**
* Send 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
diff --git a/src/lib/ffmpeg-0.11/libavutil/mathematics.pas b/src/lib/ffmpeg-0.11/libavutil/mathematics.pas
index 3859311b..d4e3c01f 100644
--- a/src/lib/ffmpeg-0.11/libavutil/mathematics.pas
+++ b/src/lib/ffmpeg-0.11/libavutil/mathematics.pas
@@ -22,7 +22,7 @@
* - Changes and updates by the UltraStar Deluxe Team
*
* Conversion of libavutil/mathematics.h
- * avutil version 51.34.101
+ * avutil version 51.54.100
*
*)
@@ -81,6 +81,13 @@ function av_rescale_q (a: cint64; bq, cq: TAVRational): cint64;
cdecl; external av__util; {av_const}
(**
+ * Rescale a 64-bit integer by 2 rational numbers with specified rounding.
+ *)
+function av_rescale_q_rnd(a: cint64; bq, cq: TAVRational;
+ enum: TAVRounding): cint64;
+ cdecl; external av__util; {av_const}
+
+(**
* Compare 2 timestamps each in its own timebases.
* The result of the function is undefined if one of the timestamps
* is outside the int64_t range when represented in the others timebase.
diff --git a/src/lib/ffmpeg-0.11/libavutil/mem.pas b/src/lib/ffmpeg-0.11/libavutil/mem.pas
index d59b9a46..5144b709 100644
--- a/src/lib/ffmpeg-0.11/libavutil/mem.pas
+++ b/src/lib/ffmpeg-0.11/libavutil/mem.pas
@@ -19,7 +19,7 @@
* - Changes and updates by the UltraStar Deluxe Team
*
* Conversion of libavutil/mem.h
- * avutil version 51.34.101
+ * avutil version 51.54.100
*
*)
diff --git a/src/lib/ffmpeg-0.11/libavutil/opt.pas b/src/lib/ffmpeg-0.11/libavutil/opt.pas
index f2c258de..28e3b858 100644
--- a/src/lib/ffmpeg-0.11/libavutil/opt.pas
+++ b/src/lib/ffmpeg-0.11/libavutil/opt.pas
@@ -23,7 +23,7 @@
* - Changes and updates by the UltraStar Deluxe Team
*
* Conversion of libavutil/opt.h
- * avutil version 51.34.101
+ * avutil version 51.54.100
*
*)
@@ -151,24 +151,25 @@ function av_find_opt(obj: Pointer; {const} name: {const} PAnsiChar; {const} unit
* AVERROR(EINVAL) if the value is not valid
*)
function av_set_string3(obj: Pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; alloc: cint; out o_out: {const} PAVOption): cint;
- cdecl; external av__util;
+ cdecl; external av__util; deprecated;
-function av_set_double(obj: pointer; name: {const} PAnsiChar; n: cdouble): PAVOption;
- cdecl; external av__util;
-function av_set_q(obj: pointer; name: {const} PAnsiChar; n: TAVRational): PAVOption;
- cdecl; external av__util;
-function av_set_int(obj: pointer; name: {const} PAnsiChar; n: cint64): PAVOption;
- cdecl; external av__util;
-function av_get_double(obj: pointer; name: {const} PAnsiChar; var o_out: {const} PAVOption): cdouble;
- cdecl; external av__util;
-function av_get_q(obj: pointer; name: {const} PAnsiChar; var o_out: {const} PAVOption): TAVRational;
+function av_set_double(obj: pointer; name: {const} PAnsiChar; n: cdouble): PAVOption;
+ cdecl; external av__util; deprecated;
+function av_set_q (obj: pointer; name: {const} PAnsiChar; n: TAVRational): PAVOption;
+ cdecl; external av__util; deprecated;
+function av_set_int (obj: pointer; name: {const} PAnsiChar; n: cint64): PAVOption;
+ cdecl; external av__util; deprecated;
+
+function av_get_double(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cdouble;
cdecl; external av__util;
-function av_get_int(obj: pointer; name: {const} PAnsiChar; var o_out: {const} PAVOption): cint64;
+function av_get_q (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): TAVRational;
cdecl; external av__util;
-function av_get_string(obj: pointer; name: {const} PAnsiChar; var o_out: {const} PAVOption; buf: PAnsiChar; buf_len: cint): PAnsiChar;
+function av_get_int (obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption): cint64;
cdecl; external av__util;
+function av_get_string(obj: pointer; name: {const} PAnsiChar; out o_out: {const} PAVOption; buf: PAnsiChar; buf_len: cint): PAnsiChar;
+ cdecl; external av__util; deprecated;
function av_next_option(obj: pointer; last: {const} PAVOption): PAVOption;
- cdecl; external av__util;
+ cdecl; external av__util; deprecated;
(**
* Show the obj options.
@@ -182,10 +183,16 @@ function av_next_option(obj: pointer; last: {const} PAVOption): PAVOption;
function av_opt_show2(obj: pointer; av_log_obj: pointer; req_flags: cint; rej_flags: cint): cint;
cdecl; external av__util;
+(**
+ * Set the values of all AVOption fields to their default values.
+ *
+ * @param s an AVOption-enabled struct (its first member must be a pointer to AVClass)
+ *)
procedure av_opt_set_defaults(s: pointer);
cdecl; external av__util;
+
procedure av_opt_set_defaults2(s: Pointer; mask: cint; flags: cint);
- cdecl; external av__util;
+ cdecl; external av__util; deprecated;
(**
* Parse the key/value pairs list in opts. For each key/value pair
@@ -242,9 +249,40 @@ function av_opt_flag_is_set(obj: pointer; field_name: {const} PAnsiChar; flag_na
function av_opt_set_dict(obj: pointer; var options: PAVDictionary): cint;
cdecl; external av__util;
-const
+(**
+ * @defgroup opt_eval_funcs Evaluating option strings
+ * @{
+ * This group of functions can be used to evaluate option strings
+ * and get numbers out of them. They do the same thing as av_opt_set(),
+ * except the result is written into the caller-supplied pointer.
+ *
+ * @param obj a struct whose first element is a pointer to AVClass.
+ * @param o an option for which the string is to be evaluated.
+ * @param val string to be evaluated.
+ * @param *_out value of the string will be written here.
+ *
+ * @return 0 on success, a negative number on failure.
+ *)
+function av_opt_eval_flags (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; flags_out: Pcint): cint;
+function av_opt_eval_int (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int_out: Pcint): cint;
+function av_opt_eval_int64 (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int64_out: Pcint64): cint;
+function av_opt_eval_float (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; float_out: Pcfloat): cint;
+function av_opt_eval_double(obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; double_out: Pcdouble): cint;
+function av_opt_eval_q (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; q_out: PAVRational): cint;
+(**
+ * @}
+ *)
+
+ const
AV_OPT_SEARCH_CHILDREN = 0001; (**< Search in possible children of the
given object first.*)
+(**
+ * The obj passed to av_opt_find() is fake -- only a double pointer to AVClass
+ * instead of a required pointer to a struct containing AVClass. This is
+ * useful for searching for options without needing to allocate the corresponding
+ * object.
+ *)
+ AV_OPT_SEARCH_FAKE_OBJ = 0002;
(**
* Look for an option in an object. Consider only options which
@@ -267,5 +305,138 @@ const
* flag.
*)
function av_opt_find(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar;
- opt_flags: cint; search_flags: cint): PAVOption;
+ opt_flags: cint; search_flags: cint): PAVOption;
+ cdecl; external av__util;
+
+(**
+ * Look for an option in an object. Consider only options which
+ * have all the specified flags set.
+ *
+ * @param[in] obj A pointer to a struct whose first element is a
+ * pointer to an AVClass.
+ * Alternatively a double pointer to an AVClass, if
+ * AV_OPT_SEARCH_FAKE_OBJ search flag is set.
+ * @param[in] name The name of the option to look for.
+ * @param[in] unit When searching for named constants, name of the unit
+ * it belongs to.
+ * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG).
+ * @param search_flags A combination of AV_OPT_SEARCH_*.
+ * @param[out] target_obj if non-NULL, an object to which the option belongs will be
+ * written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present
+ * in search_flags. This parameter is ignored if search_flags contain
+ * AV_OPT_SEARCH_FAKE_OBJ.
+ *
+ * @return A pointer to the option found, or NULL if no option
+ * was found.
+ *)
+function av_opt_find2(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar;
+ opt_flags: cint; search_flags: cint; out target_obj: pointer): {const} PAVOption;
cdecl; external av__util;
+
+(**
+ * Iterate over all AVOptions belonging to obj.
+ *
+ * @param obj an AVOptions-enabled struct or a double pointer to an
+ * AVClass describing it.
+ * @param prev result of the previous call to av_opt_next() on this object
+ * or NULL
+ * @return next AVOption or NULL
+ *)
+function av_opt_next(obj: pointer; prev: {const} PAVOption): {const} PAVOption;
+ cdecl; external av__util;
+
+(**
+ * Iterate over AVOptions-enabled children of obj.
+ *
+ * @param prev result of a previous call to this function or NULL
+ * @return next AVOptions-enabled child or NULL
+ *)
+function av_opt_child_next(obj: pointer; prev: pointer): pointer;
+ cdecl; external av__util;
+
+(**
+ * Iterate over potential AVOptions-enabled children of parent.
+ *
+ * @param prev result of a previous call to this function or NULL
+ * @return AVClass corresponding to next potential child or NULL
+ *)
+function av_opt_child_class_next(parent: {const} PAVClass; prev: {const} PAVClass): {const} PAVClass;
+ cdecl; external av__util;
+
+(**
+ * @defgroup opt_set_funcs Option setting functions
+ * @{
+ * Those functions set the field of obj with the given name to value.
+ *
+ * @param[in] obj A struct whose first element is a pointer to an AVClass.
+ * @param[in] name the name of the field to set
+ * @param[in] val The value to set. In case of av_opt_set() if the field is not
+ * of a string type, then the given string is parsed.
+ * SI postfixes and some named scalars are supported.
+ * If the field is of a numeric type, it has to be a numeric or named
+ * scalar. Behavior with more than one scalar and +- infix operators
+ * is undefined.
+ * If the field is of a flags type, it has to be a sequence of numeric
+ * scalars or named flags separated by '+' or '-'. Prefixing a flag
+ * with '+' causes it to be set without affecting the other flags;
+ * similarly, '-' unsets a flag.
+ * @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN
+ * is passed here, then the option may be set on a child of obj.
+ *
+ * @return 0 if the value has been set, or an AVERROR code in case of
+ * error:
+ * AVERROR_OPTION_NOT_FOUND if no matching option exists
+ * AVERROR(ERANGE) if the value is out of range
+ * AVERROR(EINVAL) if the value is not valid
+ *)
+function av_opt_set (obj: pointer; name: {const} PAnsiChar; val: {const} PAnsiChar; search_flags: cint): cint;
+ cdecl; external av__util;
+function av_opt_set_int (obj: pointer; name: {const} PAnsiChar; val: cint64; search_flags: cint): cint;
+ cdecl; external av__util;
+function av_opt_set_double(obj: pointer; name: {const} PAnsiChar; val: cdouble; search_flags: cint): cint;
+ cdecl; external av__util;
+function av_opt_set_q (obj: pointer; name: {const} PAnsiChar; val: TAVRational; search_flags: cint): cint;
+ cdecl; external av__util;
+(**
+ * @}
+ *)
+
+(**
+ * @defgroup opt_get_funcs Option getting functions
+ * @{
+ * Those functions get a value of the option with the given name from an object.
+ *
+ * @param[in] obj a struct whose first element is a pointer to an AVClass.
+ * @param[in] name name of the option to get.
+ * @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN
+ * is passed here, then the option may be found in a child of obj.
+ * @param[out] out_val value of the option will be written here
+ * @return 0 on success, a negative error code otherwise
+ *)
+(**
+ * @note the returned string will av_malloc()ed and must be av_free()ed by the caller
+ *)
+function av_opt_get (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out out_val: Pcuint8): cint;
+ cdecl; external av__util;
+function av_opt_get_int (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcint64): cint;
+ cdecl; external av__util;
+function av_opt_get_double(obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: Pcdouble): cint;
+ cdecl; external av__util;
+function av_opt_get_q (obj: pointer; name: {const} PAnsiChar; search_flags: cint; out_val: PAVRational): cint;
+ cdecl; external av__util;
+(**
+ * @}
+ *)
+(**
+ * Gets a pointer to the requested field in a struct.
+ * This function allows accessing a struct even when its fields are moved or
+ * renamed since the application making the access has been compiled,
+ *
+ * @returns a pointer to the field, it can be cast to the correct type and read
+ * or written to.
+ *)
+function av_opt_ptr(avclass: {const} PAVClass; obj: pointer; name: {const} PAnsiChar): pointer;
+ cdecl; external av__util;
+(**
+ * @}
+ *)
diff --git a/src/lib/ffmpeg-0.11/libavutil/pixfmt.pas b/src/lib/ffmpeg-0.11/libavutil/pixfmt.pas
index 5e8a547d..f93e482b 100644
--- a/src/lib/ffmpeg-0.11/libavutil/pixfmt.pas
+++ b/src/lib/ffmpeg-0.11/libavutil/pixfmt.pas
@@ -19,7 +19,7 @@
* - Changes and updates by the UltraStar Deluxe Team
*
* Conversion of libavutil/pixfmt.h
- * avutil version 51.34.101
+ * avutil version 51.54.100
*
*)
@@ -28,6 +28,10 @@
* Pixel format
*)
+const
+ AVPALETTE_SIZE = 1024;
+ AVPALETTE_COUNT = 256;
+
type
(**
* Pixel format. Notes:
@@ -181,6 +185,8 @@ type
PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGB0RGB0...
PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, 0BGR0BGR...
PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGR0BGR0...
+ PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
+ PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
);
diff --git a/src/lib/ffmpeg-0.11/libavutil/samplefmt.pas b/src/lib/ffmpeg-0.11/libavutil/samplefmt.pas
index 80cdd71b..62165737 100644
--- a/src/lib/ffmpeg-0.11/libavutil/samplefmt.pas
+++ b/src/lib/ffmpeg-0.11/libavutil/samplefmt.pas
@@ -19,13 +19,32 @@
* This is a part of the Pascal port of ffmpeg.
*
* Conversion of libavutil/samplefmt.h
- * avutil version 51.34.101
+ * avutil version 51.54.100
*
*)
type
(**
- * all in native-endian format
+ * Audio Sample Formats
+ *
+ * @par
+ * The data described by the sample format is always in native-endian order.
+ * Sample values can be expressed by native C types, hence the lack of a signed
+ * 24-bit sample format even though it is a common raw audio data format.
+ *
+ * @par
+ * The floating-point formats are based on full volume being in the range
+ * [-1.0, 1.0]. Any values outside this range are beyond full volume level.
+ *
+ * @par
+ * The data layout as used in av_samples_fill_arrays() and elsewhere in Libav
+ * (such as AVFrame in libavcodec) is as follows:
+ *
+ * For planar sample formats, each audio channel is in a separate data plane,
+ * and linesize is the buffer size, in bytes, for a single plane. All data
+ * planes must be the same size. For packed sample formats, only the first data
+ * plane is used, and samples for each channel are interleaved. In this case,
+ * linesize is the buffer size, in bytes, for the 1 plane.
*)
TAVSampleFormat = (
AV_SAMPLE_FMT_NONE = -1,
@@ -70,6 +89,30 @@ function av_get_alt_sample_fmt(sample_fmt: TAVSampleFormat; planar: cint): TAVSa
cdecl; external av__util;
(**
+ * Get the packed alternative form of the given sample format.
+ *
+ * If the passed sample_fmt is already in packed format, the format returned is
+ * the same as the input.
+ *
+ * @return the packed alternative form of the given sample format or
+ AV_SAMPLE_FMT_NONE on error.
+ *)
+function av_get_packed_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat;
+ cdecl; external av__util;
+
+(**
+ * Get the planar alternative form of the given sample format.
+ *
+ * If the passed sample_fmt is already in planar format, the format returned is
+ * the same as the input.
+ *
+ * @return the planar alternative form of the given sample format or
+ AV_SAMPLE_FMT_NONE on error.
+ *)
+function av_get_planar_sample_fmt(sample_fmt: TAVSampleFormat): TAVSampleFormat;
+ cdecl; external av__util;
+
+(**
* Generate a string corresponding to the sample format with
* sample_fmt, or a header if sample_fmt is negative.
*
@@ -89,7 +132,7 @@ function av_get_sample_fmt_string(buf: PAnsiChar; buf_size: cint; sample_fmt: TA
* @deprecated Use av_get_bytes_per_sample() instead.
*)
function av_get_bits_per_sample_fmt(sample_fmt: TAVSampleFormat): cint; deprecated;
- cdecl; external av__util;
+ cdecl; external av__util; deprecated;
{$ENDIF}
(**
@@ -122,6 +165,7 @@ function av_sample_fmt_is_planar(sample_fmt: TAVSampleFormat): cint;
* @param nb_channels the number of channels
* @param nb_samples the number of samples in a single channel
* @param sample_fmt the sample format
+ * @param align buffer size alignment (0 = default, 1 = no alignment)
* @return required buffer size, or negative error code on failure
*)
function av_samples_get_buffer_size(linesize: Pcint; nb_channels: cint; nb_samples: cint;
@@ -140,17 +184,21 @@ function av_samples_get_buffer_size(linesize: Pcint; nb_channels: cint; nb_sampl
* buffer for planar layout, or the aligned size of the buffer for all channels
* for packed layout.
*
+ * @see enum AVSampleFormat
+ * The documentation for AVSampleFormat describes the data layout.
+ *
* @param[out] audio_data array to be filled with the pointer for each channel
- * @param[out] linesize calculated linesize
+ * @param[out] linesize calculated linesize, may be NULL
* @param buf the pointer to a buffer containing the samples
* @param nb_channels the number of channels
* @param nb_samples the number of samples in a single channel
* @param sample_fmt the sample format
- * @param align buffer size alignment (1 = no alignment required)
+ * @param align buffer size alignment (0 = default, 1 = no alignment)
* @return 0 on success or a negative error code on failure
*)
function av_samples_fill_arrays(audio_data: pointer; linesize: Pcint;
- buf: Pcuint8; nb_channels: cint; nb_samples: cint;
+ buf: Pcuint8;
+ nb_channels: cint; nb_samples: cint;
sample_fmt: TAVSampleFormat; align: cint): cint;
cdecl; external av__util;
@@ -159,11 +207,14 @@ function av_samples_fill_arrays(audio_data: pointer; linesize: Pcint;
* linesize accordingly.
* The allocated samples buffer can be freed by using av_freep(&audio_data[0])
*
+ * @see enum AVSampleFormat
+ * The documentation for AVSampleFormat describes the data layout.
+ *
* @param[out] audio_data array to be filled with the pointer for each channel
- * @param[out] linesize aligned size for audio buffer(s)
+ * @param[out] linesize aligned size for audio buffer(s), may be NULL
* @param nb_channels number of audio channels
* @param nb_samples number of samples per channel
- * @param align buffer size alignment (1 = no alignment required)
+ * @param align buffer size alignment (0 = default, 1 = no alignment)
* @return 0 on success or a negative error code on failure
* @see av_samples_fill_arrays()
*)
@@ -171,3 +222,32 @@ function av_samples_alloc(audio_data: pointer; linesize: Pcint;
nb_channels: cint; nb_samples: cint;
sample_fmt: TAVSampleFormat; align: cint): cint;
cdecl; external av__util;
+
+(**
+ * Copy samples from src to dst.
+ *
+ * @param dst destination array of pointers to data planes
+ * @param src source array of pointers to data planes
+ * @param dst_offset offset in samples at which the data will be written to dst
+ * @param src_offset offset in samples at which the data will be read from src
+ * @param nb_samples number of samples to be copied
+ * @param nb_channels number of audio channels
+ * @param sample_fmt audio sample format
+ *)
+function av_samples_copy(var dst: Pcuint8; src: {const} Pcuint8; dst_offset: cint;
+ src_offset: cint; nb_samples: cint; nb_channels: cint;
+ sample_fmt: TAVSampleFormat): cint;
+ cdecl; external av__util;
+
+(**
+ * Fill an audio buffer with silence.
+ *
+ * @param audio_data array of pointers to data planes
+ * @param offset offset in samples at which to start filling
+ * @param nb_samples number of samples to fill
+ * @param nb_channels number of audio channels
+ * @param sample_fmt audio sample format
+ *)
+function av_samples_set_silence(var audio_data: Pcuint8; offset: cint; nb_samples: cint;
+ nb_channels: cint; sample_fmt: TAVSampleFormat): cint;
+ cdecl; external av__util;