aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authork-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2012-05-04 08:49:55 +0000
committerk-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2012-05-04 08:49:55 +0000
commit727e4c154e3c5e7789f633405b7561c0d7b1c780 (patch)
treeedd8fc48c78ff951e787ef44fdb8ece30e9c4bda /src
parent8d7de6a0515b5e2eca3179df4d76f48b1e0d2965 (diff)
downloadusdx-727e4c154e3c5e7789f633405b7561c0d7b1c780.tar.gz
usdx-727e4c154e3c5e7789f633405b7561c0d7b1c780.tar.xz
usdx-727e4c154e3c5e7789f633405b7561c0d7b1c780.zip
update of ffmpeg-0.8. it is probably 90% of what needs to be done.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2871 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src')
-rw-r--r--src/lib/ffmpeg-0.8/ToDo.txt5
-rw-r--r--src/lib/ffmpeg-0.8/avcodec.pas13
-rw-r--r--src/lib/ffmpeg-0.8/avformat.pas102
-rw-r--r--src/lib/ffmpeg-0.8/avio.pas75
-rw-r--r--src/lib/ffmpeg-0.8/swscale.pas14
5 files changed, 34 insertions, 175 deletions
diff --git a/src/lib/ffmpeg-0.8/ToDo.txt b/src/lib/ffmpeg-0.8/ToDo.txt
index c5757ec4..343952ef 100644
--- a/src/lib/ffmpeg-0.8/ToDo.txt
+++ b/src/lib/ffmpeg-0.8/ToDo.txt
@@ -1,7 +1,4 @@
-1) rational.pas
-inline function of av_cmp_q
-
-2) avutil.pas
+1) avutil.pas
inline function av_x_if_null
avcodec.pas
diff --git a/src/lib/ffmpeg-0.8/avcodec.pas b/src/lib/ffmpeg-0.8/avcodec.pas
index dd0a1877..fc7e38fa 100644
--- a/src/lib/ffmpeg-0.8/avcodec.pas
+++ b/src/lib/ffmpeg-0.8/avcodec.pas
@@ -1162,11 +1162,14 @@ type
* Additional packet data that can be provided by the container.
* Packet can contain several types of side information.
*)
- side_data: ^record
- data: Puint8;
+ side_data: pointer;
+ {
+ record
+ data: Pcuint8;
size: cint;
type_: TAVPacketSideDataType;
end;
+ }
side_data_elems: cint;
(*
@@ -3409,7 +3412,7 @@ procedure av_free_packet(pkt: PAVPacket);
* @return pointer to fresh allocated data or NULL otherwise
*)
function av_packet_new_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType;
- size: cint): Puint8;
+ size: cint): Pcuint8;
cdecl; external av__codec;
(**
@@ -3421,10 +3424,10 @@ function av_packet_new_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType;
* @return pointer to data if present or NULL otherwise
*)
function av_packet_get_side_data(pkt: PAVPacket; type_: TAVPacketSideDataType;
- size: Pcint): Puint8;
+ size: Pcint): Pcuint8;
cdecl; external av__codec;
-function av_packet_merge_side_data(pkt: PAVPacket);cint;
+function av_packet_merge_side_data(pkt: PAVPacket): cint;
cdecl; external av__codec;
function av_packet_split_side_data(pkt: PAVPacket): cint;
diff --git a/src/lib/ffmpeg-0.8/avformat.pas b/src/lib/ffmpeg-0.8/avformat.pas
index a1c72e66..138ab20f 100644
--- a/src/lib/ffmpeg-0.8/avformat.pas
+++ b/src/lib/ffmpeg-0.8/avformat.pas
@@ -181,13 +181,6 @@ type
*)
const
-{
- AV_METADATA_MATCH_CASE = 1;
- AV_METADATA_IGNORE_SUFFIX = 2;
- AV_METADATA_DONT_STRDUP_KEY = 4;
- AV_METADATA_DONT_STRDUP_VAL = 8;
- AV_METADATA_DONT_OVERWRITE = 16;
-}
AV_METADATA_MATCH_CASE = AV_DICT_MATCH_CASE;
AV_METADATA_IGNORE_SUFFIX = AV_DICT_IGNORE_SUFFIX;
AV_METADATA_DONT_STRDUP_KEY = AV_DICT_DONT_STRDUP_KEY;
@@ -217,21 +210,6 @@ function av_metadata_get(m: PAVDictionary; key: {const} PAnsiChar;
prev: {const} PAVDictionaryEntry; flags: cint): PAVDictionaryEntry;
cdecl; external av__format;
-{$IF FF_API_OLD_METADATA}
-(**
- * Set the given tag in *pm, overwriting an existing tag.
- *
- * @param pm pointer to a pointer to a metadata struct. If *pm is NULL
- * a metadata struct is allocated and put in *pm.
- * @param key tag key to add to *pm (will be av_strduped)
- * @param value tag value to add to *pm (will be av_strduped)
- * @return >= 0 on success otherwise an error code <0
- * @deprecated Use av_metadata_set2() instead.
- *)
-function av_metadata_set(var pm: PAVMetadata; key: {const} PAnsiChar; value: {const} PAnsiChar): cint;
- cdecl; external av__format; deprecated;
-{$ENDIF}
-
(**
* Set the given tag in *pm, overwriting an existing tag.
*
@@ -409,6 +387,7 @@ type
PAVInputFormat = ^TAVInputFormat;
PAVIndexEntry = ^TAVIndexEntry;
+ PPAVStream = ^PAVStream;
PAVStream = ^TAVStream;
PAVPacketList = ^TAVPacketList;
@@ -437,10 +416,7 @@ type
id: cint; ///< unique ID to identify the chapter
time_base: TAVRational; ///< time base in which the start/end timestamps are specified
start, end_: cint64; ///< chapter start/end time in time_base units
-{$IF FF_API_OLD_METADATA}
- title: PAnsiChar; ///< chapter title
-{$ENDIF}
- metadata: PAVMetadata;
+ metadata: PAVDictionary;
end;
TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter;
@@ -465,8 +441,6 @@ type
unsigned int prealloced_context:1;
}
bf_flags: byte; // 0:mpeg2ts_raw/1:mpeg2ts_compute_pcr/2:initial_pause/3:prealloced_context
- video_codec_id: TCodecID;
- audio_codec_id: TCodecID;
end;
TAVOutputFormat = record
@@ -714,10 +688,6 @@ type
*)
duration: cint64;
-{$IF FF_API_OLD_METADATA}
- language: array [0..3] of PAnsiChar; (**< ISO 639-2/B 3-letter language code (empty string if undefined) *)
-{$ENDIF}
-
(* av_read_frame() support *)
need_parsing: TAVStreamParseType;
parser: PAVCodecParserContext;
@@ -733,11 +703,6 @@ type
nb_frames: cint64; ///< number of frames in this stream if known or 0
- unused: array [0..4] of cint64;
-{$IF FF_API_OLD_METADATA}
- filename: PAnsiChar; (**< source filename of the stream *)
-{$ENDIF}
-
disposition: cint; (**< AV_DISPOSITION_* bitfield *)
probe_data: TAVProbeData;
pts_buffer: array [0..MAX_REORDER_DELAY] of cint64;
@@ -807,20 +772,10 @@ type
pb: PByteIOContext;
nb_streams: cuint;
- streams: array [0..MAX_STREAMS - 1] of PAVStream;
+ streams: PPAVStream;
filename: array [0..1023] of AnsiChar; (* input or output filename *)
(* stream info *)
timestamp: cint64;
-{$IF FF_API_OLD_METADATA}
- title: array [0..511] of AnsiChar;
- author: array [0..511] of AnsiChar;
- copyright: array [0..511] of AnsiChar;
- comment: array [0..511] of AnsiChar;
- album: array [0..511] of AnsiChar;
- year: cint; (**< ID3 year, 0 if none *)
- track: cint; (**< track number, 0 if none *)
- genre: array [0..31] of AnsiChar; (**< ID3 genre *)
-{$ENDIF}
ctx_flags: cint; (**< Format-specific flags, see AVFMTCTX_xx *)
(* private data for pts handling (do not modify directly). *)
@@ -857,13 +812,9 @@ type
(* av_read_frame() support *)
cur_st: PAVStream;
- cur_ptr_deprecated: pbyte;
- cur_len_deprecated: cint;
- cur_pkt_deprecated: TAVPacket;
(* av_seek_frame() support *)
data_offset: cint64; (**< offset of the first packet *)
- index_built: cint;
mux_rate: cint;
packet_size: cuint;
@@ -976,10 +927,6 @@ type
*)
TAVProgram = record
id : cint;
-{$IF FF_API_OLD_METADATA}
- provider_name : PAnsiChar; ///< network name for DVB streams
- name : PAnsiChar; ///< service name for DVB streams
-{$ENDIF}
flags : cint;
discard : TAVDiscard; ///< selects which program to discard and which to feed to the caller
stream_index : PCardinal;
@@ -1004,12 +951,6 @@ procedure av_metadata_conv(ctx: PAVFormatContext; {const} d_conv: PAVMetadataCon
{const} s_conv: PAVMetadataConv);
cdecl; external av__format;
-{
-var
- first_iformat: PAVInputFormat; external av__format;
- first_oformat: PAVOutputFormat; external av__format;
-}
-
(**
* If f is NULL, returns the first registered input format,
* if f is non-NULL, returns the next registered input format after f
@@ -1038,11 +979,6 @@ procedure av_register_input_format(format: PAVInputFormat);
procedure av_register_output_format(format: PAVOutputFormat);
cdecl; external av__format;
-function guess_stream_format(short_name: PAnsiChar;
- filename: PAnsiChar;
- mime_type: PAnsiChar): PAVOutputFormat;
- cdecl; external av__format; deprecated;
-
(**
* Return the output format in the list of registered output formats
* which best matches the provided parameters, or return NULL if
@@ -1055,14 +991,6 @@ function guess_stream_format(short_name: PAnsiChar;
* @param mime_type if non-NULL checks if mime_type matches with the
* MIME type of the registered formats
*)
-(**
- * @deprecated Use av_guess_format() instead.
- *)
-function guess_format(short_name: PAnsiChar;
- filename: PAnsiChar;
- mime_type: PAnsiChar): PAVOutputFormat;
- cdecl; external av__format; deprecated;
-
function av_guess_format(short_name: PAnsiChar;
filename: PAnsiChar;
mime_type: PAnsiChar): PAVOutputFormat;
@@ -1073,7 +1001,7 @@ function av_guess_format(short_name: PAnsiChar;
*)
function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar;
filename: PAnsiChar; mime_type: PAnsiChar;
- type_: TCodecType): TCodecID;
+ type_: TAVMediaType): TCodecID;
cdecl; external av__format;
(**
@@ -1224,12 +1152,6 @@ function avformat_alloc_context(): PAVFormatContext;
cdecl; external av__format;
(**
- * @deprecated Use avformat_alloc_context() instead.
- *)
-function av_alloc_format_context(): PAVFormatContext;
- cdecl; external av__format;
-
-(**
* Read packets of a media file to get stream information. This
* is useful for file formats with no headers such as MPEG. This
* function also computes the real framerate in case of MPEG-2 repeat
@@ -1616,22 +1538,6 @@ procedure dump_format(ic: PAVFormatContext; index: cint; url: PAnsiChar;
cdecl; external av__format;
(**
- * Parse width and height out of string str.
- * @deprecated Use av_parse_video_frame_size instead.
- *)
-function parse_image_size(width_ptr: PCint; height_ptr: PCint;
- str: PAnsiChar): cint;
- cdecl; external av__format; deprecated;
-
-(**
- * Convert framerate from a string to a fraction.
- * @deprecated Use av_parse_video_frame_rate instead.
- *)
-function parse_frame_rate(frame_rate: PCint; frame_rate_base: PCint;
- arg: PByteArray): cint;
- cdecl; external av__format; deprecated;
-
-(**
* Parse datestr and return a corresponding number of microseconds.
* @param datestr String representing a date or a duration.
* - If a date the syntax is:
diff --git a/src/lib/ffmpeg-0.8/avio.pas b/src/lib/ffmpeg-0.8/avio.pas
index 426f5f75..761a3e86 100644
--- a/src/lib/ffmpeg-0.8/avio.pas
+++ b/src/lib/ffmpeg-0.8/avio.pas
@@ -169,9 +169,7 @@ type
PPURLContext = ^PURLContext;
PURLContext = ^TURLContext;
TURLContext = record
-{$IF FF_API_URL_CLASS}
av_class: {const} PAVClass; ///< information for av_log(). Set by url_open().
-{$ENDIF}
prot: PURLProtocol;
flags: cint;
is_streamed: cint; (**< true if streamed (no seek possible), default = false *)
@@ -221,9 +219,9 @@ const
* constants, optionally ORed with other flags.
* @
*)
- URL_RDONLY = 0; (**< read-only *)
- URL_WRONLY = 1; (**< write-only *)
- URL_RDWR = 2; (**< read-write *)
+ URL_RDONLY = 1; (**< read-only *)
+ URL_WRONLY = 2; (**< write-only *)
+ URL_RDWR = URL_RDONLY or URL_WRONLY; (**< read-write *)
(**
* @
*)
@@ -253,8 +251,8 @@ var
(**
* @defgroup old_url_funcs Old url_* functions
- * @eprecated. Use the buffered API based on AVIOContext instead.
- * @
+ * @deprecated use the buffered API based on AVIOContext instead
+ * @{
*)
function url_open_protocol(puc: PPURLContext; up: PURLProtocol;
url: {const} PAnsiChar; flags: cint): cint;
@@ -333,8 +331,8 @@ function av_alloc_put_byte(
(**
* @defgroup old_avio_funcs Old put_/get_*() functions
- * The following functions are deprecated. Use the "avio_"-prefixed functions instead.
- * @
+ * @deprecated use the avio_ -prefixed functions instead.
+ * @{
*)
function get_buffer(s: PAVIOContext; buf: PByteArray; size: cint): cint;
cdecl; external av__format; deprecated;
@@ -395,8 +393,8 @@ function av_url_read_fseek(h: PAVIOContext; stream_index: cint;
(**
* @defgroup old_url_f_funcs Old url_f* functions
- * @deprecated, use the "avio_"-prefixed functions instead.
- * @
+ * @deprecated use the avio_ -prefixed functions instead.
+ * @{
*)
function url_fopen(var s: PAVIOContext; url: {const} PAnsiChar; flags: cint): cint;
cdecl; external av__format; deprecated;
@@ -491,7 +489,7 @@ function url_exist(url: {const} PAnsiChar): cint;
{$ENDIF} // FF_API_OLD_AVIO
(**
- * Return AVIO_* access flags corresponding to the access permissions
+ * Return AVIO_FLAG_* access flags corresponding to the access permissions
* of the resource in url, or a negative value corresponding to an
* AVERROR code in case of failure. The returned access flags are
* masked by the value in flags.
@@ -502,8 +500,6 @@ function url_exist(url: {const} PAnsiChar): cint;
* unless you are sure that no other processes are accessing the
* checked resource.
*
- * @note This function is slightly broken until next major bump
- * because of AVIO_RDONLY == 0. Don't use it until then.
*)
function avio_check(url: {const} PAnsiChar; flags: cint): cint;
cdecl; external av__format;
@@ -517,27 +513,6 @@ function avio_check(url: {const} PAnsiChar; flags: cint): cint;
procedure avio_set_interrupt_cb(interrupt_cb: Pointer);
cdecl; external av__format;
-{$IF FF_API_REGISTER_PROTOCOL}
-{
-var
- first_protocol: PURLProtocol; cvar; external av__format;
-}
-{$IFEND}
-
-{$IF FF_API_REGISTER_PROTOCOL}
-(**
- * @deprecated Use av_register_protocol() instead.
- *)
-function register_protocol(protocol: PURLProtocol): cint;
- cdecl; external av__format; deprecated;
-
-(**
- * @deprecated Use av_register_protocol2() instead.
- *)
-function av_register_protocol(protocol: PURLProtocol): cint;
- cdecl; external av__format; deprecated;
-{$ENDIF}
-
(**
* Allocate and initialize an AVIOContext for buffered I/O. It must be later
* freed with av_free().
@@ -728,15 +703,6 @@ function avio_get_str16le(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen
function avio_get_str16be(pb: PAVIOContext; maxlen: cint; buf: PAnsiChar; buflen: cint): cint;
cdecl; external av__format;
-{$IF FF_API_URL_RESETBUF}
-(** Reset the buffer for reading or writing.
- * @note Will drop any data currently in the buffer without transmitting it.
- * @param flags URL_RDONLY to set up the buffer for reading, or URL_WRONLY
- * to set up the buffer for writing. *)
-function url_resetbuf(s: PAVIOContext; flags: cint): cint;
- cdecl; external av__format;
-{$ENDIF}
-
(**
* @defgroup open_modes URL open modes
* The flags argument to avio_open must be one of the following
@@ -745,15 +711,9 @@ function url_resetbuf(s: PAVIOContext; flags: cint): cint;
*)
const
-{$IF LIBAVFORMAT_VERSION_MAJOR < 53}
- AVIO_RDONLY = 0; (**< read-only *)
- AVIO_WRONLY = 1; (**< write-only *)
- AVIO_RDWR = 2; (**< read-write *)
-{$ELSE}
- AVIO_RDONLY = 1; (**< read-only *)
- AVIO_WRONLY = 2; (**< write-only *)
- AVIO_RDWR = 4; (**< read-write *)
-{$ENDIF}
+ AVIO_FLAG_READ = 1; (**< read-only *)
+ AVIO_FLAG_WRITE = 2; (**< write-only *)
+ AVIO_FLAG_READ_WRITE = AVIO_FLAG_READ or AVIO_FLAG_WRITE; (**< read-write *)
(**
* @
*)
@@ -771,11 +731,7 @@ const
* silently ignored.
*)
const
-{$IF LIBAVFORMAT_VERSION_MAJOR < 53}
- AVIO_FLAG_NONBLOCK = 4;
-{$ELSE}
AVIO_FLAG_NONBLOCK = 8;
-{$ENDIF}
(**
* Create and initialize a AVIOContext for accessing the
@@ -823,11 +779,6 @@ function avio_open_dyn_buf(var s: PAVIOContext): cint;
function avio_close_dyn_buf(s: PAVIOContext; var pbuffer: Pcuint8): cint;
cdecl; external av__format;
-{$IF FF_API_UDP_GET_FILE}
-function udp_get_file_handle(h: PURLContext): cint;
- cdecl; external av__format;
-{$ENDIF}
-
(**
* Iterate through names of available protocols.
* @note it is recommanded to use av_protocol_next() instead of this
diff --git a/src/lib/ffmpeg-0.8/swscale.pas b/src/lib/ffmpeg-0.8/swscale.pas
index 9806fc85..f9f53d8c 100644
--- a/src/lib/ffmpeg-0.8/swscale.pas
+++ b/src/lib/ffmpeg-0.8/swscale.pas
@@ -19,7 +19,7 @@
* - Ported by the UltraStar Deluxe Team
*
* Conversion of libswscale/swscale.h
- * version: 0.14.1
+ * version: 2.0.0
*)
unit swscale;
@@ -71,8 +71,8 @@ const
* fix.
*)
(* Max. supported version by this header *)
- LIBSWSCALE_MAX_VERSION_MAJOR = 0;
- LIBSWSCALE_MAX_VERSION_MINOR = 11;
+ LIBSWSCALE_MAX_VERSION_MAJOR = 2;
+ LIBSWSCALE_MAX_VERSION_MINOR = 0;
LIBSWSCALE_MAX_VERSION_RELEASE = 0;
LIBSWSCALE_MAX_VERSION = (LIBSWSCALE_MAX_VERSION_MAJOR * VERSION_MAJOR) +
(LIBSWSCALE_MAX_VERSION_MINOR * VERSION_MINOR) +
@@ -296,7 +296,9 @@ function sws_scale(context: PSwsContext; {const} srcSlice: PPCuint8Array; {const
cdecl; external sw__scale;
{$if LIBSWSCALE_VERSION_MAJOR < 1}
-// deprecated. Use sws_scale() instead.
+(**
+ * @deprecated. Use sws_scale() instead.
+ *)
function sws_scale_ordered(context: PSwsContext; {const} src: PPCuint8Array;
srcStride: PCintArray; srcSliceY: cint; srcSliceH: cint;
dst: PPCuint8Array; dstStride: PCintArray): cint;
@@ -440,7 +442,7 @@ function sws_getCachedContext(context: PSwsContext;
*)
procedure sws_convertPalette8ToPacked32({const} src: PPCuint8Array;
dst: PPCuint8Array;
- num_pixels: clong;
+ num_pixels: cint;
{const} palette: PPCuint8Array);
cdecl; external sw__scale;
@@ -456,7 +458,7 @@ procedure sws_convertPalette8ToPacked32({const} src: PPCuint8Array;
*)
procedure sws_convertPalette8ToPacked24({const} src: PPCuint8Array;
dst: PPCuint8Array;
- num_pixels: clong;
+ num_pixels: cint;
{const} palette: PPCuint8Array);
cdecl; external sw__scale;