aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ffmpeg-2.6/avcodec.pas
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ffmpeg-2.6/avcodec.pas')
-rw-r--r--src/lib/ffmpeg-2.6/avcodec.pas129
1 files changed, 103 insertions, 26 deletions
diff --git a/src/lib/ffmpeg-2.6/avcodec.pas b/src/lib/ffmpeg-2.6/avcodec.pas
index a1e4aa02..18bb091a 100644
--- a/src/lib/ffmpeg-2.6/avcodec.pas
+++ b/src/lib/ffmpeg-2.6/avcodec.pas
@@ -338,6 +338,7 @@ type
AV_CODEC_ID_SGIRLE_DEPRECATED,
AV_CODEC_ID_MVC1_DEPRECATED,
AV_CODEC_ID_MVC2_DEPRECATED,
+ AV_CODEC_ID_HQX,
(** see below. they need to be hard coded.
AV_CODEC_ID_BRENDER_PIX= MKBETAG('B','P','I','X'),
@@ -440,7 +441,9 @@ type
AV_CODEC_ID_ADPCM_VIMA_DEPRECATED,
(** see below. they need to be hard coded.
AV_CODEC_ID_ADPCM_VIMA = MKBETAG('V','I','M','A'),
+{$IFDEF FF_API_VIMA_DECODER}
AV_CODEC_ID_VIMA = MKBETAG('V','I','M','A'),
+{$IFEND}
AV_CODEC_ID_ADPCM_AFC = MKBETAG('A','F','C',' '),
AV_CODEC_ID_ADPCM_IMA_OKI = MKBETAG('O','K','I',' '),
AV_CODEC_ID_ADPCM_DTK = MKBETAG('D','T','K',' '),
@@ -531,6 +534,7 @@ type
AV_CODEC_ID_TAK_DEPRECATED,
AV_CODEC_ID_PAF_AUDIO_DEPRECATED,
AV_CODEC_ID_ON2AVC,
+ AV_CODEC_ID_DSS_SP,
(** see below. they need to be hard coded.
AV_CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'),
AV_CODEC_ID_SONIC = MKBETAG('S','O','N','C'),
@@ -1451,6 +1455,12 @@ type
AV_PKT_DATA_STEREO3D,
(**
+ * This side data should be associated with an audio stream and corresponds
+ * to enum AVAudioServiceType.
+ *)
+ AV_PKT_DATA_AUDIO_SERVICE_TYPE,
+
+ (**
* Recommmends skipping the specified number of samples
* @code
* u32le number of samples to skip from start of this packet
@@ -2171,13 +2181,13 @@ type
*)
codec_tag: cuint;
+{$IFDEF FF_API_STREAM_CODEC_TAG}
(**
- * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
- * This is used to work around some encoder bugs.
- * - encoding: unused
- * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
+ * @deprecated this field is unused
*)
+ {attribute_deprecated}
stream_codec_tag: cuint;
+{$IFEND}
priv_data: pointer;
@@ -3662,6 +3672,13 @@ type
framerate: TAVRational;
(**
+ * Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx.
+ * - encoding: unused.
+ * - decoding: Set by libavcodec before calling get_format()
+ *)
+ sw_pix_fmt: TAVPixelFormat;
+
+ (**
* Timebase in which pkt_dts/pts and AVPacket.dts/pts are.
* Code outside libavcodec should access this field using:
* av_codec_{get,set}_pkt_timebase(avctx)
@@ -3829,7 +3846,7 @@ type
(**
* data+linesize for the bitmap of this subtitle.
- * can be set for text/ass as well once they where rendered
+ * can be set for text/ass as well once they are rendered
*)
pict: TAVPicture;
type_: TAVSubtitleType;
@@ -4107,6 +4124,12 @@ const
*)
AV_HWACCEL_FLAG_IGNORE_LEVEL = (1 << 0);
+ (**
+ * Hardware acceleration can output YUV pixel formats with a different chroma
+ * sampling than 4:2:0 and/or other than 8 bits per component.
+ *)
+ AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH = (1 << 1);
+
FF_SUB_CHARENC_MODE_DO_NOTHING = -1; ///< do nothing (demuxer outputs a stream supposed to be already in UTF-8, or the codec is bitmap for instance)
FF_SUB_CHARENC_MODE_AUTOMATIC = 0; ///< libavcodec will select the mode itself
FF_SUB_CHARENC_MODE_PRE_DECODER = 1; ///< the AVPacket data needs to be recoded to UTF-8 before being fed to the decoder, requires iconv
@@ -4315,6 +4338,9 @@ procedure avcodec_free_frame(frame: PPAVFrame);
*
* @warning This function is not thread safe!
*
+ * @note Always call this function before using decoding routines (such as
+ * @ref avcodec_decode_video2()).
+ *
* @code
* avcodec_register_all();
* av_dict_set(&opts, "b", "2.5M", 0);
@@ -4756,18 +4782,27 @@ function avcodec_decode_audio3(avctx: PAVCodecContext; samples: PSmallint;
* Decode the audio frame of size avpkt->size from avpkt->data into frame.
*
* Some decoders may support multiple frames in a single AVPacket. Such
- * decoders would then just decode the first frame. In this case,
- * avcodec_decode_audio4 has to be called again with an AVPacket containing
- * the remaining data in order to decode the second frame, etc...
- * Even if no frames are returned, the packet needs to be fed to the decoder
- * with remaining data until it is completely consumed or an error occurs.
+ * decoders would then just decode the first frame and the return value would be
+ * less than the packet size. In this case, avcodec_decode_audio4 has to be
+ * called again with an AVPacket containing the remaining data in order to
+ * decode the second frame, etc... Even if no frames are returned, the packet
+ * needs to be fed to the decoder with remaining data until it is completely
+ * consumed or an error occurs.
+ *
+ * Some decoders (those marked with CODEC_CAP_DELAY) have a delay between input
+ * and output. This means that for some packets they will not immediately
+ * produce decoded output and need to be flushed at the end of decoding to get
+ * all the decoded data. Flushing is done by calling this function with packets
+ * with avpkt->data set to NULL and avpkt->size set to 0 until it stops
+ * returning samples. It is safe to flush even those decoders that are not
+ * marked with CODEC_CAP_DELAY, then no samples will be returned.
*
* @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE
* larger than the actual read bytes because some optimized bitstream
* readers read 32 or 64 bits at once and could read over the end.
*
- * @note You might have to align the input buffer. The alignment requirements
- * depend on the CPU and the decoder.
+ * @note The AVCodecContext MUST have been opened with @ref avcodec_open2()
+ * before packets may be fed to the decoder.
*
* @param avctx the codec context
* @param[out] frame The AVFrame in which to store decoded audio samples.
@@ -4780,10 +4815,13 @@ function avcodec_decode_audio3(avctx: PAVCodecContext; samples: PSmallint;
* to the frame if av_frame_is_writable() returns 1.
* When AVCodecContext.refcounted_frames is set to 0, the returned
* reference belongs to the decoder and is valid only until the
- * next call to this function or until closing the decoder.
- * The caller may not write to it.
+ * next call to this function or until closing or flushing the
+ * decoder. The caller may not write to it.
* @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is
- * non-zero.
+ * non-zero. Note that this field being set to zero
+ * does not mean that an error has occurred. For
+ * decoders with CODEC_CAP_DELAY set, no given decode
+ * call is guaranteed to produce a frame.
* @param[in] avpkt The input AVPacket containing the input buffer.
* At least avpkt->data and avpkt->size should be set. Some
* decoders might also require additional fields to be set.
@@ -4807,17 +4845,13 @@ function avcodec_decode_audio4(avctx: PAVCodecContext; frame: PAVFrame;
* @warning The end of the input buffer buf should be set to 0 to ensure that
* no overreading happens for damaged MPEG streams.
*
- * @note You might have to align the input buffer avpkt->data.
- * The alignment requirements depend on the CPU: on some CPUs it isn't
- * necessary at all, on others it won't work at all if not aligned and on others
- * it will work but it will have an impact on performance.
- *
- * In practice, avpkt->data should have 4 byte alignment at minimum.
- *
* @note Codecs which have the CODEC_CAP_DELAY capability set have a delay
* between input and output, these need to be fed with avpkt->data=NULL,
* avpkt->size=0 at the end to return the remaining frames.
*
+ * @note The AVCodecContext MUST have been opened with @ref avcodec_open2()
+ * before packets may be fed to the decoder.
+ *
* @param avctx the codec context
* @param[out] picture The AVFrame in which the decoded video frame will be stored.
* Use av_frame_alloc() to get an AVFrame. The codec will
@@ -4830,10 +4864,10 @@ function avcodec_decode_audio4(avctx: PAVCodecContext; frame: PAVFrame;
* to the frame if av_frame_is_writable() returns 1.
* When AVCodecContext.refcounted_frames is set to 0, the returned
* reference belongs to the decoder and is valid only until the
- * next call to this function or until closing the decoder. The
- * caller may not write to it.
+ * next call to this function or until closing or flushing the
+ * decoder. The caller may not write to it.
*
- * @param[in] avpkt The input AVpacket containing the input buffer.
+ * @param[in] avpkt The input AVPacket containing the input buffer.
* You can create such packet with av_init_packet() and by then setting
* data and size, some decoders might in addition need other fields like
* flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least
@@ -4847,7 +4881,8 @@ function avcodec_decode_video2(avctx: PAVCodecContext; picture: PAVFrame;
avpkt: {const} PAVPacket): cint;
cdecl; external av__codec;
-(* Decode a subtitle message.
+(*
+ * Decode a subtitle message.
* Return a negative value on error, otherwise return the number of bytes used.
* If no subtitle could be decompressed, got_sub_ptr is zero.
* Otherwise, the subtitle is stored in *sub.
@@ -4856,6 +4891,17 @@ function avcodec_decode_video2(avctx: PAVCodecContext; picture: PAVFrame;
* and reusing a get_buffer written for video codecs would probably perform badly
* due to a potentially very different allocation pattern.
*
+ * Some decoders (those marked with CODEC_CAP_DELAY) have a delay between input
+ * and output. This means that for some packets they will not immediately
+ * produce decoded output and need to be flushed at the end of decoding to get
+ * all the decoded data. Flushing is done by calling this function with packets
+ * with avpkt->data set to NULL and avpkt->size set to 0 until it stops
+ * returning subtitles. It is safe to flush even those decoders that are not
+ * marked with CODEC_CAP_DELAY, then no subtitles will be returned.
+ *
+ * @note The AVCodecContext MUST have been opened with @ref avcodec_open2()
+ * before packets may be fed to the decoder.
+ *
* @param avctx the codec context
* @param[out] sub The Preallocated AVSubtitle in which the decoded subtitle will be stored,
* must be freed with avsubtitle_free if *got_sub_ptr is set.
@@ -5032,12 +5078,43 @@ type
*)
picture_structure: TAVPictureStructure;
+ (**
+ * Picture number incremented in presentation or output order.
+ * This field may be reinitialized at the first picture of a new sequence.
+ *
+ * For example, this corresponds to H.264 PicOrderCnt.
+ *)
+ output_picture_number: cint;
+
+ (**
+ * Dimensions of the decoded video intended for presentation.
+ *)
+ width: cint;
+ height: cint;
+
+ (**
+ * Dimensions of the coded video.
+ *)
+ coded_width: cint;
+ coded_height: cint;
+
+ (**
+ * The format of the coded data, corresponds to enum AVPixelFormat for video
+ * and for enum AVSampleFormat for audio.
+ *
+ * Note that a decoder can have considerable freedom in how exactly it
+ * decodes the data, so the format reported here might be different from the
+ * one returned by a decoder.
+ *)
+ format: cint;
end; {AVCodecParserContext}
TAVCodecParser = record
codec_ids: array [0..4] of cint; (* several codec IDs are permitted *)
priv_data_size: cint;
parser_init: function(s: PAVCodecParserContext): cint; cdecl;
+ (* This callback never returns an error, a negative value means that
+ * the frame start was in a previous packet. *)
parser_parse: function(s: PAVCodecParserContext;
avctx: PAVCodecContext;
poutbuf: {const} PPointer; poutbuf_size: PCint;