mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-24 14:20:19 +01:00
Bug #176 - Support newer versions of FFmpeg.
Also includes Benjamin's ffmpeg-configure-v2.patch.
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
#define AVCODEC_AVCODEC_H
|
||||
|
||||
/**
|
||||
* @file libavcodec/avcodec.h
|
||||
* @file
|
||||
* external API header
|
||||
*/
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
#include "libavutil/avutil.h"
|
||||
|
||||
#define LIBAVCODEC_VERSION_MAJOR 52
|
||||
#define LIBAVCODEC_VERSION_MINOR 32
|
||||
#define LIBAVCODEC_VERSION_MICRO 0
|
||||
#define LIBAVCODEC_VERSION_MINOR 72
|
||||
#define LIBAVCODEC_VERSION_MICRO 2
|
||||
|
||||
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
||||
LIBAVCODEC_VERSION_MINOR, \
|
||||
@@ -125,7 +125,9 @@ enum CodecID {
|
||||
CODEC_ID_QDRAW,
|
||||
CODEC_ID_VIXL,
|
||||
CODEC_ID_QPEG,
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
CODEC_ID_XVID,
|
||||
#endif
|
||||
CODEC_ID_PNG,
|
||||
CODEC_ID_PPM,
|
||||
CODEC_ID_PBM,
|
||||
@@ -198,6 +200,17 @@ enum CodecID {
|
||||
CODEC_ID_V210,
|
||||
CODEC_ID_DPX,
|
||||
CODEC_ID_MAD,
|
||||
CODEC_ID_FRWU,
|
||||
CODEC_ID_FLASHSV2,
|
||||
CODEC_ID_CDGRAPHICS,
|
||||
CODEC_ID_R210,
|
||||
CODEC_ID_ANM,
|
||||
CODEC_ID_BINKVIDEO,
|
||||
CODEC_ID_IFF_ILBM,
|
||||
CODEC_ID_IFF_BYTERUN1,
|
||||
CODEC_ID_KGV1,
|
||||
CODEC_ID_YOP,
|
||||
CODEC_ID_VP8,
|
||||
|
||||
/* various PCM "codecs" */
|
||||
CODEC_ID_PCM_S16LE= 0x10000,
|
||||
@@ -224,6 +237,7 @@ enum CodecID {
|
||||
CODEC_ID_PCM_F32LE,
|
||||
CODEC_ID_PCM_F64BE,
|
||||
CODEC_ID_PCM_F64LE,
|
||||
CODEC_ID_PCM_BLURAY,
|
||||
|
||||
/* various ADPCM codecs */
|
||||
CODEC_ID_ADPCM_IMA_QT= 0x11000,
|
||||
@@ -319,6 +333,9 @@ enum CodecID {
|
||||
CODEC_ID_TWINVQ,
|
||||
CODEC_ID_TRUEHD,
|
||||
CODEC_ID_MP4ALS,
|
||||
CODEC_ID_ATRAC1,
|
||||
CODEC_ID_BINKAUDIO_RDFT,
|
||||
CODEC_ID_BINKAUDIO_DCT,
|
||||
|
||||
/* subtitle codecs */
|
||||
CODEC_ID_DVD_SUBTITLE= 0x17000,
|
||||
@@ -327,6 +344,8 @@ enum CodecID {
|
||||
CODEC_ID_XSUB,
|
||||
CODEC_ID_SSA,
|
||||
CODEC_ID_MOV_TEXT,
|
||||
CODEC_ID_HDMV_PGS_SUBTITLE,
|
||||
CODEC_ID_DVB_TELETEXT,
|
||||
|
||||
/* other specific kind of codecs (generally used for attachments) */
|
||||
CODEC_ID_TTF= 0x18000,
|
||||
@@ -337,15 +356,17 @@ enum CodecID {
|
||||
* stream (only used by libavformat) */
|
||||
};
|
||||
|
||||
enum CodecType {
|
||||
CODEC_TYPE_UNKNOWN = -1,
|
||||
CODEC_TYPE_VIDEO,
|
||||
CODEC_TYPE_AUDIO,
|
||||
CODEC_TYPE_DATA,
|
||||
CODEC_TYPE_SUBTITLE,
|
||||
CODEC_TYPE_ATTACHMENT,
|
||||
CODEC_TYPE_NB
|
||||
};
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
#define CodecType AVMediaType
|
||||
|
||||
#define CODEC_TYPE_UNKNOWN AVMEDIA_TYPE_UNKNOWN
|
||||
#define CODEC_TYPE_VIDEO AVMEDIA_TYPE_VIDEO
|
||||
#define CODEC_TYPE_AUDIO AVMEDIA_TYPE_AUDIO
|
||||
#define CODEC_TYPE_DATA AVMEDIA_TYPE_DATA
|
||||
#define CODEC_TYPE_SUBTITLE AVMEDIA_TYPE_SUBTITLE
|
||||
#define CODEC_TYPE_ATTACHMENT AVMEDIA_TYPE_ATTACHMENT
|
||||
#define CODEC_TYPE_NB AVMEDIA_TYPE_NB
|
||||
#endif
|
||||
|
||||
/**
|
||||
* all in native-endian format
|
||||
@@ -382,6 +403,11 @@ enum SampleFormat {
|
||||
#define CH_STEREO_LEFT 0x20000000 ///< Stereo downmix.
|
||||
#define CH_STEREO_RIGHT 0x40000000 ///< See CH_STEREO_LEFT.
|
||||
|
||||
/** Channel mask value used for AVCodecContext.request_channel_layout
|
||||
to indicate that the user requests the channel order of the decoder output
|
||||
to be the native codec channel order. */
|
||||
#define CH_LAYOUT_NATIVE 0x8000000000000000LL
|
||||
|
||||
/* Audio channel convenience macros */
|
||||
#define CH_LAYOUT_MONO (CH_FRONT_CENTER)
|
||||
#define CH_LAYOUT_STEREO (CH_FRONT_LEFT|CH_FRONT_RIGHT)
|
||||
@@ -394,6 +420,7 @@ enum SampleFormat {
|
||||
#define CH_LAYOUT_5POINT1 (CH_LAYOUT_5POINT0|CH_LOW_FREQUENCY)
|
||||
#define CH_LAYOUT_5POINT0_BACK (CH_LAYOUT_SURROUND|CH_BACK_LEFT|CH_BACK_RIGHT)
|
||||
#define CH_LAYOUT_5POINT1_BACK (CH_LAYOUT_5POINT0_BACK|CH_LOW_FREQUENCY)
|
||||
#define CH_LAYOUT_7POINT0 (CH_LAYOUT_5POINT0|CH_BACK_LEFT|CH_BACK_RIGHT)
|
||||
#define CH_LAYOUT_7POINT1 (CH_LAYOUT_5POINT1|CH_BACK_LEFT|CH_BACK_RIGHT)
|
||||
#define CH_LAYOUT_7POINT1_WIDE (CH_LAYOUT_5POINT1_BACK|\
|
||||
CH_FRONT_LEFT_OF_CENTER|CH_FRONT_RIGHT_OF_CENTER)
|
||||
@@ -568,6 +595,9 @@ typedef struct RcOverride{
|
||||
#define CODEC_FLAG2_CHUNKS 0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
|
||||
#define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000 ///< Use MPEG-2 nonlinear quantizer.
|
||||
#define CODEC_FLAG2_BIT_RESERVOIR 0x00020000 ///< Use a bit reservoir when encoding if possible
|
||||
#define CODEC_FLAG2_MBTREE 0x00040000 ///< Use macroblock tree ratecontrol (x264 only)
|
||||
#define CODEC_FLAG2_PSY 0x00080000 ///< Use psycho visual optimizations.
|
||||
#define CODEC_FLAG2_SSIM 0x00100000 ///< Compute SSIM during encoding, error[] values are undefined.
|
||||
|
||||
/* Unsupported options :
|
||||
* Syntax Arithmetic coding (SAC)
|
||||
@@ -578,8 +608,9 @@ typedef struct RcOverride{
|
||||
|
||||
#define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 ///< Decoder can use draw_horiz_band callback.
|
||||
/**
|
||||
* Codec uses get_buffer() for allocating buffers.
|
||||
* direct rendering method 1
|
||||
* Codec uses get_buffer() for allocating buffers and supports custom allocators.
|
||||
* If not set, it might not use get_buffer() at all or use operations that
|
||||
* assume the buffer was allocated by avcodec_default_get_buffer.
|
||||
*/
|
||||
#define CODEC_CAP_DR1 0x0002
|
||||
/* If 'parse_only' field is true, then avcodec_parse_frame() can be used. */
|
||||
@@ -601,6 +632,23 @@ typedef struct RcOverride{
|
||||
* Codec can export data for HW decoding (VDPAU).
|
||||
*/
|
||||
#define CODEC_CAP_HWACCEL_VDPAU 0x0080
|
||||
/**
|
||||
* Codec can output multiple frames per AVPacket
|
||||
* Normally demuxers return one frame at a time, demuxers which do not do
|
||||
* are connected to a parser to split what they return into proper frames.
|
||||
* This flag is reserved to the very rare category of codecs which have a
|
||||
* bitstream that cannot be split into frames without timeconsuming
|
||||
* operations like full decoding. Demuxers carring such bitstreams thus
|
||||
* may return multiple frames in a packet. This has many disadvantages like
|
||||
* prohibiting stream copy in many cases thus it should only be considered
|
||||
* as a last resort.
|
||||
*/
|
||||
#define CODEC_CAP_SUBFRAMES 0x0100
|
||||
/**
|
||||
* Codec is experimental and is thus avoided in favor of non experimental
|
||||
* encoders
|
||||
*/
|
||||
#define CODEC_CAP_EXPERIMENTAL 0x0200
|
||||
|
||||
//The following defines may change, don't expect compatibility if you use them.
|
||||
#define MB_TYPE_INTRA4x4 0x0001
|
||||
@@ -860,7 +908,8 @@ typedef struct AVPanScan{
|
||||
short *dct_coeff;\
|
||||
\
|
||||
/**\
|
||||
* motion referece frame index\
|
||||
* motion reference frame index\
|
||||
* the order in which these are stored can depend on the codec.\
|
||||
* - encoding: Set by user.\
|
||||
* - decoding: Set by libavcodec.\
|
||||
*/\
|
||||
@@ -885,6 +934,7 @@ typedef struct AVPanScan{
|
||||
#define FF_QSCALE_TYPE_MPEG1 0
|
||||
#define FF_QSCALE_TYPE_MPEG2 1
|
||||
#define FF_QSCALE_TYPE_H264 2
|
||||
#define FF_QSCALE_TYPE_VP56 3
|
||||
|
||||
#define FF_BUFFER_TYPE_INTERNAL 1
|
||||
#define FF_BUFFER_TYPE_USER 2 ///< direct rendering buffers (image is (de)allocated by user)
|
||||
@@ -1235,7 +1285,7 @@ typedef struct AVCodecContext {
|
||||
void *opaque;
|
||||
|
||||
char codec_name[32];
|
||||
enum CodecType codec_type; /* see CODEC_TYPE_xxx */
|
||||
enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */
|
||||
enum CodecID codec_id; /* see CODEC_ID_xxx */
|
||||
|
||||
/**
|
||||
@@ -1274,6 +1324,7 @@ typedef struct AVCodecContext {
|
||||
#define FF_BUG_HPEL_CHROMA 2048
|
||||
#define FF_BUG_DC_CLIP 4096
|
||||
#define FF_BUG_MS 8192 ///< Work around various bugs in Microsoft's broken decoders.
|
||||
#define FF_BUG_TRUNCATED 16384
|
||||
//#define FF_BUG_FAKE_SCALABILITY 16 //Autodetection should work 100%.
|
||||
|
||||
/**
|
||||
@@ -1331,7 +1382,7 @@ typedef struct AVCodecContext {
|
||||
/**
|
||||
* Called at the beginning of each frame to get a buffer for it.
|
||||
* If pic.reference is set then the frame will be read later by libavcodec.
|
||||
* avcodec_align_dimensions() should be used to find the required width and
|
||||
* avcodec_align_dimensions2() should be used to find the required width and
|
||||
* height, as they normally need to be rounded up to the next multiple of 16.
|
||||
* if CODEC_CAP_DR1 is not set then get_buffer() must call
|
||||
* avcodec_default_get_buffer() instead of providing buffers allocated by
|
||||
@@ -1540,6 +1591,7 @@ typedef struct AVCodecContext {
|
||||
#define FF_IDCT_EA 21
|
||||
#define FF_IDCT_SIMPLENEON 22
|
||||
#define FF_IDCT_SIMPLEALPHA 23
|
||||
#define FF_IDCT_BINK 24
|
||||
|
||||
/**
|
||||
* slice count
|
||||
@@ -2095,11 +2147,21 @@ typedef struct AVCodecContext {
|
||||
*/
|
||||
int profile;
|
||||
#define FF_PROFILE_UNKNOWN -99
|
||||
|
||||
#define FF_PROFILE_AAC_MAIN 0
|
||||
#define FF_PROFILE_AAC_LOW 1
|
||||
#define FF_PROFILE_AAC_SSR 2
|
||||
#define FF_PROFILE_AAC_LTP 3
|
||||
|
||||
#define FF_PROFILE_H264_BASELINE 66
|
||||
#define FF_PROFILE_H264_MAIN 77
|
||||
#define FF_PROFILE_H264_EXTENDED 88
|
||||
#define FF_PROFILE_H264_HIGH 100
|
||||
#define FF_PROFILE_H264_HIGH_10 110
|
||||
#define FF_PROFILE_H264_HIGH_422 122
|
||||
#define FF_PROFILE_H264_HIGH_444 244
|
||||
#define FF_PROFILE_H264_CAVLC_444 44
|
||||
|
||||
/**
|
||||
* level
|
||||
* - encoding: Set by user.
|
||||
@@ -2517,7 +2579,79 @@ typedef struct AVCodecContext {
|
||||
* - encoding: Set by user
|
||||
* - decoding: Set by libavcodec
|
||||
*/
|
||||
enum AVChromaLocation chroma_sample_location;
|
||||
enum AVChromaLocation chroma_sample_location;
|
||||
|
||||
/**
|
||||
* The codec may call this to execute several independent things.
|
||||
* It will return only after finishing all tasks.
|
||||
* The user may replace this with some multithreaded implementation,
|
||||
* the default implementation will execute the parts serially.
|
||||
* Also see avcodec_thread_init and e.g. the --enable-pthread configure option.
|
||||
* @param c context passed also to func
|
||||
* @param count the number of things to execute
|
||||
* @param arg2 argument passed unchanged to func
|
||||
* @param ret return values of executed functions, must have space for "count" values. May be NULL.
|
||||
* @param func function that will be called count times, with jobnr from 0 to count-1.
|
||||
* threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no
|
||||
* two instances of func executing at the same time will have the same threadnr.
|
||||
* @return always 0 currently, but code should handle a future improvement where when any call to func
|
||||
* returns < 0 no further calls to func may be done and < 0 is returned.
|
||||
* - encoding: Set by libavcodec, user can override.
|
||||
* - decoding: Set by libavcodec, user can override.
|
||||
*/
|
||||
int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count);
|
||||
|
||||
/**
|
||||
* explicit P-frame weighted prediction analysis method
|
||||
* 0: off
|
||||
* 1: fast blind weighting (one reference duplicate with -1 offset)
|
||||
* 2: smart weighting (full fade detection analysis)
|
||||
* - encoding: Set by user.
|
||||
* - decoding: unused
|
||||
*/
|
||||
int weighted_p_pred;
|
||||
|
||||
/**
|
||||
* AQ mode
|
||||
* 0: Disabled
|
||||
* 1: Variance AQ (complexity mask)
|
||||
* 2: Auto-variance AQ (experimental)
|
||||
* - encoding: Set by user
|
||||
* - decoding: unused
|
||||
*/
|
||||
int aq_mode;
|
||||
|
||||
/**
|
||||
* AQ strength
|
||||
* Reduces blocking and blurring in flat and textured areas.
|
||||
* - encoding: Set by user
|
||||
* - decoding: unused
|
||||
*/
|
||||
float aq_strength;
|
||||
|
||||
/**
|
||||
* PSY RD
|
||||
* Strength of psychovisual optimization
|
||||
* - encoding: Set by user
|
||||
* - decoding: unused
|
||||
*/
|
||||
float psy_rd;
|
||||
|
||||
/**
|
||||
* PSY trellis
|
||||
* Strength of psychovisual optimization
|
||||
* - encoding: Set by user
|
||||
* - decoding: unused
|
||||
*/
|
||||
float psy_trellis;
|
||||
|
||||
/**
|
||||
* RC lookahead
|
||||
* Number of frames for frametype and ratecontrol lookahead
|
||||
* - encoding: Set by user
|
||||
* - decoding: unused
|
||||
*/
|
||||
int rc_lookahead;
|
||||
} AVCodecContext;
|
||||
|
||||
/**
|
||||
@@ -2531,7 +2665,7 @@ typedef struct AVCodec {
|
||||
* This is the primary way to find a codec from the user perspective.
|
||||
*/
|
||||
const char *name;
|
||||
enum CodecType type;
|
||||
enum AVMediaType type;
|
||||
enum CodecID id;
|
||||
int priv_data_size;
|
||||
int (*init)(AVCodecContext *);
|
||||
@@ -2575,9 +2709,9 @@ typedef struct AVHWAccel {
|
||||
/**
|
||||
* Type of codec implemented by the hardware accelerator.
|
||||
*
|
||||
* See CODEC_TYPE_xxx
|
||||
* See AVMEDIA_TYPE_xxx
|
||||
*/
|
||||
enum CodecType type;
|
||||
enum AVMediaType type;
|
||||
|
||||
/**
|
||||
* Codec implemented by the hardware accelerator.
|
||||
@@ -2923,6 +3057,7 @@ void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *
|
||||
const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt);
|
||||
void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
|
||||
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
||||
/**
|
||||
* Returns the pixel format corresponding to the name name.
|
||||
*
|
||||
@@ -2933,9 +3068,18 @@ void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
|
||||
* then for "gray16le".
|
||||
*
|
||||
* Finally if no pixel format has been found, returns PIX_FMT_NONE.
|
||||
*
|
||||
* @deprecated Deprecated in favor of av_get_pix_fmt().
|
||||
*/
|
||||
enum PixelFormat avcodec_get_pix_fmt(const char* name);
|
||||
unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat p);
|
||||
attribute_deprecated enum PixelFormat avcodec_get_pix_fmt(const char* name);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Returns a value representing the fourCC code associated to the
|
||||
* pixel format pix_fmt, or 0 if no associated fourCC code can be
|
||||
* found.
|
||||
*/
|
||||
unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat pix_fmt);
|
||||
|
||||
#define FF_LOSS_RESOLUTION 0x0001 /**< loss due to resolution change */
|
||||
#define FF_LOSS_DEPTH 0x0002 /**< loss due to color depth change */
|
||||
@@ -3031,6 +3175,16 @@ AVCodec *av_codec_next(AVCodec *c);
|
||||
*/
|
||||
unsigned avcodec_version(void);
|
||||
|
||||
/**
|
||||
* Returns the libavcodec build-time configuration.
|
||||
*/
|
||||
const char *avcodec_configuration(void);
|
||||
|
||||
/**
|
||||
* Returns the libavcodec license.
|
||||
*/
|
||||
const char *avcodec_license(void);
|
||||
|
||||
/**
|
||||
* Initializes libavcodec.
|
||||
*
|
||||
@@ -3095,7 +3249,7 @@ void avcodec_get_context_defaults(AVCodecContext *s);
|
||||
|
||||
/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
|
||||
* we WILL change its arguments and name a few times! */
|
||||
void avcodec_get_context_defaults2(AVCodecContext *s, enum CodecType);
|
||||
void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType);
|
||||
|
||||
/**
|
||||
* Allocates an AVCodecContext and sets its fields to default values. The
|
||||
@@ -3108,7 +3262,20 @@ AVCodecContext *avcodec_alloc_context(void);
|
||||
|
||||
/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
|
||||
* we WILL change its arguments and name a few times! */
|
||||
AVCodecContext *avcodec_alloc_context2(enum CodecType);
|
||||
AVCodecContext *avcodec_alloc_context2(enum AVMediaType);
|
||||
|
||||
/**
|
||||
* Copy the settings of the source AVCodecContext into the destination
|
||||
* AVCodecContext. The resulting destination codec context will be
|
||||
* unopened, i.e. you are required to call avcodec_open() before you
|
||||
* can use this AVCodecContext to decode/encode video/audio data.
|
||||
*
|
||||
* @param dest target codec context, should be initialized with
|
||||
* avcodec_alloc_context(), but otherwise uninitialized
|
||||
* @param src source codec context
|
||||
* @return AVERROR() on error (e.g. memory allocation error), 0 on success
|
||||
*/
|
||||
int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
|
||||
|
||||
/**
|
||||
* Sets the fields of the given AVFrame to default values.
|
||||
@@ -3129,7 +3296,36 @@ AVFrame *avcodec_alloc_frame(void);
|
||||
int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
|
||||
void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
|
||||
int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic);
|
||||
|
||||
/**
|
||||
* Returns the amount of padding in pixels which the get_buffer callback must
|
||||
* provide around the edge of the image for codecs which do not have the
|
||||
* CODEC_FLAG_EMU_EDGE flag.
|
||||
*
|
||||
* @return Required padding in pixels.
|
||||
*/
|
||||
unsigned avcodec_get_edge_width(void);
|
||||
/**
|
||||
* Modifies width and height values so that they will result in a memory
|
||||
* buffer that is acceptable for the codec if you do not use any horizontal
|
||||
* padding.
|
||||
*
|
||||
* May only be used if a codec with CODEC_CAP_DR1 has been opened.
|
||||
* If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased
|
||||
* according to avcodec_get_edge_width() before.
|
||||
*/
|
||||
void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
|
||||
/**
|
||||
* Modifies width and height values so that they will result in a memory
|
||||
* buffer that is acceptable for the codec if you also ensure that all
|
||||
* line sizes are a multiple of the respective linesize_align[i].
|
||||
*
|
||||
* May only be used if a codec with CODEC_CAP_DR1 has been opened.
|
||||
* If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased
|
||||
* according to avcodec_get_edge_width() before.
|
||||
*/
|
||||
void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
|
||||
int linesize_align[4]);
|
||||
|
||||
/**
|
||||
* Checks if the given dimension of a picture is valid, meaning that all
|
||||
@@ -3144,8 +3340,8 @@ enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum
|
||||
|
||||
int avcodec_thread_init(AVCodecContext *s, int thread_count);
|
||||
void avcodec_thread_free(AVCodecContext *s);
|
||||
int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
|
||||
int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
|
||||
int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
|
||||
//FIXME func typedef
|
||||
|
||||
/**
|
||||
@@ -3199,9 +3395,11 @@ attribute_deprecated int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *s
|
||||
/**
|
||||
* Decodes the audio frame of size avpkt->size from avpkt->data into samples.
|
||||
* Some decoders may support multiple frames in a single AVPacket, such
|
||||
* decoders would then just decode the first frame.
|
||||
* decoders would then just decode the first frame. In this case,
|
||||
* avcodec_decode_audio3 has to be called again with an AVPacket that contains
|
||||
* the remaining data in order to decode the second frame etc.
|
||||
* If no frame
|
||||
* could be decompressed, frame_size_ptr is zero. Otherwise, it is the
|
||||
* could be outputted, frame_size_ptr is zero. Otherwise, it is the
|
||||
* decompressed frame size in bytes.
|
||||
*
|
||||
* @warning You must set frame_size_ptr to the allocated size of the
|
||||
@@ -3231,7 +3429,7 @@ attribute_deprecated int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *s
|
||||
* data and size, some decoders might in addition need other fields.
|
||||
* All decoders are designed to use the least fields possible though.
|
||||
* @return On error a negative value is returned, otherwise the number of bytes
|
||||
* used or zero if no frame could be decompressed.
|
||||
* used or zero if no frame data was decompressed (used) from the input AVPacket.
|
||||
*/
|
||||
int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
|
||||
int *frame_size_ptr,
|
||||
@@ -3276,14 +3474,16 @@ attribute_deprecated int avcodec_decode_video(AVCodecContext *avctx, AVFrame *pi
|
||||
* In practice, avpkt->data should have 4 byte alignment at minimum.
|
||||
*
|
||||
* @note Some codecs have a delay between input and output, these need to be
|
||||
* feeded with avpkt->data=NULL, avpkt->size=0 at the end to return the remaining frames.
|
||||
* fed with avpkt->data=NULL, avpkt->size=0 at the end to return the remaining frames.
|
||||
*
|
||||
* @param avctx the codec context
|
||||
* @param[out] picture The AVFrame in which the decoded video frame will be stored.
|
||||
* Use avcodec_alloc_frame to get an AVFrame, the codec will
|
||||
* allocate memory for the actual bitmap.
|
||||
* @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&PKT_FLAG_KEY. All decoders are designed to use the least
|
||||
* flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least
|
||||
* fields possible.
|
||||
* @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero.
|
||||
* @return On error a negative value is returned, otherwise the number of bytes
|
||||
@@ -3670,6 +3870,13 @@ int av_picture_crop(AVPicture *dst, const AVPicture *src,
|
||||
int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum PixelFormat pix_fmt,
|
||||
int padtop, int padbottom, int padleft, int padright, int *color);
|
||||
|
||||
/**
|
||||
* Encodes extradata length to a buffer. Used by xiph codecs.
|
||||
*
|
||||
* @param s buffer to write to; must be at least (v/255+1) bytes long
|
||||
* @param v size of extradata in bytes
|
||||
* @return number of bytes written to the buffer.
|
||||
*/
|
||||
unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
|
||||
|
||||
/**
|
||||
@@ -3696,26 +3903,6 @@ int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str);
|
||||
*/
|
||||
int av_parse_video_frame_rate(AVRational *frame_rate, const char *str);
|
||||
|
||||
/* error handling */
|
||||
#if EINVAL > 0
|
||||
#define AVERROR(e) (-(e)) /**< Returns a negative error code from a POSIX error code, to return from library functions. */
|
||||
#define AVUNERROR(e) (-(e)) /**< Returns a POSIX error code from a library function error return value. */
|
||||
#else
|
||||
/* Some platforms have E* and errno already negated. */
|
||||
#define AVERROR(e) (e)
|
||||
#define AVUNERROR(e) (e)
|
||||
#endif
|
||||
#define AVERROR_UNKNOWN AVERROR(EINVAL) /**< unknown error */
|
||||
#define AVERROR_IO AVERROR(EIO) /**< I/O error */
|
||||
#define AVERROR_NUMEXPECTED AVERROR(EDOM) /**< Number syntax expected in filename. */
|
||||
#define AVERROR_INVALIDDATA AVERROR(EINVAL) /**< invalid data found */
|
||||
#define AVERROR_NOMEM AVERROR(ENOMEM) /**< not enough memory */
|
||||
#define AVERROR_NOFMT AVERROR(EILSEQ) /**< unknown format */
|
||||
#define AVERROR_NOTSUPP AVERROR(ENOSYS) /**< Operation not supported. */
|
||||
#define AVERROR_NOENT AVERROR(ENOENT) /**< No such file or directory. */
|
||||
#define AVERROR_EOF AVERROR(EPIPE) /**< End of file. */
|
||||
#define AVERROR_PATCHWELCOME -MKTAG('P','A','W','E') /**< Not yet implemented in FFmpeg. Patches welcome. */
|
||||
|
||||
/**
|
||||
* Logs a generic warning message about a missing feature. This function is
|
||||
* intended to be used internally by FFmpeg (libavcodec, libavformat, etc.)
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
#define AVFORMAT_AVFORMAT_H
|
||||
|
||||
#define LIBAVFORMAT_VERSION_MAJOR 52
|
||||
#define LIBAVFORMAT_VERSION_MINOR 36
|
||||
#define LIBAVFORMAT_VERSION_MICRO 0
|
||||
#define LIBAVFORMAT_VERSION_MINOR 64
|
||||
#define LIBAVFORMAT_VERSION_MICRO 2
|
||||
|
||||
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
|
||||
LIBAVFORMAT_VERSION_MINOR, \
|
||||
@@ -36,10 +36,21 @@
|
||||
#define LIBAVFORMAT_IDENT "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
|
||||
|
||||
/**
|
||||
* Returns the LIBAVFORMAT_VERSION_INT constant.
|
||||
* I return the LIBAVFORMAT_VERSION_INT constant. You got
|
||||
* a fucking problem with that, douchebag?
|
||||
*/
|
||||
unsigned avformat_version(void);
|
||||
|
||||
/**
|
||||
* Returns the libavformat build-time configuration.
|
||||
*/
|
||||
const char *avformat_configuration(void);
|
||||
|
||||
/**
|
||||
* Returns the libavformat license.
|
||||
*/
|
||||
const char *avformat_license(void);
|
||||
|
||||
#include <time.h>
|
||||
#include <stdio.h> /* FILE */
|
||||
#include "libavcodec/avcodec.h"
|
||||
@@ -52,7 +63,9 @@ struct AVFormatContext;
|
||||
/*
|
||||
* 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
|
||||
@@ -62,15 +75,51 @@ struct AVFormatContext;
|
||||
* 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-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.
|
||||
* 3. Several modifiers can be applied to the tag name. This is done by
|
||||
* appending a dash character ('-') and the modifier name in the order
|
||||
* they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng.
|
||||
* a) language -- a tag whose value is localized for a particular language
|
||||
* is appended with 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.
|
||||
* b) sorting -- a modified version of a tag that should be used for
|
||||
* sorting will have '-sort' appended. E.g. artist="The Beatles",
|
||||
* artist-sort="Beatles, The".
|
||||
*
|
||||
* 4. Tag names are normally exported exactly as stored in the container to
|
||||
* allow lossless remuxing to the same format. For container-independent
|
||||
* handling of metadata, av_metadata_conv() can convert it to ffmpeg generic
|
||||
* format. Follows a list of generic tag names:
|
||||
*
|
||||
* album -- name of the set this work belongs to
|
||||
* album_artist -- main creator of the set/album, if different from artist.
|
||||
* e.g. "Various Artists" for compilation albums.
|
||||
* artist -- main creator of the work
|
||||
* comment -- any additional description of the file.
|
||||
* composer -- who composed the work, if different from artist.
|
||||
* copyright -- name of copyright holder.
|
||||
* date -- date when the work was created, preferably in ISO 8601.
|
||||
* disc -- number of a subset, e.g. disc in a multi-disc collection.
|
||||
* encoder -- name/settings of the software/hardware that produced the file.
|
||||
* encoded_by -- person/group who created the file.
|
||||
* filename -- original name of the file.
|
||||
* genre -- <self-evident>.
|
||||
* language -- main language in which the work is performed, preferably
|
||||
* in ISO 639-2 format.
|
||||
* performer -- artist who performed the work, if different from artist.
|
||||
* E.g for "Also sprach Zarathustra", artist would be "Richard
|
||||
* Strauss" and performer "London Philharmonic Orchestra".
|
||||
* publisher -- name of the label/publisher.
|
||||
* title -- name of the work.
|
||||
* track -- number of this work in the set, can be in form current/total.
|
||||
*/
|
||||
|
||||
#define AV_METADATA_MATCH_CASE 1
|
||||
#define AV_METADATA_IGNORE_SUFFIX 2
|
||||
#define AV_METADATA_DONT_STRDUP_KEY 4
|
||||
#define AV_METADATA_DONT_STRDUP_VAL 8
|
||||
#define AV_METADATA_DONT_OVERWRITE 16 ///< Don't overwrite existing tags.
|
||||
|
||||
typedef struct {
|
||||
char *key;
|
||||
@@ -83,23 +132,36 @@ typedef struct AVMetadataConv AVMetadataConv;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
AVMetadataTag *
|
||||
av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int flags);
|
||||
|
||||
#if LIBAVFORMAT_VERSION_MAJOR == 52
|
||||
/**
|
||||
* 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
|
||||
* @deprecated Use av_metadata_set2() instead.
|
||||
*/
|
||||
int av_metadata_set(AVMetadata **pm, const char *key, const char *value);
|
||||
attribute_deprecated int av_metadata_set(AVMetadata **pm, const char *key, const char *value);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
int av_metadata_set2(AVMetadata **pm, const char *key, const char *value, int flags);
|
||||
|
||||
/**
|
||||
* Converts all the metadata sets from ctx according to the source and
|
||||
* destination conversion tables.
|
||||
* 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
|
||||
*/
|
||||
@@ -145,8 +207,8 @@ struct AVCodecTag;
|
||||
/** This structure contains the data a format has to probe a file. */
|
||||
typedef struct AVProbeData {
|
||||
const char *filename;
|
||||
unsigned char *buf;
|
||||
int buf_size;
|
||||
unsigned char *buf; /**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. */
|
||||
int buf_size; /**< Size of buf except extra allocated bytes */
|
||||
} AVProbeData;
|
||||
|
||||
#define AVPROBE_SCORE_MAX 100 ///< maximum score, half of that is used for file-extension-based detection
|
||||
@@ -185,6 +247,7 @@ typedef struct AVFormatParameters {
|
||||
#define AVFMT_GENERIC_INDEX 0x0100 /**< Use generic index building code. */
|
||||
#define AVFMT_TS_DISCONT 0x0200 /**< Format allows timestamp discontinuities. */
|
||||
#define AVFMT_VARIABLE_FPS 0x0400 /**< Format allows variable fps. */
|
||||
#define AVFMT_NODIMENSIONS 0x0800 /**< Format does not need width/height */
|
||||
|
||||
typedef struct AVOutputFormat {
|
||||
const char *name;
|
||||
@@ -448,8 +511,24 @@ typedef struct AVStream {
|
||||
* Number of packets to buffer for codec probing
|
||||
* NOT PART OF PUBLIC API
|
||||
*/
|
||||
#define MAX_PROBE_PACKETS 100
|
||||
#define MAX_PROBE_PACKETS 2500
|
||||
int probe_packets;
|
||||
|
||||
/**
|
||||
* 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*
|
||||
*/
|
||||
struct AVPacketList *last_in_packet_buffer;
|
||||
|
||||
/**
|
||||
* Average framerate
|
||||
*/
|
||||
AVRational avg_frame_rate;
|
||||
|
||||
/**
|
||||
* Number of frames that have been demuxed during av_find_stream_info()
|
||||
*/
|
||||
int codec_info_nb_frames;
|
||||
} AVStream;
|
||||
|
||||
#define AV_PROGRAM_RUNNING 1
|
||||
@@ -486,7 +565,11 @@ typedef struct AVChapter {
|
||||
AVMetadata *metadata;
|
||||
} AVChapter;
|
||||
|
||||
#if LIBAVFORMAT_VERSION_MAJOR < 53
|
||||
#define MAX_STREAMS 20
|
||||
#else
|
||||
#define MAX_STREAMS 100
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Format I/O context.
|
||||
@@ -530,8 +613,9 @@ typedef struct AVFormatContext {
|
||||
It is deduced from the AVStream values. */
|
||||
int64_t start_time;
|
||||
/** 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. */
|
||||
int64_t duration;
|
||||
/** decoding: total file size, 0 if unknown */
|
||||
int64_t file_size;
|
||||
@@ -566,6 +650,10 @@ typedef struct AVFormatContext {
|
||||
#define AVFMT_FLAG_GENPTS 0x0001 ///< Generate missing pts even if it requires parsing future frames.
|
||||
#define AVFMT_FLAG_IGNIDX 0x0002 ///< Ignore index.
|
||||
#define AVFMT_FLAG_NONBLOCK 0x0004 ///< Do not block when reading packets from input.
|
||||
#define AVFMT_FLAG_IGNDTS 0x0008 ///< Ignore DTS on frames that contain both DTS & PTS
|
||||
#define AVFMT_FLAG_NOFILLIN 0x0010 ///< Do not infer any values from other values, just return what is stored in the container
|
||||
#define AVFMT_FLAG_NOPARSE 0x0020 ///< 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
|
||||
#define AVFMT_FLAG_RTP_HINT 0x0040 ///< Add RTP hinting to the output file
|
||||
|
||||
int loop_input;
|
||||
/** decoding: size of data to probe; encoding: unused. */
|
||||
@@ -643,8 +731,17 @@ typedef struct AVFormatContext {
|
||||
* Remaining size available for raw_packet_buffer, in bytes.
|
||||
* NOT PART OF PUBLIC API
|
||||
*/
|
||||
#define RAW_PACKET_BUFFER_SIZE 32000
|
||||
#define RAW_PACKET_BUFFER_SIZE 2500000
|
||||
int raw_packet_buffer_remaining_size;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
int64_t start_time_realtime;
|
||||
} AVFormatContext;
|
||||
|
||||
typedef struct AVPacketList {
|
||||
@@ -679,19 +776,41 @@ enum CodecID av_guess_image2_codec(const char *filename);
|
||||
/* utils.c */
|
||||
void av_register_input_format(AVInputFormat *format);
|
||||
void av_register_output_format(AVOutputFormat *format);
|
||||
AVOutputFormat *guess_stream_format(const char *short_name,
|
||||
#if LIBAVFORMAT_VERSION_MAJOR < 53
|
||||
attribute_deprecated AVOutputFormat *guess_stream_format(const char *short_name,
|
||||
const char *filename,
|
||||
const char *mime_type);
|
||||
AVOutputFormat *guess_format(const char *short_name,
|
||||
const char *filename,
|
||||
const char *mime_type);
|
||||
|
||||
/**
|
||||
* @deprecated Use av_guess_format() instead.
|
||||
*/
|
||||
attribute_deprecated AVOutputFormat *guess_format(const char *short_name,
|
||||
const char *filename,
|
||||
const char *mime_type);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
AVOutputFormat *av_guess_format(const char *short_name,
|
||||
const char *filename,
|
||||
const char *mime_type);
|
||||
|
||||
/**
|
||||
* Guesses the codec ID based upon muxer and filename.
|
||||
*/
|
||||
enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
|
||||
const char *filename, const char *mime_type,
|
||||
enum CodecType type);
|
||||
enum AVMediaType type);
|
||||
|
||||
/**
|
||||
* Sends a nice hexadecimal dump of a buffer to the specified file stream.
|
||||
@@ -750,8 +869,22 @@ void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt, int dump_payload);
|
||||
*/
|
||||
void av_register_all(void);
|
||||
|
||||
/** 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
|
||||
*/
|
||||
enum CodecID av_codec_get_id(const struct AVCodecTag * const *tags, unsigned int tag);
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
unsigned int av_codec_get_tag(const struct AVCodecTag * const *tags, enum CodecID id);
|
||||
|
||||
/* media file input */
|
||||
@@ -769,6 +902,19 @@ AVInputFormat *av_find_input_format(const char *short_name);
|
||||
*/
|
||||
AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened);
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max);
|
||||
|
||||
/**
|
||||
* Allocates all the structures needed to read an input stream.
|
||||
* This does not open the needed codecs for decoding the stream[s].
|
||||
@@ -890,7 +1036,7 @@ int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp,
|
||||
* @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
|
||||
@@ -968,6 +1114,7 @@ void av_set_pts_info(AVStream *s, int pts_wrap_bits,
|
||||
#define AVSEEK_FLAG_BACKWARD 1 ///< seek backward
|
||||
#define AVSEEK_FLAG_BYTE 2 ///< seeking based on position in bytes
|
||||
#define AVSEEK_FLAG_ANY 4 ///< seek to any frame, even non-keyframes
|
||||
#define AVSEEK_FLAG_FRAME 8 ///< seeking based on frame number
|
||||
|
||||
int av_find_default_stream_index(AVFormatContext *s);
|
||||
|
||||
@@ -1211,48 +1358,12 @@ int av_filename_number_test(const char *filename);
|
||||
*/
|
||||
int avf_sdp_create(AVFormatContext *ac[], int n_files, char *buff, int size);
|
||||
|
||||
#ifdef HAVE_AV_CONFIG_H
|
||||
|
||||
void ff_dynarray_add(intptr_t **tab_ptr, int *nb_ptr, intptr_t elem);
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define dynarray_add(tab, nb_ptr, elem)\
|
||||
do {\
|
||||
__typeof__(tab) _tab = (tab);\
|
||||
__typeof__(elem) _elem = (elem);\
|
||||
(void)sizeof(**_tab == _elem); /* check that types are compatible */\
|
||||
ff_dynarray_add((intptr_t **)_tab, nb_ptr, (intptr_t)_elem);\
|
||||
} while(0)
|
||||
#else
|
||||
#define dynarray_add(tab, nb_ptr, elem)\
|
||||
do {\
|
||||
ff_dynarray_add((intptr_t **)(tab), nb_ptr, (intptr_t)(elem));\
|
||||
} while(0)
|
||||
#endif
|
||||
|
||||
time_t mktimegm(struct tm *tm);
|
||||
struct tm *brktimegm(time_t secs, struct tm *tm);
|
||||
const char *small_strptime(const char *p, const char *fmt,
|
||||
struct tm *dt);
|
||||
|
||||
struct in_addr;
|
||||
int resolve_host(struct in_addr *sin_addr, const char *hostname);
|
||||
|
||||
void url_split(char *proto, int proto_size,
|
||||
char *authorization, int authorization_size,
|
||||
char *hostname, int hostname_size,
|
||||
int *port_ptr,
|
||||
char *path, int path_size,
|
||||
const char *url);
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
int match_ext(const char *filename, const char *extensions);
|
||||
|
||||
#endif /* HAVE_AV_CONFIG_H */
|
||||
int av_match_ext(const char *filename, const char *extensions);
|
||||
|
||||
#endif /* AVFORMAT_AVFORMAT_H */
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#define AVFORMAT_AVIO_H
|
||||
|
||||
/**
|
||||
* @file libavformat/avio.h
|
||||
* @file
|
||||
* unbuffered I/O operations
|
||||
*
|
||||
* @warning This file has to be considered an internal but installed
|
||||
@@ -50,7 +50,7 @@ typedef struct URLContext {
|
||||
int is_streamed; /**< true if streamed (no seek possible), default = false */
|
||||
int max_packet_size; /**< if non zero, the stream is packetized with this max packet size */
|
||||
void *priv_data;
|
||||
char *filename; /**< specified filename */
|
||||
char *filename; /**< specified URL */
|
||||
} URLContext;
|
||||
|
||||
typedef struct URLPollEntry {
|
||||
@@ -65,15 +65,86 @@ typedef struct URLPollEntry {
|
||||
|
||||
typedef int URLInterruptCB(void);
|
||||
|
||||
/**
|
||||
* Creates an URLContext for accessing to the resource indicated by
|
||||
* url, and opens it using the URLProtocol up.
|
||||
*
|
||||
* @param puc pointer to the location where, in case of success, the
|
||||
* function puts the pointer to the created URLContext
|
||||
* @param flags flags which control how the resource indicated by url
|
||||
* is to be opened
|
||||
* @return 0 in case of success, a negative value corresponding to an
|
||||
* AVERROR code in case of failure
|
||||
*/
|
||||
int url_open_protocol (URLContext **puc, struct URLProtocol *up,
|
||||
const char *filename, int flags);
|
||||
int url_open(URLContext **h, const char *filename, int flags);
|
||||
const char *url, int flags);
|
||||
|
||||
/**
|
||||
* Creates an URLContext for accessing to the resource indicated by
|
||||
* url, and opens it.
|
||||
*
|
||||
* @param puc pointer to the location where, in case of success, the
|
||||
* function puts the pointer to the created URLContext
|
||||
* @param flags flags which control how the resource indicated by url
|
||||
* is to be opened
|
||||
* @return 0 in case of success, a negative value corresponding to an
|
||||
* AVERROR code in case of failure
|
||||
*/
|
||||
int url_open(URLContext **h, const char *url, int flags);
|
||||
|
||||
/**
|
||||
* Reads up to size bytes from the resource accessed by h, and stores
|
||||
* the read bytes in buf.
|
||||
*
|
||||
* @return The number of bytes actually read, or a negative value
|
||||
* corresponding to an AVERROR code in case of error. A value of zero
|
||||
* indicates that it is not possible to read more from the accessed
|
||||
* resource (except if the value of the size argument is also zero).
|
||||
*/
|
||||
int url_read(URLContext *h, unsigned char *buf, int size);
|
||||
|
||||
/**
|
||||
* Read as many bytes as possible (up to size), calling the
|
||||
* read function multiple times if necessary.
|
||||
* Will also retry if the read function returns AVERROR(EAGAIN).
|
||||
* This makes special short-read handling in applications
|
||||
* unnecessary, if the return value is < size then it is
|
||||
* certain there was either an error or the end of file was reached.
|
||||
*/
|
||||
int url_read_complete(URLContext *h, unsigned char *buf, int size);
|
||||
int url_write(URLContext *h, unsigned char *buf, int size);
|
||||
|
||||
/**
|
||||
* Changes the position that will be used by the next read/write
|
||||
* operation on the resource accessed by h.
|
||||
*
|
||||
* @param pos specifies the new position to set
|
||||
* @param whence specifies how pos should be interpreted, it must be
|
||||
* one of SEEK_SET (seek from the beginning), SEEK_CUR (seek from the
|
||||
* current position), SEEK_END (seek from the end), or AVSEEK_SIZE
|
||||
* (return the filesize of the requested resource, pos is ignored).
|
||||
* @return a negative value corresponding to an AVERROR code in case
|
||||
* of failure, or the resulting file position, measured in bytes from
|
||||
* the beginning of the file. You can use this feature together with
|
||||
* SEEK_CUR to read the current file position.
|
||||
*/
|
||||
int64_t url_seek(URLContext *h, int64_t pos, int whence);
|
||||
|
||||
/**
|
||||
* Closes the resource accessed by the URLContext h, and frees the
|
||||
* memory used by it.
|
||||
*
|
||||
* @return a negative value if an error condition occurred, 0
|
||||
* otherwise
|
||||
*/
|
||||
int url_close(URLContext *h);
|
||||
int url_exist(const char *filename);
|
||||
|
||||
/**
|
||||
* Returns a non-zero value if the resource indicated by url
|
||||
* exists, 0 otherwise.
|
||||
*/
|
||||
int url_exist(const char *url);
|
||||
|
||||
int64_t url_filesize(URLContext *h);
|
||||
|
||||
/**
|
||||
@@ -141,9 +212,17 @@ int64_t av_url_read_seek(URLContext *h, int stream_index,
|
||||
*/
|
||||
#define AVSEEK_SIZE 0x10000
|
||||
|
||||
/**
|
||||
* Oring this flag as into the "whence" parameter to a seek function causes it to
|
||||
* seek by any means (like reopening and linear reading) or other normally unreasonble
|
||||
* means that can be extreemly slow.
|
||||
* This may be ignored by the seek code.
|
||||
*/
|
||||
#define AVSEEK_FORCE 0x20000
|
||||
|
||||
typedef struct URLProtocol {
|
||||
const char *name;
|
||||
int (*url_open)(URLContext *h, const char *filename, int flags);
|
||||
int (*url_open)(URLContext *h, const char *url, int flags);
|
||||
int (*url_read)(URLContext *h, unsigned char *buf, int size);
|
||||
int (*url_write)(URLContext *h, unsigned char *buf, int size);
|
||||
int64_t (*url_seek)(URLContext *h, int64_t pos, int whence);
|
||||
@@ -175,6 +254,9 @@ URLProtocol *av_protocol_next(URLProtocol *p);
|
||||
attribute_deprecated int register_protocol(URLProtocol *protocol);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Registers the URLProtocol protocol.
|
||||
*/
|
||||
int av_register_protocol(URLProtocol *protocol);
|
||||
|
||||
/**
|
||||
@@ -294,7 +376,7 @@ void put_flush_packet(ByteIOContext *s);
|
||||
|
||||
/**
|
||||
* Reads size bytes from ByteIOContext into buf.
|
||||
* @returns number of bytes read or AVERROR
|
||||
* @return number of bytes read or AVERROR
|
||||
*/
|
||||
int get_buffer(ByteIOContext *s, unsigned char *buf, int size);
|
||||
|
||||
@@ -302,7 +384,7 @@ int get_buffer(ByteIOContext *s, unsigned char *buf, int size);
|
||||
* Reads size bytes from ByteIOContext into buf.
|
||||
* This reads at most 1 packet. If that is not enough fewer bytes will be
|
||||
* returned.
|
||||
* @returns number of bytes read or AVERROR
|
||||
* @return number of bytes read or AVERROR
|
||||
*/
|
||||
int get_partial_buffer(ByteIOContext *s, unsigned char *buf, int size);
|
||||
|
||||
@@ -327,21 +409,59 @@ static inline int url_is_streamed(ByteIOContext *s)
|
||||
return s->is_streamed;
|
||||
}
|
||||
|
||||
/** @note when opened as read/write, the buffers are only used for
|
||||
writing */
|
||||
/**
|
||||
* Creates and initializes a ByteIOContext for accessing the
|
||||
* resource referenced by the URLContext h.
|
||||
* @note When the URLContext h has been opened in read+write mode, the
|
||||
* ByteIOContext can be used only for writing.
|
||||
*
|
||||
* @param s Used to return the pointer to the created ByteIOContext.
|
||||
* In case of failure the pointed to value is set to NULL.
|
||||
* @return 0 in case of success, a negative value corresponding to an
|
||||
* AVERROR code in case of failure
|
||||
*/
|
||||
int url_fdopen(ByteIOContext **s, URLContext *h);
|
||||
|
||||
/** @warning must be called before any I/O */
|
||||
int url_setbufsize(ByteIOContext *s, int buf_size);
|
||||
#if LIBAVFORMAT_VERSION_MAJOR < 53
|
||||
/** Reset the buffer for reading or writing.
|
||||
* @note Will drop any data currently in the buffer without transmitting it.
|
||||
* @param flags URL_RDONLY to set up the buffer for reading, or URL_WRONLY
|
||||
* to set up the buffer for writing. */
|
||||
int url_resetbuf(ByteIOContext *s, int flags);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Rewinds the ByteIOContext using the specified buffer containing the first buf_size bytes of the file.
|
||||
* Used after probing to avoid seeking.
|
||||
* Joins buf and s->buffer, taking any overlap into consideration.
|
||||
* @note s->buffer must overlap with buf or they can't be joined and the function fails
|
||||
* @note This function is NOT part of the public API
|
||||
*
|
||||
* @param s The read-only ByteIOContext to rewind
|
||||
* @param buf The probe buffer containing the first buf_size bytes of the file
|
||||
* @param buf_size The size of buf
|
||||
* @return 0 in case of success, a negative value corresponding to an
|
||||
* AVERROR code in case of failure
|
||||
*/
|
||||
int ff_rewind_with_probe_data(ByteIOContext *s, unsigned char *buf, int buf_size);
|
||||
|
||||
/**
|
||||
* Creates and initializes a ByteIOContext for accessing the
|
||||
* resource indicated by url.
|
||||
* @note When the resource indicated by url has been opened in
|
||||
* read+write mode, the ByteIOContext can be used only for writing.
|
||||
*
|
||||
* @param s Used to return the pointer to the created ByteIOContext.
|
||||
* In case of failure the pointed to value is set to NULL.
|
||||
* @param flags flags which control how the resource indicated by url
|
||||
* is to be opened
|
||||
* @return 0 in case of success, a negative value corresponding to an
|
||||
* AVERROR code in case of failure
|
||||
*/
|
||||
int url_fopen(ByteIOContext **s, const char *url, int flags);
|
||||
|
||||
/** @note when opened as read/write, the buffers are only used for
|
||||
writing */
|
||||
int url_fopen(ByteIOContext **s, const char *filename, int flags);
|
||||
int url_fclose(ByteIOContext *s);
|
||||
URLContext *url_fileno(ByteIOContext *s);
|
||||
|
||||
|
||||
113
lib-src/ffmpeg/libavutil/attributes.h
Normal file
113
lib-src/ffmpeg/libavutil/attributes.h
Normal file
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Macro definitions for various function/variable attributes
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_ATTRIBUTES_H
|
||||
#define AVUTIL_ATTRIBUTES_H
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y)
|
||||
#else
|
||||
# define AV_GCC_VERSION_AT_LEAST(x,y) 0
|
||||
#endif
|
||||
|
||||
#ifndef av_always_inline
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1)
|
||||
# define av_always_inline __attribute__((always_inline)) inline
|
||||
#else
|
||||
# define av_always_inline inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_noinline
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1)
|
||||
# define av_noinline __attribute__((noinline))
|
||||
#else
|
||||
# define av_noinline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_pure
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1)
|
||||
# define av_pure __attribute__((pure))
|
||||
#else
|
||||
# define av_pure
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_const
|
||||
#if AV_GCC_VERSION_AT_LEAST(2,6)
|
||||
# define av_const __attribute__((const))
|
||||
#else
|
||||
# define av_const
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_cold
|
||||
#if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(4,3)
|
||||
# define av_cold __attribute__((cold))
|
||||
#else
|
||||
# define av_cold
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_flatten
|
||||
#if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(4,1)
|
||||
# define av_flatten __attribute__((flatten))
|
||||
#else
|
||||
# define av_flatten
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef attribute_deprecated
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1)
|
||||
# define attribute_deprecated __attribute__((deprecated))
|
||||
#else
|
||||
# define attribute_deprecated
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_unused
|
||||
#if defined(__GNUC__)
|
||||
# define av_unused __attribute__((unused))
|
||||
#else
|
||||
# define av_unused
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_uninit
|
||||
#if defined(__GNUC__) && !defined(__ICC)
|
||||
# define av_uninit(x) x=x
|
||||
#else
|
||||
# define av_uninit(x) x
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define av_builtin_constant_p __builtin_constant_p
|
||||
#else
|
||||
# define av_builtin_constant_p(x) 0
|
||||
#endif
|
||||
|
||||
#endif /* AVUTIL_ATTRIBUTES_H */
|
||||
5
lib-src/ffmpeg/libavutil/avconfig.h
Normal file
5
lib-src/ffmpeg/libavutil/avconfig.h
Normal file
@@ -0,0 +1,5 @@
|
||||
/* Generated by ffconf */
|
||||
#ifndef AVUTIL_AVCONFIG_H
|
||||
#define AVUTIL_AVCONFIG_H
|
||||
#define AV_HAVE_BIGENDIAN WORDS_BIGENDIAN
|
||||
#endif /* AVUTIL_AVCONFIG_H */
|
||||
@@ -22,7 +22,7 @@
|
||||
#define AVUTIL_AVUTIL_H
|
||||
|
||||
/**
|
||||
* @file libavutil/avutil.h
|
||||
* @file
|
||||
* external API header
|
||||
*/
|
||||
|
||||
@@ -30,13 +30,18 @@
|
||||
#define AV_STRINGIFY(s) AV_TOSTRING(s)
|
||||
#define AV_TOSTRING(s) #s
|
||||
|
||||
#define AV_GLUE(a, b) a ## b
|
||||
#define AV_JOIN(a, b) AV_GLUE(a, b)
|
||||
|
||||
#define AV_PRAGMA(s) _Pragma(#s)
|
||||
|
||||
#define AV_VERSION_INT(a, b, c) (a<<16 | b<<8 | c)
|
||||
#define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c
|
||||
#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
|
||||
|
||||
#define LIBAVUTIL_VERSION_MAJOR 50
|
||||
#define LIBAVUTIL_VERSION_MINOR 3
|
||||
#define LIBAVUTIL_VERSION_MICRO 0
|
||||
#define LIBAVUTIL_VERSION_MINOR 15
|
||||
#define LIBAVUTIL_VERSION_MICRO 1
|
||||
|
||||
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
|
||||
LIBAVUTIL_VERSION_MINOR, \
|
||||
@@ -53,7 +58,28 @@
|
||||
*/
|
||||
unsigned avutil_version(void);
|
||||
|
||||
/**
|
||||
* Returns the libavutil build-time configuration.
|
||||
*/
|
||||
const char *avutil_configuration(void);
|
||||
|
||||
/**
|
||||
* Returns the libavutil license.
|
||||
*/
|
||||
const char *avutil_license(void);
|
||||
|
||||
enum AVMediaType {
|
||||
AVMEDIA_TYPE_UNKNOWN = -1,
|
||||
AVMEDIA_TYPE_VIDEO,
|
||||
AVMEDIA_TYPE_AUDIO,
|
||||
AVMEDIA_TYPE_DATA,
|
||||
AVMEDIA_TYPE_SUBTITLE,
|
||||
AVMEDIA_TYPE_ATTACHMENT,
|
||||
AVMEDIA_TYPE_NB
|
||||
};
|
||||
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "mathematics.h"
|
||||
#include "rational.h"
|
||||
#include "intfloat_readwrite.h"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file libavutil/common.h
|
||||
* @file
|
||||
* common internal and external API header
|
||||
*/
|
||||
|
||||
@@ -34,84 +34,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y)
|
||||
#else
|
||||
# define AV_GCC_VERSION_AT_LEAST(x,y) 0
|
||||
#endif
|
||||
|
||||
#ifndef av_always_inline
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1)
|
||||
# define av_always_inline __attribute__((always_inline)) inline
|
||||
#else
|
||||
# define av_always_inline inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_noinline
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1)
|
||||
# define av_noinline __attribute__((noinline))
|
||||
#else
|
||||
# define av_noinline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_pure
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1)
|
||||
# define av_pure __attribute__((pure))
|
||||
#else
|
||||
# define av_pure
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_const
|
||||
#if AV_GCC_VERSION_AT_LEAST(2,6)
|
||||
# define av_const __attribute__((const))
|
||||
#else
|
||||
# define av_const
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_cold
|
||||
#if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(4,3)
|
||||
# define av_cold __attribute__((cold))
|
||||
#else
|
||||
# define av_cold
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_flatten
|
||||
#if (!defined(__ICC) || __ICC > 1110) && AV_GCC_VERSION_AT_LEAST(4,1)
|
||||
# define av_flatten __attribute__((flatten))
|
||||
#else
|
||||
# define av_flatten
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef attribute_deprecated
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1)
|
||||
# define attribute_deprecated __attribute__((deprecated))
|
||||
#else
|
||||
# define attribute_deprecated
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_unused
|
||||
#if defined(__GNUC__)
|
||||
# define av_unused __attribute__((unused))
|
||||
#else
|
||||
# define av_unused
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_uninit
|
||||
#if defined(__GNUC__) && !defined(__ICC)
|
||||
# define av_uninit(x) x=x
|
||||
#else
|
||||
# define av_uninit(x) x
|
||||
#endif
|
||||
#endif
|
||||
#include "attributes.h"
|
||||
|
||||
//rounded division & shift
|
||||
#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
|
||||
@@ -132,7 +55,9 @@
|
||||
/* misc math functions */
|
||||
extern const uint8_t ff_log2_tab[256];
|
||||
|
||||
static inline av_const int av_log2(unsigned int v)
|
||||
extern const uint8_t av_reverse[256];
|
||||
|
||||
static inline av_const int av_log2_c(unsigned int v)
|
||||
{
|
||||
int n = 0;
|
||||
if (v & 0xffff0000) {
|
||||
@@ -148,7 +73,7 @@ static inline av_const int av_log2(unsigned int v)
|
||||
return n;
|
||||
}
|
||||
|
||||
static inline av_const int av_log2_16bit(unsigned int v)
|
||||
static inline av_const int av_log2_16bit_c(unsigned int v)
|
||||
{
|
||||
int n = 0;
|
||||
if (v & 0xff00) {
|
||||
@@ -160,6 +85,18 @@ static inline av_const int av_log2_16bit(unsigned int v)
|
||||
return n;
|
||||
}
|
||||
|
||||
#ifdef HAVE_AV_CONFIG_H
|
||||
# include "config.h"
|
||||
# include "intmath.h"
|
||||
#endif
|
||||
|
||||
#ifndef av_log2
|
||||
# define av_log2 av_log2_c
|
||||
#endif
|
||||
#ifndef av_log2_16bit
|
||||
# define av_log2_16bit av_log2_16bit_c
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Clips a signed integer value into the amin-amax range.
|
||||
* @param a value to clip
|
||||
@@ -181,8 +118,19 @@ static inline av_const int av_clip(int a, int amin, int amax)
|
||||
*/
|
||||
static inline av_const uint8_t av_clip_uint8(int a)
|
||||
{
|
||||
if (a&(~255)) return (-a)>>31;
|
||||
else return a;
|
||||
if (a&(~0xFF)) return (-a)>>31;
|
||||
else return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clips a signed integer value into the 0-65535 range.
|
||||
* @param a value to clip
|
||||
* @return clipped value
|
||||
*/
|
||||
static inline av_const uint16_t av_clip_uint16(int a)
|
||||
{
|
||||
if (a&(~0xFFFF)) return (-a)>>31;
|
||||
else return a;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -192,8 +140,19 @@ static inline av_const uint8_t av_clip_uint8(int a)
|
||||
*/
|
||||
static inline av_const int16_t av_clip_int16(int a)
|
||||
{
|
||||
if ((a+32768) & ~65535) return (a>>31) ^ 32767;
|
||||
else return a;
|
||||
if ((a+0x8000) & ~0xFFFF) return (a>>31) ^ 0x7FFF;
|
||||
else return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clips a signed 64-bit integer value into the -2147483648,2147483647 range.
|
||||
* @param a value to clip
|
||||
* @return clipped value
|
||||
*/
|
||||
static inline av_const int32_t av_clipl_int32(int64_t a)
|
||||
{
|
||||
if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (a>>63) ^ 0x7FFFFFFF;
|
||||
else return a;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -210,6 +169,15 @@ static inline av_const float av_clipf(float a, float amin, float amax)
|
||||
else return a;
|
||||
}
|
||||
|
||||
/** Computes ceil(log2(x)).
|
||||
* @param x value used to compute ceil(log2(x))
|
||||
* @return computed ceiling of log2(x)
|
||||
*/
|
||||
static inline av_const int av_ceil_log2(int x)
|
||||
{
|
||||
return av_log2((x - 1) << 1);
|
||||
}
|
||||
|
||||
#define MKTAG(a,b,c,d) (a | (b << 8) | (c << 16) | (d << 24))
|
||||
#define MKBETAG(a,b,c,d) (d | (c << 8) | (b << 16) | (a << 24))
|
||||
|
||||
@@ -241,6 +209,30 @@ static inline av_const float av_clipf(float a, float amin, float amax)
|
||||
}\
|
||||
}
|
||||
|
||||
/*!
|
||||
* \def GET_UTF16(val, GET_16BIT, ERROR)
|
||||
* Converts a UTF-16 character (2 or 4 bytes) to its 32-bit UCS-4 encoded form
|
||||
* \param val is the output and should be of type uint32_t. It holds the converted
|
||||
* UCS-4 character and should be a left value.
|
||||
* \param GET_16BIT gets two bytes of UTF-16 encoded data converted to native endianness.
|
||||
* It can be a function or a statement whose return value or evaluated value is of type
|
||||
* uint16_t. It will be executed up to 2 times.
|
||||
* \param ERROR action that should be taken when an invalid UTF-16 surrogate is
|
||||
* returned from GET_BYTE. It should be a statement that jumps out of the macro,
|
||||
* like exit(), goto, return, break, or continue.
|
||||
*/
|
||||
#define GET_UTF16(val, GET_16BIT, ERROR)\
|
||||
val = GET_16BIT;\
|
||||
{\
|
||||
unsigned int hi = val - 0xD800;\
|
||||
if (hi < 0x800) {\
|
||||
val = GET_16BIT - 0xDC00;\
|
||||
if (val > 0x3FFU || hi > 0x3FFU)\
|
||||
ERROR\
|
||||
val += (hi<<10) + 0x10000;\
|
||||
}\
|
||||
}\
|
||||
|
||||
/*!
|
||||
* \def PUT_UTF8(val, tmp, PUT_BYTE)
|
||||
* Converts a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).
|
||||
@@ -277,10 +269,39 @@ static inline av_const float av_clipf(float a, float amin, float amax)
|
||||
}\
|
||||
}
|
||||
|
||||
/*!
|
||||
* \def PUT_UTF16(val, tmp, PUT_16BIT)
|
||||
* Converts a 32-bit Unicode character to its UTF-16 encoded form (2 or 4 bytes).
|
||||
* \param val is an input-only argument and should be of type uint32_t. It holds
|
||||
* a UCS-4 encoded Unicode character that is to be converted to UTF-16. If
|
||||
* val is given as a function it is executed only once.
|
||||
* \param tmp is a temporary variable and should be of type uint16_t. It
|
||||
* represents an intermediate value during conversion that is to be
|
||||
* output by PUT_16BIT.
|
||||
* \param PUT_16BIT writes the converted UTF-16 data to any proper destination
|
||||
* in desired endianness. It could be a function or a statement, and uses tmp
|
||||
* as the input byte. For example, PUT_BYTE could be "*output++ = tmp;"
|
||||
* PUT_BYTE will be executed 1 or 2 times depending on input character.
|
||||
*/
|
||||
#define PUT_UTF16(val, tmp, PUT_16BIT)\
|
||||
{\
|
||||
uint32_t in = val;\
|
||||
if (in < 0x10000) {\
|
||||
tmp = in;\
|
||||
PUT_16BIT\
|
||||
} else {\
|
||||
tmp = 0xD800 | ((in - 0x10000) >> 10);\
|
||||
PUT_16BIT\
|
||||
tmp = 0xDC00 | ((in - 0x10000) & 0x3FF);\
|
||||
PUT_16BIT\
|
||||
}\
|
||||
}\
|
||||
|
||||
|
||||
|
||||
#include "mem.h"
|
||||
|
||||
#ifdef HAVE_AV_CONFIG_H
|
||||
# include "config.h"
|
||||
# include "internal.h"
|
||||
#endif /* HAVE_AV_CONFIG_H */
|
||||
|
||||
|
||||
72
lib-src/ffmpeg/libavutil/error.h
Normal file
72
lib-src/ffmpeg/libavutil/error.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* error code definitions
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_ERROR_H
|
||||
#define AVUTIL_ERROR_H
|
||||
|
||||
#include <errno.h>
|
||||
#include "avutil.h"
|
||||
|
||||
/* error handling */
|
||||
#if EDOM > 0
|
||||
#define AVERROR(e) (-(e)) ///< Returns a negative error code from a POSIX error code, to return from library functions.
|
||||
#define AVUNERROR(e) (-(e)) ///< Returns a POSIX error code from a library function error return value.
|
||||
#else
|
||||
/* Some platforms have E* and errno already negated. */
|
||||
#define AVERROR(e) (e)
|
||||
#define AVUNERROR(e) (e)
|
||||
#endif
|
||||
|
||||
#if LIBAVUTIL_VERSION_MAJOR < 51
|
||||
#define AVERROR_INVALIDDATA AVERROR(EINVAL) ///< Invalid data found when processing input
|
||||
#define AVERROR_IO AVERROR(EIO) ///< I/O error
|
||||
#define AVERROR_NOENT AVERROR(ENOENT) ///< No such file or directory
|
||||
#define AVERROR_NOFMT AVERROR(EILSEQ) ///< Unknown format
|
||||
#define AVERROR_NOMEM AVERROR(ENOMEM) ///< Not enough memory
|
||||
#define AVERROR_NOTSUPP AVERROR(ENOSYS) ///< Operation not supported
|
||||
#define AVERROR_NUMEXPECTED AVERROR(EDOM) ///< Number syntax expected in filename
|
||||
#define AVERROR_UNKNOWN AVERROR(EINVAL) ///< Unknown error
|
||||
#endif
|
||||
|
||||
#define AVERROR_EOF AVERROR(EPIPE) ///< End of file
|
||||
|
||||
#define AVERROR_PATCHWELCOME (-MKTAG('P','A','W','E')) ///< Not yet implemented in FFmpeg, patches welcome
|
||||
|
||||
#if LIBAVUTIL_VERSION_MAJOR > 50
|
||||
#define AVERROR_INVALIDDATA (-MKTAG('I','N','D','A')) ///< Invalid data found when processing input
|
||||
#define AVERROR_NUMEXPECTED (-MKTAG('N','U','E','X')) ///< Number syntax expected in filename
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Puts a description of the AVERROR code errnum in errbuf.
|
||||
* In case of failure the global variable errno is set to indicate the
|
||||
* error. Even in case of failure av_strerror() will print a generic
|
||||
* error message indicating the errnum provided to errbuf.
|
||||
*
|
||||
* @param errbuf_size the size in bytes of errbuf
|
||||
* @return 0 on success, a negative value if a description for errnum
|
||||
* cannot be found
|
||||
*/
|
||||
int av_strerror(int errnum, char *errbuf, size_t errbuf_size);
|
||||
|
||||
#endif /* AVUTIL_ERROR_H */
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file libavutil/fifo.h
|
||||
* @file
|
||||
* a very simple circular buffer FIFO implementation
|
||||
*/
|
||||
|
||||
@@ -25,8 +25,6 @@
|
||||
#define AVUTIL_FIFO_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "avutil.h"
|
||||
#include "common.h"
|
||||
|
||||
typedef struct AVFifoBuffer {
|
||||
uint8_t *buffer;
|
||||
@@ -37,7 +35,7 @@ typedef struct AVFifoBuffer {
|
||||
/**
|
||||
* Initializes an AVFifoBuffer.
|
||||
* @param size of FIFO
|
||||
* @return AVFifoBuffer or NULL if mem allocation failure
|
||||
* @return AVFifoBuffer or NULL in case of memory allocation failure
|
||||
*/
|
||||
AVFifoBuffer *av_fifo_alloc(unsigned int size);
|
||||
|
||||
@@ -81,7 +79,8 @@ int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)
|
||||
/**
|
||||
* Feeds data from a user-supplied callback to an AVFifoBuffer.
|
||||
* @param *f AVFifoBuffer to write to
|
||||
* @param *src data source
|
||||
* @param *src data source; non-const since it may be used as a
|
||||
* modifiable context by the function defined in func
|
||||
* @param size number of bytes to write
|
||||
* @param *func generic write function; the first parameter is src,
|
||||
* the second is dest_buf, the third is dest_buf_size.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#define AVUTIL_INTFLOAT_READWRITE_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "common.h"
|
||||
#include "attributes.h"
|
||||
|
||||
/* IEEE 80 bits extended float */
|
||||
typedef struct AVExtFloat {
|
||||
|
||||
@@ -29,8 +29,7 @@
|
||||
* arbitrary struct of which the first field is a pointer to an
|
||||
* AVClass struct (e.g. AVCodecContext, AVFormatContext etc.).
|
||||
*/
|
||||
typedef struct AVCLASS AVClass;
|
||||
struct AVCLASS {
|
||||
typedef struct {
|
||||
/**
|
||||
* The name of the class; usually it is the same name as the
|
||||
* context structure type to which the AVClass is associated.
|
||||
@@ -49,7 +48,15 @@ struct AVCLASS {
|
||||
* @see av_set_default_options()
|
||||
*/
|
||||
const struct AVOption *option;
|
||||
};
|
||||
|
||||
/**
|
||||
* LIBAVUTIL_VERSION with which this structure was created.
|
||||
* This is used to allow fields to be added without requiring major
|
||||
* version bumps everywhere.
|
||||
*/
|
||||
|
||||
int version;
|
||||
} AVClass;
|
||||
|
||||
/* av_log API */
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <math.h>
|
||||
#include "common.h"
|
||||
#include "attributes.h"
|
||||
#include "rational.h"
|
||||
|
||||
#ifndef M_E
|
||||
@@ -35,12 +35,24 @@
|
||||
#ifndef M_LN10
|
||||
#define M_LN10 2.30258509299404568402 /* log_e 10 */
|
||||
#endif
|
||||
#ifndef M_LOG2_10
|
||||
#define M_LOG2_10 3.32192809488736234787 /* log_2 10 */
|
||||
#endif
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846 /* pi */
|
||||
#endif
|
||||
#ifndef M_SQRT1_2
|
||||
#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
|
||||
#endif
|
||||
#ifndef M_SQRT2
|
||||
#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
|
||||
#endif
|
||||
#ifndef NAN
|
||||
#define NAN (0.0/0.0)
|
||||
#endif
|
||||
#ifndef INFINITY
|
||||
#define INFINITY (1.0/0.0)
|
||||
#endif
|
||||
|
||||
enum AVRounding {
|
||||
AV_ROUND_ZERO = 0, ///< Round toward zero.
|
||||
@@ -50,6 +62,11 @@ enum AVRounding {
|
||||
AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero.
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the greatest common divisor of a and b.
|
||||
* If both a and b are 0 or either or both are <0 then behavior is
|
||||
* undefined.
|
||||
*/
|
||||
int64_t av_const av_gcd(int64_t a, int64_t b);
|
||||
|
||||
/**
|
||||
@@ -69,4 +86,13 @@ int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding) av_cons
|
||||
*/
|
||||
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const;
|
||||
|
||||
/**
|
||||
* Compares 2 timestamps each in its own timebases.
|
||||
* The result of the function is undefined if one of the timestamps
|
||||
* is outside the int64_t range when represented in the others timebase.
|
||||
* @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position
|
||||
*/
|
||||
int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b);
|
||||
|
||||
|
||||
#endif /* AVUTIL_MATHEMATICS_H */
|
||||
|
||||
@@ -19,21 +19,28 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file libavutil/mem.h
|
||||
* @file
|
||||
* memory handling functions
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_MEM_H
|
||||
#define AVUTIL_MEM_H
|
||||
|
||||
#include "common.h"
|
||||
#include "attributes.h"
|
||||
|
||||
#if defined(__ICC) || defined(__SUNPRO_C)
|
||||
#define DECLARE_ALIGNED(n,t,v) t v __attribute__ ((aligned (n)))
|
||||
#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
|
||||
#define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v
|
||||
#elif defined(__TI_COMPILER_VERSION__)
|
||||
#define DECLARE_ALIGNED(n,t,v) \
|
||||
AV_PRAGMA(DATA_ALIGN(v,n)) \
|
||||
t __attribute__((aligned(n))) v
|
||||
#define DECLARE_ASM_CONST(n,t,v) \
|
||||
AV_PRAGMA(DATA_ALIGN(v,n)) \
|
||||
static const t __attribute__((aligned(n))) v
|
||||
#elif defined(__GNUC__)
|
||||
#define DECLARE_ALIGNED(n,t,v) t v __attribute__ ((aligned (n)))
|
||||
#define DECLARE_ASM_CONST(n,t,v) static const t v attribute_used __attribute__ ((aligned (n)))
|
||||
#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
|
||||
#define DECLARE_ASM_CONST(n,t,v) static const t attribute_used __attribute__ ((aligned (n))) v
|
||||
#elif defined(_MSC_VER)
|
||||
#define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v
|
||||
#define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v
|
||||
@@ -42,7 +49,6 @@
|
||||
#define DECLARE_ASM_CONST(n,t,v) static const t v
|
||||
#endif
|
||||
|
||||
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1)
|
||||
#define av_malloc_attrib __attribute__((__malloc__))
|
||||
#else
|
||||
@@ -67,7 +73,7 @@ void *av_malloc(unsigned int size) av_malloc_attrib av_alloc_size(1);
|
||||
|
||||
/**
|
||||
* Allocates or reallocates a block of memory.
|
||||
* If ptr is NULL and size > 0, allocates a new block. If \p
|
||||
* If ptr is NULL and size > 0, allocates a new block. If
|
||||
* size is zero, frees the memory block pointed to by ptr.
|
||||
* @param size Size in bytes for the memory block to be allocated or
|
||||
* reallocated.
|
||||
|
||||
@@ -22,13 +22,15 @@
|
||||
#define AVUTIL_PIXFMT_H
|
||||
|
||||
/**
|
||||
* @file libavutil/pixfmt.h
|
||||
* @file
|
||||
* pixel format definitions
|
||||
*
|
||||
* @warning This file has to be considered an internal but installed
|
||||
* header, so it should not be directly included in your projects.
|
||||
*/
|
||||
|
||||
#include "libavutil/avconfig.h"
|
||||
|
||||
/**
|
||||
* Pixel format. Notes:
|
||||
*
|
||||
@@ -66,8 +68,8 @@ enum PixelFormat {
|
||||
PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
|
||||
PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
|
||||
PIX_FMT_GRAY8, ///< Y , 8bpp
|
||||
PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black
|
||||
PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white
|
||||
PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
|
||||
PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
|
||||
PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette
|
||||
PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG)
|
||||
PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG)
|
||||
@@ -77,12 +79,12 @@ enum PixelFormat {
|
||||
PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
|
||||
PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
|
||||
PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
|
||||
PIX_FMT_BGR4, ///< packed RGB 1:2:1, 4bpp, (msb)1B 2G 1R(lsb)
|
||||
PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
|
||||
PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
|
||||
PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
|
||||
PIX_FMT_RGB4, ///< packed RGB 1:2:1, 4bpp, (msb)1R 2G 1B(lsb)
|
||||
PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
|
||||
PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
|
||||
PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 for UV
|
||||
PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
|
||||
PIX_FMT_NV21, ///< as above, but U and V bytes are swapped
|
||||
|
||||
PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
|
||||
@@ -100,8 +102,8 @@ enum PixelFormat {
|
||||
PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
|
||||
PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
|
||||
PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
|
||||
PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, big-endian
|
||||
PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, little-endian
|
||||
PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
|
||||
PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
|
||||
|
||||
PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
|
||||
PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
|
||||
@@ -117,16 +119,24 @@ enum PixelFormat {
|
||||
PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
|
||||
PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
|
||||
|
||||
PIX_FMT_YUV420PLE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
|
||||
PIX_FMT_YUV420PBE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
|
||||
PIX_FMT_YUV422PLE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
|
||||
PIX_FMT_YUV422PBE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
|
||||
PIX_FMT_YUV444PLE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
PIX_FMT_YUV444PBE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
|
||||
PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
|
||||
PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
|
||||
PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
|
||||
PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
|
||||
PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
|
||||
PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
|
||||
PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
|
||||
|
||||
PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
|
||||
PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
|
||||
PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
|
||||
PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
|
||||
PIX_FMT_Y400A, ///< 8bit gray, 8bit alpha
|
||||
PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
|
||||
};
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
#if AV_HAVE_BIGENDIAN
|
||||
# define PIX_FMT_NE(be, le) PIX_FMT_##be
|
||||
#else
|
||||
# define PIX_FMT_NE(be, le) PIX_FMT_##le
|
||||
@@ -141,11 +151,13 @@ enum PixelFormat {
|
||||
#define PIX_FMT_RGB48 PIX_FMT_NE(RGB48BE, RGB48LE)
|
||||
#define PIX_FMT_RGB565 PIX_FMT_NE(RGB565BE, RGB565LE)
|
||||
#define PIX_FMT_RGB555 PIX_FMT_NE(RGB555BE, RGB555LE)
|
||||
#define PIX_FMT_RGB444 PIX_FMT_NE(RGB444BE, RGB444LE)
|
||||
#define PIX_FMT_BGR565 PIX_FMT_NE(BGR565BE, BGR565LE)
|
||||
#define PIX_FMT_BGR555 PIX_FMT_NE(BGR555BE, BGR555LE)
|
||||
#define PIX_FMT_BGR444 PIX_FMT_NE(BGR444BE, BGR444LE)
|
||||
|
||||
#define PIX_FMT_YUV420P16 PIX_FMT_NE(YUV420PBE, YUV420PLE)
|
||||
#define PIX_FMT_YUV422P16 PIX_FMT_NE(YUV422PBE, YUV422PLE)
|
||||
#define PIX_FMT_YUV444P16 PIX_FMT_NE(YUV444PBE, YUV444PLE)
|
||||
#define PIX_FMT_YUV420P16 PIX_FMT_NE(YUV420P16BE, YUV420P16LE)
|
||||
#define PIX_FMT_YUV422P16 PIX_FMT_NE(YUV422P16BE, YUV422P16LE)
|
||||
#define PIX_FMT_YUV444P16 PIX_FMT_NE(YUV444P16BE, YUV444P16LE)
|
||||
|
||||
#endif /* AVUTIL_PIXFMT_H */
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file libavutil/rational.h
|
||||
* @file
|
||||
* rational numbers
|
||||
* @author Michael Niedermayer <michaelni@gmx.at>
|
||||
*/
|
||||
@@ -29,7 +29,7 @@
|
||||
#define AVUTIL_RATIONAL_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "common.h"
|
||||
#include "attributes.h"
|
||||
|
||||
/**
|
||||
* rational number numerator/denominator
|
||||
|
||||
Reference in New Issue
Block a user