From 1ba91d5a0e1df7419a561f6dcf16a0839509a5e7 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Wed, 27 Aug 2008 13:28:57 +0000 Subject: Reordering of the directories[1]: moving Game/Code to src git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1302 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 1372 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1372 insertions(+) create mode 100644 src/lib/ffmpeg/avformat.pas (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas new file mode 100644 index 00000000..93ce60e5 --- /dev/null +++ b/src/lib/ffmpeg/avformat.pas @@ -0,0 +1,1372 @@ +(* + * copyright (c) 2001 Fabrice Bellard + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + *) + +(* + * This is a part of Pascal porting of ffmpeg. + * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. + * - 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 libavformat/avformat.h + * Min. version: 50.5.0 , revision 6577, Sat Oct 7 15:30:46 2006 UTC + * Max. version: 52.20.0, revision 14667, Fri Aug 8 18:40:50 2008 UTC + *) + +unit avformat; + +{$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} + +{$I switches.inc} (* for the HasInline define *) + +{$IFDEF DARWIN} + {$linklib libavformat} +{$ENDIF} + +interface + +uses + ctypes, + avcodec, + avutil, + avio, + rational, + UConfig; + +const + (* Max. supported version by this header *) + LIBAVFORMAT_MAX_VERSION_MAJOR = 52; + LIBAVFORMAT_MAX_VERSION_MINOR = 20; + LIBAVFORMAT_MAX_VERSION_RELEASE = 0; + LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + + (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); + + (* Min. supported version by this header *) + LIBAVFORMAT_MIN_VERSION_MAJOR = 50; + LIBAVFORMAT_MIN_VERSION_MINOR = 5; + LIBAVFORMAT_MIN_VERSION_RELEASE = 0; + LIBAVFORMAT_MIN_VERSION = (LIBAVFORMAT_MIN_VERSION_MAJOR * VERSION_MAJOR) + + (LIBAVFORMAT_MIN_VERSION_MINOR * VERSION_MINOR) + + (LIBAVFORMAT_MIN_VERSION_RELEASE * VERSION_RELEASE); + +(* Check if linked versions are supported *) +{$IF (LIBAVFORMAT_VERSION < LIBAVFORMAT_MIN_VERSION)} + {$MESSAGE Error 'Linked version of libavformat is too old!'} +{$IFEND} + +(* Check if linked versions are supported *) +{$IF (LIBAVFORMAT_VERSION > LIBAVFORMAT_MAX_VERSION)} + {$MESSAGE Warn 'Linked version of libavformat may be unsupported!'} +{$IFEND} + +{$IF LIBAVFORMAT_VERSION >= 52020000} // 52.20.0 +(** + * Returns the LIBAVFORMAT_VERSION_INT constant. + *) +function avformat_version(): cuint; + cdecl; external av__format; +{$IFEND} + + +type + PAVFile = Pointer; + +(* packet functions *) + +type + PAVPacket = ^TAVPacket; + TAVPacket = record + (** + * Presentation time stamp in time_base units. + * This is the time at which the decompressed packet will be presented + * to the user. + * Can be AV_NOPTS_VALUE if it is not stored in the file. + * pts MUST be larger or equal to dts as presentation can not happen before + * decompression, unless one wants to view hex dumps. Some formats misuse + * the terms dts and pts/cts to mean something different, these timestamps + * must be converted to true pts/dts before they are stored in AVPacket. + *) + pts: cint64; + (** + * Decompression time stamp in time_base units. + * This is the time at which the packet is decompressed. + * Can be AV_NOPTS_VALUE if it is not stored in the file. + *) + dts: cint64; + data: PChar; + size: cint; + stream_index: cint; + flags: cint; + duration: cint; ///< presentation duration in time_base units (0 if not available) + destruct: procedure (p: PAVPacket); cdecl; + priv: pointer; + pos: cint64; ///< byte position in stream, -1 if unknown + end; +const + PKT_FLAG_KEY = $0001; + +procedure av_destruct_packet_nofree(var pkt: TAVPacket); + cdecl; external av__format; + +(** + * Default packet destructor. + *) +procedure av_destruct_packet(var pkt: TAVPacket); + cdecl; external av__format; + +(** + * Initialize optional fields of a packet to default values. + * + * @param pkt packet + *) +procedure av_init_packet(var pkt: TAVPacket); +{$IF LIBAVFORMAT_VERSION >= 51012002} // 51.12.2 + cdecl; external av__format; +{$IFEND} + +(** + * Allocate the payload of a packet and initialize its fields to default values. + * + * @param pkt packet + * @param size wanted payload size + * @return 0 if OK. AVERROR_xxx otherwise. + *) +function av_new_packet(var pkt: TAVPacket; size: cint): cint; + cdecl; external av__format; + +(** + * Allocate and read the payload of a packet and initialize its fields to default values. + * + * @param pkt packet + * @param size wanted payload size + * @return >0 (read size) if OK. AVERROR_xxx otherwise. + *) +function av_get_packet(s: PByteIOContext; var pkt: TAVPacket; size: cint): cint; + cdecl; external av__format; + +(** + * @warning This is a hack - the packet memory allocation stuff is broken. The + * packet is allocated if it was not really allocated + *) +function av_dup_packet(pkt: PAVPacket): cint; + cdecl; external av__format; + +(** + * Free a packet + * + * @param pkt packet to free + *) +procedure av_free_packet(pkt: PAVPacket); {$IFDEF HasInline}inline;{$ENDIF} + +(*************************************************) +(* fractional numbers for exact pts handling *) + +type + (** + * the exact value of the fractional number is: 'val + num / den'. + * num is assumed to be such as 0 <= num < den + * @deprecated Use AVRational instead + *) + PAVFrac = ^TAVFrac; + TAVFrac = record + val, num, den: cint64; + end; {deprecated} + +(*************************************************) +(* input/output formats *) + +type + (* this structure contains the data a format has to probe a file *) + TAVProbeData = record + filename: pchar; + buf: pchar; + buf_size: cint; + end; + +const + AVPROBE_SCORE_MAX = 100; ///< max score, half of that is used for file extension based detection + AVPROBE_PADDING_SIZE = 32; ///< extra allocated bytes at the end of the probe buffer + + //! demuxer will use url_fopen, no opened file should be provided by the caller + AVFMT_NOFILE = $0001; + AVFMT_NEEDNUMBER = $0002; (**< needs '%d' in filename *) + AVFMT_SHOW_IDS = $0008; (**< show format stream IDs numbers *) + AVFMT_RAWPICTURE = $0020; (**< format wants AVPicture structure for + raw picture data *) + AVFMT_GLOBALHEADER = $0040; (**< format wants global header *) + AVFMT_NOTIMESTAMPS = $0080; (**< format does not need / have any timestamps *) + AVFMT_GENERIC_INDEX = $0100; (**< use generic index building code *) + + // used by AVIndexEntry + AVINDEX_KEYFRAME = $0001; + + AVFMTCTX_NOHEADER = $0001; (**< signal that no header is present + (streams are added dynamically) *) + MAX_STREAMS = 20; + + AVFMT_NOOUTPUTLOOP = -1; + AVFMT_INFINITEOUTPUTLOOP = 0; + AVFMT_FLAG_GENPTS = $0001; ///< generate pts if missing even if it requires parsing future frames + AVFMT_FLAG_IGNIDX = $0002; ///< ignore index + AVFMT_FLAG_NONBLOCK = $0004; ///< do not block when reading packets from input + + // used by AVStream + MAX_REORDER_DELAY = 4; + + // used by TAVProgram + AV_PROGRAM_RUNNING = 1; + + + AV_DISPOSITION_DEFAULT = $0001; + AV_DISPOSITION_DUB = $0002; + AV_DISPOSITION_ORIGINAL = $0004; + AV_DISPOSITION_COMMENT = $0008; + AV_DISPOSITION_LYRICS = $0010; + AV_DISPOSITION_KARAOKE = $0020; + + // used by TAVFormatContext.debug + FF_FDEBUG_TS = 0001; + +type + PPAVCodecTag = ^PAVCodecTag; + PAVCodecTag = Pointer; + + PPAVFormatContext = ^PAVFormatContext; + PAVFormatContext = ^TAVFormatContext; + + PAVFormatParameters = ^TAVFormatParameters; + + PAVOutputFormat = ^TAVOutputFormat; + PAVProbeData = ^TAVProbeData; + + PAVInputFormat = ^TAVInputFormat; + PAVIndexEntry = ^TAVIndexEntry; + + PAVStream = ^TAVStream; + PAVPacketList = ^TAVPacketList; + + PPAVProgram = ^PAVProgram; + PAVProgram = ^TAVProgram; + + {$IF LIBAVFORMAT_VERSION < 51006000} // 51.6.0 + PAVImageFormat = ^TAVImageFormat; + PAVImageInfo = ^TAVImageInfo; + {$IFEND} + + PAVChapter = ^TAVChapter; + TAVChapter = record + id: cint; ///< Unique id to identify the chapter + time_base: TAVRational; ///< Timebase in which the start/end timestamps are specified + start, end_: cint64; ///< chapter start/end time in time_base units + title: PChar; ///< chapter title + end; + TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter; + PAVChapterArray = ^TAVChapterArray; + + TAVFormatParameters = record + time_base: TAVRational; + sample_rate: cint; + channels: cint; + width: cint; + height: cint; + pix_fmt: TAVPixelFormat; + {$IF LIBAVFORMAT_VERSION < 51006000} // 51.6.0 + image_format: PAVImageFormat; + {$IFEND} + channel: cint; (* used to select dv channel *) + {$IF LIBAVFORMAT_VERSION_MAJOR < 52} + device: pchar; (* video, audio or DV device, if LIBAVFORMAT_VERSION_INT < (52<<16) *) + {$IFEND} + standard: pchar; (* tv standard, NTSC, PAL, SECAM *) + { Delphi does not support bit fields -> use bf_flags instead + unsigned int mpeg2ts_raw:1; /**< force raw MPEG2 transport stream output, if possible */ + unsigned int mpeg2ts_compute_pcr:1; /**< compute exact PCR for each transport + stream packet (only meaningful if + mpeg2ts_raw is TRUE) */ + unsigned int initial_pause:1; /**< do not begin to play the stream + immediately (RTSP only) */ + unsigned int prealloced_context:1; + } + bf_flags: byte; // 0:mpeg2ts_raw/1:mpeg2ts_compute_pcr/2:initial_pause/3:prealloced_context + {$IF LIBAVFORMAT_VERSION_MAJOR < 53} + video_codec_id: TCodecID; + audio_codec_id: TCodecID; + {$IFEND} + end; + + TAVOutputFormat = record + name: pchar; + (** + * Descriptive name for the format, meant to be more human-readable + * than \p name. You \e should use the NULL_IF_CONFIG_SMALL() macro + * to define it. + *) + long_name: pchar; + mime_type: pchar; + extensions: pchar; (*< comma separated filename extensions *) + (* size of private data so that it can be allocated in the wrapper *) + priv_data_size: cint; + (* output support *) + audio_codec: TCodecID; (* default audio codec *) + video_codec: TCodecID; (* default video codec *) + write_header: function (c: PAVFormatContext): cint; cdecl; + write_packet: function (c: PAVFormatContext; pkt: PAVPacket): cint; cdecl; + write_trailer: function (c: PAVFormatContext): cint; cdecl; + (* can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_GLOBALHEADER *) + flags: cint; + (* currently only used to set pixel format if not YUV420P *) + set_parameters: function (c: PAVFormatContext; f: PAVFormatParameters): cint; cdecl; + interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; in_: PAVPacket; flush: cint): cint; cdecl; + + {$IF LIBAVFORMAT_VERSION >= 51008000} // 51.8.0 + (** + * list of supported codec_id-codec_tag pairs, ordered by "better choice first" + * the arrays are all CODEC_ID_NONE terminated + *) + codec_tag: {const} PPAVCodecTag; + {$IFEND} + + {$IF LIBAVFORMAT_VERSION >= 51012002} // 51.12.2 + subtitle_codec: TCodecID; (**< default subtitle codec *) + {$IFEND} + + (* private fields *) + next: PAVOutputFormat; + end; + + TAVInputFormat = record + name: pchar; + (** + * Descriptive name for the format, meant to be more human-readable + * than \p name. You \e should use the NULL_IF_CONFIG_SMALL() macro + * to define it. + *) + long_name: pchar; + (* size of private data so that it can be allocated in the wrapper *) + priv_data_size: cint; + (** + * Tell if a given file has a chance of being parsed by this format. + * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes + * big so you do not have to check for that unless you need more. + *) + read_probe: function (p: PAVProbeData): cint; cdecl; + (* read the format header and initialize the AVFormatContext + structure. Return 0 if OK. 'ap' if non NULL contains + additionnal paramters. Only used in raw format right + now. 'av_new_stream' should be called to create new streams. *) + read_header: function (c: PAVFormatContext; ap: PAVFormatParameters): cint; cdecl; + (* read one packet and put it in 'pkt'. pts and flags are also + set. 'av_new_stream' can be called only if the flag + AVFMTCTX_NOHEADER is used. *) + read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; + (* close the stream. The AVFormatContext and AVStreams are not + freed by this function *) + read_close: function (c: PAVFormatContext): cint; cdecl; + (** + * seek to a given timestamp relative to the frames in + * stream component stream_index + * @param stream_index must not be -1 + * @param flags selects which direction should be preferred if no exact + * match is available + * @return >= 0 on success (but not necessarily the new offset) + *) + read_seek: function (c: PAVFormatContext; stream_index: cint; + timestamp: cint64; flags: cint): cint; cdecl; + (** + * gets the next timestamp in stream[stream_index].time_base units. + * @return the timestamp or AV_NOPTS_VALUE if an error occurred + *) + read_timestamp: function (s: PAVFormatContext; stream_index: cint; + pos: pint64; pos_limit: cint64): cint64; cdecl; + (* can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER *) + flags: cint; + (* if extensions are defined, then no probe is done. You should + usually not use extension format guessing because it is not + reliable enough *) + extensions: pchar; + (* general purpose read only value that the format can use *) + value: cint; + + (* start/resume playing - only meaningful if using a network based format (RTSP) *) + read_play: function (c: PAVFormatContext): cint; cdecl; + + (* pause playing - only meaningful if using a network based format (RTSP) *) + read_pause: function (c: PAVFormatContext): cint; cdecl; + + {$IF LIBAVFORMAT_VERSION >= 51008000} // 51.8.0 + codec_tag: {const} PPAVCodecTag; + {$IFEND} + + (* private fields *) + next: PAVInputFormat; + end; + + TAVStreamParseType = ( + AVSTREAM_PARSE_NONE, + AVSTREAM_PARSE_FULL, (**< full parsing and repack *) + AVSTREAM_PARSE_HEADERS, (**< only parse headers, don't repack *) + AVSTREAM_PARSE_TIMESTAMPS (**< full parsing and interpolation of timestamps for frames not starting on packet boundary *) + ); + + TAVIndexEntry = record + pos: cint64; + timestamp: cint64; + { Delphi doesn't support bitfields -> use flags_size instead + int flags:2; + int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs 32 byte due to possible 8byte align). + } + flags_size: cint; // 0..1: flags, 2..31: size + min_distance: cint; (* min distance between this and the previous keyframe, used to avoid unneeded searching *) + end; + + (** + * Stream structure. + * New fields can be added to the end with minor version bumps. + * Removal, reordering and changes to existing fields require a major + * version bump. + * sizeof(AVStream) must not be used outside libav*. + *) + TAVStream = record + index: cint; (* stream index in AVFormatContext *) + id: cint; (* format specific stream id *) + codec: PAVCodecContext; (* codec context *) + (** + * Real base frame rate of the stream. + * This is the lowest frame rate with which all timestamps can be + * represented accurately (it is the least common multiple of all + * frame rates in the stream), Note, this value is just a guess! + * For example if the timebase is 1/90000 and all frames have either + * approximately 3600 or 1800 timer ticks then r_frame_rate will be 50/1. + *) + r_frame_rate: TAVRational; + priv_data: pointer; + + (* internal data used in av_find_stream_info() *) + first_dts: cint64; + {$IF LIBAVFORMAT_VERSION_MAJOR < 52} + codec_info_nb_frames: cint; + {$IFEND} + + (** encoding: PTS generation when outputing stream *) + pts: TAVFrac; + (** + * This is the fundamental unit of time (in seconds) in terms + * of which frame timestamps are represented. For fixed-fps content, + * timebase should be 1/frame rate and timestamp increments should be + * identically 1. + *) + time_base: TAVRational; + pts_wrap_bits: cint; (* number of bits in pts (used for wrapping control) *) + (* ffmpeg.c private use *) + stream_copy: cint; (**< if set, just copy stream *) + discard: TAVDiscard; ///< selects which packets can be discarded at will and dont need to be demuxed + //FIXME move stuff to a flags field? + (* quality, as it has been removed from AVCodecContext and put in AVVideoFrame + * MN:dunno if thats the right place, for it *) + quality: cfloat; + (** + * Decoding: pts of the first frame of the stream, in stream time base. + * Only set this if you are absolutely 100% sure that the value you set + * it to really is the pts of the first frame. + * This may be undefined (AV_NOPTS_VALUE). + * @note The ASF header does NOT contain a correct start_time the ASF + * demuxer must NOT set this. + *) + start_time: cint64; + (** + * Decoding: duration of the stream, in stream time base. + * If a source file does not specify a duration, but does specify + * a bitrate, this value will be estimates from bit rate and file size. + *) + duration: cint64; + + language: array [0..3] of char; (* ISO 639 3-letter language code (empty string if undefined) *) + + (* av_read_frame() support *) + need_parsing: TAVStreamParseType; + parser: PAVCodecParserContext; + + cur_dts: cint64; + last_IP_duration: cint; + last_IP_pts: cint64; + (* av_seek_frame() support *) + index_entries: PAVIndexEntry; (* only used if the format does not support seeking natively *) + nb_index_entries: cint; + index_entries_allocated_size: cuint; + + nb_frames: cint64; ///< number of frames in this stream if known or 0 + + {$IF LIBAVFORMAT_VERSION >= 50006000} // 50.6.0 + pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; + {$IFEND} + + {$IF LIBAVFORMAT_VERSION >= 52006000} // 52.6.0 + filename: PChar; (**< source filename of the stream *) + {$IFEND} + + {$IF LIBAVFORMAT_VERSION >= 52008000} // 52.8.0 + disposition: cint; (**< AV_DISPOSITION_* bitfield *) + {$IFEND} + + {$IF LIBAVFORMAT_VERSION >= 52019000} // 52.19.0 + probe_data: TAVProbeData; + {$IFEND} + end; + + (** + * format I/O context. + * New fields can be added to the end with minor version bumps. + * Removal, reordering and changes to existing fields require a major + * version bump. + * sizeof(AVFormatContext) must not be used outside libav*. + *) + TAVFormatContext = record + av_class: PAVClass; (* set by av_alloc_format_context *) + (* can only be iformat or oformat, not both at the same time *) + iformat: PAVInputFormat; + oformat: PAVOutputFormat; + priv_data: pointer; + + {$IF LIBAVFORMAT_VERSION_MAJOR >= 52} + pb: PByteIOContext; + {$ELSE} + pb: TByteIOContext; + {$IFEND} + + nb_streams: cuint; + streams: array [0..MAX_STREAMS - 1] of PAVStream; + filename: array [0..1023] of char; (* input or output filename *) + (* stream info *) + timestamp: cint64; + title: array [0..511] of char; + author: array [0..511] of char; + copyright: array [0..511] of char; + comment: array [0..511] of char; + album: array [0..511] of char; + year: cint; (* ID3 year, 0 if none *) + track: cint; (* track number, 0 if none *) + genre: array [0..31] of char; (* ID3 genre *) + + ctx_flags: cint; (* format specific flags, see AVFMTCTX_xx *) + (* private data for pts handling (do not modify directly) *) + (* This buffer is only needed when packets were already buffered but + not decoded, for example to get the codec parameters in mpeg + streams *) + packet_buffer: PAVPacketList; + + (* decoding: position of the first frame of the component, in + AV_TIME_BASE fractional seconds. NEVER set this value directly: + it is deduced from the AVStream values. *) + start_time: cint64; + (* decoding: duration of the stream, in AV_TIME_BASE fractional + seconds. NEVER set this value directly: it is deduced from the + AVStream values. *) + duration: cint64; + (* decoding: total file size. 0 if unknown *) + file_size: cint64; + (* decoding: total stream bitrate in bit/s, 0 if not + available. Never set it directly if the file_size and the + duration are known as ffmpeg can compute it automatically. *) + bit_rate: cint; + + (* av_read_frame() support *) + cur_st: PAVStream; + cur_ptr: pbyte; + cur_len: cint; + cur_pkt: TAVPacket; + + (* av_seek_frame() support *) + data_offset: cint64; (* offset of the first packet *) + index_built: cint; + + mux_rate: cint; + packet_size: cint; + preload: cint; + max_delay: cint; + + (* number of times to loop output in formats that support it *) + loop_output: cint; + + flags: cint; + loop_input: cint; + + {$IF LIBAVFORMAT_VERSION >= 50006000} // 50.6.0 + (* decoding: size of data to probe; encoding unused *) + probesize: cuint; + {$IFEND} + + {$IF LIBAVFORMAT_VERSION >= 51009000} // 51.9.0 + (** + * maximum duration in AV_TIME_BASE units over which the input should be analyzed in av_find_stream_info() + *) + max_analyze_duration: cint; + + key: pbyte; + keylen : cint; + {$IFEND} + + {$IF LIBAVFORMAT_VERSION >= 51014000} // 51.14.0 + nb_programs: cuint; + programs: PPAVProgram; + {$IFEND} + + {$IF LIBAVFORMAT_VERSION >= 52003000} // 52.3.0 + (** + * Forced video codec_id. + * demuxing: set by user + *) + video_codec_id: TCodecID; + (** + * Forced audio codec_id. + * demuxing: set by user + *) + audio_codec_id: TCodecID; + (** + * Forced subtitle codec_id. + * demuxing: set by user + *) + subtitle_codec_id: TCodecID; + {$IFEND} + + {$IF LIBAVFORMAT_VERSION >= 52004000} // 52.4.0 + (** + * Maximum amount of memory in bytes to use per stream for the index. + * If the needed index exceeds this size entries will be discarded as + * needed to maintain a smaller size. This can lead to slower or less + * accurate seeking (depends on demuxer). + * Demuxers for which a full in memory index is mandatory will ignore + * this. + * muxing : unused + * demuxing: set by user + *) + max_index_size: cuint; + {$IFEND} + + {$IF LIBAVFORMAT_VERSION >= 52009000} // 52.9.0 + (** + * Maximum amount of memory in bytes to use for buffering frames + * obtained from real-time capture devices. + *) + max_picture_buffer: cuint; + {$IFEND} + + {$IF LIBAVFORMAT_VERSION >= 52014000} // 52.14.0 + nb_chapters: cuint; + chapters: PAVChapterArray; + {$IFEND} + + {$IF LIBAVFORMAT_VERSION >= 52016000} // 52.16.0 + (** + * Flags to enable debuging. + *) + debug: cint; + {$IFEND} + + {$IF LIBAVFORMAT_VERSION >= 52019000} // 52.19.0 + (** + * raw packets from the demuxer, prior to parsing and decoding. + * This buffer is used for buffering packets until the codec can + * be identified, as parsing cannot be done without knowing the + * codec. + *) + raw_packet_buffer: PAVPacketList; + raw_packet_buffer_end: PAVPacketList; + + packet_buffer_end: PAVPacketList; + {$IFEND} + end; + + (** + * New fields can be added to the end with minor version bumps. + * Removal, reordering and changes to existing fields require a major + * version bump. + * sizeof(AVProgram) must not be used outside libav*. + *) + TAVProgram = record + id : cint; + provider_name : PChar; ///< Network name for DVB streams + name : PChar; ///< Service name for DVB streams + flags : cint; + discard : TAVDiscard; ///< selects which program to discard and which to feed to the caller + {$IF LIBAVFORMAT_VERSION >= 51016000} // 51.16.0 + stream_index : PCardinal; + nb_stream_indexes : PCardinal; + {$IFEND} + end; + + TAVPacketList = record + pkt: TAVPacket; + next: PAVPacketList; + end; + +{$IF LIBAVFORMAT_VERSION < 51006000} // 51.6.0 + (* still image support *) + PAVInputImageContext = pointer; {deprecated} + + (* still image support *) + TAVImageInfo = record + pix_fmt: TAVPixelFormat; (* requested pixel format *) + width: cint; (* requested width *) + height: cint; (* requested height *) + interleaved: cint; (* image is interleaved (e.g. interleaved GIF) *) + pict: TAVPicture; (* returned allocated image *) + end; {deprecated} + + TAVImageFormat = record + name: pchar; + extensions: pchar; + (* tell if a given file has a chance of being parsing by this format *) + img_probe: function (d: PAVProbeData): cint; cdecl; + (* read a whole image. 'alloc_cb' is called when the image size is + known so that the caller can allocate the image. If 'allo_cb' + returns non zero, then the parsing is aborted. Return '0' if + OK. *) + img_read: function (b: PByteIOContext; alloc_cb: pointer; ptr: pointer): cint; cdecl; + (* write the image *) + supported_pixel_formats: cint; (* mask of supported formats for output *) + img_write: function (b: PByteIOContext; i: PAVImageInfo): cint; cdecl; + flags: cint; + next: PAVImageFormat; + end; {deprecated} + +procedure av_register_image_format(img_fmt: PAVImageFormat); + cdecl; external av__format; deprecated; + +function av_probe_image_format(pd: PAVProbeData): PAVImageFormat; + cdecl; external av__format; deprecated; + +function guess_image_format(filename: pchar): PAVImageFormat; + cdecl; external av__format; deprecated; + +function av_read_image(pb: PByteIOContext; filename: pchar; + fmt: PAVImageFormat; + alloc_cb: pointer; opaque: pointer): cint; + cdecl; external av__format; deprecated; + +function av_write_image(pb: PByteIOContext; fmt: PAVImageFormat; img: PAVImageInfo): cint; + cdecl; external av__format; deprecated; +{$IFEND} + +{$IF LIBAVFORMAT_VERSION_MAJOR < 53} +{ +var + first_iformat: PAVInputFormat; external av__format; + first_oformat: PAVOutputFormat; external av__format; +} +{$IFEND} + +{$IF LIBAVFORMAT_VERSION >= 52003000} // 52.3.0 +function av_iformat_next(f: PAVInputFormat): PAVInputFormat; + cdecl; external av__format; +function av_oformat_next(f: PAVOutputFormat): PAVOutputFormat; + cdecl; external av__format; +{$IFEND} + +function av_guess_image2_codec(filename: {const} PChar): TCodecID; + cdecl; external av__format; + +(* XXX: use automatic init with either ELF sections or C file parser *) +(* modules *) + +(* utils.c *) +procedure av_register_input_format(format: PAVInputFormat); + cdecl; external av__format; + +procedure av_register_output_format(format: PAVOutputFormat); + cdecl; external av__format; + +function guess_stream_format(short_name: pchar; filename: pchar; mime_type: pchar): PAVOutputFormat; + cdecl; external av__format; + +function guess_format(short_name: pchar; filename: pchar; mime_type: pchar): PAVOutputFormat; + cdecl; external av__format; + +(** + * Guesses the codec id based upon muxer and filename. + *) +function av_guess_codec(fmt: PAVOutputFormat; short_name: pchar; + filename: pchar; mime_type: pchar; type_: TCodecType): TCodecID; + cdecl; external av__format; + +(** + * Send a nice hexadecimal dump of a buffer to the specified file stream. + * + * @param f The file stream pointer where the dump should be sent to. + * @param buf buffer + * @param size buffer size + * + * @see av_hex_dump_log, av_pkt_dump, av_pkt_dump_log + *) +procedure av_hex_dump(f: PAVFile; buf: pchar; size: cint); + cdecl; external av__format; + +{$IF LIBAVFORMAT_VERSION >= 51011000} // 51.11.0 +(** + * Send a nice hexadecimal dump of a buffer to the log. + * + * @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 buf buffer + * @param size buffer size + * + * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log + *) +procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: PChar; size: cint); + cdecl; external av__format; +{$IFEND} + +(** + * Send a nice dump of a packet to the specified file stream. + * + * @param f The file stream pointer where the dump should be sent to. + * @param pkt packet to dump + * @param dump_payload true if the payload must be displayed too + *) +procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); + cdecl; external av__format; + +{$IF LIBAVFORMAT_VERSION >= 51011000} // 51.11.0 +(** + * Send a nice dump of a packet to the log. + * + * @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 pkt packet to dump + * @param dump_payload true if the payload must be displayed too + *) +procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_payload: cint); + cdecl; external av__format; +{$IFEND} + +procedure av_register_all(); + cdecl; external av__format; + +{$IF LIBAVFORMAT_VERSION >= 51008000} // 51.8.0 +(** codec tag <-> codec id *) +function av_codec_get_id(var tags: PAVCodecTag; tag: cuint): TCodecID; + cdecl; external av__format; +function av_codec_get_tag(var tags: PAVCodecTag; id: TCodecID): cuint; + cdecl; external av__format; +{$IFEND} + +(* media file input *) + +(** + * finds AVInputFormat based on input format's short name. + *) +function av_find_input_format(short_name: pchar): PAVInputFormat; + cdecl; external av__format; + +(** + * Guess file format. + * + * @param is_opened whether the file is already opened, determines whether + * demuxers with or without AVFMT_NOFILE are probed + *) +function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputFormat; + cdecl; external av__format; + +(** + * Allocates all the structures needed to read an input stream. + * This does not open the needed codecs for decoding the stream[s]. + *) +function av_open_input_stream(ic_ptr: PAVFormatContext; + pb: PByteIOContext; filename: pchar; + fmt: PAVInputFormat; ap: PAVFormatParameters): cint; + cdecl; external av__format; + +(** + * Open a media file as input. The codecs are not opened. Only the file + * header (if present) is read. + * + * @param ic_ptr the opened media file handle is put here + * @param filename filename to open. + * @param fmt if non NULL, force the file format to use + * @param buf_size optional buffer size (zero if default is OK) + * @param ap additional parameters needed when opening the file (NULL if default) + * @return 0 if OK. AVERROR_xxx otherwise. + *) +function av_open_input_file(var ic_ptr: PAVFormatContext; filename: pchar; + fmt: PAVInputFormat; buf_size: cint; + ap: PAVFormatParameters): cint; + cdecl; external av__format; + +(** + * Allocate an AVFormatContext. + * Can be freed with av_free() but do not forget to free everything you + * explicitly allocated as well! + *) +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 frame rate in case of mpeg2 repeat + * frame mode. + * The logical file position is not changed by this function; + * examined packets may be buffered for later processing. + * + * @param ic media file handle + * @return >=0 if OK. AVERROR_xxx if error. + * @todo Let user decide somehow what information is needed so we do not waste time getting stuff the user does not need. + *) +function av_find_stream_info(ic: PAVFormatContext): cint; + cdecl; external av__format; + +(** + * Read a transport packet from a media file. + * + * This function is obsolete and should never be used. + * Use av_read_frame() instead. + * + * @param s media file handle + * @param pkt is filled + * @return 0 if OK. AVERROR_xxx if error. + *) +function av_read_packet(s: PAVFormatContext; var pkt: TAVPacket): cint; + cdecl; external av__format; + +(** + * Return the next frame of a stream. + * + * The returned packet is valid + * until the next av_read_frame() or until av_close_input_file() and + * must be freed with av_free_packet. For video, the packet contains + * exactly one frame. For audio, it contains an cint number of + * frames if each frame has a known fixed size (e.g. PCM or ADPCM + * data). If the audio frames have a variable size (e.g. MPEG audio), + * then it contains one frame. + * + * pkt->pts, pkt->dts and pkt->duration are always set to correct + * values in AVStream.timebase units (and guessed if the format cannot + * provided them). pkt->pts can be AV_NOPTS_VALUE if the video format + * has B frames, so it is better to rely on pkt->dts if you do not + * decompress the payload. + * + * @return 0 if OK, < 0 if error or end of file. + *) +function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; + cdecl; external av__format; + +(** + * Seek to the key frame at timestamp. + * 'timestamp' in 'stream_index'. + * @param stream_index If stream_index is (-1), a default + * stream is selected, and timestamp is automatically converted + * from AV_TIME_BASE units to the stream specific time_base. + * @param timestamp timestamp in AVStream.time_base units + * or if there is no stream specified then in AV_TIME_BASE units + * @param flags flags which select direction and seeking mode + * @return >= 0 on success + *) +function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint64; flags: cint): cint; + cdecl; external av__format; + +(** + * start playing a network based stream (e.g. RTSP stream) at the + * current position + *) +function av_read_play(s: PAVFormatContext): cint; + cdecl; external av__format; + +(** + * Pause a network based stream (e.g. RTSP stream). + * + * Use av_read_play() to resume it. + *) +function av_read_pause(s: PAVFormatContext): cint; + cdecl; external av__format; + +{$IF LIBAVFORMAT_VERSION >= 52003000} // 52.3.0 +(** + * Free a AVFormatContext allocated by av_open_input_stream. + * @param s context to free + *) +procedure av_close_input_stream(s: PAVFormatContext); + cdecl; external av__format; +{$IFEND} + +(** + * Close a media file (but not its codecs). + * + * @param s media file handle + *) +procedure av_close_input_file(s: PAVFormatContext); + cdecl; external av__format; + +(** + * Add a new stream to a media file. + * + * Can only be called in the read_header() function. If the flag + * AVFMTCTX_NOHEADER is in the format context, then new streams + * can be added in read_packet too. + * + * @param s media file handle + * @param id file format dependent stream id + *) +function av_new_stream(s: PAVFormatContext; id: cint): PAVStream; + cdecl; external av__format; +{$IF LIBAVFORMAT_VERSION >= 51014000} // 51.14.0 +function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; + cdecl; external av__format; +{$IFEND} + +{$IF LIBAVFORMAT_VERSION >= 52014000} // 52.14.0 +(** + * Add a new chapter. + * This function is NOT part of the public API + * and should be ONLY used by demuxers. + * + * @param s media file handle + * @param id unique id for this chapter + * @param start chapter start time in time_base units + * @param end chapter end time in time_base units + * @param title chapter title + * + * @return AVChapter or NULL if error. + *) +function ff_new_chapter(s: PAVFormatContext; id: cint; time_base: TAVRational; start, end_: cint64; title: {const} Pchar): PAVChapter; + cdecl; external av__format; +{$IFEND} + +(** + * Set the pts for a given stream. + * + * @param s stream + * @param pts_wrap_bits number of bits effectively used by the pts + * (used for wrap control, 33 is the value for MPEG) + * @param pts_num numerator to convert to seconds (MPEG: 1) + * @param pts_den denominator to convert to seconds (MPEG: 90000) + *) +procedure av_set_pts_info(s: PAVStream; pts_wrap_bits: cint; + pts_num: cint; pts_den: cint); + cdecl; external av__format; + +const + AVSEEK_FLAG_BACKWARD = 1; ///< seek backward + AVSEEK_FLAG_BYTE = 2; ///< seeking based on position in bytes + AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non keyframes + +function av_find_default_stream_index(s: PAVFormatContext): cint; + cdecl; external av__format; + +(** + * Gets the index for a specific timestamp. + * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond to + * the timestamp which is <= the requested one, if backward is 0 + * then it will be >= + * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise + * @return < 0 if no such timestamp could be found + *) +function av_index_search_timestamp(st: PAVStream; timestamp: cint64; flags: cint): cint; + cdecl; external av__format; + +{$IF LIBAVFORMAT_VERSION >= 52004000} // 52.4.0 +(** + * Ensures the index uses less memory than the maximum specified in + * AVFormatContext.max_index_size, by discarding entries if it grows + * too large. + * This function is not part of the public API and should only be called + * by demuxers. + *) +procedure ff_reduce_index(s: PAVFormatContext; stream_index: cint); + cdecl; external av__format; +{$IFEND} + +(** + * Add a index entry into a sorted list updateing if it is already there. + * + * @param timestamp timestamp in the timebase of the given stream + *) +function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; + distance: cint; flags: cint): cint; + cdecl; external av__format; + +(** + * Does a binary search using av_index_search_timestamp() and AVCodec.read_timestamp(). + * This is not supposed to be called directly by a user application, but by demuxers. + * @param target_ts target timestamp in the time base of the given stream + * @param stream_index stream number + *) +function av_seek_frame_binary(s: PAVFormatContext; stream_index: cint; + target_ts: cint64; flags: cint): cint; + cdecl; external av__format; + + +(** + * Updates cur_dts of all streams based on given timestamp and AVStream. + * + * Stream ref_st unchanged, others set cur_dts in their native timebase + * only needed for timestamp wrapping or if (dts not set and pts!=dts). + * @param timestamp new dts expressed in time_base of param ref_st + * @param ref_st reference stream giving time_base of param timestamp + *) +procedure av_update_cur_dts(s: PAVFormatContext; ref_st: PAVStream; + timestamp: cint64); + cdecl; external av__format; + +{$IF LIBAVFORMAT_VERSION >= 51007000} // 51.7.0 +type + TReadTimestampFunc = function (pavfc: PAVFormatContext; + arg2: cint; arg3: Pint64; arg4: cint64): cint64; cdecl; + +(** + * Does a binary search using read_timestamp(). + * This is not supposed to be called directly by a user application, but by demuxers. + * @param target_ts target timestamp in the time base of the given stream + * @param stream_index stream number + *) +function av_gen_search(s: PAVFormatContext; stream_index: cint; target_ts: cint64; + pos_min: cint64; pos_max: cint64; pos_limit: cint64; ts_min: cint64; ts_max: cint64; + flags: cint; ts_ret: Pint64; read_timestamp: TReadTimestampFunc): cint64; + cdecl; external av__format; +{$IFEND} + +(* media file output *) +function av_set_parameters(s: PAVFormatContext; ap: PAVFormatParameters): cint; + cdecl; external av__format; + +(** + * Allocate the stream private data and write the stream header to an + * output media file. + * + * @param s media file handle + * @return 0 if OK. AVERROR_xxx if error. + *) +function av_write_header(s: PAVFormatContext): cint; + cdecl; external av__format; + +(** + * Write a packet to an output media file. + * + * The packet shall contain one audio or video frame. + * The packet must be correctly interleaved according to the container specification, + * if not then av_interleaved_write_frame must be used + * + * @param s media file handle + * @param pkt the packet, which contains the stream_index, buf/buf_size, dts/pts, ... + * @return < 0 if error, = 0 if OK, 1 if end of stream wanted. + *) +function av_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; + cdecl; external av__format; + +(** + * Writes a packet to an output media file ensuring correct interleaving. + * + * The packet must contain one audio or video frame. + * If the packets are already correctly interleaved the application should + * call av_write_frame() instead as it is slightly faster. It is also important + * to keep in mind that completely non-interleaved input will need huge amounts + * of memory to interleave with this, so it is preferable to interleave at the + * demuxer level. + * + * @param s media file handle + * @param pkt the packet, which contains the stream_index, buf/buf_size, dts/pts, ... + * @return < 0 if error, = 0 if OK, 1 if end of stream wanted. + *) +function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; + cdecl; external av__format; + +(** + * Interleave a packet per DTS in an output media file. + * + * Packets with pkt->destruct == av_destruct_packet will be freed inside this function, + * so they cannot be used after it, note calling av_free_packet() on them is still safe. + * + * @param s media file handle + * @param out the interleaved packet will be output here + * @param in the input packet + * @param flush 1 if no further packets are available as input and all + * remaining packets should be output + * @return 1 if a packet was output, 0 if no packet could be output, + * < 0 if an error occurred + *) +function av_interleave_packet_per_dts(s: PAVFormatContext; _out: PAVPacket; + pkt: PAVPacket; flush: cint): cint; + cdecl; external av__format; + +(** + * @brief Write the stream trailer to an output media file and + * free the file private data. + * + * @param s media file handle + * @return 0 if OK. AVERROR_xxx if error. + *) +function av_write_trailer(s: pAVFormatContext): cint; + cdecl; external av__format; + +procedure dump_format(ic: PAVFormatContext; index: cint; url: pchar; + is_output: cint); + cdecl; external av__format; + +(** + * parses 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: pchar): cint; + cdecl; external av__format; deprecated; + +(** + * Converts frame rate from string to a fraction. + * @deprecated Use av_parse_video_frame_rate instead. + *) +function parse_frame_rate(frame_rate: PCint; frame_rate_base: PCint; arg: pchar): cint; + cdecl; external av__format; deprecated; + +(** + * Parses \p datestr and returns a corresponding number of microseconds. + * @param datestr String representing a date or a duration. + * - If a date the syntax is: + * @code + * [{YYYY-MM-DD|YYYYMMDD}]{T| }{HH[:MM[:SS[.m...]]][Z]|HH[MM[SS[.m...]]][Z]} + * @endcode + * Time is localtime unless Z is appended, in which case it is + * interpreted as UTC. + * If the year-month-day part isn't specified it takes the current + * year-month-day. + * Returns the number of microseconds since 1st of January, 1970 up to + * the time of the parsed date or INT64_MIN if \p datestr cannot be + * successfully parsed. + * - If a duration the syntax is: + * @code + * [-]HH[:MM[:SS[.m...]]] + * [-]S+[.m...] + * @endcode + * Returns the number of microseconds contained in a time interval + * with the specified duration or INT64_MIN if \p datestr cannot be + * successfully parsed. + * @param duration Flag which tells how to interpret \p datestr, if + * not zero \p datestr is interpreted as a duration, otherwise as a + * date. + *) +function parse_date(datestr: pchar; duration: cint): cint64; + cdecl; external av__format; + +function av_gettime(): cint64; + cdecl; external av__format; + +(* ffm specific for ffserver *) +const + FFM_PACKET_SIZE = 4096; + +function ffm_read_write_index(fd: cint): cint64; + cdecl; external av__format; + +procedure ffm_write_write_index(fd: cint; pos: cint64); + cdecl; external av__format; + +procedure ffm_set_write_index(s: PAVFormatContext; pos: cint64; file_size: cint64); + cdecl; external av__format; + +(** + * Attempts to find a specific tag in a URL. + * + * syntax: '?tag1=val1&tag2=val2...'. Little URL decoding is done. + * Return 1 if found. + *) +function find_info_tag(arg: pchar; arg_size: cint; tag1: pchar; info: pchar): cint; + cdecl; external av__format; + +(** + * Returns in 'buf' the path with '%d' replaced by number. + + * Also handles the '%0nd' format where 'n' is the total number + * of digits and '%%'. + * + * @param buf destination buffer + * @param buf_size destination buffer size + * @param path numbered sequence string + * @param number frame number + * @return 0 if OK, -1 if format error. + *) +function av_get_frame_filename(buf: pchar; buf_size: cint; + path: pchar; number: cint): cint; + cdecl; external av__format + {$IF LIBAVFORMAT_VERSION <= 50006000} // 50.6.0 + name 'get_frame_filename' + {$IFEND}; + +(** + * Check whether filename actually is a numbered sequence generator. + * + * @param filename possible numbered sequence string + * @return 1 if a valid numbered sequence string, 0 otherwise. + *) +function av_filename_number_test(filename: pchar): cint; + cdecl; external av__format + {$IF LIBAVFORMAT_VERSION <= 50006000} // 50.6.0 + name 'filename_number_test' + {$IFEND}; + +{$IF LIBAVFORMAT_VERSION >= 51012002} // 51.12.2 +(** + * Generate an SDP for an RTP session. + * + * @param ac array of AVFormatContexts describing the RTP streams. If the + * array is composed by only one context, such context can contain + * multiple AVStreams (one AVStream per RTP stream). Otherwise, + * all the contexts in the array (an AVCodecContext per RTP stream) + * must contain only one AVStream + * @param n_files number of AVCodecContexts contained in ac + * @param buff buffer where the SDP will be stored (must be allocated by + * the caller + * @param size the size of the buffer + * @return 0 if OK. AVERROR_xxx if error. + *) +function avf_sdp_create(ac: PPAVFormatContext; n_files: cint; buff: PChar; size: cint): cint; + cdecl; external av__format; +{$IFEND} + +implementation + +{$IF LIBAVFORMAT_VERSION < 51012002} // 51.12.2 +procedure av_init_packet(var pkt: TAVPacket); +begin + with pkt do begin + pts := AV_NOPTS_VALUE; + dts := AV_NOPTS_VALUE; + pos := -1; + duration := 0; + flags := 0; + stream_index := 0; + destruct := @av_destruct_packet_nofree + end +end; +{$IFEND} + +procedure av_free_packet(pkt: PAVPacket); +begin + if ((pkt <> nil) and (@pkt^.destruct <> nil)) then + pkt^.destruct(pkt); +end; + +end. -- cgit v1.2.3 From 08a0ddf3d8f9eb819e03d9cd6c8d79bd8634fec6 Mon Sep 17 00:00:00 2001 From: tobigun Date: Wed, 1 Oct 2008 12:28:15 +0000 Subject: - FFmpeg header update - update to newest revision - if linked libs are too new, USDX will not compile anymore and display an error message (to avoid mysterious crashes if an unsupported version of FFmpeg is used) - comment change in UVisualizer.pas git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1428 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 424 +++++++++++++++++++++++++------------------- 1 file changed, 245 insertions(+), 179 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 93ce60e5..c516aea0 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -27,7 +27,7 @@ (* * Conversion of libavformat/avformat.h * Min. version: 50.5.0 , revision 6577, Sat Oct 7 15:30:46 2006 UTC - * Max. version: 52.20.0, revision 14667, Fri Aug 8 18:40:50 2008 UTC + * Max. version: 52.22.1, revision 15441, Sat Sep 27 20:05:12 2008 UTC *) unit avformat; @@ -59,8 +59,8 @@ uses const (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 20; - LIBAVFORMAT_MAX_VERSION_RELEASE = 0; + LIBAVFORMAT_MAX_VERSION_MINOR = 22; + LIBAVFORMAT_MAX_VERSION_RELEASE = 1; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); @@ -80,7 +80,7 @@ const (* Check if linked versions are supported *) {$IF (LIBAVFORMAT_VERSION > LIBAVFORMAT_MAX_VERSION)} - {$MESSAGE Warn 'Linked version of libavformat may be unsupported!'} + {$MESSAGE Error 'Linked version of libavformat is not yet supported!'} {$IFEND} {$IF LIBAVFORMAT_VERSION >= 52020000} // 52.20.0 @@ -121,11 +121,35 @@ type size: cint; stream_index: cint; flags: cint; - duration: cint; ///< presentation duration in time_base units (0 if not available) + (** + * Duration of this packet in time_base units, 0 if unknown. + * Equals next_pts - this_pts in presentation order. + *) + duration: cint; destruct: procedure (p: PAVPacket); cdecl; priv: pointer; pos: cint64; ///< byte position in stream, -1 if unknown + + {$IF LIBAVFORMAT_VERSION >= 52022000} // 52.22.0 + (** + * Time difference in stream time base units from the pts of this + * packet to the point at which the output from the decoder has converged + * independent from the availability of previous frames. That is, the + * frames are virtually identical no matter if decoding started from + * the very first frame or from this keyframe. + * Is AV_NOPTS_VALUE if unknown. + * This field is not the display duration of the current packet. + * + * The purpose of this field is to allow seeking in streams that have no + * keyframes in the conventional sense. It corresponds to the + * recovery point SEI in H.264 and match_time_delta in NUT. It is also + * essential for some types of subtitle streams to ensure that all + * subtitles are correctly displayed after seeking. + *) + convergence_duration: cint64; + {$IFEND} end; + const PKT_FLAG_KEY = $0001; @@ -139,7 +163,7 @@ procedure av_destruct_packet(var pkt: TAVPacket); cdecl; external av__format; (** - * Initialize optional fields of a packet to default values. + * Initialize optional fields of a packet with default values. * * @param pkt packet *) @@ -149,34 +173,36 @@ procedure av_init_packet(var pkt: TAVPacket); {$IFEND} (** - * Allocate the payload of a packet and initialize its fields to default values. + * Allocate the payload of a packet and initialize its fields with + * default values. * * @param pkt packet * @param size wanted payload size - * @return 0 if OK. AVERROR_xxx otherwise. + * @return 0 if OK, AVERROR_xxx otherwise *) function av_new_packet(var pkt: TAVPacket; size: cint): cint; cdecl; external av__format; (** - * Allocate and read the payload of a packet and initialize its fields to default values. + * Allocate and read the payload of a packet and initialize its fields with + * default values. * * @param pkt packet - * @param size wanted payload size - * @return >0 (read size) if OK. AVERROR_xxx otherwise. + * @param size desired payload size + * @return >0 (read size) if OK, AVERROR_xxx otherwise *) function av_get_packet(s: PByteIOContext; var pkt: TAVPacket; size: cint): cint; cdecl; external av__format; (** * @warning This is a hack - the packet memory allocation stuff is broken. The - * packet is allocated if it was not really allocated + * packet is allocated if it was not really allocated. *) function av_dup_packet(pkt: PAVPacket): cint; cdecl; external av__format; (** - * Free a packet + * Free a packet. * * @param pkt packet to free *) @@ -187,9 +213,9 @@ procedure av_free_packet(pkt: PAVPacket); {$IFDEF HasInline}inline;{$ENDIF} type (** - * the exact value of the fractional number is: 'val + num / den'. - * num is assumed to be such as 0 <= num < den - * @deprecated Use AVRational instead + * The exact value of the fractional number is: 'val + num / den'. + * num is assumed to be 0 <= num < den. + * @deprecated Use AVRational instead. *) PAVFrac = ^TAVFrac; TAVFrac = record @@ -200,7 +226,7 @@ type (* input/output formats *) type - (* this structure contains the data a format has to probe a file *) + (** This structure contains the data a format has to probe a file. *) TAVProbeData = record filename: pchar; buf: pchar; @@ -208,18 +234,19 @@ type end; const - AVPROBE_SCORE_MAX = 100; ///< max score, half of that is used for file extension based detection + AVPROBE_SCORE_MAX = 100; ///< Maximum score, half of that is used for file-extension-based detection. AVPROBE_PADDING_SIZE = 32; ///< extra allocated bytes at the end of the probe buffer - //! demuxer will use url_fopen, no opened file should be provided by the caller + //! Demuxer will use url_fopen, no opened file should be provided by the caller. AVFMT_NOFILE = $0001; - AVFMT_NEEDNUMBER = $0002; (**< needs '%d' in filename *) - AVFMT_SHOW_IDS = $0008; (**< show format stream IDs numbers *) - AVFMT_RAWPICTURE = $0020; (**< format wants AVPicture structure for - raw picture data *) - AVFMT_GLOBALHEADER = $0040; (**< format wants global header *) - AVFMT_NOTIMESTAMPS = $0080; (**< format does not need / have any timestamps *) - AVFMT_GENERIC_INDEX = $0100; (**< use generic index building code *) + AVFMT_NEEDNUMBER = $0002; (**< Needs '%d' in filename. *) + AVFMT_SHOW_IDS = $0008; (**< Show format stream IDs numbers. *) + AVFMT_RAWPICTURE = $0020; (**< Format wants AVPicture structure for + raw picture data. *) + AVFMT_GLOBALHEADER = $0040; (**< Format wants global header. *) + AVFMT_NOTIMESTAMPS = $0080; (**< Format does not need / have any timestamps. *) + AVFMT_GENERIC_INDEX = $0100; (**< Use generic index building code. *) + AVFMT_TS_DISCONT = $0200; (**< Format allows timestamp discontinuities. *) // used by AVIndexEntry AVINDEX_KEYFRAME = $0001; @@ -230,12 +257,12 @@ const AVFMT_NOOUTPUTLOOP = -1; AVFMT_INFINITEOUTPUTLOOP = 0; - AVFMT_FLAG_GENPTS = $0001; ///< generate pts if missing even if it requires parsing future frames - AVFMT_FLAG_IGNIDX = $0002; ///< ignore index - AVFMT_FLAG_NONBLOCK = $0004; ///< do not block when reading packets from input + AVFMT_FLAG_GENPTS = $0001; ///< Generate pts if missing even if it requires parsing future frames. + AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. + AVFMT_FLAG_NONBLOCK = $0004; ///< Do not block when reading packets from input. // used by AVStream - MAX_REORDER_DELAY = 4; + MAX_REORDER_DELAY = 16; // used by TAVProgram AV_PROGRAM_RUNNING = 1; @@ -279,9 +306,9 @@ type PAVChapter = ^TAVChapter; TAVChapter = record - id: cint; ///< Unique id to identify the chapter - time_base: TAVRational; ///< Timebase in which the start/end timestamps are specified - start, end_: cint64; ///< chapter start/end time in time_base units + 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 title: PChar; ///< chapter title end; TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter; @@ -297,18 +324,18 @@ type {$IF LIBAVFORMAT_VERSION < 51006000} // 51.6.0 image_format: PAVImageFormat; {$IFEND} - channel: cint; (* used to select dv channel *) + channel: cint; (**< Used to select DV channel. *) {$IF LIBAVFORMAT_VERSION_MAJOR < 52} device: pchar; (* video, audio or DV device, if LIBAVFORMAT_VERSION_INT < (52<<16) *) {$IFEND} - standard: pchar; (* tv standard, NTSC, PAL, SECAM *) + standard: pchar; (**< TV standard, NTSC, PAL, SECAM *) { Delphi does not support bit fields -> use bf_flags instead - unsigned int mpeg2ts_raw:1; /**< force raw MPEG2 transport stream output, if possible */ - unsigned int mpeg2ts_compute_pcr:1; /**< compute exact PCR for each transport + unsigned int mpeg2ts_raw:1; (**< Force raw MPEG-2 transport stream output, if possible. *) + unsigned int mpeg2ts_compute_pcr:1; (**< Compute exact PCR for each transport stream packet (only meaningful if - mpeg2ts_raw is TRUE) */ - unsigned int initial_pause:1; /**< do not begin to play the stream - immediately (RTSP only) */ + mpeg2ts_raw is TRUE). *) + unsigned int initial_pause:1; (**< Do not begin to play the stream + immediately (RTSP only). *) unsigned int prealloced_context:1; } bf_flags: byte; // 0:mpeg2ts_raw/1:mpeg2ts_compute_pcr/2:initial_pause/3:prealloced_context @@ -327,25 +354,26 @@ type *) long_name: pchar; mime_type: pchar; - extensions: pchar; (*< comma separated filename extensions *) - (* size of private data so that it can be allocated in the wrapper *) + extensions: pchar; (**< comma-separated filename extensions *) + (** Size of private data so that it can be allocated in the wrapper. *) priv_data_size: cint; (* output support *) - audio_codec: TCodecID; (* default audio codec *) - video_codec: TCodecID; (* default video codec *) + audio_codec: TCodecID; (**< default audio codec *) + video_codec: TCodecID; (**< default video codec *) write_header: function (c: PAVFormatContext): cint; cdecl; write_packet: function (c: PAVFormatContext; pkt: PAVPacket): cint; cdecl; write_trailer: function (c: PAVFormatContext): cint; cdecl; - (* can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_GLOBALHEADER *) + (** can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_GLOBALHEADER *) flags: cint; - (* currently only used to set pixel format if not YUV420P *) + (** Currently only used to set pixel format if not YUV420P. *) set_parameters: function (c: PAVFormatContext; f: PAVFormatParameters): cint; cdecl; - interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; in_: PAVPacket; flush: cint): cint; cdecl; + interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; + in_: PAVPacket; flush: cint): cint; cdecl; {$IF LIBAVFORMAT_VERSION >= 51008000} // 51.8.0 (** - * list of supported codec_id-codec_tag pairs, ordered by "better choice first" - * the arrays are all CODEC_ID_NONE terminated + * List of supported codec_id-codec_tag pairs, ordered by "better + * choice first". The arrays are all CODEC_ID_NONE terminated. *) codec_tag: {const} PPAVCodecTag; {$IFEND} @@ -366,7 +394,7 @@ type * to define it. *) long_name: pchar; - (* size of private data so that it can be allocated in the wrapper *) + (** Size of private data so that it can be allocated in the wrapper. *) priv_data_size: cint; (** * Tell if a given file has a chance of being parsed by this format. @@ -374,21 +402,21 @@ type * big so you do not have to check for that unless you need more. *) read_probe: function (p: PAVProbeData): cint; cdecl; - (* read the format header and initialize the AVFormatContext - structure. Return 0 if OK. 'ap' if non NULL contains - additionnal paramters. Only used in raw format right + (** Read the format header and initialize the AVFormatContext + structure. Return 0 if OK. 'ap' if non-NULL contains + additional parameters. Only used in raw format right now. 'av_new_stream' should be called to create new streams. *) read_header: function (c: PAVFormatContext; ap: PAVFormatParameters): cint; cdecl; - (* read one packet and put it in 'pkt'. pts and flags are also + (** Read one packet and put it in 'pkt'. pts and flags are also set. 'av_new_stream' can be called only if the flag AVFMTCTX_NOHEADER is used. *) read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; - (* close the stream. The AVFormatContext and AVStreams are not + (** Close the stream. The AVFormatContext and AVStreams are not freed by this function *) read_close: function (c: PAVFormatContext): cint; cdecl; (** - * seek to a given timestamp relative to the frames in - * stream component stream_index + * Seek to a given timestamp relative to the frames in + * stream component stream_index. * @param stream_index must not be -1 * @param flags selects which direction should be preferred if no exact * match is available @@ -397,24 +425,26 @@ type read_seek: function (c: PAVFormatContext; stream_index: cint; timestamp: cint64; flags: cint): cint; cdecl; (** - * gets the next timestamp in stream[stream_index].time_base units. + * Gets the next timestamp in stream[stream_index].time_base units. * @return the timestamp or AV_NOPTS_VALUE if an error occurred *) read_timestamp: function (s: PAVFormatContext; stream_index: cint; pos: pint64; pos_limit: cint64): cint64; cdecl; - (* can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER *) + (** Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER. *) flags: cint; - (* if extensions are defined, then no probe is done. You should + (** If extensions are defined, then no probe is done. You should usually not use extension format guessing because it is not reliable enough *) extensions: pchar; - (* general purpose read only value that the format can use *) + (** General purpose read-only value that the format can use. *) value: cint; - (* start/resume playing - only meaningful if using a network based format (RTSP) *) + (** Start/resume playing - only meaningful if using a network-based format + (RTSP). *) read_play: function (c: PAVFormatContext): cint; cdecl; - (* pause playing - only meaningful if using a network based format (RTSP) *) + (** Pause playing - only meaningful if using a network-based format + (RTSP). *) read_pause: function (c: PAVFormatContext): cint; cdecl; {$IF LIBAVFORMAT_VERSION >= 51008000} // 51.8.0 @@ -428,8 +458,8 @@ type TAVStreamParseType = ( AVSTREAM_PARSE_NONE, AVSTREAM_PARSE_FULL, (**< full parsing and repack *) - AVSTREAM_PARSE_HEADERS, (**< only parse headers, don't repack *) - AVSTREAM_PARSE_TIMESTAMPS (**< full parsing and interpolation of timestamps for frames not starting on packet boundary *) + AVSTREAM_PARSE_HEADERS, (**< Only parse headers, do not repack. *) + AVSTREAM_PARSE_TIMESTAMPS (**< full parsing and interpolation of timestamps for frames not starting on a packet boundary *) ); TAVIndexEntry = record @@ -437,10 +467,10 @@ type timestamp: cint64; { Delphi doesn't support bitfields -> use flags_size instead int flags:2; - int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs 32 byte due to possible 8byte align). + int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). } flags_size: cint; // 0..1: flags, 2..31: size - min_distance: cint; (* min distance between this and the previous keyframe, used to avoid unneeded searching *) + min_distance: cint; (**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. *) end; (** @@ -451,16 +481,16 @@ type * sizeof(AVStream) must not be used outside libav*. *) TAVStream = record - index: cint; (* stream index in AVFormatContext *) - id: cint; (* format specific stream id *) - codec: PAVCodecContext; (* codec context *) + index: cint; (**< stream index in AVFormatContext *) + id: cint; (**< format-specific stream ID *) + codec: PAVCodecContext; (**< codec context *) (** * Real base frame rate of the stream. * This is the lowest frame rate with which all timestamps can be * represented accurately (it is the least common multiple of all - * frame rates in the stream), Note, this value is just a guess! + * frame rates in the stream). Note, this value is just a guess! * For example if the timebase is 1/90000 and all frames have either - * approximately 3600 or 1800 timer ticks then r_frame_rate will be 50/1. + * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. *) r_frame_rate: TAVRational; priv_data: pointer; @@ -471,21 +501,20 @@ type codec_info_nb_frames: cint; {$IFEND} - (** encoding: PTS generation when outputing stream *) + (** encoding: pts generation when outputting stream *) pts: TAVFrac; (** * This is the fundamental unit of time (in seconds) in terms * of which frame timestamps are represented. For fixed-fps content, - * timebase should be 1/frame rate and timestamp increments should be - * identically 1. + * time base should be 1/frame rate and timestamp increments should be 1. *) time_base: TAVRational; pts_wrap_bits: cint; (* number of bits in pts (used for wrapping control) *) (* ffmpeg.c private use *) - stream_copy: cint; (**< if set, just copy stream *) - discard: TAVDiscard; ///< selects which packets can be discarded at will and dont need to be demuxed + stream_copy: cint; (**< If set, just copy stream. *) + discard: TAVDiscard; ///< Selects which packets can be discarded at will and do not need to be demuxed. //FIXME move stuff to a flags field? - (* quality, as it has been removed from AVCodecContext and put in AVVideoFrame + (** Quality, as it has been removed from AVCodecContext and put in AVVideoFrame. * MN:dunno if thats the right place, for it *) quality: cfloat; (** @@ -500,7 +529,7 @@ type (** * Decoding: duration of the stream, in stream time base. * If a source file does not specify a duration, but does specify - * a bitrate, this value will be estimates from bit rate and file size. + * a bitrate, this value will be estimated from bitrate and file size. *) duration: cint64; @@ -514,14 +543,15 @@ type last_IP_duration: cint; last_IP_pts: cint64; (* av_seek_frame() support *) - index_entries: PAVIndexEntry; (* only used if the format does not support seeking natively *) + index_entries: PAVIndexEntry; (**< Only used if the format does not + support seeking natively. *) nb_index_entries: cint; index_entries_allocated_size: cuint; nb_frames: cint64; ///< number of frames in this stream if known or 0 - {$IF LIBAVFORMAT_VERSION >= 50006000} // 50.6.0 - pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; + {$IF (LIBAVFORMAT_VERSION >= 50006000) and (LIBAVFORMAT_VERSION_MAJOR < 53)} // 50.6.0 - 53.0.0 + unused: array [0..4] of cint64; {$IFEND} {$IF LIBAVFORMAT_VERSION >= 52006000} // 52.6.0 @@ -535,18 +565,29 @@ type {$IF LIBAVFORMAT_VERSION >= 52019000} // 52.19.0 probe_data: TAVProbeData; {$IFEND} + + {$IF LIBAVFORMAT_VERSION >= 52021000} // 52.21.0 + pts_buffer: array [0..MAX_REORDER_DELAY] of cint64; + + (** + * sample aspect ratio (0 if unknown) + * - encoding: Set by user. + * - decoding: Set by libavformat. + *) + sample_aspect_ratio: TAVRational; + {$IFEND} end; (** - * format I/O context. + * Format I/O context. * New fields can be added to the end with minor version bumps. * Removal, reordering and changes to existing fields require a major * version bump. * sizeof(AVFormatContext) must not be used outside libav*. *) TAVFormatContext = record - av_class: PAVClass; (* set by av_alloc_format_context *) - (* can only be iformat or oformat, not both at the same time *) + av_class: PAVClass; (**< Set by av_alloc_format_context. *) + (* Can only be iformat or oformat, not both at the same time. *) iformat: PAVInputFormat; oformat: PAVOutputFormat; priv_data: pointer; @@ -567,28 +608,28 @@ type copyright: array [0..511] of char; comment: array [0..511] of char; album: array [0..511] of char; - year: cint; (* ID3 year, 0 if none *) - track: cint; (* track number, 0 if none *) - genre: array [0..31] of char; (* ID3 genre *) - - ctx_flags: cint; (* format specific flags, see AVFMTCTX_xx *) - (* private data for pts handling (do not modify directly) *) - (* This buffer is only needed when packets were already buffered but - not decoded, for example to get the codec parameters in mpeg - streams *) + year: cint; (**< ID3 year, 0 if none *) + track: cint; (**< track number, 0 if none *) + genre: array [0..31] of char; (**< ID3 genre *) + + ctx_flags: cint; (**< Format-specific flags, see AVFMTCTX_xx *) + (* private data for pts handling (do not modify directly). *) + (** This buffer is only needed when packets were already buffered but + not decoded, for example to get the codec parameters in MPEG + streams. *) packet_buffer: PAVPacketList; - (* decoding: position of the first frame of the component, in + (** Decoding: position of the first frame of the component, in AV_TIME_BASE fractional seconds. NEVER set this value directly: - it is deduced from the AVStream values. *) + It is deduced from the AVStream values. *) start_time: cint64; - (* decoding: duration of the stream, in AV_TIME_BASE fractional + (** Decoding: duration of the stream, in AV_TIME_BASE fractional seconds. NEVER set this value directly: it is deduced from the AVStream values. *) duration: cint64; - (* decoding: total file size. 0 if unknown *) + (** decoding: total file size, 0 if unknown *) file_size: cint64; - (* decoding: total stream bitrate in bit/s, 0 if not + (** Decoding: total stream bitrate in bit/s, 0 if not available. Never set it directly if the file_size and the duration are known as ffmpeg can compute it automatically. *) bit_rate: cint; @@ -615,13 +656,14 @@ type loop_input: cint; {$IF LIBAVFORMAT_VERSION >= 50006000} // 50.6.0 - (* decoding: size of data to probe; encoding unused *) + (** Decoding: size of data to probe; encoding: unused. *) probesize: cuint; {$IFEND} {$IF LIBAVFORMAT_VERSION >= 51009000} // 51.9.0 (** - * maximum duration in AV_TIME_BASE units over which the input should be analyzed in av_find_stream_info() + * Maximum time (in AV_TIME_BASE units) during which the input should + * be analyzed in av_find_stream_info(). *) max_analyze_duration: cint; @@ -637,17 +679,17 @@ type {$IF LIBAVFORMAT_VERSION >= 52003000} // 52.3.0 (** * Forced video codec_id. - * demuxing: set by user + * Demuxing: Set by user. *) video_codec_id: TCodecID; (** * Forced audio codec_id. - * demuxing: set by user + * Demuxing: Set by user. *) audio_codec_id: TCodecID; (** * Forced subtitle codec_id. - * demuxing: set by user + * Demuxing: Set by user. *) subtitle_codec_id: TCodecID; {$IFEND} @@ -655,10 +697,10 @@ type {$IF LIBAVFORMAT_VERSION >= 52004000} // 52.4.0 (** * Maximum amount of memory in bytes to use per stream for the index. - * If the needed index exceeds this size entries will be discarded as + * If the needed index exceeds this size, entries will be discarded as * needed to maintain a smaller size. This can lead to slower or less * accurate seeking (depends on demuxer). - * Demuxers for which a full in memory index is mandatory will ignore + * Demuxers for which a full in-memory index is mandatory will ignore * this. * muxing : unused * demuxing: set by user @@ -669,7 +711,7 @@ type {$IF LIBAVFORMAT_VERSION >= 52009000} // 52.9.0 (** * Maximum amount of memory in bytes to use for buffering frames - * obtained from real-time capture devices. + * obtained from realtime capture devices. *) max_picture_buffer: cuint; {$IFEND} @@ -681,14 +723,14 @@ type {$IF LIBAVFORMAT_VERSION >= 52016000} // 52.16.0 (** - * Flags to enable debuging. + * Flags to enable debugging. *) debug: cint; {$IFEND} {$IF LIBAVFORMAT_VERSION >= 52019000} // 52.19.0 (** - * raw packets from the demuxer, prior to parsing and decoding. + * Raw packets from the demuxer, prior to parsing and decoding. * This buffer is used for buffering packets until the codec can * be identified, as parsing cannot be done without knowing the * codec. @@ -708,8 +750,8 @@ type *) TAVProgram = record id : cint; - provider_name : PChar; ///< Network name for DVB streams - name : PChar; ///< Service name for DVB streams + provider_name : PChar; ///< network name for DVB streams + name : PChar; ///< service name for DVB streams flags : cint; discard : TAVDiscard; ///< selects which program to discard and which to feed to the caller {$IF LIBAVFORMAT_VERSION >= 51016000} // 51.16.0 @@ -799,17 +841,22 @@ procedure av_register_input_format(format: PAVInputFormat); procedure av_register_output_format(format: PAVOutputFormat); cdecl; external av__format; -function guess_stream_format(short_name: pchar; filename: pchar; mime_type: pchar): PAVOutputFormat; +function guess_stream_format(short_name: pchar; + filename: pchar; + mime_type: pchar): PAVOutputFormat; cdecl; external av__format; -function guess_format(short_name: pchar; filename: pchar; mime_type: pchar): PAVOutputFormat; +function guess_format(short_name: pchar; + filename: pchar; + mime_type: pchar): PAVOutputFormat; cdecl; external av__format; (** - * Guesses the codec id based upon muxer and filename. + * Guesses the codec ID based upon muxer and filename. *) function av_guess_codec(fmt: PAVOutputFormat; short_name: pchar; - filename: pchar; mime_type: pchar; type_: TCodecType): TCodecID; + filename: pchar; mime_type: pchar; + type_: TCodecType): TCodecID; cdecl; external av__format; (** @@ -846,7 +893,7 @@ procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: PChar; size: cint); * * @param f The file stream pointer where the dump should be sent to. * @param pkt packet to dump - * @param dump_payload true if the payload must be displayed too + * @param dump_payload True if the payload must be displayed, too. *) procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); cdecl; external av__format; @@ -860,7 +907,7 @@ procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); * @param level The importance level of the message, lower values signifying * higher importance. * @param pkt packet to dump - * @param dump_payload true if the payload must be displayed too + * @param dump_payload True if the payload must be displayed, too. *) procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_payload: cint); cdecl; external av__format; @@ -880,7 +927,7 @@ function av_codec_get_tag(var tags: PAVCodecTag; id: TCodecID): cuint; (* media file input *) (** - * finds AVInputFormat based on input format's short name. + * Finds AVInputFormat based on the short name of the input format. *) function av_find_input_format(short_name: pchar): PAVInputFormat; cdecl; external av__format; @@ -888,8 +935,8 @@ function av_find_input_format(short_name: pchar): PAVInputFormat; (** * Guess file format. * - * @param is_opened whether the file is already opened, determines whether - * demuxers with or without AVFMT_NOFILE are probed + * @param is_opened Whether the file is already opened; determines whether + * demuxers with or without AVFMT_NOFILE are probed. *) function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputFormat; cdecl; external av__format; @@ -907,12 +954,13 @@ function av_open_input_stream(ic_ptr: PAVFormatContext; * Open a media file as input. The codecs are not opened. Only the file * header (if present) is read. * - * @param ic_ptr the opened media file handle is put here - * @param filename filename to open. - * @param fmt if non NULL, force the file format to use + * @param ic_ptr The opened media file handle is put here. + * @param filename filename to open + * @param fmt If non-NULL, force the file format to use. * @param buf_size optional buffer size (zero if default is OK) - * @param ap additional parameters needed when opening the file (NULL if default) - * @return 0 if OK. AVERROR_xxx otherwise. + * @param ap Additional parameters needed when opening the file + * (NULL if default). + * @return 0 if OK, AVERROR_xxx otherwise *) function av_open_input_file(var ic_ptr: PAVFormatContext; filename: pchar; fmt: PAVInputFormat; buf_size: cint; @@ -930,14 +978,15 @@ function av_alloc_format_context(): PAVFormatContext; (** * 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 frame rate in case of mpeg2 repeat + * function also computes the real frame rate in case of MPEG-2 repeat * frame mode. * The logical file position is not changed by this function; * examined packets may be buffered for later processing. * * @param ic media file handle - * @return >=0 if OK. AVERROR_xxx if error. - * @todo Let user decide somehow what information is needed so we do not waste time getting stuff the user does not need. + * @return >=0 if OK, AVERROR_xxx on error + * @todo Let the user decide somehow what information is needed so that + * we do not waste time getting stuff the user does not need. *) function av_find_stream_info(ic: PAVFormatContext): cint; cdecl; external av__format; @@ -950,7 +999,7 @@ function av_find_stream_info(ic: PAVFormatContext): cint; * * @param s media file handle * @param pkt is filled - * @return 0 if OK. AVERROR_xxx if error. + * @return 0 if OK, AVERROR_xxx on error *) function av_read_packet(s: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; external av__format; @@ -968,11 +1017,11 @@ function av_read_packet(s: PAVFormatContext; var pkt: TAVPacket): cint; * * pkt->pts, pkt->dts and pkt->duration are always set to correct * values in AVStream.timebase units (and guessed if the format cannot - * provided them). pkt->pts can be AV_NOPTS_VALUE if the video format - * has B frames, so it is better to rely on pkt->dts if you do not + * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format + * has B-frames, so it is better to rely on pkt->dts if you do not * decompress the payload. * - * @return 0 if OK, < 0 if error or end of file. + * @return 0 if OK, < 0 on error or end of file *) function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; external av__format; @@ -983,17 +1032,18 @@ function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; * @param stream_index If stream_index is (-1), a default * stream is selected, and timestamp is automatically converted * from AV_TIME_BASE units to the stream specific time_base. - * @param timestamp timestamp in AVStream.time_base units - * or if there is no stream specified then in AV_TIME_BASE units + * @param timestamp Timestamp in AVStream.time_base units + * or, if no stream is specified, in AV_TIME_BASE units. * @param flags flags which select direction and seeking mode * @return >= 0 on success *) -function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint64; flags: cint): cint; +function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint64; + flags: cint): cint; cdecl; external av__format; (** - * start playing a network based stream (e.g. RTSP stream) at the - * current position + * Start playing a network based stream (e.g. RTSP stream) at the + * current position. *) function av_read_play(s: PAVFormatContext): cint; cdecl; external av__format; @@ -1031,7 +1081,7 @@ procedure av_close_input_file(s: PAVFormatContext); * can be added in read_packet too. * * @param s media file handle - * @param id file format dependent stream id + * @param id file-format-dependent stream ID *) function av_new_stream(s: PAVFormatContext; id: cint): PAVStream; cdecl; external av__format; @@ -1044,17 +1094,18 @@ function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; (** * Add a new chapter. * This function is NOT part of the public API - * and should be ONLY used by demuxers. + * and should ONLY be used by demuxers. * * @param s media file handle - * @param id unique id for this chapter + * @param id unique ID for this chapter * @param start chapter start time in time_base units * @param end chapter end time in time_base units * @param title chapter title * - * @return AVChapter or NULL if error. + * @return AVChapter or NULL on error *) -function ff_new_chapter(s: PAVFormatContext; id: cint; time_base: TAVRational; start, end_: cint64; title: {const} Pchar): PAVChapter; +function ff_new_chapter(s: PAVFormatContext; id: cint; time_base: TAVRational; + start, end_: cint64; title: {const} Pchar): PAVChapter; cdecl; external av__format; {$IFEND} @@ -1074,16 +1125,16 @@ procedure av_set_pts_info(s: PAVStream; pts_wrap_bits: cint; const AVSEEK_FLAG_BACKWARD = 1; ///< seek backward AVSEEK_FLAG_BYTE = 2; ///< seeking based on position in bytes - AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non keyframes + AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non-keyframes function av_find_default_stream_index(s: PAVFormatContext): cint; cdecl; external av__format; (** * Gets the index for a specific timestamp. - * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond to - * the timestamp which is <= the requested one, if backward is 0 - * then it will be >= + * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond + * to the timestamp which is <= the requested one, if backward + * is 0, then it will be >= * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise * @return < 0 if no such timestamp could be found *) @@ -1103,17 +1154,20 @@ procedure ff_reduce_index(s: PAVFormatContext; stream_index: cint); {$IFEND} (** - * Add a index entry into a sorted list updateing if it is already there. + * Add an index entry into a sorted list. Update the entry if the list + * already contains it. * * @param timestamp timestamp in the timebase of the given stream *) function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; - distance: cint; flags: cint): cint; + size: cint; distance: cint; flags: cint): cint; cdecl; external av__format; (** - * Does a binary search using av_index_search_timestamp() and AVCodec.read_timestamp(). - * This is not supposed to be called directly by a user application, but by demuxers. + * Does a binary search using av_index_search_timestamp() and + * AVCodec.read_timestamp(). + * This is not supposed to be called directly by a user application, + * but by demuxers. * @param target_ts target timestamp in the time base of the given stream * @param stream_index stream number *) @@ -1123,10 +1177,10 @@ function av_seek_frame_binary(s: PAVFormatContext; stream_index: cint; (** - * Updates cur_dts of all streams based on given timestamp and AVStream. + * Updates cur_dts of all streams based on the given timestamp and AVStream. * - * Stream ref_st unchanged, others set cur_dts in their native timebase - * only needed for timestamp wrapping or if (dts not set and pts!=dts). + * Stream ref_st unchanged, others set cur_dts in their native time base. + * Only needed for timestamp wrapping or if (dts not set and pts!=dts). * @param timestamp new dts expressed in time_base of param ref_st * @param ref_st reference stream giving time_base of param timestamp *) @@ -1141,13 +1195,17 @@ type (** * Does a binary search using read_timestamp(). - * This is not supposed to be called directly by a user application, but by demuxers. + * This is not supposed to be called directly by a user application, + * but by demuxers. * @param target_ts target timestamp in the time base of the given stream * @param stream_index stream number *) -function av_gen_search(s: PAVFormatContext; stream_index: cint; target_ts: cint64; - pos_min: cint64; pos_max: cint64; pos_limit: cint64; ts_min: cint64; ts_max: cint64; - flags: cint; ts_ret: Pint64; read_timestamp: TReadTimestampFunc): cint64; +function av_gen_search(s: PAVFormatContext; stream_index: cint; + target_ts: cint64; pos_min: cint64; + pos_max: cint64; pos_limit: cint64; + ts_min: cint64; ts_max: cint64; + flags: cint; ts_ret: Pint64; + read_timestamp: TReadTimestampFunc): cint64; cdecl; external av__format; {$IFEND} @@ -1160,7 +1218,7 @@ function av_set_parameters(s: PAVFormatContext; ap: PAVFormatParameters): cint; * output media file. * * @param s media file handle - * @return 0 if OK. AVERROR_xxx if error. + * @return 0 if OK, AVERROR_xxx on error *) function av_write_header(s: PAVFormatContext): cint; cdecl; external av__format; @@ -1169,12 +1227,13 @@ function av_write_header(s: PAVFormatContext): cint; * Write a packet to an output media file. * * The packet shall contain one audio or video frame. - * The packet must be correctly interleaved according to the container specification, - * if not then av_interleaved_write_frame must be used + * The packet must be correctly interleaved according to the container + * specification, if not then av_interleaved_write_frame must be used. * * @param s media file handle - * @param pkt the packet, which contains the stream_index, buf/buf_size, dts/pts, ... - * @return < 0 if error, = 0 if OK, 1 if end of stream wanted. + * @param pkt The packet, which contains the stream_index, buf/buf_size, + * dts/pts, ... + * @return < 0 on error, = 0 if OK, 1 if end of stream wanted *) function av_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; external av__format; @@ -1190,17 +1249,19 @@ function av_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; * demuxer level. * * @param s media file handle - * @param pkt the packet, which contains the stream_index, buf/buf_size, dts/pts, ... - * @return < 0 if error, = 0 if OK, 1 if end of stream wanted. + * @param pkt The packet, which contains the stream_index, buf/buf_size, + * dts/pts, ... + * @return < 0 on error, = 0 if OK, 1 if end of stream wanted *) function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; external av__format; (** - * Interleave a packet per DTS in an output media file. + * Interleave a packet per dts in an output media file. * - * Packets with pkt->destruct == av_destruct_packet will be freed inside this function, - * so they cannot be used after it, note calling av_free_packet() on them is still safe. + * Packets with pkt->destruct == av_destruct_packet will be freed inside this + * function, so they cannot be used after it, note calling av_free_packet() + * on them is still safe. * * @param s media file handle * @param out the interleaved packet will be output here @@ -1218,8 +1279,10 @@ function av_interleave_packet_per_dts(s: PAVFormatContext; _out: PAVPacket; * @brief Write the stream trailer to an output media file and * free the file private data. * + * May only be called after a successful call to av_write_header. + * * @param s media file handle - * @return 0 if OK. AVERROR_xxx if error. + * @return 0 if OK, AVERROR_xxx on error *) function av_write_trailer(s: pAVFormatContext): cint; cdecl; external av__format; @@ -1229,17 +1292,19 @@ procedure dump_format(ic: PAVFormatContext; index: cint; url: pchar; cdecl; external av__format; (** - * parses width and height out of string str. + * Parses 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: pchar): cint; +function parse_image_size(width_ptr: PCint; height_ptr: PCint; + str: pchar): cint; cdecl; external av__format; deprecated; (** * Converts frame rate from string to a fraction. * @deprecated Use av_parse_video_frame_rate instead. *) -function parse_frame_rate(frame_rate: PCint; frame_rate_base: PCint; arg: pchar): cint; +function parse_frame_rate(frame_rate: PCint; frame_rate_base: PCint; + arg: pchar): cint; cdecl; external av__format; deprecated; (** @@ -1251,7 +1316,7 @@ function parse_frame_rate(frame_rate: PCint; frame_rate_base: PCint; arg: pchar) * @endcode * Time is localtime unless Z is appended, in which case it is * interpreted as UTC. - * If the year-month-day part isn't specified it takes the current + * If the year-month-day part is not specified it takes the current * year-month-day. * Returns the number of microseconds since 1st of January, 1970 up to * the time of the parsed date or INT64_MIN if \p datestr cannot be @@ -1271,10 +1336,11 @@ function parse_frame_rate(frame_rate: PCint; frame_rate_base: PCint; arg: pchar) function parse_date(datestr: pchar; duration: cint): cint64; cdecl; external av__format; +(** Gets the current time in microseconds. *) function av_gettime(): cint64; cdecl; external av__format; -(* ffm specific for ffserver *) +(* ffm-specific for ffserver *) const FFM_PACKET_SIZE = 4096; @@ -1298,7 +1364,7 @@ function find_info_tag(arg: pchar; arg_size: cint; tag1: pchar; info: pchar): ci (** * Returns in 'buf' the path with '%d' replaced by number. - + * * Also handles the '%0nd' format where 'n' is the total number * of digits and '%%'. * @@ -1306,7 +1372,7 @@ function find_info_tag(arg: pchar; arg_size: cint; tag1: pchar; info: pchar): ci * @param buf_size destination buffer size * @param path numbered sequence string * @param number frame number - * @return 0 if OK, -1 if format error. + * @return 0 if OK, -1 on format error *) function av_get_frame_filename(buf: pchar; buf_size: cint; path: pchar; number: cint): cint; @@ -1319,7 +1385,7 @@ function av_get_frame_filename(buf: pchar; buf_size: cint; * Check whether filename actually is a numbered sequence generator. * * @param filename possible numbered sequence string - * @return 1 if a valid numbered sequence string, 0 otherwise. + * @return 1 if a valid numbered sequence string, 0 otherwise *) function av_filename_number_test(filename: pchar): cint; cdecl; external av__format @@ -1335,12 +1401,12 @@ function av_filename_number_test(filename: pchar): cint; * array is composed by only one context, such context can contain * multiple AVStreams (one AVStream per RTP stream). Otherwise, * all the contexts in the array (an AVCodecContext per RTP stream) - * must contain only one AVStream + * must contain only one AVStream. * @param n_files number of AVCodecContexts contained in ac * @param buff buffer where the SDP will be stored (must be allocated by - * the caller + * the caller) * @param size the size of the buffer - * @return 0 if OK. AVERROR_xxx if error. + * @return 0 if OK, AVERROR_xxx on error *) function avf_sdp_create(ac: PPAVFormatContext; n_files: cint; buff: PChar; size: cint): cint; cdecl; external av__format; -- cgit v1.2.3 From e24412a795e205494d0a7420fd582841c1fc1dd4 Mon Sep 17 00:00:00 2001 From: tobigun Date: Wed, 4 Feb 2009 17:17:51 +0000 Subject: ffmpeg header update git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1581 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 217 ++++++++++++++++++++++++++++++++------------ 1 file changed, 157 insertions(+), 60 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index c516aea0..62df8a83 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -27,7 +27,7 @@ (* * Conversion of libavformat/avformat.h * Min. version: 50.5.0 , revision 6577, Sat Oct 7 15:30:46 2006 UTC - * Max. version: 52.22.1, revision 15441, Sat Sep 27 20:05:12 2008 UTC + * Max. version: 52.25.0, revision 16986, Wed Feb 4 05:56:39 2009 UTC *) unit avformat; @@ -54,13 +54,14 @@ uses avutil, avio, rational, + SysUtils, UConfig; const (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 22; - LIBAVFORMAT_MAX_VERSION_RELEASE = 1; + LIBAVFORMAT_MAX_VERSION_MINOR = 25; + LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); @@ -95,6 +96,68 @@ function avformat_version(): cuint; type PAVFile = Pointer; +(* + * Public Metadata API. + * !!WARNING!! This is a work in progress. Don't use outside FFmpeg for now. + * The metadata API allows libavformat to export metadata tags to a client + * application using a sequence of key/value pairs. + * Important concepts to keep in mind: + * 1. Keys are unique; there can never be 2 tags with the same key. This is + * also meant semantically, i.e., a demuxer should not knowingly produce + * several keys that are literally different but semantically identical. + * E.g., key=Author5, key=Author6. In this example, all authors must be + * placed in the same tag. + * 2. Metadata is flat, not hierarchical; there are no subtags. If you + * want to store, e.g., the email address of the child of producer Alice + * and actor Bob, that could have key=alice_and_bobs_childs_email_address. + * 3. A tag whose value is localized for a particular language is appended + * with a dash character ('-') and the ISO 639 3-letter language code. + * For example: Author-ger=Michael, Author-eng=Mike + * The original/default language is in the unqualified "Author" tag. + * A demuxer should set a default if it sets any translated tag. + *) +const + AV_METADATA_MATCH_CASE = 1; + AV_METADATA_IGNORE_SUFFIX = 2; + +type + PAVMetadataTag = ^TAVMetadataTag; + TAVMetadataTag = record + key: PAnsiChar; + value: PAnsiChar; + end; + + PAVMetadata = Pointer; + +{$IF LIBAVFORMAT_VERSION > 52024001} // > 52.24.1 + +(** + * gets a metadata element with matching key. + * @param prev set to the previous matching element to find the next. + * @param flags allows case as well as suffix insensitive comparisons. + * @return found tag or NULL, changing key or value leads to undefined behavior. + *) +function av_metadata_get(m: PAVMetadata; key: {const} PAnsiChar; + prev: {const} PAVMetadataTag ; flags: cint): PAVMetadataTag; + cdecl; external av__format; + +(** + * sets the given tag in m, overwriting an existing tag. + * @param key tag key to add to m (will be av_strduped). + * @param value tag value to add to m (will be av_strduped). + * @return >= 0 if success otherwise error code that is <0. + *) +function av_metadata_set(var pm: PAVMetadata; key: {const} PAnsiChar; value: {const} PAnsiChar): cint; + cdecl; external av__format; + +(** + * Free all the memory allocated for an AVMetadata struct. + *) +procedure av_metadata_free(var m: PAVMetadata); + cdecl; external av__format; + +{$IFEND} + (* packet functions *) type @@ -117,7 +180,7 @@ type * Can be AV_NOPTS_VALUE if it is not stored in the file. *) dts: cint64; - data: PChar; + data: PByteArray; size: cint; stream_index: cint; flags: cint; @@ -126,7 +189,7 @@ type * Equals next_pts - this_pts in presentation order. *) duration: cint; - destruct: procedure (p: PAVPacket); cdecl; + destruct: procedure (p: PAVPacket); cdecl; priv: pointer; pos: cint64; ///< byte position in stream, -1 if unknown @@ -220,7 +283,7 @@ type PAVFrac = ^TAVFrac; TAVFrac = record val, num, den: cint64; - end; {deprecated} + end; (*************************************************) (* input/output formats *) @@ -228,8 +291,8 @@ type type (** This structure contains the data a format has to probe a file. *) TAVProbeData = record - filename: pchar; - buf: pchar; + filename: PAnsiChar; + buf: PByteArray; buf_size: cint; end; @@ -309,7 +372,10 @@ 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 - title: PChar; ///< chapter title + title: PAnsiChar; ///< chapter title + {$IF LIBAVFORMAT_VERSION >= 52024001} // 52.24.1 + metadata: PAVMetadata; + {$IFEND} end; TAVChapterArray = array[0..(MaxInt div SizeOf(TAVChapter))-1] of TAVChapter; PAVChapterArray = ^TAVChapterArray; @@ -326,9 +392,9 @@ type {$IFEND} channel: cint; (**< Used to select DV channel. *) {$IF LIBAVFORMAT_VERSION_MAJOR < 52} - device: pchar; (* video, audio or DV device, if LIBAVFORMAT_VERSION_INT < (52<<16) *) + device: PAnsiChar; (* video, audio or DV device, if LIBAVFORMAT_VERSION_INT < (52<<16) *) {$IFEND} - standard: pchar; (**< TV standard, NTSC, PAL, SECAM *) + standard: PAnsiChar; (**< TV standard, NTSC, PAL, SECAM *) { Delphi does not support bit fields -> use bf_flags instead unsigned int mpeg2ts_raw:1; (**< Force raw MPEG-2 transport stream output, if possible. *) unsigned int mpeg2ts_compute_pcr:1; (**< Compute exact PCR for each transport @@ -346,15 +412,15 @@ type end; TAVOutputFormat = record - name: pchar; + name: PAnsiChar; (** * Descriptive name for the format, meant to be more human-readable * than \p name. You \e should use the NULL_IF_CONFIG_SMALL() macro * to define it. *) - long_name: pchar; - mime_type: pchar; - extensions: pchar; (**< comma-separated filename extensions *) + long_name: PAnsiChar; + mime_type: PAnsiChar; + extensions: PAnsiChar; (**< comma-separated filename extensions *) (** Size of private data so that it can be allocated in the wrapper. *) priv_data_size: cint; (* output support *) @@ -387,13 +453,13 @@ type end; TAVInputFormat = record - name: pchar; + name: PAnsiChar; (** * Descriptive name for the format, meant to be more human-readable * than \p name. You \e should use the NULL_IF_CONFIG_SMALL() macro * to define it. *) - long_name: pchar; + long_name: PAnsiChar; (** Size of private data so that it can be allocated in the wrapper. *) priv_data_size: cint; (** @@ -435,7 +501,7 @@ type (** If extensions are defined, then no probe is done. You should usually not use extension format guessing because it is not reliable enough *) - extensions: pchar; + extensions: PAnsiChar; (** General purpose read-only value that the format can use. *) value: cint; @@ -533,7 +599,7 @@ type *) duration: cint64; - language: array [0..3] of char; (* ISO 639 3-letter language code (empty string if undefined) *) + language: array [0..3] of PAnsiChar; (* ISO 639 3-letter language code (empty string if undefined) *) (* av_read_frame() support *) need_parsing: TAVStreamParseType; @@ -555,7 +621,7 @@ type {$IFEND} {$IF LIBAVFORMAT_VERSION >= 52006000} // 52.6.0 - filename: PChar; (**< source filename of the stream *) + filename: PAnsiChar; (**< source filename of the stream *) {$IFEND} {$IF LIBAVFORMAT_VERSION >= 52008000} // 52.8.0 @@ -576,6 +642,17 @@ type *) sample_aspect_ratio: TAVRational; {$IFEND} + + {$IF LIBAVFORMAT_VERSION >= 52024001} // 52.24.1 + metadata: PAVMetadata; + {$IFEND} + + {$IF LIBAVFORMAT_VERSION > 52024001} // > 52.24.1 + {* av_read_frame() support *} + cur_ptr: {const} PCuint8; + cur_len: cint; + cur_pkt: TAVPacket; + {$IFEND} end; (** @@ -600,17 +677,17 @@ type nb_streams: cuint; streams: array [0..MAX_STREAMS - 1] of PAVStream; - filename: array [0..1023] of char; (* input or output filename *) + filename: array [0..1023] of AnsiChar; (* input or output filename *) (* stream info *) timestamp: cint64; - title: array [0..511] of char; - author: array [0..511] of char; - copyright: array [0..511] of char; - comment: array [0..511] of char; - album: array [0..511] of char; + 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 char; (**< ID3 genre *) + genre: array [0..31] of AnsiChar; (**< ID3 genre *) ctx_flags: cint; (**< Format-specific flags, see AVFMTCTX_xx *) (* private data for pts handling (do not modify directly). *) @@ -636,9 +713,11 @@ type (* av_read_frame() support *) cur_st: PAVStream; - cur_ptr: pbyte; - cur_len: cint; - cur_pkt: TAVPacket; + {$IF LIBAVFORMAT_VERSION_MAJOR < 53} + cur_ptr_deprecated: pbyte; + cur_len_deprecated: cint; + cur_pkt_deprecated: TAVPacket; + {$IFEND} (* av_seek_frame() support *) data_offset: cint64; (* offset of the first packet *) @@ -740,6 +819,10 @@ type packet_buffer_end: PAVPacketList; {$IFEND} + + {$IF LIBAVFORMAT_VERSION >= 52024001} // 52.24.1 + metadata: PAVMetadata; + {$IFEND} end; (** @@ -750,14 +833,17 @@ type *) TAVProgram = record id : cint; - provider_name : PChar; ///< network name for DVB streams - name : PChar; ///< service name for DVB streams + provider_name : PAnsiChar; ///< network name for DVB streams + name : PAnsiChar; ///< service name for DVB streams flags : cint; discard : TAVDiscard; ///< selects which program to discard and which to feed to the caller {$IF LIBAVFORMAT_VERSION >= 51016000} // 51.16.0 stream_index : PCardinal; nb_stream_indexes : PCardinal; {$IFEND} + {$IF LIBAVFORMAT_VERSION >= 52024001} // 52.24.1 + metadata: PAVMetadata; + {$IFEND} end; TAVPacketList = record @@ -779,8 +865,8 @@ type end; {deprecated} TAVImageFormat = record - name: pchar; - extensions: pchar; + name: PAnsiChar; + extensions: PAnsiChar; (* tell if a given file has a chance of being parsing by this format *) img_probe: function (d: PAVProbeData): cint; cdecl; (* read a whole image. 'alloc_cb' is called when the image size is @@ -801,10 +887,10 @@ procedure av_register_image_format(img_fmt: PAVImageFormat); function av_probe_image_format(pd: PAVProbeData): PAVImageFormat; cdecl; external av__format; deprecated; -function guess_image_format(filename: pchar): PAVImageFormat; +function guess_image_format(filename: PAnsiChar): PAVImageFormat; cdecl; external av__format; deprecated; -function av_read_image(pb: PByteIOContext; filename: pchar; +function av_read_image(pb: PByteIOContext; filename: PAnsiChar; fmt: PAVImageFormat; alloc_cb: pointer; opaque: pointer): cint; cdecl; external av__format; deprecated; @@ -828,7 +914,7 @@ function av_oformat_next(f: PAVOutputFormat): PAVOutputFormat; cdecl; external av__format; {$IFEND} -function av_guess_image2_codec(filename: {const} PChar): TCodecID; +function av_guess_image2_codec(filename: {const} PAnsiChar): TCodecID; cdecl; external av__format; (* XXX: use automatic init with either ELF sections or C file parser *) @@ -841,21 +927,21 @@ procedure av_register_input_format(format: PAVInputFormat); procedure av_register_output_format(format: PAVOutputFormat); cdecl; external av__format; -function guess_stream_format(short_name: pchar; - filename: pchar; - mime_type: pchar): PAVOutputFormat; +function guess_stream_format(short_name: PAnsiChar; + filename: PAnsiChar; + mime_type: PAnsiChar): PAVOutputFormat; cdecl; external av__format; -function guess_format(short_name: pchar; - filename: pchar; - mime_type: pchar): PAVOutputFormat; +function guess_format(short_name: PAnsiChar; + filename: PAnsiChar; + mime_type: PAnsiChar): PAVOutputFormat; cdecl; external av__format; (** * Guesses the codec ID based upon muxer and filename. *) -function av_guess_codec(fmt: PAVOutputFormat; short_name: pchar; - filename: pchar; mime_type: pchar; +function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; + filename: PAnsiChar; mime_type: PAnsiChar; type_: TCodecType): TCodecID; cdecl; external av__format; @@ -868,7 +954,7 @@ function av_guess_codec(fmt: PAVOutputFormat; short_name: pchar; * * @see av_hex_dump_log, av_pkt_dump, av_pkt_dump_log *) -procedure av_hex_dump(f: PAVFile; buf: pchar; size: cint); +procedure av_hex_dump(f: PAVFile; buf: PByteArray; size: cint); cdecl; external av__format; {$IF LIBAVFORMAT_VERSION >= 51011000} // 51.11.0 @@ -884,7 +970,7 @@ procedure av_hex_dump(f: PAVFile; buf: pchar; size: cint); * * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log *) -procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: PChar; size: cint); +procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: PByteArray; size: cint); cdecl; external av__format; {$IFEND} @@ -913,6 +999,15 @@ procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_paylo cdecl; external av__format; {$IFEND} +(** + * Initialize libavformat and register all the muxers, demuxers and + * protocols. If you do not call this function, then you can select + * exactly which formats you want to support. + * + * @see av_register_input_format() + * @see av_register_output_format() + * @see register_protocol() + *) procedure av_register_all(); cdecl; external av__format; @@ -929,7 +1024,7 @@ function av_codec_get_tag(var tags: PAVCodecTag; id: TCodecID): cuint; (** * Finds AVInputFormat based on the short name of the input format. *) -function av_find_input_format(short_name: pchar): PAVInputFormat; +function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; cdecl; external av__format; (** @@ -946,7 +1041,7 @@ function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputForma * This does not open the needed codecs for decoding the stream[s]. *) function av_open_input_stream(ic_ptr: PAVFormatContext; - pb: PByteIOContext; filename: pchar; + pb: PByteIOContext; filename: PAnsiChar; fmt: PAVInputFormat; ap: PAVFormatParameters): cint; cdecl; external av__format; @@ -962,7 +1057,7 @@ function av_open_input_stream(ic_ptr: PAVFormatContext; * (NULL if default). * @return 0 if OK, AVERROR_xxx otherwise *) -function av_open_input_file(var ic_ptr: PAVFormatContext; filename: pchar; +function av_open_input_file(var ic_ptr: PAVFormatContext; filename: PAnsiChar; fmt: PAVInputFormat; buf_size: cint; ap: PAVFormatParameters): cint; cdecl; external av__format; @@ -1105,7 +1200,7 @@ function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; * @return AVChapter or NULL on error *) function ff_new_chapter(s: PAVFormatContext; id: cint; time_base: TAVRational; - start, end_: cint64; title: {const} Pchar): PAVChapter; + start, end_: cint64; title: {const} PAnsiChar): PAVChapter; cdecl; external av__format; {$IFEND} @@ -1287,7 +1382,7 @@ function av_interleave_packet_per_dts(s: PAVFormatContext; _out: PAVPacket; function av_write_trailer(s: pAVFormatContext): cint; cdecl; external av__format; -procedure dump_format(ic: PAVFormatContext; index: cint; url: pchar; +procedure dump_format(ic: PAVFormatContext; index: cint; url: PAnsiChar; is_output: cint); cdecl; external av__format; @@ -1296,16 +1391,18 @@ procedure dump_format(ic: PAVFormatContext; index: cint; url: pchar; * @deprecated Use av_parse_video_frame_size instead. *) function parse_image_size(width_ptr: PCint; height_ptr: PCint; - str: pchar): cint; + str: PAnsiChar): cint; cdecl; external av__format; deprecated; +{$IF LIBAVFORMAT_VERSION_MAJOR < 53} (** * Converts frame rate from string to a fraction. * @deprecated Use av_parse_video_frame_rate instead. *) function parse_frame_rate(frame_rate: PCint; frame_rate_base: PCint; - arg: pchar): cint; + arg: PByteArray): cint; cdecl; external av__format; deprecated; +{$IFEND} (** * Parses \p datestr and returns a corresponding number of microseconds. @@ -1333,7 +1430,7 @@ function parse_frame_rate(frame_rate: PCint; frame_rate_base: PCint; * not zero \p datestr is interpreted as a duration, otherwise as a * date. *) -function parse_date(datestr: pchar; duration: cint): cint64; +function parse_date(datestr: PAnsiChar; duration: cint): cint64; cdecl; external av__format; (** Gets the current time in microseconds. *) @@ -1359,7 +1456,7 @@ procedure ffm_set_write_index(s: PAVFormatContext; pos: cint64; file_size: cint6 * syntax: '?tag1=val1&tag2=val2...'. Little URL decoding is done. * Return 1 if found. *) -function find_info_tag(arg: pchar; arg_size: cint; tag1: pchar; info: pchar): cint; +function find_info_tag(arg: PAnsiChar; arg_size: cint; tag1: PAnsiChar; info: PAnsiChar): cint; cdecl; external av__format; (** @@ -1374,8 +1471,8 @@ function find_info_tag(arg: pchar; arg_size: cint; tag1: pchar; info: pchar): ci * @param number frame number * @return 0 if OK, -1 on format error *) -function av_get_frame_filename(buf: pchar; buf_size: cint; - path: pchar; number: cint): cint; +function av_get_frame_filename(buf: PAnsiChar; buf_size: cint; + path: PAnsiChar; number: cint): cint; cdecl; external av__format {$IF LIBAVFORMAT_VERSION <= 50006000} // 50.6.0 name 'get_frame_filename' @@ -1387,7 +1484,7 @@ function av_get_frame_filename(buf: pchar; buf_size: cint; * @param filename possible numbered sequence string * @return 1 if a valid numbered sequence string, 0 otherwise *) -function av_filename_number_test(filename: pchar): cint; +function av_filename_number_test(filename: PAnsiChar): cint; cdecl; external av__format {$IF LIBAVFORMAT_VERSION <= 50006000} // 50.6.0 name 'filename_number_test' @@ -1408,7 +1505,7 @@ function av_filename_number_test(filename: pchar): cint; * @param size the size of the buffer * @return 0 if OK, AVERROR_xxx on error *) -function avf_sdp_create(ac: PPAVFormatContext; n_files: cint; buff: PChar; size: cint): cint; +function avf_sdp_create(ac: PPAVFormatContext; n_files: cint; buff: PByteArray; size: cint): cint; cdecl; external av__format; {$IFEND} -- cgit v1.2.3 From e5f52491b0ed631f09e6bc2033d1495e44cc8d2c Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Fri, 12 Jun 2009 22:38:53 +0000 Subject: finally this updated as well. please test and check. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1815 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 288 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 225 insertions(+), 63 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 62df8a83..0f2eadfa 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -29,6 +29,11 @@ * 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.34.0, Sat Jun 13 00:37:00 2009 UTC + * MiSchi +} unit avformat; @@ -60,7 +65,7 @@ uses const (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 25; + LIBAVFORMAT_MAX_VERSION_MINOR = 34; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -92,13 +97,11 @@ function avformat_version(): cuint; cdecl; external av__format; {$IFEND} - type PAVFile = Pointer; (* * Public Metadata API. - * !!WARNING!! This is a work in progress. Don't use outside FFmpeg for now. * The metadata API allows libavformat to export metadata tags to a client * application using a sequence of key/value pairs. * Important concepts to keep in mind: @@ -111,7 +114,7 @@ type * want to store, e.g., the email address of the child of producer Alice * and actor Bob, that could have key=alice_and_bobs_childs_email_address. * 3. A tag whose value is localized for a particular language is appended - * with a dash character ('-') and the ISO 639 3-letter language code. + * with a dash character ('-') and the ISO 639-2/B 3-letter language code. * For example: Author-ger=Michael, Author-eng=Mike * The original/default language is in the unqualified "Author" tag. * A demuxer should set a default if it sets any translated tag. @@ -129,54 +132,67 @@ type PAVMetadata = Pointer; -{$IF LIBAVFORMAT_VERSION > 52024001} // > 52.24.1 +{$IF LIBAVFORMAT_VERSION >= 52030001} // >= 52.30.1 +(** + * Convert all the metadata sets from ctx according to the source and + * destination conversion tables. + * @param d_conv destination tags format conversion table + * @param s_conv source tags format conversion table + *) + PAVMetadataConv = ^TAVMetadataConv; + TAVMetadataConv = record + ctx: PAVFormatContext; + d_conv: {const} PAVMetadataConv; + s_conv: {const} PAVMetadataConv; + end; +{$IFEND} +{$IF LIBAVFORMAT_VERSION > 52024001} // > 52.24.1 (** - * gets a metadata element with matching key. - * @param prev set to the previous matching element to find the next. - * @param flags allows case as well as suffix insensitive comparisons. - * @return found tag or NULL, changing key or value leads to undefined behavior. + * Gets a metadata element with matching key. + * @param prev Set to the previous matching element to find the next. + * @param flags Allows case as well as suffix-insensitive comparisons. + * @return Found tag or NULL, changing key or value leads to undefined behavior. *) function av_metadata_get(m: PAVMetadata; key: {const} PAnsiChar; prev: {const} PAVMetadataTag ; flags: cint): PAVMetadataTag; cdecl; external av__format; (** - * sets the given tag in m, overwriting an existing tag. - * @param key tag key to add to m (will be av_strduped). - * @param value tag value to add to m (will be av_strduped). - * @return >= 0 if success otherwise error code that is <0. + * Sets the given tag in m, overwriting an existing tag. + * @param key tag key to add to m (will be av_strduped) + * @param value tag value to add to m (will be av_strduped) + * @return >= 0 on success otherwise an error code <0 *) function av_metadata_set(var pm: PAVMetadata; key: {const} PAnsiChar; value: {const} PAnsiChar): cint; cdecl; external av__format; (** - * Free all the memory allocated for an AVMetadata struct. + * Frees all the memory allocated for an AVMetadata struct. *) procedure av_metadata_free(var m: PAVMetadata); cdecl; external av__format; - {$IFEND} (* packet functions *) +{$IF LIBAVCODEC_VERSION < 52032000} // < 52.32.0 type PAVPacket = ^TAVPacket; TAVPacket = record (** - * Presentation time stamp in time_base units. - * This is the time at which the decompressed packet will be presented - * to the user. + * Presentation timestamp in time_base units; the time at which the + * decompressed packet will be presented to the user. * Can be AV_NOPTS_VALUE if it is not stored in the file. * pts MUST be larger or equal to dts as presentation can not happen before * decompression, unless one wants to view hex dumps. Some formats misuse - * the terms dts and pts/cts to mean something different, these timestamps + * the terms dts and pts/cts to mean something different. Such timestamps * must be converted to true pts/dts before they are stored in AVPacket. *) pts: cint64; (** - * Decompression time stamp in time_base units. - * This is the time at which the packet is decompressed. + * Decompression timestamp in time_base units; the time at which the + * packet is decompressed. * Can be AV_NOPTS_VALUE if it is not stored in the file. *) dts: cint64; @@ -245,6 +261,7 @@ procedure av_init_packet(var pkt: TAVPacket); *) function av_new_packet(var pkt: TAVPacket; size: cint): cint; cdecl; external av__format; +{$IFEND} (** * Allocate and read the payload of a packet and initialize its fields with @@ -257,6 +274,7 @@ function av_new_packet(var pkt: TAVPacket; size: cint): cint; function av_get_packet(s: PByteIOContext; var pkt: TAVPacket; size: cint): cint; cdecl; external av__format; +{$IF LIBAVCODEC_VERSION < 52032000} // < 52.32.0 (** * @warning This is a hack - the packet memory allocation stuff is broken. The * packet is allocated if it was not really allocated. @@ -270,6 +288,7 @@ function av_dup_packet(pkt: PAVPacket): cint; * @param pkt packet to free *) procedure av_free_packet(pkt: PAVPacket); {$IFDEF HasInline}inline;{$ENDIF} +{$IFEND} (*************************************************) (* fractional numbers for exact pts handling *) @@ -278,7 +297,6 @@ type (** * The exact value of the fractional number is: 'val + num / den'. * num is assumed to be 0 <= num < den. - * @deprecated Use AVRational instead. *) PAVFrac = ^TAVFrac; TAVFrac = record @@ -297,7 +315,7 @@ type end; const - AVPROBE_SCORE_MAX = 100; ///< Maximum score, half of that is used for file-extension-based detection. + AVPROBE_SCORE_MAX = 100; ///< Maximum score, half of that is used for file-extension-based detection AVPROBE_PADDING_SIZE = 32; ///< extra allocated bytes at the end of the probe buffer //! Demuxer will use url_fopen, no opened file should be provided by the caller. @@ -310,6 +328,9 @@ const AVFMT_NOTIMESTAMPS = $0080; (**< Format does not need / have any timestamps. *) AVFMT_GENERIC_INDEX = $0100; (**< Use generic index building code. *) AVFMT_TS_DISCONT = $0200; (**< Format allows timestamp discontinuities. *) + {$IF LIBAVFORMAT_VERSION >= 52029002} // 52.29.2 + AVFMT_VARIABLE_FPS = $0400; (**< Format allows variable fps. *) + {$IFEND} // used by AVIndexEntry AVINDEX_KEYFRAME = $0001; @@ -320,7 +341,7 @@ const AVFMT_NOOUTPUTLOOP = -1; AVFMT_INFINITEOUTPUTLOOP = 0; - AVFMT_FLAG_GENPTS = $0001; ///< Generate pts if missing even if it requires parsing future frames. + AVFMT_FLAG_GENPTS = $0001; ///< Generate missing pts even if it requires parsing future frames. AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. AVFMT_FLAG_NONBLOCK = $0004; ///< Do not block when reading packets from input. @@ -339,7 +360,11 @@ const AV_DISPOSITION_KARAOKE = $0020; // used by TAVFormatContext.debug - FF_FDEBUG_TS = 0001; + FF_FDEBUG_TS = 0001; + + {$IF LIBAVFORMAT_VERSION >= 52034000} // > 52.34.0 + MAX_PROBE_PACKETS = 100; + {$IFEND} type PPAVCodecTag = ^PAVCodecTag; @@ -372,7 +397,9 @@ 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 LIBAVFORMAT_VERSION < 53000000} // 53.00.0 title: PAnsiChar; ///< chapter title + {$IFEND} {$IF LIBAVFORMAT_VERSION >= 52024001} // 52.24.1 metadata: PAVMetadata; {$IFEND} @@ -415,13 +442,13 @@ type name: PAnsiChar; (** * Descriptive name for the format, meant to be more human-readable - * than \p name. You \e should use the NULL_IF_CONFIG_SMALL() macro + * than name. You should use the NULL_IF_CONFIG_SMALL() macro * to define it. *) long_name: PAnsiChar; mime_type: PAnsiChar; extensions: PAnsiChar; (**< comma-separated filename extensions *) - (** Size of private data so that it can be allocated in the wrapper. *) + (** size of private data so that it can be allocated in the wrapper *) priv_data_size: cint; (* output support *) audio_codec: TCodecID; (**< default audio codec *) @@ -439,7 +466,7 @@ type {$IF LIBAVFORMAT_VERSION >= 51008000} // 51.8.0 (** * List of supported codec_id-codec_tag pairs, ordered by "better - * choice first". The arrays are all CODEC_ID_NONE terminated. + * choice first". The arrays are all terminated by CODEC_ID_NONE. *) codec_tag: {const} PPAVCodecTag; {$IFEND} @@ -448,6 +475,10 @@ type subtitle_codec: TCodecID; (**< default subtitle codec *) {$IFEND} + {$IF LIBAVFORMAT_VERSION >= 52030001} // 52.30.1 + {const} metadata_conv: PAVMetadataConv; + {$IFEND} + (* private fields *) next: PAVOutputFormat; end; @@ -456,14 +487,14 @@ type name: PAnsiChar; (** * Descriptive name for the format, meant to be more human-readable - * than \p name. You \e should use the NULL_IF_CONFIG_SMALL() macro + * than name. You should use the NULL_IF_CONFIG_SMALL() macro * to define it. *) long_name: PAnsiChar; (** Size of private data so that it can be allocated in the wrapper. *) priv_data_size: cint; (** - * Tell if a given file has a chance of being parsed by this format. + * Tell if a given file has a chance of being parsed as this format. * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes * big so you do not have to check for that unless you need more. *) @@ -475,21 +506,28 @@ type read_header: function (c: PAVFormatContext; ap: PAVFormatParameters): cint; cdecl; (** Read one packet and put it in 'pkt'. pts and flags are also set. 'av_new_stream' can be called only if the flag - AVFMTCTX_NOHEADER is used. *) + AVFMTCTX_NOHEADER is used. + @return 0 on success, < 0 on error. + When returning an error, pkt must not have been allocated + or must be freed before returning *) read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; (** Close the stream. The AVFormatContext and AVStreams are not freed by this function *) read_close: function (c: PAVFormatContext): cint; cdecl; + +{$IF LIBAVFORMAT_VERSION_MAJOR < 53} (** * Seek to a given timestamp relative to the frames in * stream component stream_index. - * @param stream_index must not be -1 - * @param flags selects which direction should be preferred if no exact - * match is available + * @param stream_index Must not be -1. + * @param flags Selects which direction should be preferred if no exact + * match is available. * @return >= 0 on success (but not necessarily the new offset) *) read_seek: function (c: PAVFormatContext; stream_index: cint; timestamp: cint64; flags: cint): cint; cdecl; +{$IFEND} + (** * Gets the next timestamp in stream[stream_index].time_base units. * @return the timestamp or AV_NOPTS_VALUE if an error occurred @@ -517,6 +555,25 @@ type codec_tag: {const} PPAVCodecTag; {$IFEND} + {$IF LIBAVFORMAT_VERSION >= 52030000} // 52.30.0 + (** + * Seek to timestamp ts. + * Seeking will be done so that the point from which all active streams + * can be presented successfully will be closest to ts and within min/max_ts. + * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. + *) + read_seek2: function (s: PAVFormatContext; + stream_index: cint; + min_ts: cint64; + ts: cint64; + max_ts: cint64; + flags: cint): cint; cdecl; + {$IFEND} + + {$IF LIBAVFORMAT_VERSION >= 52030001} // 52.30.1 + {const} metadata_conv: PAVMetadataConv; + {$IFEND} + (* private fields *) next: PAVInputFormat; end; @@ -551,11 +608,11 @@ type id: cint; (**< format-specific stream ID *) codec: PAVCodecContext; (**< codec context *) (** - * Real base frame rate of the stream. - * This is the lowest frame rate with which all timestamps can be + * Real base framerate of the stream. + * This is the lowest framerate with which all timestamps can be * represented accurately (it is the least common multiple of all - * frame rates in the stream). Note, this value is just a guess! - * For example if the timebase is 1/90000 and all frames have either + * framerates in the stream). Note, this value is just a guess! + * For example, if the time base is 1/90000 and all frames have either * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. *) r_frame_rate: TAVRational; @@ -572,7 +629,7 @@ type (** * This is the fundamental unit of time (in seconds) in terms * of which frame timestamps are represented. For fixed-fps content, - * time base should be 1/frame rate and timestamp increments should be 1. + * time base should be 1/framerate and timestamp increments should be 1. *) time_base: TAVRational; pts_wrap_bits: cint; (* number of bits in pts (used for wrapping control) *) @@ -599,7 +656,9 @@ type *) duration: cint64; - language: array [0..3] of PAnsiChar; (* ISO 639 3-letter language code (empty string if undefined) *) + {$IF LIBAVFORMAT_VERSION_MAJOR < 53} + language: array [0..3] of PAnsiChar; (* ISO 639-2/B 3-letter language code (empty string if undefined) *) + {$IFEND} (* av_read_frame() support *) need_parsing: TAVStreamParseType; @@ -620,7 +679,7 @@ type unused: array [0..4] of cint64; {$IFEND} - {$IF LIBAVFORMAT_VERSION >= 52006000} // 52.6.0 + {$IF (LIBAVFORMAT_VERSION >= 52006000) and (LIBAVFORMAT_VERSION_MAJOR < 53)} // 52.6.0 - 53.0.0 filename: PAnsiChar; (**< source filename of the stream *) {$IFEND} @@ -653,6 +712,25 @@ type cur_len: cint; cur_pkt: TAVPacket; {$IFEND} + + {$IF LIBAVFORMAT_VERSION >= 52030000} // > 52.30.0 + // Timestamp generation support: + (** + * Timestamp corresponding to the last dts sync point. + * + * Initialized when AVCodecParserContext.dts_sync_point >= 0 and + * a DTS is received from the underlying container. Otherwise set to + * AV_NOPTS_VALUE by default. + *) + reference_dts: cint64; + {$IFEND} + {$IF LIBAVFORMAT_VERSION >= 52034000} // > 52.34.0 + (** + * Number of packets to buffer for codec probing + * NOT PART OF PUBLIC API + *) + probe_packets: cint; + {$IFEND} end; (** @@ -663,7 +741,7 @@ type * sizeof(AVFormatContext) must not be used outside libav*. *) TAVFormatContext = record - av_class: PAVClass; (**< Set by av_alloc_format_context. *) + av_class: PAVClass; (**< Set by avformat_alloc_context. *) (* Can only be iformat or oformat, not both at the same time. *) iformat: PAVInputFormat; oformat: PAVOutputFormat; @@ -680,6 +758,7 @@ type filename: array [0..1023] of AnsiChar; (* input or output filename *) (* stream info *) timestamp: cint64; + {$IF LIBAVFORMAT_VERSION < 53000000} // 53.00.0 title: array [0..511] of AnsiChar; author: array [0..511] of AnsiChar; copyright: array [0..511] of AnsiChar; @@ -688,6 +767,7 @@ type year: cint; (**< ID3 year, 0 if none *) track: cint; (**< track number, 0 if none *) genre: array [0..31] of AnsiChar; (**< ID3 genre *) + {$IFEND} ctx_flags: cint; (**< Format-specific flags, see AVFMTCTX_xx *) (* private data for pts handling (do not modify directly). *) @@ -735,7 +815,7 @@ type loop_input: cint; {$IF LIBAVFORMAT_VERSION >= 50006000} // 50.6.0 - (** Decoding: size of data to probe; encoding: unused. *) + (** decoding: size of data to probe; encoding: unused. *) probesize: cuint; {$IFEND} @@ -775,8 +855,8 @@ type {$IF LIBAVFORMAT_VERSION >= 52004000} // 52.4.0 (** - * Maximum amount of memory in bytes to use per stream for the index. - * If the needed index exceeds this size, entries will be discarded as + * Maximum amount of memory in bytes to use for the index of each stream. + * If the index exceeds this size, entries will be discarded as * needed to maintain a smaller size. This can lead to slower or less * accurate seeking (depends on demuxer). * Demuxers for which a full in-memory index is mandatory will ignore @@ -833,8 +913,10 @@ type *) TAVProgram = record id : cint; + {$IF LIBAVFORMAT_VERSION < 53000000} // 53.00.0 provider_name : PAnsiChar; ///< network name for DVB streams name : PAnsiChar; ///< service name for DVB streams + {$IFEND} flags : cint; discard : TAVDiscard; ///< selects which program to discard and which to feed to the caller {$IF LIBAVFORMAT_VERSION >= 51016000} // 51.16.0 @@ -908,8 +990,18 @@ var {$IFEND} {$IF LIBAVFORMAT_VERSION >= 52003000} // 52.3.0 +(** + * If f is NULL, returns the first registered input format, + * if f is non-NULL, returns the next registered input format after f + * or NULL if f is the last one. + *) function av_iformat_next(f: PAVInputFormat): PAVInputFormat; cdecl; external av__format; +(** + * If f is NULL, returns the first registered output format, + * if f is non-NULL, returns the next registered input format after f + * or NULL if f is the last one. + *) function av_oformat_next(f: PAVOutputFormat): PAVOutputFormat; cdecl; external av__format; {$IFEND} @@ -917,8 +1009,8 @@ function av_oformat_next(f: PAVOutputFormat): PAVOutputFormat; function av_guess_image2_codec(filename: {const} PAnsiChar): TCodecID; cdecl; external av__format; -(* XXX: use automatic init with either ELF sections or C file parser *) -(* modules *) +(* XXX: Use automatic init with either ELF sections or C file parser *) +(* modules. *) (* utils.c *) procedure av_register_input_format(format: PAVInputFormat); @@ -1006,7 +1098,7 @@ procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_paylo * * @see av_register_input_format() * @see av_register_output_format() - * @see register_protocol() + * @see av_register_protocol() *) procedure av_register_all(); cdecl; external av__format; @@ -1062,18 +1154,28 @@ function av_open_input_file(var ic_ptr: PAVFormatContext; filename: PAnsiChar; ap: PAVFormatParameters): cint; cdecl; external av__format; +{$IF LIBAVFORMAT_VERSION >= 52026000} // 52.26.0 (** * Allocate an AVFormatContext. * Can be freed with av_free() but do not forget to free everything you * explicitly allocated as well! *) +function avformat_alloc_context(): PAVFormatContext; + cdecl; external av__format; +{$ELSE} + {$IF LIBAVFORMAT_VERSION_MAJOR < 53} +(** + * @deprecated Use avformat_alloc_context() instead. + *) function av_alloc_format_context(): PAVFormatContext; cdecl; external av__format; + {$IFEND} +{$IFEND} (** * 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 frame rate in case of MPEG-2 repeat + * function also computes the real framerate in case of MPEG-2 repeat * frame mode. * The logical file position is not changed by this function; * examined packets may be buffered for later processing. @@ -1111,7 +1213,7 @@ function av_read_packet(s: PAVFormatContext; var pkt: TAVPacket): cint; * then it contains one frame. * * pkt->pts, pkt->dts and pkt->duration are always set to correct - * values in AVStream.timebase units (and guessed if the format cannot + * values in AVStream.time_base units (and guessed if the format cannot * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format * has B-frames, so it is better to rely on pkt->dts if you do not * decompress the payload. @@ -1122,7 +1224,7 @@ function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; external av__format; (** - * Seek to the key frame at timestamp. + * Seek to the keyframe at timestamp. * 'timestamp' in 'stream_index'. * @param stream_index If stream_index is (-1), a default * stream is selected, and timestamp is automatically converted @@ -1136,15 +1238,51 @@ function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint6 flags: cint): cint; cdecl; external av__format; +{$IF LIBAVFORMAT_VERSION >= 52026000} // 52.26.0 (** - * Start playing a network based stream (e.g. RTSP stream) at the + * Seek to timestamp ts. + * Seeking will be done so that the point from which all active streams + * can be presented successfully will be closest to ts and within min/max_ts. + * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. + * + * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in byte and + * are the file position (this may not be supported by all demuxers). + * If flags contain AVSEEK_FLAG_FRAME then all timestamps are in frames + * in the stream with stream_index (this may not be supported by all demuxers). + * Otherwise all timestamps are in units of the stream selected by stream_index + * or if stream_index is -1, in AV_TIME_BASE units. + * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as + * keyframes (this may not be supported by all demuxers). + * + * @param stream_index index of the stream which is used as time base reference. + * @param min_ts smallest acceptable timestamp + * @param ts target timestamp + * @param max_ts largest acceptable timestamp + * @param flags flags + * @returns >=0 on success, error code otherwise + * + * @NOTE This is part of the new seek API which is still under construction. + * Thus do not use this yet. It may change at any time, do not expect + * ABI compatibility yet! + *) +function avformat_seek_file(s: PAVFormatContext; + stream_index: cint; + min_ts: cint64; + ts: cint64; + max_ts: cint64; + flags: cint): cint; + cdecl; external av__format; +{$IFEND} + +(** + * Start playing a network-based stream (e.g. RTSP stream) at the * current position. *) function av_read_play(s: PAVFormatContext): cint; cdecl; external av__format; (** - * Pause a network based stream (e.g. RTSP stream). + * Pause a network-based stream (e.g. RTSP stream). * * Use av_read_play() to resume it. *) @@ -1239,7 +1377,7 @@ function av_index_search_timestamp(st: PAVStream; timestamp: cint64; flags: cint {$IF LIBAVFORMAT_VERSION >= 52004000} // 52.4.0 (** * Ensures the index uses less memory than the maximum specified in - * AVFormatContext.max_index_size, by discarding entries if it grows + * AVFormatContext.max_index_size by discarding entries if it grows * too large. * This function is not part of the public API and should only be called * by demuxers. @@ -1337,7 +1475,7 @@ function av_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; * Writes a packet to an output media file ensuring correct interleaving. * * The packet must contain one audio or video frame. - * If the packets are already correctly interleaved the application should + * If the packets are already correctly interleaved, the application should * call av_write_frame() instead as it is slightly faster. It is also important * to keep in mind that completely non-interleaved input will need huge amounts * of memory to interleave with this, so it is preferable to interleave at the @@ -1355,7 +1493,7 @@ function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): ci * Interleave a packet per dts in an output media file. * * Packets with pkt->destruct == av_destruct_packet will be freed inside this - * function, so they cannot be used after it, note calling av_free_packet() + * function, so they cannot be used after it. Note that calling av_free_packet() * on them is still safe. * * @param s media file handle @@ -1370,6 +1508,24 @@ function av_interleave_packet_per_dts(s: PAVFormatContext; _out: PAVPacket; pkt: PAVPacket; flush: cint): cint; cdecl; external av__format; +{$IF LIBAVFORMAT_VERSION >= 52025000} // 52.25.0 +(** + * Add packet to AVFormatContext->packet_buffer list, determining its + * interleaved position using compare() function argument. + * + * This function is not part of the public API and should only be called + * by muxers using their own interleave function. + *) +{ +procedure ff_interleave_add_packet(s: PAVFormatContext; + pkt: PAVPacket; + compare: function(para1: PAVFormatContext; + para2: PAVPacket; + para3: PAVPacket): cint); + cdecl; external av__format; +} +{$IFEND} + (** * @brief Write the stream trailer to an output media file and * free the file private data. @@ -1396,7 +1552,7 @@ function parse_image_size(width_ptr: PCint; height_ptr: PCint; {$IF LIBAVFORMAT_VERSION_MAJOR < 53} (** - * Converts frame rate from string to a fraction. + * Converts 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; @@ -1405,7 +1561,7 @@ function parse_frame_rate(frame_rate: PCint; frame_rate_base: PCint; {$IFEND} (** - * Parses \p datestr and returns a corresponding number of microseconds. + * Parses datestr and returns a corresponding number of microseconds. * @param datestr String representing a date or a duration. * - If a date the syntax is: * @code @@ -1416,7 +1572,7 @@ function parse_frame_rate(frame_rate: PCint; frame_rate_base: PCint; * If the year-month-day part is not specified it takes the current * year-month-day. * Returns the number of microseconds since 1st of January, 1970 up to - * the time of the parsed date or INT64_MIN if \p datestr cannot be + * the time of the parsed date or INT64_MIN if datestr cannot be * successfully parsed. * - If a duration the syntax is: * @code @@ -1424,10 +1580,10 @@ function parse_frame_rate(frame_rate: PCint; frame_rate_base: PCint; * [-]S+[.m...] * @endcode * Returns the number of microseconds contained in a time interval - * with the specified duration or INT64_MIN if \p datestr cannot be + * with the specified duration or INT64_MIN if datestr cannot be * successfully parsed. - * @param duration Flag which tells how to interpret \p datestr, if - * not zero \p datestr is interpreted as a duration, otherwise as a + * @param duration Flag which tells how to interpret datestr, if + * not zero datestr is interpreted as a duration, otherwise as a * date. *) function parse_date(datestr: PAnsiChar; duration: cint): cint64; @@ -1444,7 +1600,11 @@ const function ffm_read_write_index(fd: cint): cint64; cdecl; external av__format; +{$IF LIBAVFORMAT_VERSION < 52027000} // 52.27.0 procedure ffm_write_write_index(fd: cint; pos: cint64); +{$ELSE} +function ffm_write_write_index(fd: cint; pos: cint64): cint; +{$IFEND} cdecl; external av__format; procedure ffm_set_write_index(s: PAVFormatContext; pos: cint64; file_size: cint64); @@ -1460,7 +1620,7 @@ function find_info_tag(arg: PAnsiChar; arg_size: cint; tag1: PAnsiChar; info: PA cdecl; external av__format; (** - * Returns in 'buf' the path with '%d' replaced by number. + * Returns in 'buf' the path with '%d' replaced by a number. * * Also handles the '%0nd' format where 'n' is the total number * of digits and '%%'. @@ -1526,10 +1686,12 @@ begin end; {$IFEND} +{$IF LIBAVCODEC_VERSION < 52032000} // < 52.32.0 procedure av_free_packet(pkt: PAVPacket); begin if ((pkt <> nil) and (@pkt^.destruct <> nil)) then pkt^.destruct(pkt); end; +{$IFEND} end. -- cgit v1.2.3 From 19e9af5d971b48c18342b9e5122d278d9966290a Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sat, 13 Jun 2009 11:14:47 +0000 Subject: 1st try to fix linux compilation error: reordering of type declarations. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1819 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 0f2eadfa..0ec2c118 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -132,21 +132,6 @@ type PAVMetadata = Pointer; -{$IF LIBAVFORMAT_VERSION >= 52030001} // >= 52.30.1 -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) - PAVMetadataConv = ^TAVMetadataConv; - TAVMetadataConv = record - ctx: PAVFormatContext; - d_conv: {const} PAVMetadataConv; - s_conv: {const} PAVMetadataConv; - end; -{$IFEND} - {$IF LIBAVFORMAT_VERSION > 52024001} // > 52.24.1 (** * Gets a metadata element with matching key. @@ -392,6 +377,21 @@ type PAVImageInfo = ^TAVImageInfo; {$IFEND} +{$IF LIBAVFORMAT_VERSION >= 52030001} // >= 52.30.1 +(** + * Convert all the metadata sets from ctx according to the source and + * destination conversion tables. + * @param d_conv destination tags format conversion table + * @param s_conv source tags format conversion table + *) + PAVMetadataConv = ^TAVMetadataConv; + TAVMetadataConv = record + ctx: PAVFormatContext; + d_conv: {const} PAVMetadataConv; + s_conv: {const} PAVMetadataConv; + end; +{$IFEND} + PAVChapter = ^TAVChapter; TAVChapter = record id: cint; ///< unique ID to identify the chapter -- cgit v1.2.3 From 917901e8e33438c425aef50a0a7417f32d77b760 Mon Sep 17 00:00:00 2001 From: s_alexander Date: Mon, 9 Nov 2009 00:27:55 +0000 Subject: merged unicode branch (r1931) into trunk git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1939 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 0ec2c118..e39416a1 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -1132,7 +1132,7 @@ function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputForma * Allocates all the structures needed to read an input stream. * This does not open the needed codecs for decoding the stream[s]. *) -function av_open_input_stream(ic_ptr: PAVFormatContext; +function av_open_input_stream(var ic_ptr: PAVFormatContext; pb: PByteIOContext; filename: PAnsiChar; fmt: PAVInputFormat; ap: PAVFormatParameters): cint; cdecl; external av__format; -- cgit v1.2.3 From a548f53eda3c55786bfd76abd6c9613608de151f Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sun, 6 Dec 2009 18:28:26 +0000 Subject: update to version 52.34.1 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1986 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index e39416a1..4d883820 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -31,7 +31,7 @@ *) { * update to - * Max. version: 52.34.0, Sat Jun 13 00:37:00 2009 UTC + * Max. version: 52.34.1, Sun Dec 6 19:27:00 2009 CET * MiSchi } @@ -66,7 +66,7 @@ const (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; LIBAVFORMAT_MAX_VERSION_MINOR = 34; - LIBAVFORMAT_MAX_VERSION_RELEASE = 0; + LIBAVFORMAT_MAX_VERSION_RELEASE = 1; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); @@ -804,7 +804,11 @@ type index_built: cint; mux_rate: cint; + {$IF LIBAVFORMAT_VERSION < 52034001} // < 52.34.1 packet_size: cint; + {$ELSE} + packet_size: cuint; + {$IFEND} preload: cint; max_delay: cint; -- cgit v1.2.3 From 47c06ba46e42ec31d69e9f6c6876ecec89adf6e8 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sun, 6 Dec 2009 18:33:46 +0000 Subject: update to version 52.35.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1987 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 4d883820..3e8cf59c 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -31,7 +31,7 @@ *) { * update to - * Max. version: 52.34.1, Sun Dec 6 19:27:00 2009 CET + * Max. version: 52.35.0, Sun Dec 6 19:33:00 2009 CET * MiSchi } @@ -65,8 +65,8 @@ uses const (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 34; - LIBAVFORMAT_MAX_VERSION_RELEASE = 1; + LIBAVFORMAT_MAX_VERSION_MINOR = 35; + LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); @@ -351,6 +351,10 @@ const MAX_PROBE_PACKETS = 100; {$IFEND} + {$IF LIBAVFORMAT_VERSION >= 52035000} // > 52.35.0 + RAW_PACKET_BUFFER_SIZE 32000 + {$IFEND} + type PPAVCodecTag = ^PAVCodecTag; PAVCodecTag = Pointer; @@ -907,6 +911,15 @@ type {$IF LIBAVFORMAT_VERSION >= 52024001} // 52.24.1 metadata: PAVMetadata; {$IFEND} + + {$IF LIBAVFORMAT_VERSION >= 52035000} // 52.35.0 + (** + * Remaining size available for raw_packet_buffer, in bytes. + * NOT PART OF PUBLIC API + *) + raw_packet_buffer_remaining_size: cint; + {$IFEND} + end; (** -- cgit v1.2.3 From 96ee94dee4ffb7b233ae0a809d3e548340202218 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sun, 6 Dec 2009 18:54:42 +0000 Subject: update to version 52.36.0. Mainly comment edits, but also one code change! git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1988 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 70 ++++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 33 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 3e8cf59c..44086cdd 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -31,7 +31,7 @@ *) { * update to - * Max. version: 52.35.0, Sun Dec 6 19:33:00 2009 CET + * Max. version: 52.36.0, Sun Dec 6 19:33:00 2009 CET * MiSchi } @@ -65,7 +65,7 @@ uses const (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 35; + LIBAVFORMAT_MAX_VERSION_MINOR = 36; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -547,11 +547,11 @@ type (** General purpose read-only value that the format can use. *) value: cint; - (** Start/resume playing - only meaningful if using a network-based format + (** Starts/resumes playing - only meaningful if using a network-based format (RTSP). *) read_play: function (c: PAVFormatContext): cint; cdecl; - (** Pause playing - only meaningful if using a network-based format + (** Pauses playing - only meaningful if using a network-based format (RTSP). *) read_pause: function (c: PAVFormatContext): cint; cdecl; @@ -561,7 +561,7 @@ type {$IF LIBAVFORMAT_VERSION >= 52030000} // 52.30.0 (** - * Seek to timestamp ts. + * Seeks to timestamp ts. * Seeking will be done so that the point from which all active streams * can be presented successfully will be closest to ts and within min/max_ts. * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. @@ -1055,7 +1055,7 @@ function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; cdecl; external av__format; (** - * Send a nice hexadecimal dump of a buffer to the specified file stream. + * Sends a nice hexadecimal dump of a buffer to the specified file stream. * * @param f The file stream pointer where the dump should be sent to. * @param buf buffer @@ -1068,7 +1068,7 @@ procedure av_hex_dump(f: PAVFile; buf: PByteArray; size: cint); {$IF LIBAVFORMAT_VERSION >= 51011000} // 51.11.0 (** - * Send a nice hexadecimal dump of a buffer to the log. + * Sends a nice hexadecimal dump of a buffer to the log. * * @param avcl A pointer to an arbitrary struct of which the first field is a * pointer to an AVClass struct. @@ -1084,7 +1084,7 @@ procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: PByteArray; size: cin {$IFEND} (** - * Send a nice dump of a packet to the specified file stream. + * Sends a nice dump of a packet to the specified file stream. * * @param f The file stream pointer where the dump should be sent to. * @param pkt packet to dump @@ -1095,7 +1095,7 @@ procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); {$IF LIBAVFORMAT_VERSION >= 51011000} // 51.11.0 (** - * Send a nice dump of a packet to the log. + * Sends a nice dump of a packet to the log. * * @param avcl A pointer to an arbitrary struct of which the first field is a * pointer to an AVClass struct. @@ -1109,7 +1109,7 @@ procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_paylo {$IFEND} (** - * Initialize libavformat and register all the muxers, demuxers and + * Initializes libavformat and registers all the muxers, demuxers and * protocols. If you do not call this function, then you can select * exactly which formats you want to support. * @@ -1137,7 +1137,7 @@ function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; cdecl; external av__format; (** - * Guess file format. + * Guesses file format. * * @param is_opened Whether the file is already opened; determines whether * demuxers with or without AVFMT_NOFILE are probed. @@ -1155,7 +1155,7 @@ function av_open_input_stream(var ic_ptr: PAVFormatContext; cdecl; external av__format; (** - * Open a media file as input. The codecs are not opened. Only the file + * Opens a media file as input. The codecs are not opened. Only the file * header (if present) is read. * * @param ic_ptr The opened media file handle is put here. @@ -1173,7 +1173,7 @@ function av_open_input_file(var ic_ptr: PAVFormatContext; filename: PAnsiChar; {$IF LIBAVFORMAT_VERSION >= 52026000} // 52.26.0 (** - * Allocate an AVFormatContext. + * Allocates an AVFormatContext. * Can be freed with av_free() but do not forget to free everything you * explicitly allocated as well! *) @@ -1190,7 +1190,7 @@ function av_alloc_format_context(): PAVFormatContext; {$IFEND} (** - * Read packets of a media file to get stream information. This + * Reads 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 * frame mode. @@ -1206,7 +1206,7 @@ function av_find_stream_info(ic: PAVFormatContext): cint; cdecl; external av__format; (** - * Read a transport packet from a media file. + * Reads a transport packet from a media file. * * This function is obsolete and should never be used. * Use av_read_frame() instead. @@ -1219,7 +1219,7 @@ function av_read_packet(s: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; external av__format; (** - * Return the next frame of a stream. + * Returns the next frame of a stream. * * The returned packet is valid * until the next av_read_frame() or until av_close_input_file() and @@ -1241,7 +1241,7 @@ function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; external av__format; (** - * Seek to the keyframe at timestamp. + * Seeks to the keyframe at timestamp. * 'timestamp' in 'stream_index'. * @param stream_index If stream_index is (-1), a default * stream is selected, and timestamp is automatically converted @@ -1257,7 +1257,7 @@ function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint6 {$IF LIBAVFORMAT_VERSION >= 52026000} // 52.26.0 (** - * Seek to timestamp ts. + * Seeks to timestamp ts. * Seeking will be done so that the point from which all active streams * can be presented successfully will be closest to ts and within min/max_ts. * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. @@ -1292,14 +1292,14 @@ function avformat_seek_file(s: PAVFormatContext; {$IFEND} (** - * Start playing a network-based stream (e.g. RTSP stream) at the + * Starts playing a network-based stream (e.g. RTSP stream) at the * current position. *) function av_read_play(s: PAVFormatContext): cint; cdecl; external av__format; (** - * Pause a network-based stream (e.g. RTSP stream). + * Pauses a network-based stream (e.g. RTSP stream). * * Use av_read_play() to resume it. *) @@ -1308,7 +1308,7 @@ function av_read_pause(s: PAVFormatContext): cint; {$IF LIBAVFORMAT_VERSION >= 52003000} // 52.3.0 (** - * Free a AVFormatContext allocated by av_open_input_stream. + * Frees a AVFormatContext allocated by av_open_input_stream. * @param s context to free *) procedure av_close_input_stream(s: PAVFormatContext); @@ -1316,7 +1316,7 @@ procedure av_close_input_stream(s: PAVFormatContext); {$IFEND} (** - * Close a media file (but not its codecs). + * Closes a media file (but not its codecs). * * @param s media file handle *) @@ -1324,7 +1324,7 @@ procedure av_close_input_file(s: PAVFormatContext); cdecl; external av__format; (** - * Add a new stream to a media file. + * Adds a new stream to a media file. * * Can only be called in the read_header() function. If the flag * AVFMTCTX_NOHEADER is in the format context, then new streams @@ -1342,7 +1342,7 @@ function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; {$IF LIBAVFORMAT_VERSION >= 52014000} // 52.14.0 (** - * Add a new chapter. + * Adds a new chapter. * This function is NOT part of the public API * and should ONLY be used by demuxers. * @@ -1360,7 +1360,7 @@ function ff_new_chapter(s: PAVFormatContext; id: cint; time_base: TAVRational; {$IFEND} (** - * Set the pts for a given stream. + * Sets the pts for a given stream. * * @param s stream * @param pts_wrap_bits number of bits effectively used by the pts @@ -1369,7 +1369,11 @@ function ff_new_chapter(s: PAVFormatContext; id: cint; time_base: TAVRational; * @param pts_den denominator to convert to seconds (MPEG: 90000) *) procedure av_set_pts_info(s: PAVStream; pts_wrap_bits: cint; +{$IF LIBAVFORMAT_VERSION < 52036000} // < 52.36.0 pts_num: cint; pts_den: cint); +{$IFEND} + pts_num: cuint; pts_den: cuint); +{$IFEND} cdecl; external av__format; const @@ -1404,7 +1408,7 @@ procedure ff_reduce_index(s: PAVFormatContext; stream_index: cint); {$IFEND} (** - * Add an index entry into a sorted list. Update the entry if the list + * Adds an index entry into a sorted list. Updates the entry if the list * already contains it. * * @param timestamp timestamp in the timebase of the given stream @@ -1464,7 +1468,7 @@ function av_set_parameters(s: PAVFormatContext; ap: PAVFormatParameters): cint; cdecl; external av__format; (** - * Allocate the stream private data and write the stream header to an + * Allocates the stream private data and writes the stream header to an * output media file. * * @param s media file handle @@ -1474,7 +1478,7 @@ function av_write_header(s: PAVFormatContext): cint; cdecl; external av__format; (** - * Write a packet to an output media file. + * Writes a packet to an output media file. * * The packet shall contain one audio or video frame. * The packet must be correctly interleaved according to the container @@ -1507,7 +1511,7 @@ function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): ci cdecl; external av__format; (** - * Interleave a packet per dts in an output media file. + * Interleaves a packet per dts in an output media file. * * Packets with pkt->destruct == av_destruct_packet will be freed inside this * function, so they cannot be used after it. Note that calling av_free_packet() @@ -1544,8 +1548,8 @@ procedure ff_interleave_add_packet(s: PAVFormatContext; {$IFEND} (** - * @brief Write the stream trailer to an output media file and - * free the file private data. + * Writes the stream trailer to an output media file and frees the + * file private data. * * May only be called after a successful call to av_write_header. * @@ -1656,7 +1660,7 @@ function av_get_frame_filename(buf: PAnsiChar; buf_size: cint; {$IFEND}; (** - * Check whether filename actually is a numbered sequence generator. + * Checks whether filename actually is a numbered sequence generator. * * @param filename possible numbered sequence string * @return 1 if a valid numbered sequence string, 0 otherwise @@ -1669,7 +1673,7 @@ function av_filename_number_test(filename: PAnsiChar): cint; {$IF LIBAVFORMAT_VERSION >= 51012002} // 51.12.2 (** - * Generate an SDP for an RTP session. + * Generates an SDP for an RTP session. * * @param ac array of AVFormatContexts describing the RTP streams. If the * array is composed by only one context, such context can contain -- cgit v1.2.3 From 9a17649166a5a6c2e1f3820675d8e4c5e83cef18 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sun, 6 Dec 2009 18:58:19 +0000 Subject: update to version 52.37.0. Includes fix of previous commit of 52.36.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1989 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 44086cdd..008afd0e 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -31,7 +31,7 @@ *) { * update to - * Max. version: 52.36.0, Sun Dec 6 19:33:00 2009 CET + * Max. version: 52.37.0, Sun Dec 6 19:57:00 2009 CET * MiSchi } @@ -65,7 +65,7 @@ uses const (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 36; + LIBAVFORMAT_MAX_VERSION_MINOR = 37; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -1371,7 +1371,7 @@ function ff_new_chapter(s: PAVFormatContext; id: cint; time_base: TAVRational; procedure av_set_pts_info(s: PAVStream; pts_wrap_bits: cint; {$IF LIBAVFORMAT_VERSION < 52036000} // < 52.36.0 pts_num: cint; pts_den: cint); -{$IFEND} +{$ELSE} pts_num: cuint; pts_den: cuint); {$IFEND} cdecl; external av__format; @@ -1380,6 +1380,9 @@ const AVSEEK_FLAG_BACKWARD = 1; ///< seek backward AVSEEK_FLAG_BYTE = 2; ///< seeking based on position in bytes AVSEEK_FLAG_ANY = 4; ///< seek to any frame, even non-keyframes +{$IF LIBAVFORMAT_VERSION >= 52037000} // >= 52.37.0 + AVSEEK_FLAG_FRAME = 8; +{$IFEND} function av_find_default_stream_index(s: PAVFormatContext): cint; cdecl; external av__format; -- cgit v1.2.3 From cc80f6691d33fe192f1faedd1dcc63e893839a18 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sun, 6 Dec 2009 19:05:16 +0000 Subject: update to version 52.38.0. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1990 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 008afd0e..42ee9d51 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -31,7 +31,7 @@ *) { * update to - * Max. version: 52.37.0, Sun Dec 6 19:57:00 2009 CET + * Max. version: 52.38.0, Sun Dec 6 20:05:00 2009 CET * MiSchi } @@ -65,7 +65,7 @@ uses const (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 37; + LIBAVFORMAT_MAX_VERSION_MINOR = 38; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -295,8 +295,8 @@ type (** This structure contains the data a format has to probe a file. *) TAVProbeData = record filename: PAnsiChar; - buf: PByteArray; - buf_size: cint; + buf: PByteArray; (**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. *) + buf_size: cint; (**< Size of buf except extra allocated bytes *) end; const @@ -728,13 +728,20 @@ type *) reference_dts: cint64; {$IFEND} - {$IF LIBAVFORMAT_VERSION >= 52034000} // > 52.34.0 + {$IF LIBAVFORMAT_VERSION >= 52034000} // >= 52.34.0 (** * Number of packets to buffer for codec probing * NOT PART OF PUBLIC API *) probe_packets: cint; {$IFEND} + {$IF LIBAVFORMAT_VERSION >= 52038000} // >= 52.38.0 + (** + * last packet in packet_buffer for this stream when muxing. + * used internally, NOT PART OF PUBLIC API, dont read or write from outside of libav* + *) + last_in_packet_buffer: PAVPacketList; + {$IFEND} end; (** -- cgit v1.2.3 From a6c2ddd0dd06d80267933a2ef8e89bba2c0a9d52 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sun, 6 Dec 2009 19:13:40 +0000 Subject: update to version 52.39.2 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1991 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 42ee9d51..99c3e97a 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -31,7 +31,7 @@ *) { * update to - * Max. version: 52.38.0, Sun Dec 6 20:05:00 2009 CET + * Max. version: 52.39.2, Sun Dec 6 20:05:00 2009 CET * MiSchi } @@ -65,8 +65,8 @@ uses const (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 38; - LIBAVFORMAT_MAX_VERSION_RELEASE = 0; + LIBAVFORMAT_MAX_VERSION_MINOR = 39; + LIBAVFORMAT_MAX_VERSION_RELEASE = 2; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); @@ -97,6 +97,20 @@ function avformat_version(): cuint; cdecl; external av__format; {$IFEND} +{$IF LIBAVFORMAT_VERSION >= 52039002} // 52.39.2 +(** + * Returns the libavformat build-time configuration. + *) +function avformat_configuration(): {const} PansiChar; + cdecl; external av__format; + +(** + * Returns the libavformat license. + *) +function avformat_license(): {const} PansiChar; + cdecl; external av__format; +{$IFEND} + type PAVFile = Pointer; @@ -347,12 +361,20 @@ const // used by TAVFormatContext.debug FF_FDEBUG_TS = 0001; - {$IF LIBAVFORMAT_VERSION >= 52034000} // > 52.34.0 + {$IF LIBAVFORMAT_VERSION >= 52034000} // >= 52.34.0 + {$IF LIBAVFORMAT_VERSION < 52039000} // < 52.39.0 MAX_PROBE_PACKETS = 100; + {$ELSE} + MAX_PROBE_PACKETS = 2500; + {$IFEND} {$IFEND} - {$IF LIBAVFORMAT_VERSION >= 52035000} // > 52.35.0 + {$IF LIBAVFORMAT_VERSION >= 52035000} // >= 52.35.0 + {$IF LIBAVFORMAT_VERSION < 52039000} // < 52.39.0 RAW_PACKET_BUFFER_SIZE 32000 + {$ELSE} + RAW_PACKET_BUFFER_SIZE 2500000 + {$IFEND} {$IFEND} type -- cgit v1.2.3 From 733bcb70ca27687cbe05d0755eeec27888347be3 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sun, 6 Dec 2009 19:16:27 +0000 Subject: update to version 52.41.0. No code change. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1992 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 99c3e97a..2b8a5e4f 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -31,7 +31,7 @@ *) { * update to - * Max. version: 52.39.2, Sun Dec 6 20:05:00 2009 CET + * Max. version: 52.41.0, Sun Dec 6 20:15:00 2009 CET * MiSchi } @@ -65,8 +65,8 @@ uses const (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 39; - LIBAVFORMAT_MAX_VERSION_RELEASE = 2; + LIBAVFORMAT_MAX_VERSION_MINOR = 41; + LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); -- cgit v1.2.3 From 5762173ae803c171943bc5d6c7c6e732902cd4e8 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Wed, 16 Dec 2009 22:29:25 +0000 Subject: typos corrected git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2041 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 2b8a5e4f..9c5170f5 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -371,9 +371,9 @@ const {$IF LIBAVFORMAT_VERSION >= 52035000} // >= 52.35.0 {$IF LIBAVFORMAT_VERSION < 52039000} // < 52.39.0 - RAW_PACKET_BUFFER_SIZE 32000 + RAW_PACKET_BUFFER_SIZE = 32000; {$ELSE} - RAW_PACKET_BUFFER_SIZE 2500000 + RAW_PACKET_BUFFER_SIZE = 2500000; {$IFEND} {$IFEND} -- cgit v1.2.3 From e22d981dcb8f0014ce28fdc07b59248d87376fad Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Mon, 28 Dec 2009 23:54:22 +0000 Subject: update of the headers. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2054 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 9c5170f5..0c1660f5 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -31,7 +31,7 @@ *) { * update to - * Max. version: 52.41.0, Sun Dec 6 20:15:00 2009 CET + * Max. version: 52.44.0, Tue Dec 29 0:40:00 2009 CET * MiSchi } @@ -65,7 +65,7 @@ uses const (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 41; + LIBAVFORMAT_MAX_VERSION_MINOR = 44; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -136,6 +136,10 @@ type const AV_METADATA_MATCH_CASE = 1; AV_METADATA_IGNORE_SUFFIX = 2; +{$IF LIBAVFORMAT_VERSION >= 52043000} // >= 52.43.0 + AV_METADATA_DONT_STRDUP_KEY = 4; + AV_METADATA_DONT_STRDUP_VAL = 8; +{$IFEND} type PAVMetadataTag = ^TAVMetadataTag; @@ -147,6 +151,7 @@ type PAVMetadata = Pointer; {$IF LIBAVFORMAT_VERSION > 52024001} // > 52.24.1 +{$IF LIBAVFORMAT_VERSION_MAJOR == 52} (** * Gets a metadata element with matching key. * @param prev Set to the previous matching element to find the next. @@ -165,6 +170,18 @@ function av_metadata_get(m: PAVMetadata; key: {const} PAnsiChar; *) function av_metadata_set(var pm: PAVMetadata; key: {const} PAnsiChar; value: {const} PAnsiChar): cint; cdecl; external av__format; +{$IFEND} + +{$IF LIBAVFORMAT_VERSION >= 52043000} // >= 52.43.0 +(** + * Sets the given tag in m, overwriting an existing tag. + * @param key tag key to add to m (will be av_strduped depending on flags) + * @param value tag value to add to m (will be av_strduped depending on flags) + * @return >= 0 on success otherwise an error code <0 + *) +function av_metadata_set2(var pm: PAVMetadata; key: {const} PAnsiChar; value: {const} PAnsiChar; flags: cint): cint; + cdecl; external av__format; +{$IFEND} (** * Frees all the memory allocated for an AVMetadata struct. @@ -764,6 +781,12 @@ type *) last_in_packet_buffer: PAVPacketList; {$IFEND} + {$IF LIBAVFORMAT_VERSION >= 52041000} // >= 52.41.0 + (** + * Average framerate + *) + avg_frame_rate: TAVRational; + {$IFEND} end; (** -- cgit v1.2.3 From b9848dd7f2a9b2de721176a4b777b8d06c53df27 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Tue, 29 Dec 2009 00:25:41 +0000 Subject: typo correction git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2055 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 0c1660f5..81018333 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -151,7 +151,7 @@ type PAVMetadata = Pointer; {$IF LIBAVFORMAT_VERSION > 52024001} // > 52.24.1 -{$IF LIBAVFORMAT_VERSION_MAJOR == 52} +{$IF LIBAVFORMAT_VERSION_MAJOR = 52} (** * Gets a metadata element with matching key. * @param prev Set to the previous matching element to find the next. -- cgit v1.2.3 From f0db3d8fe11723042477cf5eea6e480bfd9aeba6 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Mon, 4 Jan 2010 10:38:32 +0000 Subject: Correct typo. LIBAVCODEC_VERSION was used instead of LIBAVFORMAT_VERSION git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2060 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 81018333..b1a4407d 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -290,7 +290,7 @@ function av_new_packet(var pkt: TAVPacket; size: cint): cint; function av_get_packet(s: PByteIOContext; var pkt: TAVPacket; size: cint): cint; cdecl; external av__format; -{$IF LIBAVCODEC_VERSION < 52032000} // < 52.32.0 +{$IF LIBAVFORMAT_VERSION < 52032000} // < 52.32.0 (** * @warning This is a hack - the packet memory allocation stuff is broken. The * packet is allocated if it was not really allocated. @@ -1762,7 +1762,7 @@ begin end; {$IFEND} -{$IF LIBAVCODEC_VERSION < 52032000} // < 52.32.0 +{$IF LIBAVFORMAT_VERSION < 52032000} // < 52.32.0 procedure av_free_packet(pkt: PAVPacket); begin if ((pkt <> nil) and (@pkt^.destruct <> nil)) then -- cgit v1.2.3 From ad36268f8f5e58da937d4fe44fe9a2819ee59195 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Mon, 4 Jan 2010 11:06:39 +0000 Subject: Update to 52.45.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2061 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index b1a4407d..91fdf9d2 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -31,7 +31,7 @@ *) { * update to - * Max. version: 52.44.0, Tue Dec 29 0:40:00 2009 CET + * Max. version: 52.45.0, Mo Jan 4 0:40:00 2009 CET * MiSchi } @@ -65,7 +65,7 @@ uses const (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 44; + LIBAVFORMAT_MAX_VERSION_MINOR = 45; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -1088,15 +1088,39 @@ procedure av_register_input_format(format: PAVInputFormat); procedure av_register_output_format(format: PAVOutputFormat); cdecl; external av__format; +{$IF LIBAVFORMAT_VERSION_MAJOR < 53} // < 53 function guess_stream_format(short_name: PAnsiChar; filename: PAnsiChar; mime_type: PAnsiChar): PAVOutputFormat; - cdecl; external av__format; + cdecl; external av__format; deprecated; +{$IFEND} +(** + * Returns the output format in the list of registered output formats + * which best matches the provided parameters, or returns NULL if + * there is no match. + * + * @param short_name if non-NULL checks if short_name matches with the + * names of the registered formats + * @param filename if non-NULL checks if filename terminates with the + * extensions of the registered formats + * @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; +{$IF LIBAVFORMAT_VERSION >= 52045000} // >= 52.45.0 + deprecated; +function av_guess_format(short_name: PAnsiChar; + filename: PAnsiChar; + mime_type: PAnsiChar): PAVOutputFormat; + cdecl; external av__format; +{$IFEND} (** * Guesses the codec ID based upon muxer and filename. -- cgit v1.2.3 From b2a59a224fa062cb9b9fb0802d60aef50dfdfb57 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Mon, 4 Jan 2010 11:14:04 +0000 Subject: Update to 52.46.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2062 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 91fdf9d2..a2d48358 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -31,7 +31,7 @@ *) { * update to - * Max. version: 52.45.0, Mo Jan 4 0:40:00 2009 CET + * Max. version: 52.46.0, Mo Jan 4 0:40:00 2009 CET * MiSchi } @@ -65,7 +65,7 @@ uses const (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 45; + LIBAVFORMAT_MAX_VERSION_MINOR = 46; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + -- cgit v1.2.3 From 9e42ef049f989abb651515f96317b07eb1030923 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Mon, 4 Jan 2010 11:22:09 +0000 Subject: Found another typo to correct. Again, LIBAVCODEC_VERSION was used instead of LIBAVFORMAT_VERSION git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2063 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index a2d48358..f9776cb9 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -192,7 +192,7 @@ procedure av_metadata_free(var m: PAVMetadata); (* packet functions *) -{$IF LIBAVCODEC_VERSION < 52032000} // < 52.32.0 +{$IF LIBAVFORMAT_VERSION < 52032000} // < 52.32.0 type PAVPacket = ^TAVPacket; TAVPacket = record -- cgit v1.2.3 From d35aae71ead05b26b5e00b25de4f6ed11f11ad13 Mon Sep 17 00:00:00 2001 From: k-m_schindler 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/avformat.pas | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') 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; -- cgit v1.2.3 From fd66c4eae6749ceb00862043088d657d4145cb38 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sat, 20 Feb 2010 23:52:00 +0000 Subject: update to 52.46.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2123 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 261ce8f6..8efc0894 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -90,7 +90,8 @@ const {$IF LIBAVFORMAT_VERSION >= 52020000} // 52.20.0 (** - * Returns the LIBAVFORMAT_VERSION_INT constant. + * I return the LIBAVFORMAT_VERSION_INT constant. You got + * a fucking problem with that, douchebag? *) function avformat_version(): cuint; cdecl; external av__format; -- cgit v1.2.3 From 9c9f6974f039307bf2165cc8a760421d4dfeeab6 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sat, 20 Feb 2010 23:56:35 +0000 Subject: update to 52.47.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2124 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 8efc0894..8bf218a2 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -30,7 +30,7 @@ * 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 2010 0:40:00 CET + * Max. version: 52.47.0, Sun Feb 21 2010 0:40:00 CET * MiSchi *) @@ -64,7 +64,7 @@ uses const (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 46; + LIBAVFORMAT_MAX_VERSION_MINOR = 47; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -353,7 +353,11 @@ const AVFMTCTX_NOHEADER = $0001; (**< signal that no header is present (streams are added dynamically) *) +{$IF LIBAVFORMAT_VERSION_MAJOR < 53} MAX_STREAMS = 20; +{$ELSE} + MAX_STREAMS = 100; +{$IFEND} AVFMT_NOOUTPUTLOOP = -1; AVFMT_INFINITEOUTPUTLOOP = 0; -- cgit v1.2.3 From 9f09437f455b45079243f3f1bdb7d3865d538521 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sun, 21 Feb 2010 00:00:09 +0000 Subject: update to 52.48.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2125 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 8bf218a2..7db19bf7 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -30,7 +30,7 @@ * Max. version: 52.25.0, revision 16986, Wed Feb 4 05:56:39 2009 UTC * * update to - * Max. version: 52.47.0, Sun Feb 21 2010 0:40:00 CET + * Max. version: 52.48.0, Sun Feb 21 2010 0:40:00 CET * MiSchi *) @@ -64,7 +64,7 @@ uses const (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 47; + LIBAVFORMAT_MAX_VERSION_MINOR = 48; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -364,6 +364,9 @@ const AVFMT_FLAG_GENPTS = $0001; ///< Generate missing pts even if it requires parsing future frames. AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. AVFMT_FLAG_NONBLOCK = $0004; ///< Do not block when reading packets from input. +{$IF LIBAVFORMAT_VERSION >= 52048000} // >= 52.48.0 + AVFMT_FLAG_IGNDTS = $0008; ///< Ignore DTS on frames that contain both DTS & PTS +{$IFEND} // used by AVStream MAX_REORDER_DELAY = 16; -- cgit v1.2.3 From aff0652810f7d337ff68298d7b0c0bbaff13a25c Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sun, 21 Feb 2010 00:03:00 +0000 Subject: update to 52.52.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2126 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 7db19bf7..54e6ca00 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -30,7 +30,7 @@ * Max. version: 52.25.0, revision 16986, Wed Feb 4 05:56:39 2009 UTC * * update to - * Max. version: 52.48.0, Sun Feb 21 2010 0:40:00 CET + * Max. version: 52.52.0, Sun Feb 21 2010 0:40:00 CET * MiSchi *) @@ -64,7 +64,7 @@ uses const (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 48; + LIBAVFORMAT_MAX_VERSION_MINOR = 52; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -347,6 +347,9 @@ const {$IF LIBAVFORMAT_VERSION >= 52029002} // 52.29.2 AVFMT_VARIABLE_FPS = $0400; (**< Format allows variable fps. *) {$IFEND} + {$IF LIBAVFORMAT_VERSION >= 52052000} // 52.52.0 + AVFMT_NODIMENSIONS = $0800; (**< Format does not need width/height *) + {$IFEND} // used by AVIndexEntry AVINDEX_KEYFRAME = $0001; -- cgit v1.2.3 From fb8586505dba52c4cc5d7ca8aeda23015b91318d Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sat, 24 Apr 2010 22:33:18 +0000 Subject: update to 52.54.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2299 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 54e6ca00..5385c3bd 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -30,7 +30,7 @@ * Max. version: 52.25.0, revision 16986, Wed Feb 4 05:56:39 2009 UTC * * update to - * Max. version: 52.52.0, Sun Feb 21 2010 0:40:00 CET + * Max. version: 52.54.0, Sun Apr 25 2010 0:40:00 CET * MiSchi *) @@ -64,7 +64,7 @@ uses const (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 52; + LIBAVFORMAT_MAX_VERSION_MINOR = 54; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -117,7 +117,9 @@ type (* * Public Metadata API. * The metadata API allows libavformat to export metadata tags to a client - * application using a sequence of key/value pairs. + * application using a sequence of key/value pairs. Like all strings in FFmpeg, + * metadata must be stored as UTF-8 encoded Unicode. Note that metadata + * exported by demuxers isn't checked to be valid UTF-8 in most cases. * Important concepts to keep in mind: * 1. Keys are unique; there can never be 2 tags with the same key. This is * also meant semantically, i.e., a demuxer should not knowingly produce @@ -797,6 +799,12 @@ type *) avg_frame_rate: TAVRational; {$IFEND} + {$IF LIBAVFORMAT_VERSION >= 52054000} // >= 52.54.0 + (** + * Number of frames that have been demuxed during av_find_stream_info() + *) + codec_info_nb_frames: cint; + {$IFEND} end; (** -- cgit v1.2.3 From 6583d76a34dd5cf2aa54941156ab3dc4e754fa70 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sat, 24 Apr 2010 22:42:43 +0000 Subject: update to 52.56.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2300 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 5385c3bd..c05cc69e 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -30,7 +30,7 @@ * Max. version: 52.25.0, revision 16986, Wed Feb 4 05:56:39 2009 UTC * * update to - * Max. version: 52.54.0, Sun Apr 25 2010 0:40:00 CET + * Max. version: 52.56.0, Sun Apr 25 2010 0:40:00 CET * MiSchi *) @@ -64,7 +64,7 @@ uses const (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 54; + LIBAVFORMAT_MAX_VERSION_MINOR = 56; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -990,6 +990,17 @@ type raw_packet_buffer_remaining_size: cint; {$IFEND} + {$IF LIBAVFORMAT_VERSION >= 52056000} // 52.56.0 + (** + * Start time of the stream in real world time, in microseconds + * since the unix epoch (00:00 1st January 1970). That is, pts=0 + * in the stream was captured at this real world time. + * - encoding: Set by user. + * - decoding: Unused. + *) + start_time_realtime: cint64; + {$IFEND} + end; (** -- cgit v1.2.3 From b1e0065793003a66c10794ef254a439ac90293a5 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sat, 24 Apr 2010 22:52:07 +0000 Subject: update to 52.59.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2301 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index c05cc69e..cad4ab1b 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -30,7 +30,7 @@ * Max. version: 52.25.0, revision 16986, Wed Feb 4 05:56:39 2009 UTC * * update to - * Max. version: 52.56.0, Sun Apr 25 2010 0:40:00 CET + * Max. version: 52.59.0, Sun Apr 25 2010 0:40:00 CET * MiSchi *) @@ -64,7 +64,7 @@ uses const (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 56; + LIBAVFORMAT_MAX_VERSION_MINOR = 59; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -157,6 +157,7 @@ type (** * Gets a metadata element with matching key. * @param prev Set to the previous matching element to find the next. + * If set to NULL the first matching element is returned. * @param flags Allows case as well as suffix-insensitive comparisons. * @return Found tag or NULL, changing key or value leads to undefined behavior. *) @@ -1381,7 +1382,7 @@ function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint6 * @param ts target timestamp * @param max_ts largest acceptable timestamp * @param flags flags - * @returns >=0 on success, error code otherwise + * @return >=0 on success, error code otherwise * * @NOTE This is part of the new seek API which is still under construction. * Thus do not use this yet. It may change at any time, do not expect -- cgit v1.2.3 From d48ed1b73836f77d6d35da757d73638f655aee00 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sat, 24 Apr 2010 23:04:48 +0000 Subject: update to 52.60.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2302 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index cad4ab1b..7ffee8ab 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -30,7 +30,7 @@ * Max. version: 52.25.0, revision 16986, Wed Feb 4 05:56:39 2009 UTC * * update to - * Max. version: 52.59.0, Sun Apr 25 2010 0:40:00 CET + * Max. version: 52.60.0, Sun Apr 25 2010 0:40:00 CET * MiSchi *) @@ -64,7 +64,7 @@ uses const (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 59; + LIBAVFORMAT_MAX_VERSION_MINOR = 60; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -373,6 +373,10 @@ const {$IF LIBAVFORMAT_VERSION >= 52048000} // >= 52.48.0 AVFMT_FLAG_IGNDTS = $0008; ///< Ignore DTS on frames that contain both DTS & PTS {$IFEND} +{$IF LIBAVFORMAT_VERSION >= 52060000} // >= 52.60.0 + AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container + AVFMT_FLAG_NOPARSE = $0020; ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled +{$IFEND} // used by AVStream MAX_REORDER_DELAY = 16; @@ -1799,6 +1803,17 @@ function avf_sdp_create(ac: PPAVFormatContext; n_files: cint; buff: PByteArray; cdecl; external av__format; {$IFEND} +{$IF LIBAVFORMAT_VERSION >= 52060000} // 52.60.0 +(** + * Returns a positive value if the given filename has one of the given + * extensions, 0 otherwise. + * + * @param extensions a comma-separated list of filename extensions + *) +function av_match_ext(filename: {const} Pchar; extensions: {const} Pchar): cint; + cdecl; external av__format; +{$IFEND} + implementation {$IF LIBAVFORMAT_VERSION < 51012002} // 51.12.2 -- cgit v1.2.3 From ff95f0d464a7259cba44e7d796dfc16a935df55e Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sat, 24 Apr 2010 23:08:58 +0000 Subject: update to 52.61.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2303 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 7ffee8ab..56f1eadc 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -30,7 +30,7 @@ * Max. version: 52.25.0, revision 16986, Wed Feb 4 05:56:39 2009 UTC * * update to - * Max. version: 52.60.0, Sun Apr 25 2010 0:40:00 CET + * Max. version: 52.61.0, Sun Apr 25 2010 0:40:00 CET * MiSchi *) @@ -64,7 +64,7 @@ uses const (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 60; + LIBAVFORMAT_MAX_VERSION_MINOR = 61; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -142,6 +142,9 @@ const AV_METADATA_DONT_STRDUP_KEY = 4; AV_METADATA_DONT_STRDUP_VAL = 8; {$IFEND} +{$IF LIBAVFORMAT_VERSION >= 52061000} // >= 52.61.0 + AV_METADATA_DONT_OVERWRITE = 16; +{$IFEND} type PAVMetadataTag = ^TAVMetadataTag; -- cgit v1.2.3 From 92b5231fdaef94f38b7d8fdd622a5a5cb2e7433c Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sat, 24 Apr 2010 23:10:50 +0000 Subject: final update to 52.61.0 comment forgotten git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2304 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 56f1eadc..7bc22741 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -863,8 +863,9 @@ type It is deduced from the AVStream values. *) start_time: cint64; (** Decoding: duration of the stream, in AV_TIME_BASE fractional - seconds. NEVER set this value directly: it is deduced from the - AVStream values. *) + seconds. Only set this value if you know none of the individual stream + durations and also dont set any of them. This is deduced from the + AVStream values if not set. *) duration: cint64; (** decoding: total file size, 0 if unknown *) file_size: cint64; -- cgit v1.2.3 From a6db8d3dae4c64681031c22d567f6d16322da2a1 Mon Sep 17 00:00:00 2001 From: tobigun Date: Mon, 26 Apr 2010 08:32:45 +0000 Subject: added a warning that adjusting the max supported FFmpeg manually is not a valid fix and as a consequence random crashes or bugs may occur. The USDX team does not give any support for USDX with manually adjusted FFmpeg headers. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2311 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 7bc22741..a378e2e6 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -62,6 +62,31 @@ uses UConfig; const + (* + * IMPORTANT: The official FFmpeg C headers change very quickly. Often some + * of the data structures are changed so that they become incompatible with + * older header files. The Pascal headers have to be adjusted to those changes, + * otherwise the application might crash randomly or strange bugs (not + * necessarily related to video or audio due to buffer overflows etc.) might + * occur. + * + * In the past users reported problems with USDX that took hours to fix and + * the problem was an unsupported version of FFmpeg. So we decided to disable + * support for future versions of FFmpeg until the headers are revised by us + * for that version as they otherwise most probably will break USDX. + * + * If the headers do not yet support your FFmpeg version you may want to + * adjust the max. version numbers manually but please note: it may work but + * in many cases it does not. The USDX team does NOT PROVIDE ANY SUPPORT + * for the game if the MAX. VERSION WAS CHANGED. + * + * The only safe way to support new versions of FFmpeg is to add the changes + * of the FFmpeg git repository C headers to the Pascal headers. + * You can accelerate this process by posting a patch with the git changes + * translated to Pascal to our bug tracker (please join our IRC chat before + * you start working on it). Simply adjusting the max. versions is NOT a valid + * fix. + *) (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; LIBAVFORMAT_MAX_VERSION_MINOR = 61; -- cgit v1.2.3 From d7255c72875a1ccfee5db9debd4fcc5a9f363886 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Tue, 11 May 2010 17:19:27 +0000 Subject: avformat to 52.61.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2351 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index a378e2e6..d5804b31 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -198,9 +198,13 @@ function av_metadata_get(m: PAVMetadata; key: {const} PAnsiChar; * @param key tag key to add to m (will be av_strduped) * @param value tag value to add to m (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; +{$IF LIBAVFORMAT_VERSION >= 52061000} // >= 52.61.0 + deprecated; +{$IFEND} {$IFEND} {$IF LIBAVFORMAT_VERSION >= 52043000} // >= 52.43.0 -- cgit v1.2.3 From cffe33baf336287778e3bbe1585ae087b0b0f6e0 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Tue, 11 May 2010 17:30:21 +0000 Subject: avformat and avio.pas to 52.62.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2352 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index d5804b31..76990479 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -26,12 +26,8 @@ (* * 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.61.0, Sun Apr 25 2010 0:40:00 CET - * MiSchi + * Min. version: 50.5.0 , revision 6577, Sat Oct 7 15:30:46 2006 UTC + * Max. version: 52.62.0, revision 23004, Tue May 11 19:29:00 2010 CET *) unit avformat; @@ -1288,6 +1284,22 @@ function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputFormat; cdecl; external av__format; +{$IF LIBAVFORMAT_VERSION >= 52062000} // 52.62.0 +(** + * Guesses the file format. + * + * @param is_opened Whether the file is already opened; determines whether + * demuxers with or without AVFMT_NOFILE are probed. + * @param score_max A probe score larger that this is required to accept a + * detection, the variable is set to the actual detection + * score afterwards. + * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended + * to retry with a larger probe buffer. + *) +function av_probe_input_format2(pd: PAVProbeData; is_opened: cint; score_max: PCint): PAVInputFormat; + cdecl; external av__format; +{$IFEND} + (** * Allocates all the structures needed to read an input stream. * This does not open the needed codecs for decoding the stream[s]. -- cgit v1.2.3 From 8a53f45fee7894cb05f598edc5564c8428fdae6d Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Tue, 11 May 2010 17:32:07 +0000 Subject: correction of previous commit (avformat and avio.pas to 52.62.0) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2353 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 76990479..fdf90f7b 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -85,7 +85,7 @@ const *) (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 61; + LIBAVFORMAT_MAX_VERSION_MINOR = 62; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + -- cgit v1.2.3 From 9103f21db074ebb7a1e535e6a1e658db14c79110 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Wed, 12 May 2010 23:20:24 +0000 Subject: update of some comments. No code change. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2370 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index fdf90f7b..a217263d 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -27,7 +27,7 @@ (* * Conversion of libavformat/avformat.h * Min. version: 50.5.0 , revision 6577, Sat Oct 7 15:30:46 2006 UTC - * Max. version: 52.62.0, revision 23004, Tue May 11 19:29:00 2010 CET + * Max. version: 52.62.0, revision 23102, Thu May 13 1:15:00 2010 CET *) unit avformat; @@ -1260,9 +1260,23 @@ procedure av_register_all(); cdecl; external av__format; {$IF LIBAVFORMAT_VERSION >= 51008000} // 51.8.0 -(** codec tag <-> codec id *) +(** + * Gets the CodecID for the given codec tag tag. + * If no codec id is found returns CODEC_ID_NONE. + * + * @param tags list of supported codec_id-codec_tag pairs, as stored + * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag + *) function av_codec_get_id(var tags: PAVCodecTag; tag: cuint): TCodecID; cdecl; external av__format; + +(** + * Gets the codec tag for the given codec id id. + * If no codec tag is found returns 0. + * + * @param tags list of supported codec_id-codec_tag pairs, as stored + * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag + *) function av_codec_get_tag(var tags: PAVCodecTag; id: TCodecID): cuint; cdecl; external av__format; {$IFEND} -- cgit v1.2.3 From c7ae63da30275a50c03183a15442c320378cd60c Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Wed, 19 May 2010 17:19:39 +0000 Subject: update avformat to 52.63.0 and correct avutil version to 50.15.2 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2389 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index a217263d..b745f962 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -27,7 +27,7 @@ (* * Conversion of libavformat/avformat.h * Min. version: 50.5.0 , revision 6577, Sat Oct 7 15:30:46 2006 UTC - * Max. version: 52.62.0, revision 23102, Thu May 13 1:15:00 2010 CET + * Max. version: 52.63.0, revision 23179, Wed May 19 19:17:00 2010 CET *) unit avformat; @@ -85,7 +85,7 @@ const *) (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 62; + LIBAVFORMAT_MAX_VERSION_MINOR = 63; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -405,6 +405,9 @@ const AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container AVFMT_FLAG_NOPARSE = $0020; ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled {$IFEND} +{$IF LIBAVFORMAT_VERSION >= 52063000} // >= 52.63.0 + AVFMT_FLAG_RTP_HINT = $0040; ///< Add RTP hinting to the output file +{$IFEND} // used by AVStream MAX_REORDER_DELAY = 16; -- cgit v1.2.3 From 80b73d81dd1ec60bd60b153c0aebf6141aac3a06 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Sun, 30 May 2010 19:33:10 +0000 Subject: Update to 52.67.0 and avio.pas cosmetics git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2431 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index b745f962..34142125 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -14,20 +14,16 @@ * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - *) - -(* + * * This is a part of Pascal porting of ffmpeg. * - Originally by Victor Zinetz for Delphi and Free Pascal on Windows. * - 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 libavformat/avformat.h * Min. version: 50.5.0 , revision 6577, Sat Oct 7 15:30:46 2006 UTC - * Max. version: 52.63.0, revision 23179, Wed May 19 19:17:00 2010 CET + * Max. version: 52.67.0, revision 23357, Sun May 30 21:30:00 2010 CET *) unit avformat; @@ -85,7 +81,7 @@ const *) (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 63; + LIBAVFORMAT_MAX_VERSION_MINOR = 67; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -674,6 +670,9 @@ type AVSTREAM_PARSE_FULL, (**< full parsing and repack *) AVSTREAM_PARSE_HEADERS, (**< Only parse headers, do not repack. *) AVSTREAM_PARSE_TIMESTAMPS (**< full parsing and interpolation of timestamps for frames not starting on a packet boundary *) + {$IF LIBAVFORMAT_VERSION >= 52066000} // 52.66.0 + , AVSTREAM_PARSE_FULL_ONCE (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) + {$IFEND} ); TAVIndexEntry = record -- cgit v1.2.3 From 8ba7eab8d58733b17e41d03ac237e7ff813ff4b0 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Tue, 20 Jul 2010 18:53:45 +0000 Subject: update avformat to 52.68.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2584 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 34142125..436ccf9b 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -23,7 +23,7 @@ * * Conversion of libavformat/avformat.h * Min. version: 50.5.0 , revision 6577, Sat Oct 7 15:30:46 2006 UTC - * Max. version: 52.67.0, revision 23357, Sun May 30 21:30:00 2010 CET + * Max. version: 52.68.0, revision 23634, Tue Jul 20 21:30:00 2010 CET *) unit avformat; @@ -81,7 +81,7 @@ const *) (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 67; + LIBAVFORMAT_MAX_VERSION_MINOR = 68; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -203,7 +203,8 @@ function av_metadata_set(var pm: PAVMetadata; key: {const} PAnsiChar; value: {co (** * Sets the given tag in m, overwriting an existing tag. * @param key tag key to add to m (will be av_strduped depending on flags) - * @param value tag value to add to m (will be av_strduped depending on flags) + * @param value tag value to add to m (will be av_strduped depending on flags). + * Passing a NULL value will cause an existing tag to be deleted. * @return >= 0 on success otherwise an error code <0 *) function av_metadata_set2(var pm: PAVMetadata; key: {const} PAnsiChar; value: {const} PAnsiChar; flags: cint): cint; @@ -386,7 +387,9 @@ const {$IF LIBAVFORMAT_VERSION_MAJOR < 53} MAX_STREAMS = 20; {$ELSE} +{$IF LIBAVFORMAT_VERSION < 52068000} // < 52.68.0 MAX_STREAMS = 100; +{$IFEND} {$IFEND} AVFMT_NOOUTPUTLOOP = -1; -- cgit v1.2.3 From eb4e04eeb81f4821c0cdcf909113a49d081ff19e Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Tue, 20 Jul 2010 19:03:41 +0000 Subject: update avformat to 52.69.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2585 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 436ccf9b..c5ae2606 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -23,7 +23,7 @@ * * Conversion of libavformat/avformat.h * Min. version: 50.5.0 , revision 6577, Sat Oct 7 15:30:46 2006 UTC - * Max. version: 52.68.0, revision 23634, Tue Jul 20 21:30:00 2010 CET + * Max. version: 52.69.0, revision 23702, Tue Jul 20 21:30:00 2010 CET *) unit avformat; @@ -81,7 +81,7 @@ const *) (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 68; + LIBAVFORMAT_MAX_VERSION_MINOR = 69; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + -- cgit v1.2.3 From 9006de111c4f56259f90e9c3ebfae720ce650969 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Tue, 20 Jul 2010 19:13:11 +0000 Subject: update avformat to 52.70.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2586 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index c5ae2606..2f05ee4a 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -23,7 +23,7 @@ * * Conversion of libavformat/avformat.h * Min. version: 50.5.0 , revision 6577, Sat Oct 7 15:30:46 2006 UTC - * Max. version: 52.69.0, revision 23702, Tue Jul 20 21:30:00 2010 CET + * Max. version: 52.70.0, revision 23704, Tue Jul 20 21:30:00 2010 CET *) unit avformat; @@ -81,7 +81,7 @@ const *) (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 69; + LIBAVFORMAT_MAX_VERSION_MINOR = 70; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + -- cgit v1.2.3 From 145aa4960ddf6cb96f0dd6eb86177cbb89b0161c Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Tue, 20 Jul 2010 19:26:14 +0000 Subject: update avformat to 52.71.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2587 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 2f05ee4a..42fc4347 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -23,7 +23,7 @@ * * Conversion of libavformat/avformat.h * Min. version: 50.5.0 , revision 6577, Sat Oct 7 15:30:46 2006 UTC - * Max. version: 52.70.0, revision 23704, Tue Jul 20 21:30:00 2010 CET + * Max. version: 52.71.0, revision 23706, Tue Jul 20 21:30:00 2010 CET *) unit avformat; @@ -81,7 +81,7 @@ const *) (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 70; + LIBAVFORMAT_MAX_VERSION_MINOR = 71; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -1763,8 +1763,9 @@ function parse_frame_rate(frame_rate: PCint; frame_rate_base: PCint; * @param datestr String representing a date or a duration. * - If a date the syntax is: * @code - * [{YYYY-MM-DD|YYYYMMDD}]{T| }{HH[:MM[:SS[.m...]]][Z]|HH[MM[SS[.m...]]][Z]} + * now|{[{YYYY-MM-DD|YYYYMMDD}[T|t| ]]{{HH[:MM[:SS[.m...]]]}|{HH[MM[SS[.m...]]]}}[Z|z]} * @endcode + * If the value is "now" it takes the current time. * Time is localtime unless Z is appended, in which case it is * interpreted as UTC. * If the year-month-day part is not specified it takes the current -- cgit v1.2.3 From 522a36656fa8eb4a69d945376350b569ec8701a5 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Tue, 20 Jul 2010 20:41:33 +0000 Subject: update avformat to 52.72.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2588 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 149 ++++++++++++++++++++++++++------------------ 1 file changed, 89 insertions(+), 60 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 42fc4347..6121c685 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -23,7 +23,7 @@ * * Conversion of libavformat/avformat.h * Min. version: 50.5.0 , revision 6577, Sat Oct 7 15:30:46 2006 UTC - * Max. version: 52.71.0, revision 23706, Tue Jul 20 21:30:00 2010 CET + * Max. version: 52.72.0, revision 23941, Tue Jul 20 21:30:00 2010 CET *) unit avformat; @@ -81,7 +81,7 @@ const *) (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 71; + LIBAVFORMAT_MAX_VERSION_MINOR = 72; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -116,13 +116,13 @@ function avformat_version(): cuint; {$IF LIBAVFORMAT_VERSION >= 52039002} // 52.39.2 (** - * Returns the libavformat build-time configuration. + * Return the libavformat build-time configuration. *) function avformat_configuration(): {const} PansiChar; cdecl; external av__format; (** - * Returns the libavformat license. + * Return the libavformat license. *) function avformat_license(): {const} PansiChar; cdecl; external av__format; @@ -175,7 +175,7 @@ type {$IF LIBAVFORMAT_VERSION > 52024001} // > 52.24.1 {$IF LIBAVFORMAT_VERSION_MAJOR = 52} (** - * Gets a metadata element with matching key. + * Get a metadata element with matching key. * @param prev Set to the previous matching element to find the next. * If set to NULL the first matching element is returned. * @param flags Allows case as well as suffix-insensitive comparisons. @@ -186,7 +186,7 @@ function av_metadata_get(m: PAVMetadata; key: {const} PAnsiChar; cdecl; external av__format; (** - * Sets the given tag in m, overwriting an existing tag. + * Set the given tag in m, overwriting an existing tag. * @param key tag key to add to m (will be av_strduped) * @param value tag value to add to m (will be av_strduped) * @return >= 0 on success otherwise an error code <0 @@ -201,7 +201,7 @@ function av_metadata_set(var pm: PAVMetadata; key: {const} PAnsiChar; value: {co {$IF LIBAVFORMAT_VERSION >= 52043000} // >= 52.43.0 (** - * Sets the given tag in m, overwriting an existing tag. + * Set the given tag in m, overwriting an existing tag. * @param key tag key to add to m (will be av_strduped depending on flags) * @param value tag value to add to m (will be av_strduped depending on flags). * Passing a NULL value will cause an existing tag to be deleted. @@ -212,7 +212,7 @@ function av_metadata_set2(var pm: PAVMetadata; key: {const} PAnsiChar; value: {c {$IFEND} (** - * Frees all the memory allocated for an AVMetadata struct. + * Free all the memory allocated for an AVMetadata struct. *) procedure av_metadata_free(var m: PAVMetadata); cdecl; external av__format; @@ -633,11 +633,11 @@ type (** General purpose read-only value that the format can use. *) value: cint; - (** Starts/resumes playing - only meaningful if using a network-based format + (** Start/resume playing - only meaningful if using a network-based format (RTSP). *) read_play: function (c: PAVFormatContext): cint; cdecl; - (** Pauses playing - only meaningful if using a network-based format + (** Pause playing - only meaningful if using a network-based format (RTSP). *) read_pause: function (c: PAVFormatContext): cint; cdecl; @@ -647,7 +647,7 @@ type {$IF LIBAVFORMAT_VERSION >= 52030000} // 52.30.0 (** - * Seeks to timestamp ts. + * Seek to timestamp ts. * Seeking will be done so that the point from which all active streams * can be presented successfully will be closest to ts and within min/max_ts. * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. @@ -1164,8 +1164,8 @@ function guess_stream_format(short_name: PAnsiChar; {$IFEND} (** - * Returns the output format in the list of registered output formats - * which best matches the provided parameters, or returns NULL if + * Return the output format in the list of registered output formats + * which best matches the provided parameters, or return NULL if * there is no match. * * @param short_name if non-NULL checks if short_name matches with the @@ -1191,7 +1191,7 @@ function av_guess_format(short_name: PAnsiChar; {$IFEND} (** - * Guesses the codec ID based upon muxer and filename. + * Guess the codec ID based upon muxer and filename. *) function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; filename: PAnsiChar; mime_type: PAnsiChar; @@ -1199,7 +1199,7 @@ function av_guess_codec(fmt: PAVOutputFormat; short_name: PAnsiChar; cdecl; external av__format; (** - * Sends a nice hexadecimal dump of a buffer to the specified file stream. + * Send a nice hexadecimal dump of a buffer to the specified file stream. * * @param f The file stream pointer where the dump should be sent to. * @param buf buffer @@ -1212,7 +1212,7 @@ procedure av_hex_dump(f: PAVFile; buf: PByteArray; size: cint); {$IF LIBAVFORMAT_VERSION >= 51011000} // 51.11.0 (** - * Sends a nice hexadecimal dump of a buffer to the log. + * Send a nice hexadecimal dump of a buffer to the log. * * @param avcl A pointer to an arbitrary struct of which the first field is a * pointer to an AVClass struct. @@ -1228,7 +1228,7 @@ procedure av_hex_dump_log(avcl: Pointer; level: cint; buf: PByteArray; size: cin {$IFEND} (** - * Sends a nice dump of a packet to the specified file stream. + * Send a nice dump of a packet to the specified file stream. * * @param f The file stream pointer where the dump should be sent to. * @param pkt packet to dump @@ -1239,7 +1239,7 @@ procedure av_pkt_dump(f: PAVFile; pkt: PAVPacket; dump_payload: cint); {$IF LIBAVFORMAT_VERSION >= 51011000} // 51.11.0 (** - * Sends a nice dump of a packet to the log. + * Send a nice dump of a packet to the log. * * @param avcl A pointer to an arbitrary struct of which the first field is a * pointer to an AVClass struct. @@ -1253,7 +1253,7 @@ procedure av_pkt_dump_log(avcl: Pointer; level: cint; pkt: PAVPacket; dump_paylo {$IFEND} (** - * Initializes libavformat and registers all the muxers, demuxers and + * Initialize libavformat and register all the muxers, demuxers and * protocols. If you do not call this function, then you can select * exactly which formats you want to support. * @@ -1266,7 +1266,7 @@ procedure av_register_all(); {$IF LIBAVFORMAT_VERSION >= 51008000} // 51.8.0 (** - * Gets the CodecID for the given codec tag tag. + * Get the CodecID for the given codec tag tag. * If no codec id is found returns CODEC_ID_NONE. * * @param tags list of supported codec_id-codec_tag pairs, as stored @@ -1276,7 +1276,7 @@ function av_codec_get_id(var tags: PAVCodecTag; tag: cuint): TCodecID; cdecl; external av__format; (** - * Gets the codec tag for the given codec id id. + * Getsthe codec tag for the given codec id id. * If no codec tag is found returns 0. * * @param tags list of supported codec_id-codec_tag pairs, as stored @@ -1289,13 +1289,13 @@ function av_codec_get_tag(var tags: PAVCodecTag; id: TCodecID): cuint; (* media file input *) (** - * Finds AVInputFormat based on the short name of the input format. + * Find AVInputFormat based on the short name of the input format. *) function av_find_input_format(short_name: PAnsiChar): PAVInputFormat; cdecl; external av__format; (** - * Guesses file format. + * Guess file format. * * @param is_opened Whether the file is already opened; determines whether * demuxers with or without AVFMT_NOFILE are probed. @@ -1305,7 +1305,7 @@ function av_probe_input_format(pd: PAVProbeData; is_opened: cint): PAVInputForma {$IF LIBAVFORMAT_VERSION >= 52062000} // 52.62.0 (** - * Guesses the file format. + * Guess the file format. * * @param is_opened Whether the file is already opened; determines whether * demuxers with or without AVFMT_NOFILE are probed. @@ -1320,7 +1320,7 @@ function av_probe_input_format2(pd: PAVProbeData; is_opened: cint; score_max: PC {$IFEND} (** - * Allocates all the structures needed to read an input stream. + * Allocate all the structures needed to read an input stream. * This does not open the needed codecs for decoding the stream[s]. *) function av_open_input_stream(var ic_ptr: PAVFormatContext; @@ -1329,7 +1329,7 @@ function av_open_input_stream(var ic_ptr: PAVFormatContext; cdecl; external av__format; (** - * Opens a media file as input. The codecs are not opened. Only the file + * Open a media file as input. The codecs are not opened. Only the file * header (if present) is read. * * @param ic_ptr The opened media file handle is put here. @@ -1347,7 +1347,7 @@ function av_open_input_file(var ic_ptr: PAVFormatContext; filename: PAnsiChar; {$IF LIBAVFORMAT_VERSION >= 52026000} // 52.26.0 (** - * Allocates an AVFormatContext. + * Allocate an AVFormatContext. * Can be freed with av_free() but do not forget to free everything you * explicitly allocated as well! *) @@ -1364,7 +1364,7 @@ function av_alloc_format_context(): PAVFormatContext; {$IFEND} (** - * Reads packets of a media file to get stream information. This + * 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 * frame mode. @@ -1380,7 +1380,7 @@ function av_find_stream_info(ic: PAVFormatContext): cint; cdecl; external av__format; (** - * Reads a transport packet from a media file. + * Read a transport packet from a media file. * * This function is obsolete and should never be used. * Use av_read_frame() instead. @@ -1393,7 +1393,7 @@ function av_read_packet(s: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; external av__format; (** - * Returns the next frame of a stream. + * Return the next frame of a stream. * * The returned packet is valid * until the next av_read_frame() or until av_close_input_file() and @@ -1415,7 +1415,7 @@ function av_read_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; external av__format; (** - * Seeks to the keyframe at timestamp. + * Seek to the keyframe at timestamp. * 'timestamp' in 'stream_index'. * @param stream_index If stream_index is (-1), a default * stream is selected, and timestamp is automatically converted @@ -1431,7 +1431,7 @@ function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint6 {$IF LIBAVFORMAT_VERSION >= 52026000} // 52.26.0 (** - * Seeks to timestamp ts. + * Seek to timestamp ts. * Seeking will be done so that the point from which all active streams * can be presented successfully will be closest to ts and within min/max_ts. * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. @@ -1466,14 +1466,14 @@ function avformat_seek_file(s: PAVFormatContext; {$IFEND} (** - * Starts playing a network-based stream (e.g. RTSP stream) at the + * Start playing a network-based stream (e.g. RTSP stream) at the * current position. *) function av_read_play(s: PAVFormatContext): cint; cdecl; external av__format; (** - * Pauses a network-based stream (e.g. RTSP stream). + * Pause a network-based stream (e.g. RTSP stream). * * Use av_read_play() to resume it. *) @@ -1482,7 +1482,7 @@ function av_read_pause(s: PAVFormatContext): cint; {$IF LIBAVFORMAT_VERSION >= 52003000} // 52.3.0 (** - * Frees a AVFormatContext allocated by av_open_input_stream. + * Free a AVFormatContext allocated by av_open_input_stream. * @param s context to free *) procedure av_close_input_stream(s: PAVFormatContext); @@ -1490,7 +1490,7 @@ procedure av_close_input_stream(s: PAVFormatContext); {$IFEND} (** - * Closes a media file (but not its codecs). + * Close a media file (but not its codecs). * * @param s media file handle *) @@ -1498,7 +1498,7 @@ procedure av_close_input_file(s: PAVFormatContext); cdecl; external av__format; (** - * Adds a new stream to a media file. + * Add a new stream to a media file. * * Can only be called in the read_header() function. If the flag * AVFMTCTX_NOHEADER is in the format context, then new streams @@ -1516,7 +1516,7 @@ function av_new_program(s: PAVFormatContext; id: cint): PAVProgram; {$IF LIBAVFORMAT_VERSION >= 52014000} // 52.14.0 (** - * Adds a new chapter. + * Add a new chapter. * This function is NOT part of the public API * and should ONLY be used by demuxers. * @@ -1534,7 +1534,7 @@ function ff_new_chapter(s: PAVFormatContext; id: cint; time_base: TAVRational; {$IFEND} (** - * Sets the pts for a given stream. + * Set the pts for a given stream. * * @param s stream * @param pts_wrap_bits number of bits effectively used by the pts @@ -1562,7 +1562,7 @@ function av_find_default_stream_index(s: PAVFormatContext): cint; cdecl; external av__format; (** - * Gets the index for a specific timestamp. + * Get the index for a specific timestamp. * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond * to the timestamp which is <= the requested one, if backward * is 0, then it will be >= @@ -1574,7 +1574,7 @@ function av_index_search_timestamp(st: PAVStream; timestamp: cint64; flags: cint {$IF LIBAVFORMAT_VERSION >= 52004000} // 52.4.0 (** - * Ensures the index uses less memory than the maximum specified in + * Ensure the index uses less memory than the maximum specified in * AVFormatContext.max_index_size by discarding entries if it grows * too large. * This function is not part of the public API and should only be called @@ -1585,7 +1585,7 @@ procedure ff_reduce_index(s: PAVFormatContext; stream_index: cint); {$IFEND} (** - * Adds an index entry into a sorted list. Updates the entry if the list + * Add an index entry into a sorted list. Update the entry if the list * already contains it. * * @param timestamp timestamp in the timebase of the given stream @@ -1595,7 +1595,7 @@ function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; cdecl; external av__format; (** - * Does a binary search using av_index_search_timestamp() and + * Perform a binary search using av_index_search_timestamp() and * AVCodec.read_timestamp(). * This is not supposed to be called directly by a user application, * but by demuxers. @@ -1608,7 +1608,7 @@ function av_seek_frame_binary(s: PAVFormatContext; stream_index: cint; (** - * Updates cur_dts of all streams based on the given timestamp and AVStream. + * Update cur_dts of all streams based on the given timestamp and AVStream. * * Stream ref_st unchanged, others set cur_dts in their native time base. * Only needed for timestamp wrapping or if (dts not set and pts!=dts). @@ -1625,7 +1625,7 @@ type arg2: cint; arg3: Pint64; arg4: cint64): cint64; cdecl; (** - * Does a binary search using read_timestamp(). + * Perform a binary search using read_timestamp(). * This is not supposed to be called directly by a user application, * but by demuxers. * @param target_ts target timestamp in the time base of the given stream @@ -1644,8 +1644,37 @@ function av_gen_search(s: PAVFormatContext; stream_index: cint; function av_set_parameters(s: PAVFormatContext; ap: PAVFormatParameters): cint; cdecl; external av__format; +{$IF LIBAVFORMAT_VERSION >= 52072000} // 52.72.0 (** - * Allocates the stream private data and writes the stream header to an + * Split a URL string into components. + * + * The pointers to buffers for storing individual components may be null, + * in order to ignore that component. Buffers for components not found are + * set to empty strings. If the port is not found, it is set to a negative + * value. + * + * @param proto the buffer for the protocol + * @param proto_size the size of the proto buffer + * @param authorization the buffer for the authorization + * @param authorization_size the size of the authorization buffer + * @param hostname the buffer for the host name + * @param hostname_size the size of the hostname buffer + * @param port_ptr a pointer to store the port number in + * @param path the buffer for the path + * @param path_size the size of the path buffer + * @param url the URL to split + *) +procedure av_url_split(proto: PAnsiChar; proto_size: cint; + authorization: PAnsiChar; authorization_size: cint; + hostname: PAnsiChar; hostname_size: cint; + port_ptr: Pcint; + path: PAnsiChar; path_size: cint; + {const} url: PAnsiChar); + cdecl; external av__format; +{$IFEND} + +(** + * Allocate the stream private data and write the stream header to an * output media file. * * @param s media file handle @@ -1655,7 +1684,7 @@ function av_write_header(s: PAVFormatContext): cint; cdecl; external av__format; (** - * Writes a packet to an output media file. + * Write a packet to an output media file. * * The packet shall contain one audio or video frame. * The packet must be correctly interleaved according to the container @@ -1670,7 +1699,7 @@ function av_write_frame(s: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; external av__format; (** - * Writes a packet to an output media file ensuring correct interleaving. + * Write a packet to an output media file ensuring correct interleaving. * * The packet must contain one audio or video frame. * If the packets are already correctly interleaved, the application should @@ -1688,7 +1717,7 @@ function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): ci cdecl; external av__format; (** - * Interleaves a packet per dts in an output media file. + * Interleave a packet per dts in an output media file. * * Packets with pkt->destruct == av_destruct_packet will be freed inside this * function, so they cannot be used after it. Note that calling av_free_packet() @@ -1725,7 +1754,7 @@ procedure ff_interleave_add_packet(s: PAVFormatContext; {$IFEND} (** - * Writes the stream trailer to an output media file and frees the + * Write the stream trailer to an output media file and free the * file private data. * * May only be called after a successful call to av_write_header. @@ -1741,7 +1770,7 @@ procedure dump_format(ic: PAVFormatContext; index: cint; url: PAnsiChar; cdecl; external av__format; (** - * Parses width and height out of string str. + * 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; @@ -1750,7 +1779,7 @@ function parse_image_size(width_ptr: PCint; height_ptr: PCint; {$IF LIBAVFORMAT_VERSION_MAJOR < 53} (** - * Converts framerate from a string to a fraction. + * 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; @@ -1759,7 +1788,7 @@ function parse_frame_rate(frame_rate: PCint; frame_rate_base: PCint; {$IFEND} (** - * Parses datestr and returns a corresponding number of microseconds. + * Parse datestr and return a corresponding number of microseconds. * @param datestr String representing a date or a duration. * - If a date the syntax is: * @code @@ -1778,7 +1807,7 @@ function parse_frame_rate(frame_rate: PCint; frame_rate_base: PCint; * [-]HH[:MM[:SS[.m...]]] * [-]S+[.m...] * @endcode - * Returns the number of microseconds contained in a time interval + * @return the number of microseconds contained in a time interval * with the specified duration or INT64_MIN if datestr cannot be * successfully parsed. * @param duration Flag which tells how to interpret datestr, if @@ -1788,7 +1817,7 @@ function parse_frame_rate(frame_rate: PCint; frame_rate_base: PCint; function parse_date(datestr: PAnsiChar; duration: cint): cint64; cdecl; external av__format; -(** Gets the current time in microseconds. *) +(** Get the current time in microseconds. *) function av_gettime(): cint64; cdecl; external av__format; @@ -1810,7 +1839,7 @@ procedure ffm_set_write_index(s: PAVFormatContext; pos: cint64; file_size: cint6 cdecl; external av__format; (** - * Attempts to find a specific tag in a URL. + * Attempt to find a specific tag in a URL. * * syntax: '?tag1=val1&tag2=val2...'. Little URL decoding is done. * Return 1 if found. @@ -1819,7 +1848,7 @@ function find_info_tag(arg: PAnsiChar; arg_size: cint; tag1: PAnsiChar; info: PA cdecl; external av__format; (** - * Returns in 'buf' the path with '%d' replaced by a number. + * Return in 'buf' the path with '%d' replaced by a number. * * Also handles the '%0nd' format where 'n' is the total number * of digits and '%%'. @@ -1838,7 +1867,7 @@ function av_get_frame_filename(buf: PAnsiChar; buf_size: cint; {$IFEND}; (** - * Checks whether filename actually is a numbered sequence generator. + * Check whether filename actually is a numbered sequence generator. * * @param filename possible numbered sequence string * @return 1 if a valid numbered sequence string, 0 otherwise @@ -1851,7 +1880,7 @@ function av_filename_number_test(filename: PAnsiChar): cint; {$IF LIBAVFORMAT_VERSION >= 51012002} // 51.12.2 (** - * Generates an SDP for an RTP session. + * Generate an SDP for an RTP session. * * @param ac array of AVFormatContexts describing the RTP streams. If the * array is composed by only one context, such context can contain @@ -1870,7 +1899,7 @@ function avf_sdp_create(ac: PPAVFormatContext; n_files: cint; buff: PByteArray; {$IF LIBAVFORMAT_VERSION >= 52060000} // 52.60.0 (** - * Returns a positive value if the given filename has one of the given + * Return a positive value if the given filename has one of the given * extensions, 0 otherwise. * * @param extensions a comma-separated list of filename extensions -- cgit v1.2.3 From 33eaeeb528fd11b42d60c73e4d75b051950d1f8b Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Tue, 20 Jul 2010 20:51:52 +0000 Subject: update avformat to 52.73.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2589 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 6121c685..9f7f5448 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -23,7 +23,7 @@ * * Conversion of libavformat/avformat.h * Min. version: 50.5.0 , revision 6577, Sat Oct 7 15:30:46 2006 UTC - * Max. version: 52.72.0, revision 23941, Tue Jul 20 21:30:00 2010 CET + * Max. version: 52.73.0, revision 24007, Tue Jul 20 21:30:00 2010 CET *) unit avformat; @@ -81,7 +81,7 @@ const *) (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 72; + LIBAVFORMAT_MAX_VERSION_MINOR = 73; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -421,6 +421,13 @@ const AV_DISPOSITION_COMMENT = $0008; AV_DISPOSITION_LYRICS = $0010; AV_DISPOSITION_KARAOKE = $0020; + {$IF LIBAVFORMAT_VERSION >= 52073000} // >= 52.73.0 +(** Track should be used during playback by default. + * Useful for subtitle track that should be displayed + * even when user did not explicitly ask for subtitles. + *) + AV_DISPOSITION_FORCED = $0040; + {$IFEND} // used by TAVFormatContext.debug FF_FDEBUG_TS = 0001; @@ -800,7 +807,8 @@ type {$IFEND} {$IF LIBAVFORMAT_VERSION > 52024001} // > 52.24.1 - {* av_read_frame() support *} + {* Intended mostly for av_read_frame() support. Not supposed to be used by *} + {* external applications; try to use something else if at all possible. *} cur_ptr: {const} PCuint8; cur_len: cint; cur_pkt: TAVPacket; @@ -1452,7 +1460,7 @@ function av_seek_frame(s: PAVFormatContext; stream_index: cint; timestamp: cint6 * @param flags flags * @return >=0 on success, error code otherwise * - * @NOTE This is part of the new seek API which is still under construction. + * @note This is part of the new seek API which is still under construction. * Thus do not use this yet. It may change at any time, do not expect * ABI compatibility yet! *) @@ -1725,7 +1733,7 @@ function av_interleaved_write_frame(s: PAVFormatContext; var pkt: TAVPacket): ci * * @param s media file handle * @param out the interleaved packet will be output here - * @param in the input packet + * @param pkt the input packet * @param flush 1 if no further packets are available as input and all * remaining packets should be output * @return 1 if a packet was output, 0 if no packet could be output, -- cgit v1.2.3 From 5d82dc076def1f149382adc096388fe24a38e2b3 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Tue, 20 Jul 2010 20:56:22 +0000 Subject: update avformat to 52.74.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2590 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 9f7f5448..74a0fd8d 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -23,7 +23,7 @@ * * Conversion of libavformat/avformat.h * Min. version: 50.5.0 , revision 6577, Sat Oct 7 15:30:46 2006 UTC - * Max. version: 52.73.0, revision 24007, Tue Jul 20 21:30:00 2010 CET + * Max. version: 52.74.0, revision 24278, Tue Jul 20 21:30:00 2010 CET *) unit avformat; @@ -81,7 +81,7 @@ const *) (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 73; + LIBAVFORMAT_MAX_VERSION_MINOR = 74; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + -- cgit v1.2.3 From d08099847764ab27552fd1133eeb623c8b01b2a3 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Tue, 20 Jul 2010 21:00:22 +0000 Subject: update avformat to 52.76.0 git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2591 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 74a0fd8d..2d790dc3 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -23,7 +23,7 @@ * * Conversion of libavformat/avformat.h * Min. version: 50.5.0 , revision 6577, Sat Oct 7 15:30:46 2006 UTC - * Max. version: 52.74.0, revision 24278, Tue Jul 20 21:30:00 2010 CET + * Max. version: 52.76.0, revision 24355, Tue Jul 20 21:30:00 2010 CET *) unit avformat; @@ -81,7 +81,7 @@ const *) (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 74; + LIBAVFORMAT_MAX_VERSION_MINOR = 76; LIBAVFORMAT_MAX_VERSION_RELEASE = 0; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + @@ -1604,7 +1604,7 @@ function av_add_index_entry(st: PAVStream; pos: cint64; timestamp: cint64; (** * Perform a binary search using av_index_search_timestamp() and - * AVCodec.read_timestamp(). + * AVInputFormat.read_timestamp(). * This is not supposed to be called directly by a user application, * but by demuxers. * @param target_ts target timestamp in the time base of the given stream -- cgit v1.2.3 From 18a13231776d913f803efbc7d081963d78674cc9 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Wed, 25 Aug 2010 21:14:03 +0000 Subject: update avformat to 52.78.2. Mainly comment formatting. In addition, add routine av_metadata_conv, which was forgotten in 52.30.1. no further code change. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2621 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 213 +++++++++++++++++++++++++++++++------------- 1 file changed, 151 insertions(+), 62 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 2d790dc3..6a3530c8 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -23,7 +23,7 @@ * * Conversion of libavformat/avformat.h * Min. version: 50.5.0 , revision 6577, Sat Oct 7 15:30:46 2006 UTC - * Max. version: 52.76.0, revision 24355, Tue Jul 20 21:30:00 2010 CET + * Max. version: 52.78.2, revision 24790, Wed Aug 25 23:00:00 2010 CET *) unit avformat; @@ -81,8 +81,8 @@ const *) (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; - LIBAVFORMAT_MAX_VERSION_MINOR = 76; - LIBAVFORMAT_MAX_VERSION_RELEASE = 0; + LIBAVFORMAT_MAX_VERSION_MINOR = 78; + LIBAVFORMAT_MAX_VERSION_RELEASE = 2; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); @@ -176,6 +176,7 @@ type {$IF LIBAVFORMAT_VERSION_MAJOR = 52} (** * Get a metadata element with matching key. + * * @param prev Set to the previous matching element to find the next. * If set to NULL the first matching element is returned. * @param flags Allows case as well as suffix-insensitive comparisons. @@ -186,9 +187,12 @@ function av_metadata_get(m: PAVMetadata; key: {const} PAnsiChar; cdecl; external av__format; (** - * Set the given tag in m, overwriting an existing tag. - * @param key tag key to add to m (will be av_strduped) - * @param value tag value to add to m (will be av_strduped) + * 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. *) @@ -201,9 +205,12 @@ function av_metadata_set(var pm: PAVMetadata; key: {const} PAnsiChar; value: {co {$IF LIBAVFORMAT_VERSION >= 52043000} // >= 52.43.0 (** - * Set the given tag in m, overwriting an existing tag. - * @param key tag key to add to m (will be av_strduped depending on flags) - * @param value tag value to add to m (will be av_strduped depending on flags). + * 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 depending on flags) + * @param value tag value to add to *pm (will be av_strduped depending on flags). * Passing a NULL value will cause an existing tag to be deleted. * @return >= 0 on success otherwise an error code <0 *) @@ -211,6 +218,20 @@ function av_metadata_set2(var pm: PAVMetadata; key: {const} PAnsiChar; value: {c cdecl; external av__format; {$IFEND} +{$IF LIBAVFORMAT_VERSION >= 52030001} // >= 52.30.1 +(** + * Convert all the metadata sets from ctx according to the source and + * destination conversion tables. If one of the tables is NULL, then + * tags are converted to/from ffmpeg generic tag names. + * + * @param d_conv destination tags format conversion table + * @param s_conv source tags format conversion table + *) +procedure av_metadata_conv(ctx: PAVFormatContext, {const} d_conv: PAVMetadataConv, + {const} s_conv: PAVMetadataConv); + cdecl; external av__format; +{$IFEND} + (** * Free all the memory allocated for an AVMetadata struct. *) @@ -351,7 +372,9 @@ type (* input/output formats *) type - (** This structure contains the data a format has to probe a file. *) + (** + * This structure contains the data a format has to probe a file. + *) TAVProbeData = record filename: PAnsiChar; buf: PByteArray; (**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. *) @@ -421,11 +444,13 @@ const AV_DISPOSITION_COMMENT = $0008; AV_DISPOSITION_LYRICS = $0010; AV_DISPOSITION_KARAOKE = $0020; + {$IF LIBAVFORMAT_VERSION >= 52073000} // >= 52.73.0 -(** Track should be used during playback by default. - * Useful for subtitle track that should be displayed - * even when user did not explicitly ask for subtitles. - *) + (** + * Track should be used during playback by default. + * Useful for subtitle track that should be displayed + * even when user did not explicitly ask for subtitles. + *) AV_DISPOSITION_FORCED = $0040; {$IFEND} @@ -478,6 +503,7 @@ type (** * Convert all the metadata sets from ctx according to the source and * destination conversion tables. + * * @param d_conv destination tags format conversion table * @param s_conv source tags format conversion table *) @@ -545,7 +571,9 @@ type long_name: PAnsiChar; mime_type: PAnsiChar; extensions: PAnsiChar; (**< comma-separated filename extensions *) - (** size of private data so that it can be allocated in the wrapper *) + (** + * size of private data so that it can be allocated in the wrapper + *) priv_data_size: cint; (* output support *) audio_codec: TCodecID; (**< default audio codec *) @@ -553,9 +581,13 @@ type write_header: function (c: PAVFormatContext): cint; cdecl; write_packet: function (c: PAVFormatContext; pkt: PAVPacket): cint; cdecl; write_trailer: function (c: PAVFormatContext): cint; cdecl; - (** can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_GLOBALHEADER *) + (** + * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_GLOBALHEADER + *) flags: cint; - (** Currently only used to set pixel format if not YUV420P. *) + (** + * Currently only used to set pixel format if not YUV420P. + *) set_parameters: function (c: PAVFormatContext; f: PAVFormatParameters): cint; cdecl; interleave_packet: function (s: PAVFormatContext; out_: PAVPacket; in_: PAVPacket; flush: cint): cint; cdecl; @@ -581,35 +613,53 @@ type end; TAVInputFormat = record + (** + * A comma separated list of short names for the format. New names + * may be appended with a minor bump. + *) name: PAnsiChar; + (** * Descriptive name for the format, meant to be more human-readable * than name. You should use the NULL_IF_CONFIG_SMALL() macro * to define it. *) long_name: PAnsiChar; - (** Size of private data so that it can be allocated in the wrapper. *) + + (** + * Size of private data so that it can be allocated in the wrapper. + *) priv_data_size: cint; + (** * Tell if a given file has a chance of being parsed as this format. * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes * big so you do not have to check for that unless you need more. *) read_probe: function (p: PAVProbeData): cint; cdecl; - (** Read the format header and initialize the AVFormatContext - structure. Return 0 if OK. 'ap' if non-NULL contains - additional parameters. Only used in raw format right - now. 'av_new_stream' should be called to create new streams. *) + + (** + * Read the format header and initialize the AVFormatContext + * structure. Return 0 if OK. 'ap' if non-NULL contains + * additional parameters. Only used in raw format right + * now. 'av_new_stream' should be called to create new streams. + *) read_header: function (c: PAVFormatContext; ap: PAVFormatParameters): cint; cdecl; - (** Read one packet and put it in 'pkt'. pts and flags are also - set. 'av_new_stream' can be called only if the flag - AVFMTCTX_NOHEADER is used. - @return 0 on success, < 0 on error. - When returning an error, pkt must not have been allocated - or must be freed before returning *) + + (** + * Read one packet and put it in 'pkt'. pts and flags are also + * set. 'av_new_stream' can be called only if the flag + * AVFMTCTX_NOHEADER is used. + * @return 0 on success, < 0 on error. + * When returning an error, pkt must not have been allocated + * or must be freed before returning + *) read_packet: function (c: PAVFormatContext; var pkt: TAVPacket): cint; cdecl; - (** Close the stream. The AVFormatContext and AVStreams are not - freed by this function *) + + (** + * Close the stream. The AVFormatContext and AVStreams are not + * freed by this function + *) read_close: function (c: PAVFormatContext): cint; cdecl; {$IF LIBAVFORMAT_VERSION_MAJOR < 53} @@ -631,21 +681,34 @@ type *) read_timestamp: function (s: PAVFormatContext; stream_index: cint; pos: pint64; pos_limit: cint64): cint64; cdecl; - (** Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER. *) + + (** + * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER. + *) flags: cint; - (** If extensions are defined, then no probe is done. You should - usually not use extension format guessing because it is not - reliable enough *) + + (** + * If extensions are defined, then no probe is done. You should + * usually not use extension format guessing because it is not + * reliable enough + *) extensions: PAnsiChar; - (** General purpose read-only value that the format can use. *) + + (** + * General purpose read-only value that the format can use. + *) value: cint; - (** Start/resume playing - only meaningful if using a network-based format - (RTSP). *) + (** + * Start/resume playing - only meaningful if using a network-based format + * (RTSP). + *) read_play: function (c: PAVFormatContext): cint; cdecl; - (** Pause playing - only meaningful if using a network-based format - (RTSP). *) + (** + * Pause playing - only meaningful if using a network-based format + * (RTSP). + *) read_pause: function (c: PAVFormatContext): cint; cdecl; {$IF LIBAVFORMAT_VERSION >= 51008000} // 51.8.0 @@ -724,7 +787,9 @@ type codec_info_nb_frames: cint; {$IFEND} - (** encoding: pts generation when outputting stream *) + (** + * encoding: pts generation when outputting stream + *) pts: TAVFrac; (** * This is the fundamental unit of time (in seconds) in terms @@ -737,9 +802,12 @@ type stream_copy: cint; (**< If set, just copy stream. *) discard: TAVDiscard; ///< Selects which packets can be discarded at will and do not need to be demuxed. //FIXME move stuff to a flags field? - (** Quality, as it has been removed from AVCodecContext and put in AVVideoFrame. - * MN:dunno if thats the right place, for it *) + (** + * Quality, as it has been removed from AVCodecContext and put in AVVideoFrame. + * MN:dunno if thats the right place, for it + *) quality: cfloat; + (** * Decoding: pts of the first frame of the stream, in stream time base. * Only set this if you are absolutely 100% sure that the value you set @@ -749,6 +817,7 @@ type * demuxer must NOT set this. *) start_time: cint64; + (** * Decoding: duration of the stream, in stream time base. * If a source file does not specify a duration, but does specify @@ -757,7 +826,7 @@ type duration: cint64; {$IF LIBAVFORMAT_VERSION_MAJOR < 53} - language: array [0..3] of PAnsiChar; (* ISO 639-2/B 3-letter language code (empty string if undefined) *) + language: array [0..3] of PAnsiChar; (**< ISO 639-2/B 3-letter language code (empty string if undefined) *) {$IFEND} (* av_read_frame() support *) @@ -891,25 +960,35 @@ type ctx_flags: cint; (**< Format-specific flags, see AVFMTCTX_xx *) (* private data for pts handling (do not modify directly). *) - (** This buffer is only needed when packets were already buffered but - not decoded, for example to get the codec parameters in MPEG - streams. *) + (** + * This buffer is only needed when packets were already buffered but + * not decoded, for example to get the codec parameters in MPEG + * streams. + *) packet_buffer: PAVPacketList; - (** Decoding: position of the first frame of the component, in - AV_TIME_BASE fractional seconds. NEVER set this value directly: - It is deduced from the AVStream values. *) + (** + * Decoding: position of the first frame of the component, in + * AV_TIME_BASE fractional seconds. NEVER set this value directly: + * It is deduced from the AVStream values. + *) start_time: cint64; - (** Decoding: duration of the stream, in AV_TIME_BASE fractional - seconds. Only set this value if you know none of the individual stream - durations and also dont set any of them. This is deduced from the - AVStream values if not set. *) + (** + * Decoding: duration of the stream, in AV_TIME_BASE fractional + * seconds. Only set this value if you know none of the individual stream + * durations and also dont set any of them. This is deduced from the + * AVStream values if not set. + *) duration: cint64; - (** decoding: total file size, 0 if unknown *) + (** + * decoding: total file size, 0 if unknown + *) file_size: cint64; - (** Decoding: total stream bitrate in bit/s, 0 if not - available. Never set it directly if the file_size and the - duration are known as ffmpeg can compute it automatically. *) + (** + * Decoding: total stream bitrate in bit/s, 0 if not + * available. Never set it directly if the file_size and the + * duration are known as ffmpeg can compute it automatically. + *) bit_rate: cint; (* av_read_frame() support *) @@ -921,7 +1000,7 @@ type {$IFEND} (* av_seek_frame() support *) - data_offset: cint64; (* offset of the first packet *) + data_offset: cint64; (**< offset of the first packet *) index_built: cint; mux_rate: cint; @@ -933,14 +1012,18 @@ type preload: cint; max_delay: cint; - (* number of times to loop output in formats that support it *) + (** + * number of times to loop output in formats that support it + *) loop_output: cint; flags: cint; loop_input: cint; {$IF LIBAVFORMAT_VERSION >= 50006000} // 50.6.0 - (** decoding: size of data to probe; encoding: unused. *) + (** + * decoding: size of data to probe; encoding: unused. + *) probesize: cuint; {$IFEND} @@ -966,11 +1049,13 @@ type * Demuxing: Set by user. *) video_codec_id: TCodecID; + (** * Forced audio codec_id. * Demuxing: Set by user. *) audio_codec_id: TCodecID; + (** * Forced subtitle codec_id. * Demuxing: Set by user. @@ -1648,7 +1733,9 @@ function av_gen_search(s: PAVFormatContext; stream_index: cint; cdecl; external av__format; {$IFEND} -(* media file output *) +(** + * media file output + *) function av_set_parameters(s: PAVFormatContext; ap: PAVFormatParameters): cint; cdecl; external av__format; @@ -1825,7 +1912,9 @@ function parse_frame_rate(frame_rate: PCint; frame_rate_base: PCint; function parse_date(datestr: PAnsiChar; duration: cint): cint64; cdecl; external av__format; -(** Get the current time in microseconds. *) +(** + * Get the current time in microseconds. + *) function av_gettime(): cint64; cdecl; external av__format; -- cgit v1.2.3 From bb47f56a41521dfd9e00201eca4ff39aff765695 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Thu, 26 Aug 2010 00:15:13 +0000 Subject: update avformat.h and avio.h to 52.78.3. Addition of FF_API constants and new IFDEFs. Also error correction in avio.h (see is_connected). git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2622 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 95 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 81 insertions(+), 14 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 6a3530c8..aba64565 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -23,7 +23,7 @@ * * Conversion of libavformat/avformat.h * Min. version: 50.5.0 , revision 6577, Sat Oct 7 15:30:46 2006 UTC - * Max. version: 52.78.2, revision 24790, Wed Aug 25 23:00:00 2010 CET + * Max. version: 52.78.3, revision 24841, Thu Aug 26 02:00:00 2010 CET *) unit avformat; @@ -82,7 +82,7 @@ const (* Max. supported version by this header *) LIBAVFORMAT_MAX_VERSION_MAJOR = 52; LIBAVFORMAT_MAX_VERSION_MINOR = 78; - LIBAVFORMAT_MAX_VERSION_RELEASE = 2; + LIBAVFORMAT_MAX_VERSION_RELEASE = 3; LIBAVFORMAT_MAX_VERSION = (LIBAVFORMAT_MAX_VERSION_MAJOR * VERSION_MAJOR) + (LIBAVFORMAT_MAX_VERSION_MINOR * VERSION_MINOR) + (LIBAVFORMAT_MAX_VERSION_RELEASE * VERSION_RELEASE); @@ -105,6 +105,22 @@ const {$MESSAGE Error 'Linked version of libavformat is not yet supported!'} {$IFEND} +{$IF LIBAVFORMAT_VERSION >= 52078003} // >= 52.78.3 +(** + * Those FF_API_* defines are not part of public API. + * They may change, break or disappear at any time. + *) +const + {$IF LIBAVFORMAT_VERSION_MAJOR < 53} + FF_API_MAX_STREAMS = (LIBAVFORMAT_VERSION_MAJOR < 53); + FF_API_OLD_METADATA = (LIBAVFORMAT_VERSION_MAJOR < 53); + FF_API_REGISTER_PROTOCOL = (LIBAVFORMAT_VERSION_MAJOR < 53); + FF_API_URL_RESETBUF = (LIBAVFORMAT_VERSION_MAJOR < 53); + {$ELSE} + FF_API_URL_CLASS = (LIBAVFORMAT_VERSION_MAJOR >= 53); + {$IFEND} +{$IFEND} + {$IF LIBAVFORMAT_VERSION >= 52020000} // 52.20.0 (** * I return the LIBAVFORMAT_VERSION_INT constant. You got @@ -173,7 +189,6 @@ type PAVMetadata = Pointer; {$IF LIBAVFORMAT_VERSION > 52024001} // > 52.24.1 -{$IF LIBAVFORMAT_VERSION_MAJOR = 52} (** * Get a metadata element with matching key. * @@ -186,6 +201,7 @@ function av_metadata_get(m: PAVMetadata; key: {const} PAnsiChar; prev: {const} PAVMetadataTag ; flags: cint): PAVMetadataTag; cdecl; external av__format; +{$IF LIBAVFORMAT_VERSION < 52078003} // < 52.78.3 (** * Set the given tag in *pm, overwriting an existing tag. * @@ -198,9 +214,24 @@ function av_metadata_get(m: PAVMetadata; key: {const} PAnsiChar; *) function av_metadata_set(var pm: PAVMetadata; key: {const} PAnsiChar; value: {const} PAnsiChar): cint; cdecl; external av__format; -{$IF LIBAVFORMAT_VERSION >= 52061000} // >= 52.61.0 + {$IF LIBAVFORMAT_VERSION >= 52061000} // >= 52.61.0 deprecated; -{$IFEND} + {$IFEND} +{$ELSE} + {$IFDEF 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; + {$IFEND} {$IFEND} {$IF LIBAVFORMAT_VERSION >= 52043000} // >= 52.43.0 @@ -407,13 +438,21 @@ const AVFMTCTX_NOHEADER = $0001; (**< signal that no header is present (streams are added dynamically) *) -{$IF LIBAVFORMAT_VERSION_MAJOR < 53} + +{$IF LIBAVFORMAT_VERSION < 52078003} // < 52.78.3 + {$IF LIBAVFORMAT_VERSION_MAJOR < 53} MAX_STREAMS = 20; -{$ELSE} -{$IF LIBAVFORMAT_VERSION < 52068000} // < 52.68.0 + {$ELSE} + {$IF LIBAVFORMAT_VERSION < 52068000} // < 52.68.0 MAX_STREAMS = 100; + {$IFEND} + {$IFEND} +{$ELSE} + {$IFDEF FF_API_MAX_STREAMS} + MAX_STREAMS = 20; + {$IFEND} {$IFEND} -{$IFEND} + AVFMT_NOOUTPUTLOOP = -1; AVFMT_INFINITEOUTPUTLOOP = 0; @@ -520,8 +559,12 @@ 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 LIBAVFORMAT_VERSION < 53000000} // 53.00.0 + {$IF LIBAVFORMAT_VERSION < 52078003} // < 52.78.3 title: PAnsiChar; ///< chapter title + {$ELSE} + {$IFDEF FF_API_OLD_METADATA} + title: PAnsiChar; ///< chapter title + {$IFEND} {$IFEND} {$IF LIBAVFORMAT_VERSION >= 52024001} // 52.24.1 metadata: PAVMetadata; @@ -825,8 +868,12 @@ type *) duration: cint64; - {$IF LIBAVFORMAT_VERSION_MAJOR < 53} + {$IF LIBAVFORMAT_VERSION < 52078003} // < 52.78.3 language: array [0..3] of PAnsiChar; (**< ISO 639-2/B 3-letter language code (empty string if undefined) *) + {$ELSE} + {$IFDEF FF_API_OLD_METADATA} + language: array [0..3] of PAnsiChar; (**< ISO 639-2/B 3-letter language code (empty string if undefined) *) + {$IFEND} {$IFEND} (* av_read_frame() support *) @@ -848,8 +895,12 @@ type unused: array [0..4] of cint64; {$IFEND} - {$IF (LIBAVFORMAT_VERSION >= 52006000) and (LIBAVFORMAT_VERSION_MAJOR < 53)} // 52.6.0 - 53.0.0 + {$IF (LIBAVFORMAT_VERSION >= 52006000) and (LIBAVFORMAT_VERSION < 52078003)} // 52.6.0 - 52.78.2 filename: PAnsiChar; (**< source filename of the stream *) + {$ELSE} + {$IFDEF FF_API_OLD_METADATA} + filename: PAnsiChar; (**< source filename of the stream *) + {$IFEND} {$IFEND} {$IF LIBAVFORMAT_VERSION >= 52008000} // 52.8.0 @@ -947,7 +998,17 @@ type filename: array [0..1023] of AnsiChar; (* input or output filename *) (* stream info *) timestamp: cint64; - {$IF LIBAVFORMAT_VERSION < 53000000} // 53.00.0 + {$IF LIBAVFORMAT_VERSION < 52078003} // < 52.78.3 + 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 *) + {$ELSE} + {$IFDEF FF_API_OLD_METADATA} title: array [0..511] of AnsiChar; author: array [0..511] of AnsiChar; copyright: array [0..511] of AnsiChar; @@ -956,6 +1017,7 @@ type year: cint; (**< ID3 year, 0 if none *) track: cint; (**< track number, 0 if none *) genre: array [0..31] of AnsiChar; (**< ID3 genre *) + {$IFEND} {$IFEND} ctx_flags: cint; (**< Format-specific flags, see AVFMTCTX_xx *) @@ -1143,9 +1205,14 @@ type *) TAVProgram = record id : cint; - {$IF LIBAVFORMAT_VERSION < 53000000} // 53.00.0 + {$IF LIBAVFORMAT_VERSION < 52078003} // < 52.78.3 + provider_name : PAnsiChar; ///< network name for DVB streams + name : PAnsiChar; ///< service name for DVB streams + {$ELSE} + {$IFDEF FF_API_OLD_METADATA} provider_name : PAnsiChar; ///< network name for DVB streams name : PAnsiChar; ///< service name for DVB streams + {$IFEND} {$IFEND} flags : cint; discard : TAVDiscard; ///< selects which program to discard and which to feed to the caller -- cgit v1.2.3 From 31ec38a0595c8bbd6e18677bce127607814744aa Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Thu, 26 Aug 2010 00:30:58 +0000 Subject: fix compilation on linux. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2623 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index aba64565..3b6ee3cc 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -249,20 +249,6 @@ function av_metadata_set2(var pm: PAVMetadata; key: {const} PAnsiChar; value: {c cdecl; external av__format; {$IFEND} -{$IF LIBAVFORMAT_VERSION >= 52030001} // >= 52.30.1 -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. If one of the tables is NULL, then - * tags are converted to/from ffmpeg generic tag names. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) -procedure av_metadata_conv(ctx: PAVFormatContext, {const} d_conv: PAVMetadataConv, - {const} s_conv: PAVMetadataConv); - cdecl; external av__format; -{$IFEND} - (** * Free all the memory allocated for an AVMetadata struct. *) @@ -1260,6 +1246,20 @@ type next: PAVImageFormat; end; {deprecated} +{$IF LIBAVFORMAT_VERSION >= 52030001} // >= 52.30.1 +(** + * Convert all the metadata sets from ctx according to the source and + * destination conversion tables. If one of the tables is NULL, then + * tags are converted to/from ffmpeg generic tag names. + * + * @param d_conv destination tags format conversion table + * @param s_conv source tags format conversion table + *) +procedure av_metadata_conv(ctx: PAVFormatContext, {const} d_conv: PAVMetadataConv, + {const} s_conv: PAVMetadataConv); + cdecl; external av__format; +{$IFEND} + procedure av_register_image_format(img_fmt: PAVImageFormat); cdecl; external av__format; deprecated; -- cgit v1.2.3 From 7a0c585fedbe21776651fce77a992cce2b319450 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Thu, 26 Aug 2010 00:44:37 +0000 Subject: another try to fix compilation on linux. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2625 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 3b6ee3cc..255ff0d5 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -1246,20 +1246,6 @@ type next: PAVImageFormat; end; {deprecated} -{$IF LIBAVFORMAT_VERSION >= 52030001} // >= 52.30.1 -(** - * Convert all the metadata sets from ctx according to the source and - * destination conversion tables. If one of the tables is NULL, then - * tags are converted to/from ffmpeg generic tag names. - * - * @param d_conv destination tags format conversion table - * @param s_conv source tags format conversion table - *) -procedure av_metadata_conv(ctx: PAVFormatContext, {const} d_conv: PAVMetadataConv, - {const} s_conv: PAVMetadataConv); - cdecl; external av__format; -{$IFEND} - procedure av_register_image_format(img_fmt: PAVImageFormat); cdecl; external av__format; deprecated; @@ -1278,6 +1264,20 @@ function av_write_image(pb: PByteIOContext; fmt: PAVImageFormat; img: PAVImageIn cdecl; external av__format; deprecated; {$IFEND} +{$IF LIBAVFORMAT_VERSION >= 52030001} // >= 52.30.1 +(** + * Convert all the metadata sets from ctx according to the source and + * destination conversion tables. If one of the tables is NULL, then + * tags are converted to/from ffmpeg generic tag names. + * + * @param d_conv destination tags format conversion table + * @param s_conv source tags format conversion table + *) +procedure av_metadata_conv(ctx: PAVFormatContext, {const} d_conv: PAVMetadataConv, + {const} s_conv: PAVMetadataConv); + cdecl; external av__format; +{$IFEND} + {$IF LIBAVFORMAT_VERSION_MAJOR < 53} { var -- cgit v1.2.3 From 8a5255e1c425ba854aa0b012924ad18f88c59206 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Thu, 26 Aug 2010 00:52:26 +0000 Subject: another try to fix compilation on linux. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2627 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index 255ff0d5..e6edddb2 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -1273,7 +1273,7 @@ function av_write_image(pb: PByteIOContext; fmt: PAVImageFormat; img: PAVImageIn * @param d_conv destination tags format conversion table * @param s_conv source tags format conversion table *) -procedure av_metadata_conv(ctx: PAVFormatContext, {const} d_conv: PAVMetadataConv, +procedure av_metadata_conv(ctx: PAVFormatContext; {const} d_conv: PAVMetadataConv; {const} s_conv: PAVMetadataConv); cdecl; external av__format; {$IFEND} -- cgit v1.2.3 From 84b836b0733a9b12e50be4adadea349591413973 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Thu, 26 Aug 2010 00:55:55 +0000 Subject: fix compilation on windows. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2628 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/lib/ffmpeg/avformat.pas | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/lib/ffmpeg/avformat.pas') diff --git a/src/lib/ffmpeg/avformat.pas b/src/lib/ffmpeg/avformat.pas index e6edddb2..bd13c70e 100644 --- a/src/lib/ffmpeg/avformat.pas +++ b/src/lib/ffmpeg/avformat.pas @@ -231,7 +231,7 @@ function av_metadata_set(var pm: PAVMetadata; key: {const} PAnsiChar; value: {co *) function av_metadata_set(var pm: PAVMetadata; key: {const} PAnsiChar; value: {const} PAnsiChar): cint; cdecl; external av__format; deprecated; - {$IFEND} + {$ENDIF} {$IFEND} {$IF LIBAVFORMAT_VERSION >= 52043000} // >= 52.43.0 @@ -436,7 +436,7 @@ const {$ELSE} {$IFDEF FF_API_MAX_STREAMS} MAX_STREAMS = 20; - {$IFEND} + {$ENDIF} {$IFEND} @@ -550,7 +550,7 @@ type {$ELSE} {$IFDEF FF_API_OLD_METADATA} title: PAnsiChar; ///< chapter title - {$IFEND} + {$ENDIF} {$IFEND} {$IF LIBAVFORMAT_VERSION >= 52024001} // 52.24.1 metadata: PAVMetadata; @@ -859,7 +859,7 @@ type {$ELSE} {$IFDEF FF_API_OLD_METADATA} language: array [0..3] of PAnsiChar; (**< ISO 639-2/B 3-letter language code (empty string if undefined) *) - {$IFEND} + {$ENDIF} {$IFEND} (* av_read_frame() support *) @@ -886,7 +886,7 @@ type {$ELSE} {$IFDEF FF_API_OLD_METADATA} filename: PAnsiChar; (**< source filename of the stream *) - {$IFEND} + {$ENDIF} {$IFEND} {$IF LIBAVFORMAT_VERSION >= 52008000} // 52.8.0 @@ -1003,7 +1003,7 @@ type year: cint; (**< ID3 year, 0 if none *) track: cint; (**< track number, 0 if none *) genre: array [0..31] of AnsiChar; (**< ID3 genre *) - {$IFEND} + {$ENDIF} {$IFEND} ctx_flags: cint; (**< Format-specific flags, see AVFMTCTX_xx *) @@ -1198,7 +1198,7 @@ type {$IFDEF FF_API_OLD_METADATA} provider_name : PAnsiChar; ///< network name for DVB streams name : PAnsiChar; ///< service name for DVB streams - {$IFEND} + {$ENDIF} {$IFEND} flags : cint; discard : TAVDiscard; ///< selects which program to discard and which to feed to the caller -- cgit v1.2.3