From 5d1d06acda578ffcfa6beb3bc5876ad332110dfc Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sat, 9 Jun 2012 11:15:48 +0000 Subject: update and additions to ffmpeg-0.10 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2892 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg-0.10/avutil.pas | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) (limited to 'src/lib/ffmpeg-0.10/avutil.pas') diff --git a/src/lib/ffmpeg-0.10/avutil.pas b/src/lib/ffmpeg-0.10/avutil.pas index 0d9235e0..8da705df 100644 --- a/src/lib/ffmpeg-0.10/avutil.pas +++ b/src/lib/ffmpeg-0.10/avutil.pas @@ -116,7 +116,7 @@ type * Return a string describing the media_type enum, NULL if media_type * is unknown. *) -function av_get_media_type_string(media_type: TAVMediaType): Pchar; +function av_get_media_type_string(media_type: TAVMediaType): PAnsiChar; cdecl; external av__util; const @@ -177,14 +177,13 @@ type * @param[in] pict_type the picture type @return a single character * representing the picture type, '?' if pict_type is unknown *) -function av_get_picture_type_char(pict_type: TAVPictureType): Pchar; +function av_get_picture_type_char(pict_type: TAVPictureType): PAnsiChar; cdecl; external av__util; (** * Return x default pointer in case p is NULL. *) -function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; - cdecl; external av__util; +function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} {$INCLUDE libavutil/cpu.pas} @@ -206,35 +205,38 @@ function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; (* 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; +(** + * MKTAG and MKBETAG are usually used to convert a magic string to an enumeration index. + * In Pascal this can probably not be used and the functions could be removed. + * KMS 8/6/2012 + *) +function MKTAG (a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} +function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} implementation -(* To Be Implemented, March 2012 KMS *) -//function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; -//begin -// If p = Nil Then -// Result := p -// Else -// Result := x; -// //return (void *)(intptr_t)(p ? p : x); -//end; +function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} +begin + if p = nil then + Result := x + else + Result := p; +end; (* libavutil/common.h *) -function MKTAG(a, b, c, d: AnsiChar): integer; +function MKTAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} 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; +function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDIF} begin Result := (ord(d) or (ord(c) shl 8) or (ord(b) shl 16) or (ord(a) shl 24)); end; type - Psize_t = ^size_t; + Psize_t = ^size_t; function av_size_mult(a: size_t; b: size_t; r: Psize_t): size_t; cdecl; external av__util; -- cgit v1.2.3