diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib/ffmpeg-0.10/libavutil/dict.pas | 68 | ||||
-rw-r--r-- | src/lib/ffmpeg-0.10/libavutil/mathematics.pas | 25 | ||||
-rw-r--r-- | src/lib/ffmpeg-0.10/libavutil/mem.pas | 48 | ||||
-rw-r--r-- | src/lib/ffmpeg-0.10/libavutil/opt.pas | 26 | ||||
-rw-r--r-- | src/lib/ffmpeg-0.8/libavutil/dict.pas | 20 | ||||
-rw-r--r-- | src/lib/ffmpeg-0.8/libavutil/mathematics.pas | 21 | ||||
-rw-r--r-- | src/lib/ffmpeg-0.8/libavutil/mem.pas | 4 | ||||
-rw-r--r-- | src/lib/ffmpeg-0.8/libavutil/opt.pas | 22 |
8 files changed, 47 insertions, 187 deletions
diff --git a/src/lib/ffmpeg-0.10/libavutil/dict.pas b/src/lib/ffmpeg-0.10/libavutil/dict.pas index b5608576..e2626e50 100644 --- a/src/lib/ffmpeg-0.10/libavutil/dict.pas +++ b/src/lib/ffmpeg-0.10/libavutil/dict.pas @@ -23,66 +23,6 @@ * *) -unit dict; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -interface - -uses - ctypes, - UConfig; - -(** - * @file - * Public dictionary API. - * @deprecated - * AVDictionary is provided for compatibility with libav. It is both in - * implementation as well as API inefficient. It does not scale and is - * extremely slow with large dictionaries. - * It is recommended that new code uses our tree container from tree.c/h - * where applicable, which uses AVL trees to achieve O(log n) performance. - *) - -(** - * @addtogroup lavu_dict AVDictionary - * @ingroup lavu_data - * - * @brief Simple key:value store - * - * @{ - * Dictionaries are used for storing key:value pairs. To create - * an AVDictionary, simply pass an address of a NULL pointer to - * av_dict_set(). NULL can be used as an empty dictionary wherever - * a pointer to an AVDictionary is required. - * Use av_dict_get() to retrieve an entry or iterate over all - * entries and finally av_dict_free() to free the dictionary - * and all its contents. - * - * @code - * AVDictionary *d = NULL; // "create" an empty dictionary - * av_dict_set(&d, "foo", "bar", 0); // add an entry - * - * char *k = av_strdup("key"); // if your strings are already allocated, - * char *v = av_strdup("value"); // you can avoid copying them like this - * av_dict_set(&d, k, v, AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL); - * - * AVDictionaryEntry *t = NULL; - * while (t = av_dict_get(d, "", t, AV_DICT_IGNORE_SUFFIX)) { - * <....> // iterate over all entries in d - * } - * - * av_dict_free(&d); - * @endcode - * - *) - const AV_DICT_MATCH_CASE = 1; AV_DICT_IGNORE_SUFFIX = 2; @@ -151,11 +91,3 @@ procedure av_dict_copy(var dst: PAVDictionary; src: PAVDictionary; flags: cint); *) procedure av_dict_free(var m: PAVDictionary); cdecl; external av__util; - -(** - * @} - *) - -implementation - -end. diff --git a/src/lib/ffmpeg-0.10/libavutil/mathematics.pas b/src/lib/ffmpeg-0.10/libavutil/mathematics.pas index 0ebdf262..3859311b 100644 --- a/src/lib/ffmpeg-0.10/libavutil/mathematics.pas +++ b/src/lib/ffmpeg-0.10/libavutil/mathematics.pas @@ -26,23 +26,6 @@ * *) -unit mathematics; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -interface - -uses - ctypes, - rational, - UConfig; - const M_E = 2.7182818284590452354; // e M_LN2 = 0.69314718055994530942; // log_e 2 @@ -118,11 +101,3 @@ function av_compare_ts(ts_a: cint64; tb_a: TAVRational; ts_b: cint64; tb_b: TAVR *) function av_compare_mod(a: cuint64; b: cuint64; modVar: cuint64): cint64; cdecl; external av__util; - -(** - * @} - *) - -implementation - -end. diff --git a/src/lib/ffmpeg-0.10/libavutil/mem.pas b/src/lib/ffmpeg-0.10/libavutil/mem.pas index 5cc1dc1b..d71dd3d3 100644 --- a/src/lib/ffmpeg-0.10/libavutil/mem.pas +++ b/src/lib/ffmpeg-0.10/libavutil/mem.pas @@ -30,9 +30,6 @@ (* memory handling functions *) -type - FF_INTERNAL_MEM_TYPE = cuint; - (** * Allocate a block of size bytes with alignment suitable for all * memory accesses (including vectors if available on the CPU). @@ -60,6 +57,19 @@ function av_realloc(ptr: pointer; size: FF_INTERNAL_MEM_TYPE): pointer; cdecl; external av__util; {av_alloc_size(2)} (** + * Allocate or reallocate a block of memory. + * This function does the same thing as av_realloc, except: + * - It takes two arguments and checks the result of the multiplication for + * integer overflow. + * - It frees the input block in case of failure, thus avoiding the memory + * leak with the classic "buf = realloc(buf); if (!buf) return -1;". + *) +{ available only in 0.8.5 - 0.8.10 +function av_realloc_f(ptr: pointer; nelem: size_t; size: size_t): pointer; + cdecl; external av__util; +} + +(** * Free a memory block which has been allocated with av_malloc(z)() or * av_realloc(). * @param ptr Pointer to the memory block which should be freed. @@ -82,6 +92,21 @@ function av_mallocz(size: FF_INTERNAL_MEM_TYPE): pointer; cdecl; external av__util; {av_malloc_attrib av_alloc_size(1)} (** + * Allocate a block of nmemb * size bytes with alignment suitable for all + * memory accesses (including vectors if available on the CPU) and + * zero all the bytes of the block. + * The allocation will fail if nmemb * size is greater than or equal + * to INT_MAX. + * @param nmemb + * @param size + * @return Pointer to the allocated block, NULL if it cannot be allocated. + *) +(* available only in 0.8.5 - 0.8.10 +function av_calloc(nmemb: size_t; size: size_t): pointer; + cdecl; external av__util; {av_malloc_attrib} +*) + +(** * Duplicate the string s. * @param s string to be duplicated. * @return Pointer to a newly allocated string containing a @@ -109,3 +134,20 @@ procedure av_freep (ptr: pointer); *) procedure av_dynarray_add(tab_ptr: pointer; nb_ptr: PCint; elem: pointer); cdecl; external av__util; + +(** + * Multiply two size_t values checking for overflow. + * @return 0 if success, AVERROR(EINVAL) if overflow. + *) +{ available only in 0.8.5 - 0.8.10 +//static inline int av_size_mult(size_t a, size_t b, size_t *r) +} +{ + size_t t = a * b; + /* Hack inspired from glibc: only try the division if nelem and elsize + * are both greater than sqrt(SIZE_MAX). */ + if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) + return AVERROR(EINVAL); + *r = t; + return 0; +} diff --git a/src/lib/ffmpeg-0.10/libavutil/opt.pas b/src/lib/ffmpeg-0.10/libavutil/opt.pas index 6d5b3c89..61af0754 100644 --- a/src/lib/ffmpeg-0.10/libavutil/opt.pas +++ b/src/lib/ffmpeg-0.10/libavutil/opt.pas @@ -27,24 +27,6 @@ * *) -unit opt; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -interface - -uses - ctypes, - dict, - rational, - UConfig; - (** * @defgroup avoptions AVOptions * @ingroup lavu_data @@ -649,11 +631,3 @@ function av_opt_get_q (obj: pointer; name: {const} PAnsiChar; search_flags: procedure av_opt_ptr(avclass: {const} PAVClass; obj: pointer; name: {const} PAnsiChar); cdecl; external av__util; *) - -(** - * @} - *) - -implementation - -end.
\ No newline at end of file diff --git a/src/lib/ffmpeg-0.8/libavutil/dict.pas b/src/lib/ffmpeg-0.8/libavutil/dict.pas index b07ce6e8..d50d3b0b 100644 --- a/src/lib/ffmpeg-0.8/libavutil/dict.pas +++ b/src/lib/ffmpeg-0.8/libavutil/dict.pas @@ -23,22 +23,6 @@ * *) -unit dict; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -interface - -uses - ctypes, - UConfig; - const AV_DICT_MATCH_CASE = 1; AV_DICT_IGNORE_SUFFIX = 2; @@ -103,7 +87,3 @@ procedure av_dict_copy(var dst: PAVDictionary; src: PAVDictionary; flags: cint); *) procedure av_dict_free(var m: PAVDictionary); cdecl; external av__util; - -implementation - -end. diff --git a/src/lib/ffmpeg-0.8/libavutil/mathematics.pas b/src/lib/ffmpeg-0.8/libavutil/mathematics.pas index 2f8eaab2..36768a55 100644 --- a/src/lib/ffmpeg-0.8/libavutil/mathematics.pas +++ b/src/lib/ffmpeg-0.8/libavutil/mathematics.pas @@ -26,23 +26,6 @@ * *) -unit mathematics; - -{$IFDEF FPC} - {$MODE DELPHI } - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -interface - -uses - ctypes, - rational, - UConfig; - const M_E = 2.7182818284590452354; // e M_LN2 = 0.69314718055994530942; // log_e 2 @@ -113,7 +96,3 @@ function av_compare_ts(ts_a: cint64; tb_a: TAVRational; ts_b: cint64; tb_b: TAVR *) function av_compare_mod(a: cuint64; b: cuint64; modVar: cuint64): cint64; cdecl; external av__util; - -implementation - -end. diff --git a/src/lib/ffmpeg-0.8/libavutil/mem.pas b/src/lib/ffmpeg-0.8/libavutil/mem.pas index 322a8657..c438bbfc 100644 --- a/src/lib/ffmpeg-0.8/libavutil/mem.pas +++ b/src/lib/ffmpeg-0.8/libavutil/mem.pas @@ -101,10 +101,10 @@ function av_mallocz(size: size_t): pointer; * @param size * @return Pointer to the allocated block, NULL if it cannot be allocated. *) -{ available only in 0.8.5 - 0.8.10 +(* available only in 0.8.5 - 0.8.10 function av_calloc(nmemb: size_t; size: size_t): pointer; cdecl; external av__util; {av_malloc_attrib} -} +*) (** * Duplicate the string s. diff --git a/src/lib/ffmpeg-0.8/libavutil/opt.pas b/src/lib/ffmpeg-0.8/libavutil/opt.pas index c7b0d914..16bf0f26 100644 --- a/src/lib/ffmpeg-0.8/libavutil/opt.pas +++ b/src/lib/ffmpeg-0.8/libavutil/opt.pas @@ -27,24 +27,6 @@ * *) -unit opt; - -{$IFDEF FPC} - {$MODE DELPHI} - {$PACKENUM 4} (* use 4-byte enums *) - {$PACKRECORDS C} (* C/C++-compatible record packing *) -{$ELSE} - {$MINENUMSIZE 4} (* use 4-byte enums *) -{$ENDIF} - -interface - -uses - ctypes, - dict, - rational, - UConfig; - type TAVOptionType = ( FF_OPT_TYPE_FLAGS, @@ -275,7 +257,3 @@ const function av_opt_find(obj: pointer; name: {const} PAnsiChar; unit_: {const} PAnsiChar; opt_flags: cint; search_flags: cint): PAVOption; cdecl; external av__util; - -implementation - -end. |