From cdd6f059a65f28ff7a18ccf1194e9554adad1a1b Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 27 Sep 2014 16:47:09 +0200 Subject: avcodec, avutil: allow more control about how samples are skipped Add CODEC_FLAG2_SKIP_MANUAL (exposed as "skip_manual"), which makes the decoder export sample skip information via side data, instead of applying it automatically. The format of the side data is the same as AV_PKT_DATA_SKIP_SAMPLES, but since AVPacket and AVFrame side data constants overlap, AV_FRAME_DATA_SKIP_SAMPLES needs to be introduced. This is useful for applications which want to do the timestamp calculations manually, or which actually want to retrieve the padding. Signed-off-by: Michael Niedermayer --- libavutil/frame.h | 12 ++++++++++++ libavutil/version.h | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'libavutil') diff --git a/libavutil/frame.h b/libavutil/frame.h index ee24628ae8..d335bee831 100644 --- a/libavutil/frame.h +++ b/libavutil/frame.h @@ -94,6 +94,18 @@ enum AVFrameSideDataType { * libavutil/motion_vector.h. */ AV_FRAME_DATA_MOTION_VECTORS, + /** + * Recommmends skipping the specified number of samples. This is exported + * only if the "skip_manual" AVOption is set in libavcodec. + * This has the same format as AV_PKT_DATA_SKIP_SAMPLES. + * @code + * u32le number of samples to skip from start of this packet + * u32le number of samples to skip from end of this packet + * u8 reason for start skip + * u8 reason for end skip (0=padding silence, 1=convergence) + * @endcode + */ + AV_FRAME_DATA_SKIP_SAMPLES, }; enum AVActiveFormatDescription { diff --git a/libavutil/version.h b/libavutil/version.h index 9e138b5fab..f73f33441c 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -56,7 +56,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 54 -#define LIBAVUTIL_VERSION_MINOR 8 +#define LIBAVUTIL_VERSION_MINOR 9 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ -- cgit v1.2.3