diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/ffmpeg-1.1/avcodec.pas | 388 | ||||
-rw-r--r-- | src/lib/ffmpeg-1.1/avformat.pas | 40 | ||||
-rw-r--r-- | src/lib/ffmpeg-1.1/avutil.pas | 8 | ||||
-rw-r--r-- | src/lib/ffmpeg-1.1/libavutil/log.pas | 83 | ||||
-rw-r--r-- | src/lib/ffmpeg-1.1/libavutil/opt.pas | 117 | ||||
-rw-r--r-- | src/lib/ffmpeg-1.1/libavutil/pixfmt.pas | 4 |
6 files changed, 296 insertions, 344 deletions
diff --git a/src/lib/ffmpeg-1.1/avcodec.pas b/src/lib/ffmpeg-1.1/avcodec.pas index d2d2beb1..02ca8ab8 100644 --- a/src/lib/ffmpeg-1.1/avcodec.pas +++ b/src/lib/ffmpeg-1.1/avcodec.pas @@ -36,6 +36,8 @@ unit avcodec; {$MINENUMSIZE 4} (* use 4-byte enums *) {$ENDIF} +{$I switches.inc} (* for ffmpeg defines *) + {$IFDEF DARWIN} {$linklib libavcodec} {$ENDIF} @@ -110,52 +112,51 @@ const * dropped at a future version bump. The defines themselves are not part of * the public API and may change, break or disappear at any time. *) -const {$ifndef FF_API_REQUEST_CHANNELS} - FF_API_REQUEST_CHANNELS = (LIBAVCODEC_VERSION_MAJOR < 55); +{$define FF_API_REQUEST_CHANNELS := (LIBAVCODEC_VERSION_MAJOR < 55)} {$endif} {$ifndef FF_API_ALLOC_CONTEXT} - FF_API_ALLOC_CONTEXT = (LIBAVCODEC_VERSION_MAJOR < 55); +{$define FF_API_ALLOC_CONTEXT := (LIBAVCODEC_VERSION_MAJOR < 55)} {$endif} {$ifndef FF_API_AVCODEC_OPEN} - FF_API_AVCODEC_OPEN = (LIBAVCODEC_VERSION_MAJOR < 55); +{$define FF_API_AVCODEC_OPEN := (LIBAVCODEC_VERSION_MAJOR < 55)} {$endif} {$ifndef FF_API_OLD_DECODE_AUDIO} - FF_API_OLD_DECODE_AUDIO = (LIBAVCODEC_VERSION_MAJOR < 55); +{$define FF_API_OLD_DECODE_AUDIO := (LIBAVCODEC_VERSION_MAJOR < 55)} {$endif} {$ifndef FF_API_OLD_TIMECODE} - FF_API_OLD_TIMECODE = (LIBAVCODEC_VERSION_MAJOR < 55); +{$define FF_API_OLD_TIMECODE := (LIBAVCODEC_VERSION_MAJOR < 55)} {$endif} {$ifndef FF_API_OLD_ENCODE_AUDIO} - FF_API_OLD_ENCODE_AUDIO = (LIBAVCODEC_VERSION_MAJOR < 55); +{$define FF_API_OLD_ENCODE_AUDIO := (LIBAVCODEC_VERSION_MAJOR < 55)} {$endif} {$ifndef FF_API_OLD_ENCODE_VIDEO} - FF_API_OLD_ENCODE_VIDEO = (LIBAVCODEC_VERSION_MAJOR < 55); +{$define FF_API_OLD_ENCODE_VIDEO := (LIBAVCODEC_VERSION_MAJOR < 55)} {$endif} {$ifndef FF_API_MPV_GLOBAL_OPTS} - FF_API_MPV_GLOBAL_OPTS = (LIBAVCODEC_VERSION_MAJOR < 55); +{$define FF_API_MPV_GLOBAL_OPTS := (LIBAVCODEC_VERSION_MAJOR < 55)} {$endif} {$ifndef FF_API_COLOR_TABLE_ID} - FF_API_COLOR_TABLE_ID = (LIBAVCODEC_VERSION_MAJOR < 55); +{$define FF_API_COLOR_TABLE_ID := (LIBAVCODEC_VERSION_MAJOR < 55)} {$endif} {$ifndef FF_API_INTER_THRESHOLD} - FF_API_INTER_THRESHOLD = (LIBAVCODEC_VERSION_MAJOR < 55); +{$define FF_API_INTER_THRESHOLD := (LIBAVCODEC_VERSION_MAJOR < 55)} {$endif} {$ifndef FF_API_SUB_ID} - FF_API_SUB_ID = (LIBAVCODEC_VERSION_MAJOR < 55); +{$define FF_API_SUB_ID := (LIBAVCODEC_VERSION_MAJOR < 55)} {$endif} {$ifndef FF_API_DSP_MASK} - FF_API_DSP_MASK = (LIBAVCODEC_VERSION_MAJOR < 55); +{$define FF_API_DSP_MASK := (LIBAVCODEC_VERSION_MAJOR < 55)} {$endif} {$ifndef FF_API_FIND_BEST_PIX_FMT} - FF_API_FIND_BEST_PIX_FMT = (LIBAVCODEC_VERSION_MAJOR < 55); +{$define FF_API_FIND_BEST_PIX_FMT := (LIBAVCODEC_VERSION_MAJOR < 55)} {$endif} {$ifndef FF_API_CODEC_ID} - FF_API_CODEC_ID = (LIBAVCODEC_VERSION_MAJOR < 55); +{$define FF_API_CODEC_ID := (LIBAVCODEC_VERSION_MAJOR < 55)} {$endif} {$ifndef FF_API_VDA_ASYNC} - FF_API_VDA_ASYNC = (LIBAVCODEC_VERSION_MAJOR < 55); +{$define FF_API_VDA_ASYNC := (LIBAVCODEC_VERSION_MAJOR < 55)} {$endif} {$IFNDEF FPC} @@ -178,7 +179,7 @@ const * * Basic definitions, functions for querying libavcodec capabilities, * allocating core structures, etc. - * @{ + * @ *) (** @@ -655,8 +656,8 @@ type AV_CODEC_ID_Y41P = $59343150, // MKBETAG('Y','4','1','P'), AV_CODEC_ID_YUV4 = $59555634, // MKBETAG('Y','U','V','4'), AV_CODEC_ID_EIA_608 = $63363038, // MKBETAG('c','6','0','8'), - AV_CODEC_ID_MICRODVD = $6D445644 // MKBETAG('m','D','V','D') - AV_CODEC_ID_TAK = $7442614B, // MKBETAG('t','B','a','K'), + AV_CODEC_ID_MICRODVD = $6D445644, // MKBETAG('m','D','V','D'), + AV_CODEC_ID_TAK = $7442614B // MKBETAG('t','B','a','K'), ); @@ -678,7 +679,8 @@ const * @see avcodec_get_descriptor() *) type - record AVCodecDescriptor = + PAVCodecDescriptor = ^TAVCodecDescriptor; + TAVCodecDescriptor = record id: TAVCodecID; type_: TAVMediaType; (** @@ -714,7 +716,7 @@ const *) AV_CODEC_PROP_LOSSLESS = 1 << 2; -{$IF FF_API_OLD_DECODE_AUDIO} +{$IFDEF FF_API_OLD_DECODE_AUDIO} (* in bytes *) AVCODEC_MAX_AUDIO_FRAME_SIZE = 192000; // 1 second of 48khz 32bit audio {$IFEND} @@ -1047,18 +1049,21 @@ type TAVPanScan = record {24} (*** id. * - encoding: set by user. - * - decoding: set by libavcodec. *) + * - decoding: set by libavcodec. + *) id: cint; (*** width and height in 1/16 pel * - encoding: set by user. - * - decoding: set by libavcodec. *) + * - decoding: set by libavcodec. + *) width: cint; height: cint; (*** position of the top left corner in 1/16 pel for up to 3 fields/frames. * - encoding: set by user. - * - decoding: set by libavcodec. *) + * - decoding: set by libavcodec. + *) position: array [0..2] of array [0..1] of cint16; end; {TAVPanScan} @@ -1372,9 +1377,9 @@ type ); TAVPacketSideDataType = record - data: PByte; - size: cint; - type_: AVPacketSideDataType; + data: PByte; + size: cint; + type_: AVPacketSideDataType; end; PAVPacketSideDataType = ^TAVPacketSideDataType; @@ -1498,6 +1503,7 @@ type * av_opt_ptr() can be reordered. This allows 2 forks to add fields * without breaking compatibility with each other. *) + PPAVFrame = ^PAVFrame; PAVFrame = ^TAVFrame; TAVFrame = record (** @@ -1537,7 +1543,7 @@ type * encoding: set by user * decoding: set by AVCodecContext.get_buffer() *) - extended_data: pointer of pbyte; + extended_data: ^pbyte; (** * width and height of the video frame @@ -1900,49 +1906,6 @@ type pkt_size: cint; end; {TAVFrame} -(** - * Accessors for some AVFrame fields. - * The position of these field in the structure is not part of the ABI, - * they should not be accessed directly outside libavcodec. - *) -function av_frame_get_best_effort_timestamp(frame: {const} PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_duration (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_pkt_pos (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_channel_layout (frame: {const} PAVFrame): cint64; - cdecl; external av__codec; -procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); - cdecl; external av__codec; -function av_frame_get_channels (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_channels (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_sample_rate (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_metadata (frame: {const} PAVFrame): PAVDictionary; - cdecl; external av__codec; -procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); - cdecl; external av__codec; -function av_frame_get_decode_error_flags (frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); - cdecl; external av__codec; -function av_frame_get_pkt_size(frame: {const} PAVFrame): cint; - cdecl; external av__codec; -procedure av_frame_set_pkt_size(frame: PAVFrame; val: cint); - cdecl; external av__codec; - -type TAVCodecInternal = record end; PAVCodecInternal = ^TAVCodecInternal; @@ -1972,6 +1935,16 @@ type ); (** + * four components are given, that's all. + * the last component is alpha + *) + PAVPicture = ^TAVPicture; + TAVPicture = record + data: array [0..AV_NUM_DATA_POINTERS - 1] of PByteArray; + linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; ///< number of bytes per line + end; {TAVPicture} + +(** * main external API structure. * New fields can be added to the end with minor version bumps. * Removal, reordering and changes to existing fields require a major @@ -2016,7 +1989,7 @@ type *) stream_codec_tag: cuint; -{$IF FF_API_SUB_ID} +{$IFDEF FF_API_SUB_ID} (** * @deprecated this field is unused *) @@ -2760,7 +2733,7 @@ type *) cutoff: cint; -{$IF FF_API_REQUEST_CHANNELS} +{$IFDEF FF_API_REQUEST_CHANNELS} (** * Decoder should decode to this many channels if it can (0 for default) * - encoding: unused @@ -3212,7 +3185,7 @@ type *) idct_algo: cint; -{$IF FF_API_DSP_MASK} +{$IFDEF FF_API_DSP_MASK} (** * Unused. * @deprecated use av_set_cpu_flags_mask() instead. @@ -3406,7 +3379,7 @@ type * - encoding unused. * - decodimg set by user *) - pkt_timebase: PAVRational; + pkt_timebase: TAVRational; (** * AVCodecDescriptor @@ -3435,13 +3408,6 @@ type metadata: PAVDictionary; end; {TAVCodecContext} - function av_codec_get_pkt_timebase(avctx: {const} PAVCodecContext): TAVRational; - procedure av_codec_set_pkt_timebase(avctx: {const} PAVCodecContext; val: TAVRational); - - function av_codec_get_codec_descriptor(avctx: {const} PAVCodecContext): PAVCodecDescriptor; - procedure av_codec_set_codec_descriptor(avctx: {const} PAVCodecContext; desc: {const} PAVCodecDescriptor); - -type (** * AVProfile. *) @@ -3451,8 +3417,66 @@ type name: {const} PAnsiChar; ///< short name for the profile end; {TAVProfile} + TAVSubtitleType = ( + SUBTITLE_NONE, + + SUBTITLE_BITMAP, ///< A bitmap, pict will be set + + (** + * Plain text, the text field must be set by the decoder and is + * authoritative. ass and pict fields may contain approximations. + *) + SUBTITLE_TEXT, + + (** + * Formatted text, the ass field must be set by the decoder and is + * authoritative. pict and text fields may contain approximations. + *) + SUBTITLE_ASS + ); {TAVSubtitleType} + + PPAVSubtitleRect = ^PAVSubtitleRect; + PAVSubtitleRect = ^TAVSubtitleRect; + TAVSubtitleRect = record + x: cint; ///< top left corner of pict, undefined when pict is not set + y: cint; ///< top left corner of pict, undefined when pict is not set + w: cint; ///< width of pict, undefined when pict is not set + h: cint; ///< height of pict, undefined when pict is not set + nb_colors: cint; ///< number of colors in pict, undefined when pict is not set + + (** + * data+linesize for the bitmap of this subtitle. + * can be set for text/ass as well once they where rendered + *) + pict: TAVPicture; + type_: TAVSubtitleType; + + text: PAnsiChar; ///< 0 terminated plain UTF-8 text + + (** + * 0 terminated ASS/SSA compatible event line. + * The presentation of this is unaffected by the other values in this + * struct. + *) + ass: PAnsiChar; + + (** + * 1 indicates this subtitle is a forced subtitle. + * A forced subtitle should be displayed even when subtitles are hidden. + *) + forced: cint; + end; {TAVSubtitleRect} + + PPAVSubtitle = ^PAVSubtitle; + PAVSubtitle = ^TAVSubtitle; TAVSubtitle = record - end; + format: cuint16; (* 0 = graphics *) + start_display_time: cuint32; (* relative to packet pts, in ms *) + end_display_time: cuint32; (* relative to packet pts, in ms *) + num_rects: cuint; + rects: PPAVSubtitleRect; + pts: cint64; ///< Same as packet pts, in AV_TIME_BASE + end; {TAVSubtitle} (** * AVCodec. @@ -3497,7 +3521,7 @@ type next: PAVCodec; (** * @name Frame-level threading support functions - * @{ + * @ *) (** * If defined, called on thread contexts when they are created. @@ -3647,84 +3671,64 @@ type * @defgroup lavc_picture AVPicture * * Functions for working with AVPicture - * @{ + * @ *) (** - * four components are given, that's all. - * the last component is alpha + * Accessors for some AVFrame fields. + * The position of these field in the structure is not part of the ABI, + * they should not be accessed directly outside libavcodec. *) - PAVPicture = ^TAVPicture; - TAVPicture = record - data: array [0..AV_NUM_DATA_POINTERS - 1] of PByteArray; - linesize: array [0..AV_NUM_DATA_POINTERS - 1] of cint; ///< number of bytes per line - end; {TAVPicture} +function av_frame_get_best_effort_timestamp(frame: {const} PAVFrame): cint64; + cdecl; external av__codec; overload; +procedure av_frame_set_best_effort_timestamp(frame: PAVFrame; val: cint64); + cdecl; external av__codec; overload; +function av_frame_get_pkt_duration (frame: {const} PAVFrame): cint64; + cdecl; external av__codec; overload; +procedure av_frame_get_pkt_duration (frame: PAVFrame; val: cint64); + cdecl; external av__codec; overload; +function av_frame_get_pkt_pos (frame: {const} PAVFrame): cint64; + cdecl; external av__codec; overload; +procedure av_frame_get_pkt_pos (frame: PAVFrame; val: cint64); + cdecl; external av__codec; overload; +function av_frame_get_channel_layout (frame: {const} PAVFrame): cint64; + cdecl; external av__codec; overload; +procedure av_frame_get_channel_layout (frame: PAVFrame; val: cint64); + cdecl; external av__codec; overload; +function av_frame_get_channels (frame: {const} PAVFrame): cint; + cdecl; external av__codec; +procedure av_frame_set_channels (frame: PAVFrame; val: cint); + cdecl; external av__codec; +function av_frame_get_sample_rate (frame: {const} PAVFrame): cint; + cdecl; external av__codec; +procedure av_frame_set_sample_rate (frame: PAVFrame; val: cint); + cdecl; external av__codec; +function av_frame_get_metadata (frame: {const} PAVFrame): PAVDictionary; + cdecl; external av__codec; +procedure av_frame_set_metadata (frame: PAVFrame; val: PAVDictionary); + cdecl; external av__codec; +function av_frame_get_decode_error_flags (frame: {const} PAVFrame): cint; + cdecl; external av__codec; +procedure av_frame_set_decode_error_flags (frame: PAVFrame; val: cint); + cdecl; external av__codec; +function av_frame_get_pkt_size (frame: {const} PAVFrame): cint; + cdecl; external av__codec; +procedure av_frame_set_pkt_size (frame: PAVFrame; val: cint); + cdecl; external av__codec; + +function av_codec_get_pkt_timebase(avctx: {const} PAVCodecContext): TAVRational; + cdecl; external av__codec; +procedure av_codec_set_pkt_timebase(avctx: {const} PAVCodecContext; val: TAVRational); + cdecl; external av__codec; -/** - * @} - */ +function av_codec_get_codec_descriptor(avctx: {const} PAVCodecContext): PAVCodecDescriptor; + cdecl; external av__codec; +procedure av_codec_set_codec_descriptor(avctx: {const} PAVCodecContext; desc: {const} PAVCodecDescriptor); + cdecl; external av__codec; const AV_SUBTITLE_FLAG_FORCED = $00000001; -type - TAVSubtitleType = ( - SUBTITLE_NONE, - - SUBTITLE_BITMAP, ///< A bitmap, pict will be set - - (** - * Plain text, the text field must be set by the decoder and is - * authoritative. ass and pict fields may contain approximations. - *) - SUBTITLE_TEXT, - - (** - * Formatted text, the ass field must be set by the decoder and is - * authoritative. pict and text fields may contain approximations. - *) - SUBTITLE_ASS - ); {TAVSubtitleType} - - PPAVSubtitleRect = ^PAVSubtitleRect; - PAVSubtitleRect = ^TAVSubtitleRect; - TAVSubtitleRect = record - x: cint; ///< top left corner of pict, undefined when pict is not set - y: cint; ///< top left corner of pict, undefined when pict is not set - w: cint; ///< width of pict, undefined when pict is not set - h: cint; ///< height of pict, undefined when pict is not set - nb_colors: cint; ///< number of colors in pict, undefined when pict is not set - - (** - * data+linesize for the bitmap of this subtitle. - * can be set for text/ass as well once they where rendered - *) - pict: TAVPicture; - type_: TAVSubtitleType; - - text: PAnsiChar; ///< 0 terminated plain UTF-8 text - - (** - * 0 terminated ASS/SSA compatible event line. - * The presentation of this is unaffected by the other values in this - * struct. - *) - ass: PAnsiChar; - - flags: cint; - end; {TAVSubtitleRect} - - PPAVSubtitle = ^PAVSubtitle; - PAVSubtitle = ^TAVSubtitle; - TAVSubtitle = record - format: cuint16; (* 0 = graphics *) - start_display_time: cuint32; (* relative to packet pts, in ms *) - end_display_time: cuint32; (* relative to packet pts, in ms *) - num_rects: cuint; - rects: PPAVSubtitleRect; - pts: cint64; ///< Same as packet pts, in AV_TIME_BASE - end; {TAVSubtitle} - (** * If c is NULL, returns the first registered codec, * if c is non-NULL, returns the next registered codec after c, @@ -3776,7 +3780,7 @@ procedure avcodec_register(codec: PAVCodec); procedure avcodec_register_all(); cdecl; external av__codec; -{$IF FF_API_ALLOC_CONTEXT} +{$IFDEF FF_API_ALLOC_CONTEXT} (** * Allocate an AVCodecContext and sets it fields to default values. The * resulting struct can be deallocated by simply calling av_free(). @@ -3908,7 +3912,7 @@ procedure avcodec_get_frame_defaults(frame: PAVFrame); procedure avcodec_free_frame(frame: PPAVFrame); cdecl; external av__codec; -{$IF FF_API_AVCODEC_OPEN} +{$IFDEF FF_API_AVCODEC_OPEN} (** * Initialize the AVCodecContext to use the given AVCodec. Prior to using this * function the context has to be allocated. @@ -4002,12 +4006,8 @@ procedure avsubtitle_free(sub: PAVSubtitle); cdecl; external av__codec; (** - * @} - *) - -(** * @addtogroup lavc_packet - * @{ + * @ *) (* @@ -4053,7 +4053,7 @@ procedure av_shrink_packet(pkt: PAVPacket; size: cint); * @param pkt packet * @param grow_by number of bytes by which to increase the size of the packet *) -function av_grow_packet(pkt: PAVPacket; grow_by: cint): cint; +function av_grow_packet(pkt: PAVPacket; grow_by: cint): cint; cdecl; external av__codec; (* @@ -4121,15 +4121,6 @@ function av_packet_merge_side_data(pkt: PAVPacket): cint; function av_packet_split_side_data(pkt: PAVPacket): cint; cdecl; external av__codec; -/** - * @} - */ - -/** - * @addtogroup lavc_decoding - * @{ - */ - (** * Find a registered decoder with a matching codec ID. * @@ -4190,7 +4181,7 @@ procedure avcodec_align_dimensions2(s: PAVCodecContext; width: PCint; height: PC linesize_align: PAVNDPArray); cdecl; external av__codec; -{$IF FF_API_OLD_DECODE_AUDIO} +{$IFDEF FF_API_OLD_DECODE_AUDIO} (** * Wrapper function which calls avcodec_decode_audio4. * @@ -4347,13 +4338,13 @@ function avcodec_decode_subtitle2(avctx: PAVCodecContext; sub: PAVSubtitle; avpkt: PAVPacket): cint; cdecl; external av__codec; -/** +(** * @defgroup lavc_parsing Frame parsing - * @{ - */ + * @ + *) const - AV_PARSER_PTS_NB = 4; + AV_PARSER_PTS_NB = 4; PARSER_FLAG_COMPLETE_FRAMES = $0001; PARSER_FLAG_ONCE = $0002; /// Set if the parser has a valid file offset @@ -4563,13 +4554,8 @@ procedure av_parser_close(s: PAVCodecParserContext); cdecl; external av__codec; (** - * @} - * @} - *) - -(** * @addtogroup lavc_encoding - * @{ + * @ *) (** @@ -4590,7 +4576,7 @@ function avcodec_find_encoder(id: TAVCodecID): PAVCodec; function avcodec_find_encoder_by_name(name: PAnsiChar): PAVCodec; cdecl; external av__codec; -{$IF FF_API_OLD_ENCODE_AUDIO} +{$IFDEF FF_API_OLD_ENCODE_AUDIO} (** * Encode an audio frame from samples into buf. * @@ -4663,7 +4649,7 @@ function avcodec_encode_audio2(avctx: PAVCodecContext; avpkt: PAVPacket; frame: {const} PAVFrame; got_packet_ptr: Pcint): cint; cdecl; external av__codec; -{$IF FF_API_OLD_ENCODE_AUDIO} +{$IFDEF FF_API_OLD_ENCODE_AUDIO} (** * @deprecated use avcodec_encode_video2() instead. * @@ -4725,17 +4711,13 @@ function avcodec_encode_subtitle(avctx: PAVCodecContext; buf: PByteArray; buf_size: cint; sub: {const} PAVSubtitle): cint; cdecl; external av__codec; -(** - * @} - *) - {$IFDEF FF_API_AVCODEC_RESAMPLE} (** * @defgroup lavc_resample Audio resampling * @ingroup libavc * @deprecated use libswresample instead * - * @{ + * @ *) type PReSampleContext = pointer; @@ -4765,7 +4747,7 @@ type filter_length: cint; log2_phase_count: cint; linear: cint; cutoff: cdouble): PReSampleContext; cdecl; external av__codec; deprecated; - + function audio_resample (s: PReSampleContext; output: PSmallint; input: PSmallint; nb_samples: cint): cint; cdecl; external av__codec; deprecated; @@ -4823,14 +4805,11 @@ procedure av_resample_compensate (c: PAVResampleContext; sample_delta: cint; procedure av_resample_close (c: PAVResampleContext); cdecl; external av__codec; deprecated; -(** - * @} - *) {$ENDIF} (** * @addtogroup lavc_picture - * @{ + * @ *) (** @@ -4888,7 +4867,7 @@ function avpicture_get_size (pix_fmt: TAVPixelFormat; width: cint; height: cint) cdecl; external av__codec; (** - * deinterlace - if not supported return -1 *) + * deinterlace - if not supported return -1 *) function avpicture_deinterlace (dst: PAVPicture; src: {const} PAVPicture; pix_fmt: TAVPixelFormat; width: cint; height: cint): cint; @@ -4918,23 +4897,19 @@ function av_picture_pad(dst: PAVPicture; src: {const} PAVPicture; cdecl; external av__codec; (** - * @} - *) - -(** * @defgroup lavc_misc Utility functions * @ingroup libavc * * Miscellaneous utility functions related to both encoding and decoding * (or neither). - * @{ + * @ *) (** * @defgroup lavc_misc_pixfmt Pixel formats * * Functions for working with pixel formats. - * @{ + * @ *) (** @@ -5078,7 +5053,7 @@ function avcodec_find_best_pix_fmt_of_list(pix_fmt_list: PAVPixelFormat; * @return The best pixel format to convert to or -1 if none was found. *) function avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: TAVPixelFormat; - src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint)): TAVPixelFormat; + src_pix_fmt: TAVPixelFormat; has_alpha: cint; loss_ptr: Pcint): TAVPixelFormat; cdecl; external av__codec; {$IFDEF AV_HAVE_INCOMPATIBLE_FORK_ABI} @@ -5095,13 +5070,10 @@ function avcodec_find_best_pix_fmt2(dst_pix_fmt1: TAVPixelFormat; dst_pix_fmt2: function avcodec_default_get_format(s: PAVCodecContext; fmt: {const} PAVPixelFormat): TAVPixelFormat; cdecl; external av__codec; -(** - * @} - *) - procedure avcodec_set_dimensions(s: PAVCodecContext; width: cint; height: cint); cdecl; external av__codec; +(** * Put a string representing the codec tag codec_tag in buf. * * @param buf_size size in bytes of buf @@ -5205,7 +5177,7 @@ function av_get_exact_bits_per_sample(codec_id: TAVCodecID): cint; * @return frame duration, in samples, if known. 0 if not able to * determine. *) -function av_get_audio_frame_duration(avctx: PAVCodecContext, frame_bytes: cint): cint; +function av_get_audio_frame_duration(avctx: PAVCodecContext; frame_bytes: cint): cint; cdecl; external av__codec; type @@ -5423,10 +5395,6 @@ function avcodec_descriptor_next(prev: {const} PAVCodecDescriptor): PAVCodecDesc function avcodec_descriptor_get_by_name(name: {const} PAnsiChar): PAVCodecDescriptor; cdecl; external av__codec; -(** - * @} - *) - implementation end. diff --git a/src/lib/ffmpeg-1.1/avformat.pas b/src/lib/ffmpeg-1.1/avformat.pas index 2d6bbe29..6ed9ec63 100644 --- a/src/lib/ffmpeg-1.1/avformat.pas +++ b/src/lib/ffmpeg-1.1/avformat.pas @@ -465,7 +465,7 @@ const increasing timestamps, but they must still be monotonic *) - AVFMT_SEEK_TO_PTS = $4000000 (**< Seeking is based on PTS *) + AVFMT_SEEK_TO_PTS = $4000000; (**< Seeking is based on PTS *) // used by AVIndexEntry AVINDEX_KEYFRAME = $0001; @@ -475,8 +475,8 @@ const MAX_STREAMS = 20; - AVFMT_FLAG_GENPTS = $0001; ///< Generate missing pts even if it requires parsing future frames. - AVFMT_FLAG_IGNIDX = $0002; ///< Ignore index. + 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. AVFMT_FLAG_IGNDTS = $0008; ///< Ignore DTS on frames that contain both DTS & PTS AVFMT_FLAG_NOFILLIN = $0010; ///< Do not infer any values from other values, just return what is stored in the container @@ -511,9 +511,9 @@ const * even when user did not explicitly ask for subtitles. *) AV_DISPOSITION_FORCED = $0040; - AV_DISPOSITION_HEARING_IMPAIRED = $0080; /**< stream for hearing impaired audiences */ - AV_DISPOSITION_VISUAL_IMPAIRED = $0100; /**< stream for visual impaired audiences */ - AV_DISPOSITION_CLEAN_EFFECTS = $0200; /**< stream without voice */ + AV_DISPOSITION_HEARING_IMPAIRED = $0080; (**< stream for hearing impaired audiences *) + AV_DISPOSITION_VISUAL_IMPAIRED = $0100; (**< stream for visual impaired audiences *) + AV_DISPOSITION_CLEAN_EFFECTS = $0200; (**< stream without voice *) (** * The stream is stored in the file as an attached picture/"cover art" (e.g. * APIC frame in ID3v2). The single packet associated with it will be returned @@ -547,7 +547,12 @@ type PPAVStream = ^PAVStream; PAVStream = ^TAVStream; + PAVPacketList = ^TAVPacketList; + TAVPacketList = record + pkt: TAVPacket; + next: PAVPacketList; + end; (*AVPacketList*) PPAVProgram = ^PAVProgram; PAVProgram = ^TAVProgram; @@ -775,17 +780,14 @@ type max_ts: cint64; flags: cint): cint; cdecl; end; -(** - * @} - *) TAVStreamParseType = ( AVSTREAM_PARSE_NONE, 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 *) - AVSTREAM_PARSE_FULL_ONCE (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) - AVSTREAM_PARSE_FULL_RAW = $57415230; // MKTAG(0,'R','A','W'), + AVSTREAM_PARSE_FULL_ONCE, (**< full parsing and repack of the first frame only, only implemented for H.264 currently *) + AVSTREAM_PARSE_FULL_RAW = $57415230 // MKTAG(0,'R','A','W'), (**< full parsing and repack with timestamp and position generation by parser for raw this assumes that each packet in the file contains no demuxer level headers and just codec level data, otherwise position generation would fail *) @@ -1137,7 +1139,7 @@ type * iformat/oformat.flags. In such a case, the (de)muxer will handle * I/O in some other way and this field will be NULL. *) - pb: PByteIOContext; + pb: PByteIOContext; (* stream info *) ctx_flags: cint; (**< Format-specific flags, see AVFMTCTX_xx *) @@ -1393,7 +1395,7 @@ type *) raw_packet_buffer_remaining_size: cint; -end; + end; (** * Returns the method used to set ctx->duration. @@ -1403,18 +1405,13 @@ end; function av_fmt_ctx_get_duration_estimation_method(ctx: {const} PAVFormatContext): TAVDurationEstimationMethod; cdecl; external av__format; - TAVPacketList = record - pkt: TAVPacket; - next: PAVPacketList; - end; (*AVPacketList*) - (** * @defgroup lavf_core Core functions * @ingroup libavf * * Functions for querying libavformat capabilities, allocating core structures, * etc. - * @{ + * @ *) (** @@ -1572,7 +1569,7 @@ function avformat_alloc_output_context2(ctx: PPAVFormatContext; oformat: PAVOutp (** * @addtogroup lavf_decoding - * @{ + * @ *) (** @@ -1631,7 +1628,8 @@ function av_probe_input_format3(pd: PAVProbeData; is_opened: cint; score_ret: Pc *) function av_probe_input_buffer(pb: PAVIOContext; var fmt: PAVInputFormat; filename: {const} PAnsiChar; logctx: pointer; - offset: cuint; max_probe_size: cuint); + offset: cuint; max_probe_size: cuint): cint; + cdecl; external av__format; (** * Open an input stream and read the header. The codecs are not opened. diff --git a/src/lib/ffmpeg-1.1/avutil.pas b/src/lib/ffmpeg-1.1/avutil.pas index 5f21b695..5ea0231c 100644 --- a/src/lib/ffmpeg-1.1/avutil.pas +++ b/src/lib/ffmpeg-1.1/avutil.pas @@ -202,12 +202,12 @@ function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF {$INCLUDE libavutil/mem.pas} -{$INCLUDE libavutil/opt.pas} - {$INCLUDE libavutil/log.pas} {$INCLUDE libavutil/pixfmt.pas} +{$INCLUDE libavutil/opt.pas} + {$INCLUDE libavutil/samplefmt.pas} (* libavutil/common.h *) // until now MKTAG and MKBETAG is all from common.h KMS 19/5/2010 @@ -222,6 +222,9 @@ function MKBETAG(a, b, c, d: AnsiChar): integer; {$IFDEF HasInline}inline;{$ENDI implementation +uses + SysUtils; + function av_x_if_null(p: {const} pointer; x: {const} pointer): pointer; {$IFDEF HasInline}inline;{$ENDIF} begin if p = nil then @@ -272,6 +275,7 @@ var begin errbuf := stralloc(AV_ERROR_MAX_STRING_SIZE); av_make_error_string(errbuf, AV_ERROR_MAX_STRING_SIZE, errnum); + av_err2str := errbuf end; (* libavutil/mem.h *) diff --git a/src/lib/ffmpeg-1.1/libavutil/log.pas b/src/lib/ffmpeg-1.1/libavutil/log.pas index 3eb7dcb3..9ad35369 100644 --- a/src/lib/ffmpeg-1.1/libavutil/log.pas +++ b/src/lib/ffmpeg-1.1/libavutil/log.pas @@ -29,6 +29,88 @@ *) type + TAVOptionType = ( +{$IFDEF FF_API_OLD_AVOPTIONS} + FF_OPT_TYPE_FLAGS = 0, + FF_OPT_TYPE_INT, + FF_OPT_TYPE_INT64, + FF_OPT_TYPE_DOUBLE, + FF_OPT_TYPE_FLOAT, + FF_OPT_TYPE_STRING, + FF_OPT_TYPE_RATIONAL, + FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length + FF_OPT_TYPE_CONST = 128 +{$ELSE} + AV_OPT_TYPE_FLAGS, + AV_OPT_TYPE_INT, + AV_OPT_TYPE_INT64, + AV_OPT_TYPE_DOUBLE, + AV_OPT_TYPE_FLOAT, + AV_OPT_TYPE_STRING, + AV_OPT_TYPE_RATIONAL, + AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length + AV_OPT_TYPE_CONST = 128, + AV_OPT_TYPE_PIXEL_FMT = $50464D54, ///< MKBETAG('P','F','M','T'), + AV_OPT_TYPE_IMAGE_SIZE = $53495A45 ///< MKBETAG('S','I','Z','E'), offset must point to two consecutive integers +{$ENDIF} + ); + +const + AV_OPT_FLAG_ENCODING_PARAM = 1; ///< a generic parameter which can be set by the user for muxing or encoding + AV_OPT_FLAG_DECODING_PARAM = 2; ///< a generic parameter which can be set by the user for demuxing or decoding + AV_OPT_FLAG_METADATA = 4; ///< some data extracted or inserted into the file like title, comment, ... + AV_OPT_FLAG_AUDIO_PARAM = 8; + AV_OPT_FLAG_VIDEO_PARAM = 16; + AV_OPT_FLAG_SUBTITLE_PARAM = 32; + AV_OPT_FLAG_FILTERING_PARAM = 1 shl 16; ///< a generic parameter which can be set by the user for filtering + +type + (** + * AVOption + *) + PAVOption = ^TAVOption; + TAVOption = record + name: {const} PAnsiChar; + + (** + * short English help text + * @todo What about other languages? + *) + help: {const} PAnsiChar; + + (** + * The offset relative to the context structure where the option + * value is stored. It should be 0 for named constants. + *) + offset: cint; + type_: TAVOptionType; + + (** + * the default value for scalar options + *) + default_val: record + case cint of + 0: (i64: cint64); + 1: (dbl: cdouble); + 2: (str: PAnsiChar); + (* TODO those are unused now *) + 3: (q: TAVRational); + end; + min: cdouble; ///< minimum valid value for the option + max: cdouble; ///< maximum valid value for the option + + flags: cint; +//FIXME think about enc-audio, ... style flags + + (** + * The logical unit to which the option belongs. Non-constant + * options and corresponding named constants share the same + * unit. May be NULL. + *) + unit_: {const} PAnsiChar; + end; + +type PAVClassCategory = ^TAVClassCategory; TAVClassCategory = ( AV_CLASS_CATEGORY_NA = 0, @@ -110,7 +192,6 @@ type *) child_class_next: function (prev: {const} PAVClass): {const} PAVClass; cdecl; - (** * Category used for visualization (like color) * This is only set if the category is equal for all objects using this class. diff --git a/src/lib/ffmpeg-1.1/libavutil/opt.pas b/src/lib/ffmpeg-1.1/libavutil/opt.pas index 003deff1..60ba821a 100644 --- a/src/lib/ffmpeg-1.1/libavutil/opt.pas +++ b/src/lib/ffmpeg-1.1/libavutil/opt.pas @@ -27,111 +27,6 @@ * *) -type - TAVOptionType = ( -{$IFDEF FF_API_OLD_AVOPTIONS} - FF_OPT_TYPE_FLAGS = 0, - FF_OPT_TYPE_INT, - FF_OPT_TYPE_INT64, - FF_OPT_TYPE_DOUBLE, - FF_OPT_TYPE_FLOAT, - FF_OPT_TYPE_STRING, - FF_OPT_TYPE_RATIONAL, - FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - FF_OPT_TYPE_CONST = 128 -{$ELSE} - AV_OPT_TYPE_FLAGS, - AV_OPT_TYPE_INT, - AV_OPT_TYPE_INT64, - AV_OPT_TYPE_DOUBLE, - AV_OPT_TYPE_FLOAT, - AV_OPT_TYPE_STRING, - AV_OPT_TYPE_RATIONAL, - AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length - AV_OPT_TYPE_CONST = 128, - AV_OPT_TYPE_PIXEL_FMT = $50464D54, ///< MKBETAG('P','F','M','T') - AV_OPT_TYPE_SAMPLE_FMT = $53464D54, ///< MKBETAG('S','F','M','T') - AV_OPT_TYPE_IMAGE_SIZE = $53495A45 ///< MKBETAG('S','I','Z','E'), offset must point to two consecutive integers -{$ENDIF} - ); - -const - AV_OPT_FLAG_ENCODING_PARAM = 1; ///< a generic parameter which can be set by the user for muxing or encoding - AV_OPT_FLAG_DECODING_PARAM = 2; ///< a generic parameter which can be set by the user for demuxing or decoding - AV_OPT_FLAG_METADATA = 4; ///< some data extracted or inserted into the file like title, comment, ... - AV_OPT_FLAG_AUDIO_PARAM = 8; - AV_OPT_FLAG_VIDEO_PARAM = 16; - AV_OPT_FLAG_SUBTITLE_PARAM = 32; - AV_OPT_FLAG_FILTERING_PARAM = 1 shl 16; ///< a generic parameter which can be set by the user for filtering - -type - (** - * AVOption - *) - PAVOption = ^TAVOption; - TAVOption = record - name: {const} PAnsiChar; - - (** - * short English help text - * @todo What about other languages? - *) - help: {const} PAnsiChar; - - (** - * The offset relative to the context structure where the option - * value is stored. It should be 0 for named constants. - *) - offset: cint; - type_: TAVOptionType; - - (** - * the default value for scalar options - *) - default_val: record - case cint of - 0: (i64: cint64); - 1: (dbl: cdouble); - 2: (str: PAnsiChar); - (* TODO those are unused now *) - 3: (q: TAVRational); - end; - min: cdouble; ///< minimum valid value for the option - max: cdouble; ///< maximum valid value for the option - - flags: cint; -//FIXME think about enc-audio, ... style flags - - (** - * The logical unit to which the option belongs. Non-constant - * options and corresponding named constants share the same - * unit. May be NULL. - *) - unit_: {const} PAnsiChar; - end; - - (** - * A single allowed range of values, or a single allowed value. - *) - PAVOptionRange = ^TAVOptionRange; - PPAVOptionRange = ^PAVOptionRange; - TAVOptionRange = record - str: {const} PAnsiChar; - value_min, value_max: cdouble; ///< For string ranges this represents the min/max length, for dimensions this represents the min/max pixel count - component_min, component_max: cdouble; ///< For string this represents the unicode range for chars, 0-127 limits to ASCII - is_range: cint; ///< if set to 1 the struct encodes a range, if set to 0 a single value - end; - - (** - * List of AVOptionRange structs - *) - PAVOptionRanges = ^TAVOptionRanges; - PPAVOptionRanges = ^PAVOptionRanges; - TAVOptionRanges = record - range: PPAVOptionRange; - nb_ranges: cint; - end; - {$IFDEF FF_API_FIND_OPT} (** * Look for an option in obj. Look only for the options which @@ -326,9 +221,9 @@ function av_opt_set_dict(obj: pointer; var options: PAVDictionary): cint; * AVERROR(EINVAL) if no key is present * *) -av_opt_get_key_value(ropts: {const} PPAnsiChar; - key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar - flags: byte, +function av_opt_get_key_value(ropts: {const} PPAnsiChar; + key_val_sep: {const} PAnsiChar; pairs_sep: {const} PAnsiChar; + flags: byte; rkey, rval: PPAnsiChar): cint; cdecl; external av__util; @@ -354,11 +249,17 @@ const * @return 0 on success, a negative number on failure. *) function av_opt_eval_flags (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; flags_out: Pcint): cint; + cdecl; external av__util; function av_opt_eval_int (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int_out: Pcint): cint; + cdecl; external av__util; function av_opt_eval_int64 (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; int64_out: Pcint64): cint; + cdecl; external av__util; function av_opt_eval_float (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; float_out: Pcfloat): cint; + cdecl; external av__util; function av_opt_eval_double(obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; double_out: Pcdouble): cint; + cdecl; external av__util; function av_opt_eval_q (obj: pointer; o: {const} PAVOption; val: {const} PAnsiChar; q_out: PAVRational): cint; + cdecl; external av__util; (** * @} *) diff --git a/src/lib/ffmpeg-1.1/libavutil/pixfmt.pas b/src/lib/ffmpeg-1.1/libavutil/pixfmt.pas index a88a1a94..d14ad215 100644 --- a/src/lib/ffmpeg-1.1/libavutil/pixfmt.pas +++ b/src/lib/ffmpeg-1.1/libavutil/pixfmt.pas @@ -175,11 +175,11 @@ type AV_PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big-endian AV_PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little-endian - /** + (** * duplicated pixel formats for compatibility with libav. * FFmpeg supports these formats since May 8 2012 and Jan 28 2012 (commits f9ca1ac7 and 143a5c55) * Libav added them Oct 12 2012 with incompatible values (commit 6d5600e85) - */ + *) AV_PIX_FMT_YUVA422P_LIBAV, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples) AV_PIX_FMT_YUVA444P_LIBAV, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) |