Updated FFmpeg.

This commit is contained in:
Christopher Snowhill 2017-04-22 14:52:10 -07:00
parent e8c1c899e3
commit d2fac79106
32 changed files with 596 additions and 173 deletions

View File

@ -112,6 +112,12 @@
* are filled. This situation is handled transparently if you follow the steps
* outlined above.
*
* In theory, sending input can result in EAGAIN - this should happen only if
* not all output was received. You can use this to structure alternative decode
* or encode loops other than the one suggested above. For example, you could
* try sending new input on each iteration, and try to receive output if that
* returns EAGAIN.
*
* End of stream situations. These require "flushing" (aka draining) the codec,
* as the codec might buffer multiple frames or packets internally for
* performance or out of necessity (consider B-frames).
@ -136,8 +142,9 @@
*
* Not all codecs will follow a rigid and predictable dataflow; the only
* guarantee is that an AVERROR(EAGAIN) return value on a send/receive call on
* one end implies that a receive/send call on the other end will succeed. In
* general, no codec will permit unlimited buffering of input or output.
* one end implies that a receive/send call on the other end will succeed, or
* at least will not fail with AVERROR(EAGAIN). In general, no codec will
* permit unlimited buffering of input or output.
*
* This API replaces the following legacy functions:
* - avcodec_decode_video2() and avcodec_decode_audio4():
@ -146,7 +153,8 @@
* Unlike with the old video decoding API, multiple frames might result from
* a packet. For audio, splitting the input packet into frames by partially
* decoding packets becomes transparent to the API user. You never need to
* feed an AVPacket to the API twice.
* feed an AVPacket to the API twice (unless it is rejected with AVERROR(EAGAIN) - then
* no data was read from the packet).
* Additionally, sending a flush/draining packet is required only once.
* - avcodec_encode_video2()/avcodec_encode_audio2():
* Use avcodec_send_frame() to feed input to the encoder, then use
@ -159,7 +167,22 @@
* and will result in undefined behavior.
*
* Some codecs might require using the new API; using the old API will return
* an error when calling it.
* an error when calling it. All codecs support the new API.
*
* A codec is not allowed to return AVERROR(EAGAIN) for both sending and receiving. This
* would be an invalid state, which could put the codec user into an endless
* loop. The API has no concept of time either: it cannot happen that trying to
* do avcodec_send_packet() results in AVERROR(EAGAIN), but a repeated call 1 second
* later accepts the packet (with no other receive/flush API calls involved).
* The API is a strict state machine, and the passage of time is not supposed
* to influence it. Some timing-dependent behavior might still be deemed
* acceptable in certain cases. But it must never result in both send/receive
* returning EAGAIN at the same time at any point. It must also absolutely be
* avoided that the current state is "unstable" and can "flip-flop" between
* the send/receive APIs allowing progress. For example, it's not allowed that
* the codec randomly decides that it actually wants to consume a packet now
* instead of returning a frame, after it just returned AVERROR(EAGAIN) on an
* avcodec_send_packet() call.
* @}
*/
@ -416,6 +439,12 @@ enum AVCodecID {
AV_CODEC_ID_SPEEDHQ,
AV_CODEC_ID_FMVC,
AV_CODEC_ID_SCPR,
AV_CODEC_ID_CLEARVIDEO,
AV_CODEC_ID_XPM,
AV_CODEC_ID_AV1,
AV_CODEC_ID_BITPACKED,
AV_CODEC_ID_MSCC,
AV_CODEC_ID_SRGC,
/* various PCM "codecs" */
AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
@ -698,7 +727,7 @@ typedef struct AVCodecDescriptor {
/**
* Codec uses only intra compression.
* Video codecs only.
* Video and audio codecs only.
*/
#define AV_CODEC_PROP_INTRA_ONLY (1 << 0)
/**
@ -1369,6 +1398,11 @@ typedef struct AVCPBProperties {
* @{
*/
enum AVPacketSideDataType {
/**
* An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE
* bytes worth of palette. This side data signals that a new palette is
* present.
*/
AV_PKT_DATA_PALETTE,
/**
@ -1542,7 +1576,7 @@ enum AVPacketSideDataType {
/**
* Mastering display metadata (based on SMPTE-2086:2014). This metadata
* should be associated with a video stream and containts data in the form
* should be associated with a video stream and contains data in the form
* of the AVMasteringDisplayMetadata struct.
*/
AV_PKT_DATA_MASTERING_DISPLAY_METADATA,
@ -1552,6 +1586,13 @@ enum AVPacketSideDataType {
* to the AVSphericalMapping structure.
*/
AV_PKT_DATA_SPHERICAL,
/**
* Content light level (based on CTA-861.3). This metadata should be
* associated with a video stream and contains data in the form of the
* AVContentLightMetadata struct.
*/
AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
};
#define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS //DEPRECATED
@ -1680,7 +1721,7 @@ enum AVFieldOrder {
* New fields can be added to the end with minor version bumps.
* Removal, reordering and changes to existing fields require a major
* version bump.
* Please use AVOptions (av_opt* / av_set/get*()) to access these fields from user
* You can use AVOptions (av_opt* / av_set/get*()) to access these fields from user
* applications.
* The name string for AVOptions options matches the associated command line
* parameter name and can be found in libavcodec/options_table.h
@ -2951,8 +2992,8 @@ typedef struct AVCodecContext {
#define FF_DEBUG_MMCO 0x00000800
#define FF_DEBUG_BUGS 0x00001000
#if FF_API_DEBUG_MV
#define FF_DEBUG_VIS_QP 0x00002000 ///< only access through AVOptions from outside libavcodec
#define FF_DEBUG_VIS_MB_TYPE 0x00004000 ///< only access through AVOptions from outside libavcodec
#define FF_DEBUG_VIS_QP 0x00002000
#define FF_DEBUG_VIS_MB_TYPE 0x00004000
#endif
#define FF_DEBUG_BUFFERS 0x00008000
#define FF_DEBUG_THREADS 0x00010000
@ -2962,7 +3003,6 @@ typedef struct AVCodecContext {
#if FF_API_DEBUG_MV
/**
* debug
* Code outside libavcodec should access this field using AVOptions
* - encoding: Set by user.
* - decoding: Set by user.
*/
@ -3097,8 +3137,6 @@ typedef struct AVCodecContext {
* low resolution decoding, 1-> 1/2 size, 2->1/4 size
* - encoding: unused
* - decoding: Set by user.
* Code outside libavcodec should access this field using:
* av_codec_{get,set}_lowres(avctx)
*/
int lowres;
#endif
@ -3399,8 +3437,6 @@ typedef struct AVCodecContext {
/**
* 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)
* - encoding unused.
* - decoding set by user.
*/
@ -3408,8 +3444,6 @@ typedef struct AVCodecContext {
/**
* AVCodecDescriptor
* Code outside libavcodec should access this field using:
* av_codec_{get,set}_codec_descriptor(avctx)
* - encoding: unused.
* - decoding: set by libavcodec.
*/
@ -3420,8 +3454,6 @@ typedef struct AVCodecContext {
* low resolution decoding, 1-> 1/2 size, 2->1/4 size
* - encoding: unused
* - decoding: Set by user.
* Code outside libavcodec should access this field using:
* av_codec_{get,set}_lowres(avctx)
*/
int lowres;
#endif
@ -3462,7 +3494,6 @@ typedef struct AVCodecContext {
* However for formats that do not use pre-multiplied alpha
* there might be serious artefacts (though e.g. libswscale currently
* assumes pre-multiplied alpha anyway).
* Code outside libavcodec should access this field using AVOptions
*
* - decoding: set by user
* - encoding: unused
@ -3479,7 +3510,6 @@ typedef struct AVCodecContext {
#if !FF_API_DEBUG_MV
/**
* debug motion vectors
* Code outside libavcodec should access this field using AVOptions
* - encoding: Set by user.
* - decoding: Set by user.
*/
@ -3491,7 +3521,6 @@ typedef struct AVCodecContext {
/**
* custom intra quantization matrix
* Code outside libavcodec should access this field using av_codec_g/set_chroma_intra_matrix()
* - encoding: Set by user, can be NULL.
* - decoding: unused.
*/
@ -3500,8 +3529,6 @@ typedef struct AVCodecContext {
/**
* dump format separator.
* can be ", " or "\n " or anything else
* Code outside libavcodec should access this field using AVOptions
* (NO direct access).
* - encoding: Set by user.
* - decoding: Set by user.
*/
@ -3511,13 +3538,12 @@ typedef struct AVCodecContext {
* ',' separated list of allowed decoders.
* If NULL then all are allowed
* - encoding: unused
* - decoding: set by user through AVOPtions (NO direct access)
* - decoding: set by user
*/
char *codec_whitelist;
/*
* Properties of the stream that gets decoded
* To be accessed through av_codec_get_properties() (NO direct access)
* - encoding: unused
* - decoding: set by libavcodec
*/
@ -3609,6 +3635,15 @@ typedef struct AVCodecContext {
* contexts used must be created on the same device.
*/
AVBufferRef *hw_device_ctx;
/**
* Bit set of AV_HWACCEL_FLAG_* flags, which affect hardware accelerated
* decoding (if active).
* - encoding: unused
* - decoding: Set by user (either before avcodec_open2(), or in the
* AVCodecContext.get_format callback)
*/
int hwaccel_flags;
} AVCodecContext;
AVRational av_codec_get_pkt_timebase (const AVCodecContext *avctx);
@ -3668,7 +3703,7 @@ typedef struct AVCodec {
const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
uint8_t max_lowres; ///< maximum value for lowres supported by the decoder, no direct access, use av_codec_get_max_lowres()
uint8_t max_lowres; ///< maximum value for lowres supported by the decoder
const AVClass *priv_class; ///< AVClass for the private context
const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
@ -3895,6 +3930,11 @@ typedef struct AVHWAccel {
* AVCodecInternal.hwaccel_priv_data.
*/
int priv_data_size;
/**
* Internal hwaccel capabilities.
*/
int caps_internal;
} AVHWAccel;
/**
@ -4422,13 +4462,13 @@ AVPacket *av_packet_alloc(void);
* @see av_packet_alloc
* @see av_packet_ref
*/
AVPacket *av_packet_clone(AVPacket *src);
AVPacket *av_packet_clone(const AVPacket *src);
/**
* Free the packet, if the packet is reference counted, it will be
* unreferenced first.
*
* @param packet packet to be freed. The pointer will be set to NULL.
* @param pkt packet to be freed. The pointer will be set to NULL.
* @note passing NULL is a no-op.
*/
void av_packet_free(AVPacket **pkt);
@ -4563,12 +4603,16 @@ int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
* @param size pointer for side information size to store (optional)
* @return pointer to data if present or NULL otherwise
*/
uint8_t* av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
uint8_t* av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type,
int *size);
#if FF_API_MERGE_SD_API
attribute_deprecated
int av_packet_merge_side_data(AVPacket *pkt);
attribute_deprecated
int av_packet_split_side_data(AVPacket *pkt);
#endif
const char *av_packet_side_data_name(enum AVPacketSideDataType type);
@ -4868,13 +4912,13 @@ int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
* 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
* Some decoders (those marked with AV_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.
* marked with AV_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.
@ -4928,8 +4972,10 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
* a flush packet.
*
* @return 0 on success, otherwise negative error code:
* AVERROR(EAGAIN): input is not accepted right now - the packet must be
* resent after trying to read output
* AVERROR(EAGAIN): input is not accepted in the current state - user
* must read output with avcodec_receive_frame() (once
* all output is read, the packet should be resent, and
* the call will not fail with EAGAIN).
* AVERROR_EOF: the decoder has been flushed, and no new packets can
* be sent to it (also returned if more than 1 flush
* packet is sent)
@ -4950,7 +4996,7 @@ int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt);
*
* @return
* 0: success, a frame was returned
* AVERROR(EAGAIN): output is not available right now - user must try
* AVERROR(EAGAIN): output is not available in this state - user must try
* to send new input
* AVERROR_EOF: the decoder has been fully flushed, and there will be
* no more output frames
@ -4983,8 +5029,10 @@ int avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame);
* avctx->frame_size for all frames except the last.
* The final frame may be smaller than avctx->frame_size.
* @return 0 on success, otherwise negative error code:
* AVERROR(EAGAIN): input is not accepted right now - the frame must be
* resent after trying to read output packets
* AVERROR(EAGAIN): input is not accepted in the current state - user
* must read output with avcodec_receive_packet() (once
* all output is read, the packet should be resent, and
* the call will not fail with EAGAIN).
* AVERROR_EOF: the encoder has been flushed, and no new frames can
* be sent to it
* AVERROR(EINVAL): codec not opened, refcounted_frames not set, it is a
@ -5002,8 +5050,8 @@ int avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame);
* encoder. Note that the function will always call
* av_frame_unref(frame) before doing anything else.
* @return 0 on success, otherwise negative error code:
* AVERROR(EAGAIN): output is not available right now - user must try
* to send input
* AVERROR(EAGAIN): output is not available in the current state - user
* must try to send input
* AVERROR_EOF: the encoder has been fully flushed, and there will be
* no more output packets
* AVERROR(EINVAL): codec not opened, or it is an encoder
@ -5629,6 +5677,7 @@ attribute_deprecated
void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
#endif
#if FF_API_TAG_STRING
/**
* Put a string representing the codec tag codec_tag in buf.
*
@ -5637,8 +5686,12 @@ void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
* @param codec_tag codec tag to assign
* @return the length of the string that would have been generated if
* enough space had been available, excluding the trailing null
*
* @deprecated see av_fourcc_make_string() and av_fourcc2str().
*/
attribute_deprecated
size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag);
#endif
void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
@ -5751,7 +5804,7 @@ int av_get_audio_frame_duration2(AVCodecParameters *par, int frame_bytes);
#if FF_API_OLD_BSF
typedef struct AVBitStreamFilterContext {
void *priv_data;
struct AVBitStreamFilter *filter;
const struct AVBitStreamFilter *filter;
AVCodecParserContext *parser;
struct AVBitStreamFilterContext *next;
/**
@ -5798,12 +5851,15 @@ typedef struct AVBSFContext {
void *priv_data;
/**
* Parameters of the input stream. Set by the caller before av_bsf_init().
* Parameters of the input stream. This field is allocated in
* av_bsf_alloc(), it needs to be filled by the caller before
* av_bsf_init().
*/
AVCodecParameters *par_in;
/**
* Parameters of the output stream. Set by the filter in av_bsf_init().
* Parameters of the output stream. This field is allocated in
* av_bsf_alloc(), it is set by the filter in av_bsf_init().
*/
AVCodecParameters *par_out;

View File

@ -53,8 +53,7 @@
*
* Deprecated: use AVCodecContext.hw_frames_ctx instead.
*/
attribute_deprecated
struct vaapi_context {
struct attribute_deprecated vaapi_context {
/**
* Window system dependent data
*

View File

@ -50,7 +50,7 @@
*/
#include <vdpau/vdpau.h>
#include <vdpau/vdpau_x11.h>
#include "libavutil/avconfig.h"
#include "libavutil/attributes.h"

View File

@ -28,7 +28,7 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 57
#define LIBAVCODEC_VERSION_MINOR 81
#define LIBAVCODEC_VERSION_MINOR 93
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
@ -157,6 +157,9 @@
#ifndef FF_API_VAAPI_CONTEXT
#define FF_API_VAAPI_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_MERGE_SD
#define FF_API_MERGE_SD (LIBAVCODEC_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_AVCTX_TIMEBASE
#define FF_API_AVCTX_TIMEBASE (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
@ -229,5 +232,12 @@
#ifndef FF_API_STRUCT_VAAPI_CONTEXT
#define FF_API_STRUCT_VAAPI_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_MERGE_SD_API
#define FF_API_MERGE_SD_API (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_TAG_STRING
#define FF_API_TAG_STRING (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#endif /* AVCODEC_VERSION_H */

View File

@ -58,7 +58,8 @@ typedef struct AVVideotoolboxContext {
/**
* CVPixelBuffer Format Type that Videotoolbox will use for decoded frames.
* set by the caller.
* set by the caller. If this is set to 0, then no specific format is
* requested from the decoder, and its native format is output.
*/
OSType cv_pix_fmt_type;

View File

@ -32,9 +32,6 @@ typedef struct AVVorbisParseContext AVVorbisParseContext;
/**
* Allocate and initialize the Vorbis parser using headers in the extradata.
*
* @param avctx codec context
* @param s Vorbis parser context
*/
AVVorbisParseContext *av_vorbis_parse_init(const uint8_t *extradata,
int extradata_size);

View File

@ -1005,7 +1005,9 @@ typedef struct AVStream {
* All fields below this line are not part of the public API. They
* may not be used outside of libavformat and can be changed and
* removed at will.
* New public fields should be added right above.
* Internal note: be aware that physically removing these fields
* will break ABI. Replace removed fields with dummy fields, and
* add new fields to AVStreamInternal.
*****************************************************************
*/
@ -1201,6 +1203,12 @@ typedef struct AVStream {
*/
int inject_global_side_data;
/*****************************************************************
* All fields above this line are not part of the public API.
* Fields below are part of the public API and ABI again.
*****************************************************************
*/
/**
* String containing paris of key and values describing recommended encoder configuration.
* Paris are separated by ','.
@ -1460,7 +1468,9 @@ typedef struct AVFormatContext {
#define AVFMT_FLAG_MP4A_LATM 0x8000 ///< Enable RTP MP4A-LATM payload
#define AVFMT_FLAG_SORT_DTS 0x10000 ///< try to interleave outputted packets by dts (using this flag can slow demuxing down)
#define AVFMT_FLAG_PRIV_OPT 0x20000 ///< Enable use of private options by delaying codec open (this could be made default once all code is converted)
#define AVFMT_FLAG_KEEP_SIDE_DATA 0x40000 ///< Don't merge side data but keep it separate.
#if FF_API_LAVF_KEEPSIDE_FLAG
#define AVFMT_FLAG_KEEP_SIDE_DATA 0x40000 ///< Don't merge side data but keep it separate. Deprecated, will be the default.
#endif
#define AVFMT_FLAG_FAST_SEEK 0x80000 ///< Enable fast, but inaccurate seeks for some formats
#define AVFMT_FLAG_SHORTEST 0x100000 ///< Stop muxing when the shortest stream stops.
#define AVFMT_FLAG_AUTO_BSF 0x200000 ///< Wait for packet data before writing a header, and add bitstream filters as requested by the muxer
@ -1649,7 +1659,7 @@ typedef struct AVFormatContext {
/**
* Audio preload in microseconds.
* Note, not all formats support this and unpredictable things may happen if it is used when not supported.
* - encoding: Set by user via AVOptions (NO direct access)
* - encoding: Set by user
* - decoding: unused
*/
int audio_preload;
@ -1657,7 +1667,7 @@ typedef struct AVFormatContext {
/**
* Max chunk time in microseconds.
* Note, not all formats support this and unpredictable things may happen if it is used when not supported.
* - encoding: Set by user via AVOptions (NO direct access)
* - encoding: Set by user
* - decoding: unused
*/
int max_chunk_duration;
@ -1665,7 +1675,7 @@ typedef struct AVFormatContext {
/**
* Max chunk size in bytes
* Note, not all formats support this and unpredictable things may happen if it is used when not supported.
* - encoding: Set by user via AVOptions (NO direct access)
* - encoding: Set by user
* - decoding: unused
*/
int max_chunk_size;
@ -1674,14 +1684,14 @@ typedef struct AVFormatContext {
* forces the use of wallclock timestamps as pts/dts of packets
* This has undefined results in the presence of B frames.
* - encoding: unused
* - decoding: Set by user via AVOptions (NO direct access)
* - decoding: Set by user
*/
int use_wallclock_as_timestamps;
/**
* avio flags, used to force AVIO_FLAG_DIRECT.
* - encoding: unused
* - decoding: Set by user via AVOptions (NO direct access)
* - decoding: Set by user
*/
int avio_flags;
@ -1689,34 +1699,34 @@ typedef struct AVFormatContext {
* The duration field can be estimated through various ways, and this field can be used
* to know how the duration was estimated.
* - encoding: unused
* - decoding: Read by user via AVOptions (NO direct access)
* - decoding: Read by user
*/
enum AVDurationEstimationMethod duration_estimation_method;
/**
* Skip initial bytes when opening stream
* - encoding: unused
* - decoding: Set by user via AVOptions (NO direct access)
* - decoding: Set by user
*/
int64_t skip_initial_bytes;
/**
* Correct single timestamp overflows
* - encoding: unused
* - decoding: Set by user via AVOptions (NO direct access)
* - decoding: Set by user
*/
unsigned int correct_ts_overflow;
/**
* Force seeking to any (also non key) frames.
* - encoding: unused
* - decoding: Set by user via AVOptions (NO direct access)
* - decoding: Set by user
*/
int seek2any;
/**
* Flush the I/O context after each packet.
* - encoding: Set by user via AVOptions (NO direct access)
* - encoding: Set by user
* - decoding: unused
*/
int flush_packets;
@ -1726,14 +1736,14 @@ typedef struct AVFormatContext {
* The maximal score is AVPROBE_SCORE_MAX, its set when the demuxer probes
* the format.
* - encoding: unused
* - decoding: set by avformat, read by user via av_format_get_probe_score() (NO direct access)
* - decoding: set by avformat, read by user
*/
int probe_score;
/**
* number of bytes to read maximally to identify format.
* - encoding: unused
* - decoding: set by user through AVOPtions (NO direct access)
* - decoding: set by user
*/
int format_probesize;
@ -1741,7 +1751,7 @@ typedef struct AVFormatContext {
* ',' separated list of allowed decoders.
* If NULL then all are allowed
* - encoding: unused
* - decoding: set by user through AVOptions (NO direct access)
* - decoding: set by user
*/
char *codec_whitelist;
@ -1749,7 +1759,7 @@ typedef struct AVFormatContext {
* ',' separated list of allowed demuxers.
* If NULL then all are allowed
* - encoding: unused
* - decoding: set by user through AVOptions (NO direct access)
* - decoding: set by user
*/
char *format_whitelist;
@ -1771,7 +1781,7 @@ typedef struct AVFormatContext {
* Forced video codec.
* This allows forcing a specific decoder, even when there are multiple with
* the same codec_id.
* Demuxing: Set by user via av_format_set_video_codec (NO direct access).
* Demuxing: Set by user
*/
AVCodec *video_codec;
@ -1779,7 +1789,7 @@ typedef struct AVFormatContext {
* Forced audio codec.
* This allows forcing a specific decoder, even when there are multiple with
* the same codec_id.
* Demuxing: Set by user via av_format_set_audio_codec (NO direct access).
* Demuxing: Set by user
*/
AVCodec *audio_codec;
@ -1787,7 +1797,7 @@ typedef struct AVFormatContext {
* Forced subtitle codec.
* This allows forcing a specific decoder, even when there are multiple with
* the same codec_id.
* Demuxing: Set by user via av_format_set_subtitle_codec (NO direct access).
* Demuxing: Set by user
*/
AVCodec *subtitle_codec;
@ -1795,7 +1805,7 @@ typedef struct AVFormatContext {
* Forced data codec.
* This allows forcing a specific decoder, even when there are multiple with
* the same codec_id.
* Demuxing: Set by user via av_format_set_data_codec (NO direct access).
* Demuxing: Set by user
*/
AVCodec *data_codec;
@ -1819,15 +1829,13 @@ typedef struct AVFormatContext {
/**
* Output timestamp offset, in microseconds.
* Muxing: set by user via AVOptions (NO direct access)
* Muxing: set by user
*/
int64_t output_ts_offset;
/**
* dump format separator.
* can be ", " or "\n " or anything else
* Code outside libavformat should access this field using AVOptions
* (NO direct access).
* - muxing: Set by user.
* - demuxing: Set by user.
*/
@ -1864,7 +1872,7 @@ typedef struct AVFormatContext {
/**
* ',' separated list of allowed protocols.
* - encoding: unused
* - decoding: set by user through AVOptions (NO direct access)
* - decoding: set by user
*/
char *protocol_whitelist;
@ -1899,18 +1907,22 @@ typedef struct AVFormatContext {
/**
* ',' separated list of disallowed protocols.
* - encoding: unused
* - decoding: set by user through AVOptions (NO direct access)
* - decoding: set by user
*/
char *protocol_blacklist;
/**
* The maximum number of streams.
* - encoding: unused
* - decoding: set by user through AVOptions (NO direct access)
* - decoding: set by user
*/
int max_streams;
} AVFormatContext;
/**
* Accessors for some AVFormatContext fields. These used to be provided for ABI
* compatibility, and do not need to be used anymore.
*/
int av_format_get_probe_score(const AVFormatContext *s);
AVCodec * av_format_get_video_codec(const AVFormatContext *s);
void av_format_set_video_codec(AVFormatContext *s, AVCodec *c);

View File

@ -34,7 +34,15 @@
#include "libavformat/version.h"
#define AVIO_SEEKABLE_NORMAL 0x0001 /**< Seeking works like for a local file */
/**
* Seeking works like for a local file.
*/
#define AVIO_SEEKABLE_NORMAL (1 << 0)
/**
* Seeking by timestamp with avio_seek_time() is possible.
*/
#define AVIO_SEEKABLE_TIME (1 << 1)
/**
* Callback for checking whether to abort blocking functions.
@ -319,6 +327,8 @@ typedef struct AVIOContext {
* This is current internal only, do not use from outside.
*/
int (*short_seek_get)(void *opaque);
int64_t written;
} AVIOContext;
/**

View File

@ -32,8 +32,8 @@
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
// Also please add any ticket numbers that you believe might be affected here
#define LIBAVFORMAT_VERSION_MAJOR 57
#define LIBAVFORMAT_VERSION_MINOR 66
#define LIBAVFORMAT_VERSION_MICRO 102
#define LIBAVFORMAT_VERSION_MINOR 72
#define LIBAVFORMAT_VERSION_MICRO 101
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
@ -88,6 +88,15 @@
#ifndef FF_API_HLS_WRAP
#define FF_API_HLS_WRAP (LIBAVFORMAT_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_LAVF_MERGE_SD
#define FF_API_LAVF_MERGE_SD (LIBAVFORMAT_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_LAVF_KEEPSIDE_FLAG
#define FF_API_LAVF_KEEPSIDE_FLAG (LIBAVFORMAT_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_OLD_ROTATE_API
#define FF_API_OLD_ROTATE_API (LIBAVFORMAT_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_R_FRAME_RATE

View File

@ -266,6 +266,11 @@ int av_strcasecmp(const char *a, const char *b);
*/
int av_strncasecmp(const char *a, const char *b, size_t n);
/**
* Locale-independent strings replace.
* @note This means only ASCII-range characters are replace
*/
char *av_strireplace(const char *str, const char *from, const char *to);
/**
* Thread safe basename.

View File

@ -343,6 +343,20 @@ FILE *av_fopen_utf8(const char *path, const char *mode);
*/
AVRational av_get_time_base_q(void);
#define AV_FOURCC_MAX_STRING_SIZE 32
#define av_fourcc2str(fourcc) av_fourcc_make_string((char[AV_FOURCC_MAX_STRING_SIZE]){0}, fourcc)
/**
* Fill the provided buffer with a string containing a FourCC (four-character
* code) representation.
*
* @param buf a buffer with size in bytes of at least AV_FOURCC_MAX_STRING_SIZE
* @param fourcc the fourcc to represent
* @return the buffer in input
*/
char *av_fourcc_make_string(char *buf, uint32_t fourcc);
/**
* @}
* @}

View File

@ -256,9 +256,10 @@ AVBufferPool *av_buffer_pool_init(int size, AVBufferRef* (*alloc)(int size));
* @param alloc a function that will be used to allocate new buffers when the
* pool is empty.
* @param pool_free a function that will be called immediately before the pool
* is freed. I.e. after av_buffer_pool_can_uninit() is called
* by the pool and all the frames are returned to the pool and
* freed. It is intended to uninitialize the user opaque data.
* is freed. I.e. after av_buffer_pool_uninit() is called
* by the caller and all the frames are returned to the pool
* and freed. It is intended to uninitialize the user opaque
* data.
* @return newly created buffer pool on success, NULL on error.
*/
AVBufferPool *av_buffer_pool_init2(int size, void *opaque,

View File

@ -18,6 +18,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* Display matrix
*/
#ifndef AVUTIL_DISPLAY_H
#define AVUTIL_DISPLAY_H
@ -25,15 +30,26 @@
#include "common.h"
/**
* @addtogroup lavu_video
* @{
*
* @defgroup lavu_video_display Display transformation matrix functions
* @{
*/
/**
* @addtogroup lavu_video_display
* The display transformation matrix specifies an affine transformation that
* should be applied to video frames for correct presentation. It is compatible
* with the matrices stored in the ISO/IEC 14496-12 container format.
*
* The data is a 3x3 matrix represented as a 9-element array:
*
* @code{.unparsed}
* | a b u |
* (a, b, u, c, d, v, x, y, w) -> | c d v |
* | x y w |
* @endcode
*
* All numbers are stored in native endianness, as 16.16 fixed-point values,
* except for u, v and w, which are stored as 2.30 fixed-point values.
@ -41,15 +57,21 @@
* The transformation maps a point (p, q) in the source (pre-transformation)
* frame to the point (p', q') in the destination (post-transformation) frame as
* follows:
*
* @code{.unparsed}
* | a b u |
* (p, q, 1) . | c d v | = z * (p', q', 1)
* | x y w |
* @endcode
*
* The transformation can also be more explicitly written in components as
* follows:
*
* @code{.unparsed}
* p' = (a * p + c * q + x) / z;
* q' = (b * p + d * q + y) / z;
* z = u * p + v * q + w
* @endcode
*/
/**
@ -84,4 +106,9 @@ void av_display_rotation_set(int32_t matrix[9], double angle);
*/
void av_display_matrix_flip(int32_t matrix[9], int hflip, int vflip);
/**
* @}
* @}
*/
#endif /* AVUTIL_DISPLAY_H */

View File

@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
#define FFMPEG_VERSION "N-83693-g11e629a4c0"
#define FFMPEG_VERSION "N-85607-g4d15724952"
#endif /* AVUTIL_FFVERSION_H */

View File

@ -127,6 +127,12 @@ enum AVFrameSideDataType {
* libavutil/spherical.h.
*/
AV_FRAME_DATA_SPHERICAL,
/**
* Content light level (based on CTA-861.3). This payload contains data in
* the form of the AVContentLightMetadata struct.
*/
AV_FRAME_DATA_CONTENT_LIGHT_LEVEL,
};
enum AVActiveFormatDescription {
@ -179,9 +185,6 @@ typedef struct AVFrameSideData {
*
* sizeof(AVFrame) is not a part of the public ABI, so new fields may be added
* to the end with a minor bump.
* Similarly fields that are marked as to be only accessed by
* av_opt_ptr() can be reordered. This allows 2 forks to add fields
* without breaking compatibility with each other.
*
* Fields can be accessed through AVOptions, the name string used, matches the
* C structure field name for fields accessible through AVOptions. The AVClass
@ -420,8 +423,6 @@ typedef struct AVFrame {
/**
* MPEG vs JPEG YUV range.
* It must be accessed using av_frame_get_color_range() and
* av_frame_set_color_range().
* - encoding: Set by user
* - decoding: Set by libavcodec
*/
@ -433,8 +434,6 @@ typedef struct AVFrame {
/**
* YUV colorspace type.
* It must be accessed using av_frame_get_colorspace() and
* av_frame_set_colorspace().
* - encoding: Set by user
* - decoding: Set by libavcodec
*/
@ -444,8 +443,6 @@ typedef struct AVFrame {
/**
* frame timestamp estimated using various heuristics, in stream time base
* Code outside libavutil should access this field using:
* av_frame_get_best_effort_timestamp(frame)
* - encoding: unused
* - decoding: set by libavcodec, read by user.
*/
@ -453,8 +450,6 @@ typedef struct AVFrame {
/**
* reordered pos from the last AVPacket that has been input into the decoder
* Code outside libavutil should access this field using:
* av_frame_get_pkt_pos(frame)
* - encoding: unused
* - decoding: Read by user.
*/
@ -463,8 +458,6 @@ typedef struct AVFrame {
/**
* duration of the corresponding packet, expressed in
* AVStream->time_base units, 0 if unknown.
* Code outside libavutil should access this field using:
* av_frame_get_pkt_duration(frame)
* - encoding: unused
* - decoding: Read by user.
*/
@ -472,8 +465,6 @@ typedef struct AVFrame {
/**
* metadata.
* Code outside libavutil should access this field using:
* av_frame_get_metadata(frame)
* - encoding: Set by user.
* - decoding: Set by libavcodec.
*/
@ -483,8 +474,6 @@ typedef struct AVFrame {
* decode error flags of the frame, set to a combination of
* FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there
* were errors during the decoding.
* Code outside libavutil should access this field using:
* av_frame_get_decode_error_flags(frame)
* - encoding: unused
* - decoding: set by libavcodec, read by user.
*/
@ -494,8 +483,6 @@ typedef struct AVFrame {
/**
* number of audio channels, only used for audio.
* Code outside libavutil should access this field using:
* av_frame_get_channels(frame)
* - encoding: unused
* - decoding: Read by user.
*/
@ -503,8 +490,7 @@ typedef struct AVFrame {
/**
* size of the corresponding packet containing the compressed
* frame. It must be accessed using av_frame_get_pkt_size() and
* av_frame_set_pkt_size().
* frame.
* It is set to a negative value if unknown.
* - encoding: unused
* - decoding: set by libavcodec, read by user.
@ -514,13 +500,11 @@ typedef struct AVFrame {
#if FF_API_FRAME_QP
/**
* QP table
* Not to be accessed directly from outside libavutil
*/
attribute_deprecated
int8_t *qscale_table;
/**
* QP store stride
* Not to be accessed directly from outside libavutil
*/
attribute_deprecated
int qstride;
@ -528,9 +512,6 @@ typedef struct AVFrame {
attribute_deprecated
int qscale_type;
/**
* Not to be accessed directly from outside libavutil
*/
AVBufferRef *qp_table_buf;
#endif
/**
@ -552,9 +533,8 @@ typedef struct AVFrame {
} AVFrame;
/**
* Accessors for some AVFrame fields.
* The position of these field in the structure is not part of the ABI,
* they should not be accessed directly outside libavutil.
* Accessors for some AVFrame fields. These used to be provided for ABI
* compatibility, and do not need to be used anymore.
*/
int64_t av_frame_get_best_effort_timestamp(const AVFrame *frame);
void av_frame_set_best_effort_timestamp(AVFrame *frame, int64_t val);

View File

@ -223,10 +223,9 @@ typedef struct AVHWFramesContext {
} AVHWFramesContext;
/**
* Allocate an AVHWDeviceContext for a given pixel format.
* Allocate an AVHWDeviceContext for a given hardware type.
*
* @param format a hwaccel pixel format (AV_PIX_FMT_FLAG_HWACCEL must be set
* on the corresponding format descriptor)
* @param type the type of the hardware device to allocate.
* @return a reference to the newly created AVHWDeviceContext on success or NULL
* on failure.
*/
@ -418,7 +417,7 @@ void *av_hwdevice_hwconfig_alloc(AVBufferRef *device_ctx);
* configuration is provided, returns the maximum possible capabilities
* of the device.
*
* @param device_ctx a reference to the associated AVHWDeviceContext.
* @param ref a reference to the associated AVHWDeviceContext.
* @param hwconfig a filled HW-specific configuration structure, or NULL
* to return the maximum possible capabilities of the device.
* @return AVHWFramesConstraints structure describing the constraints
@ -434,4 +433,91 @@ AVHWFramesConstraints *av_hwdevice_get_hwframe_constraints(AVBufferRef *ref,
*/
void av_hwframe_constraints_free(AVHWFramesConstraints **constraints);
/**
* Flags to apply to frame mappings.
*/
enum {
/**
* The mapping must be readable.
*/
AV_HWFRAME_MAP_READ = 1 << 0,
/**
* The mapping must be writeable.
*/
AV_HWFRAME_MAP_WRITE = 1 << 1,
/**
* The mapped frame will be overwritten completely in subsequent
* operations, so the current frame data need not be loaded. Any values
* which are not overwritten are unspecified.
*/
AV_HWFRAME_MAP_OVERWRITE = 1 << 2,
/**
* The mapping must be direct. That is, there must not be any copying in
* the map or unmap steps. Note that performance of direct mappings may
* be much lower than normal memory.
*/
AV_HWFRAME_MAP_DIRECT = 1 << 3,
};
/**
* Map a hardware frame.
*
* This has a number of different possible effects, depending on the format
* and origin of the src and dst frames. On input, src should be a usable
* frame with valid buffers and dst should be blank (typically as just created
* by av_frame_alloc()). src should have an associated hwframe context, and
* dst may optionally have a format and associated hwframe context.
*
* If src was created by mapping a frame from the hwframe context of dst,
* then this function undoes the mapping - dst is replaced by a reference to
* the frame that src was originally mapped from.
*
* If both src and dst have an associated hwframe context, then this function
* attempts to map the src frame from its hardware context to that of dst and
* then fill dst with appropriate data to be usable there. This will only be
* possible if the hwframe contexts and associated devices are compatible -
* given compatible devices, av_hwframe_ctx_create_derived() can be used to
* create a hwframe context for dst in which mapping should be possible.
*
* If src has a hwframe context but dst does not, then the src frame is
* mapped to normal memory and should thereafter be usable as a normal frame.
* If the format is set on dst, then the mapping will attempt to create dst
* with that format and fail if it is not possible. If format is unset (is
* AV_PIX_FMT_NONE) then dst will be mapped with whatever the most appropriate
* format to use is (probably the sw_format of the src hwframe context).
*
* A return value of AVERROR(ENOSYS) indicates that the mapping is not
* possible with the given arguments and hwframe setup, while other return
* values indicate that it failed somehow.
*
* @param dst Destination frame, to contain the mapping.
* @param src Source frame, to be mapped.
* @param flags Some combination of AV_HWFRAME_MAP_* flags.
* @return Zero on success, negative AVERROR code on failure.
*/
int av_hwframe_map(AVFrame *dst, const AVFrame *src, int flags);
/**
* Create and initialise an AVHWFramesContext as a mapping of another existing
* AVHWFramesContext on a different device.
*
* av_hwframe_ctx_init() should not be called after this.
*
* @param derived_frame_ctx On success, a reference to the newly created
* AVHWFramesContext.
* @param derived_device_ctx A reference to the device to create the new
* AVHWFramesContext on.
* @param source_frame_ctx A reference to an existing AVHWFramesContext
* which will be mapped to the derived context.
* @param flags Currently unused; should be set to zero.
* @return Zero on success, negative AVERROR code on failure.
*/
int av_hwframe_ctx_create_derived(AVBufferRef **derived_frame_ctx,
enum AVPixelFormat format,
AVBufferRef *derived_device_ctx,
AVBufferRef *source_frame_ctx,
int flags);
#endif /* AVUTIL_HWCONTEXT_H */

View File

@ -120,6 +120,24 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
const uint8_t *src_data[4], const int src_linesizes[4],
enum AVPixelFormat pix_fmt, int width, int height);
/**
* Copy image data located in uncacheable (e.g. GPU mapped) memory. Where
* available, this function will use special functionality for reading from such
* memory, which may result in greatly improved performance compared to plain
* av_image_copy().
*
* The data pointers and the linesizes must be aligned to the maximum required
* by the CPU architecture.
*
* @note The linesize parameters have the type ptrdiff_t here, while they are
* int for av_image_copy().
* @note On x86, the linesizes currently need to be aligned to the cacheline
* size (i.e. 64) to get improved performance.
*/
void av_image_copy_uc_from(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4],
const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4],
enum AVPixelFormat pix_fmt, int width, int height);
/**
* Setup the data pointers and linesizes based on the specified image
* parameters and the provided array.
@ -137,7 +155,7 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
* one call, use av_image_alloc().
*
* @param dst_data data pointers to be filled in
* @param dst_linesizes linesizes for the image in dst_data to be filled in
* @param dst_linesize linesizes for the image in dst_data to be filled in
* @param src buffer which will contain or contains the actual image data, can be NULL
* @param pix_fmt the pixel format of the image
* @param width the width of the image in pixels
@ -167,7 +185,7 @@ int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, int width, int height,
* @param dst a buffer into which picture data will be copied
* @param dst_size the size in bytes of dst
* @param src_data pointers containing the source image data
* @param src_linesizes linesizes for the image in src_data
* @param src_linesize linesizes for the image in src_data
* @param pix_fmt the pixel format of the source image
* @param width the width of the source image in pixels
* @param height the height of the source image in pixels

View File

@ -229,6 +229,11 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
# define AV_RN(s, p) (*((const __unaligned uint##s##_t*)(p)))
# define AV_WN(s, p, v) (*((__unaligned uint##s##_t*)(p)) = (v))
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_X64)) && AV_HAVE_FAST_UNALIGNED
# define AV_RN(s, p) (*((const __unaligned uint##s##_t*)(p)))
# define AV_WN(s, p, v) (*((__unaligned uint##s##_t*)(p)) = (v))
#elif AV_HAVE_FAST_UNALIGNED
# define AV_RN(s, p) (((const av_alias##s*)(p))->u##s)
@ -242,8 +247,8 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
((const uint8_t*)(x))[1])
#endif
#ifndef AV_WB16
# define AV_WB16(p, darg) do { \
unsigned d = (darg); \
# define AV_WB16(p, val) do { \
uint16_t d = (val); \
((uint8_t*)(p))[1] = (d); \
((uint8_t*)(p))[0] = (d)>>8; \
} while(0)
@ -255,8 +260,8 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
((const uint8_t*)(x))[0])
#endif
#ifndef AV_WL16
# define AV_WL16(p, darg) do { \
unsigned d = (darg); \
# define AV_WL16(p, val) do { \
uint16_t d = (val); \
((uint8_t*)(p))[0] = (d); \
((uint8_t*)(p))[1] = (d)>>8; \
} while(0)
@ -270,8 +275,8 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
((const uint8_t*)(x))[3])
#endif
#ifndef AV_WB32
# define AV_WB32(p, darg) do { \
unsigned d = (darg); \
# define AV_WB32(p, val) do { \
uint32_t d = (val); \
((uint8_t*)(p))[3] = (d); \
((uint8_t*)(p))[2] = (d)>>8; \
((uint8_t*)(p))[1] = (d)>>16; \
@ -287,8 +292,8 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
((const uint8_t*)(x))[0])
#endif
#ifndef AV_WL32
# define AV_WL32(p, darg) do { \
unsigned d = (darg); \
# define AV_WL32(p, val) do { \
uint32_t d = (val); \
((uint8_t*)(p))[0] = (d); \
((uint8_t*)(p))[1] = (d)>>8; \
((uint8_t*)(p))[2] = (d)>>16; \
@ -308,8 +313,8 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
(uint64_t)((const uint8_t*)(x))[7])
#endif
#ifndef AV_WB64
# define AV_WB64(p, darg) do { \
uint64_t d = (darg); \
# define AV_WB64(p, val) do { \
uint64_t d = (val); \
((uint8_t*)(p))[7] = (d); \
((uint8_t*)(p))[6] = (d)>>8; \
((uint8_t*)(p))[5] = (d)>>16; \
@ -333,8 +338,8 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
(uint64_t)((const uint8_t*)(x))[0])
#endif
#ifndef AV_WL64
# define AV_WL64(p, darg) do { \
uint64_t d = (darg); \
# define AV_WL64(p, val) do { \
uint64_t d = (val); \
((uint8_t*)(p))[0] = (d); \
((uint8_t*)(p))[1] = (d)>>8; \
((uint8_t*)(p))[2] = (d)>>16; \

View File

@ -86,4 +86,43 @@ AVMasteringDisplayMetadata *av_mastering_display_metadata_alloc(void);
*/
AVMasteringDisplayMetadata *av_mastering_display_metadata_create_side_data(AVFrame *frame);
/**
* Content light level needed by to transmit HDR over HDMI (CTA-861.3).
*
* To be used as payload of a AVFrameSideData or AVPacketSideData with the
* appropriate type.
*
* @note The struct should be allocated with av_content_light_metadata_alloc()
* and its size is not a part of the public ABI.
*/
typedef struct AVContentLightMetadata {
/**
* Max content light level (cd/m^2).
*/
unsigned MaxCLL;
/**
* Max average light level per frame (cd/m^2).
*/
unsigned MaxFALL;
} AVContentLightMetadata;
/**
* Allocate an AVContentLightMetadata structure and set its fields to
* default values. The resulting struct can be freed using av_freep().
*
* @return An AVContentLightMetadata filled with default values or NULL
* on failure.
*/
AVContentLightMetadata *av_content_light_metadata_alloc(size_t *size);
/**
* Allocate a complete AVContentLightMetadata and add it to the frame.
*
* @param frame The frame which side data is added to.
*
* @return The AVContentLightMetadata structure to be filled by caller.
*/
AVContentLightMetadata *av_content_light_metadata_create_side_data(AVFrame *frame);
#endif /* AVUTIL_MASTERING_DISPLAY_METADATA_H */

View File

@ -97,6 +97,9 @@
#define DECLARE_ASM_CONST(n,t,v) \
AV_PRAGMA(DATA_ALIGN(v,n)) \
static const t __attribute__((aligned(n))) v
#elif defined(__DJGPP__)
#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (FFMIN(n, 16)))) v
#define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v
#elif defined(__GNUC__) || defined(__clang__)
#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
#define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v

View File

@ -176,6 +176,11 @@ typedef struct AVPixFmtDescriptor {
*/
#define AV_PIX_FMT_FLAG_ALPHA (1 << 7)
/**
* The pixel format is following a Bayer pattern
*/
#define AV_PIX_FMT_FLAG_BAYER (1 << 8)
/**
* Return the number of bits per pixel used by the pixel format
* described by pixdesc. Note that this is not the same as the number

View File

@ -396,6 +396,7 @@ enum AVPixelFormat {
/**
* Chromaticity coordinates of the source primaries.
* These values match the ones defined by ISO/IEC 23001-8_2013 § 7.1.
*/
enum AVColorPrimaries {
AVCOL_PRI_RESERVED0 = 0,
@ -411,13 +412,15 @@ enum AVColorPrimaries {
AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020
AVCOL_PRI_SMPTE428 = 10, ///< SMPTE ST 428-1 (CIE 1931 XYZ)
AVCOL_PRI_SMPTEST428_1 = AVCOL_PRI_SMPTE428,
AVCOL_PRI_SMPTE431 = 11, ///< SMPTE ST 431-2 (2011)
AVCOL_PRI_SMPTE432 = 12, ///< SMPTE ST 432-1 D65 (2010)
AVCOL_PRI_SMPTE431 = 11, ///< SMPTE ST 431-2 (2011) / DCI P3
AVCOL_PRI_SMPTE432 = 12, ///< SMPTE ST 432-1 (2010) / P3 D65 / Display P3
AVCOL_PRI_JEDEC_P22 = 22, ///< JEDEC P22 phosphors
AVCOL_PRI_NB ///< Not part of ABI
};
/**
* Color Transfer Characteristic.
* These values match the ones defined by ISO/IEC 23001-8_2013 § 7.2.
*/
enum AVColorTransferCharacteristic {
AVCOL_TRC_RESERVED0 = 0,
@ -446,6 +449,7 @@ enum AVColorTransferCharacteristic {
/**
* YUV colorspace type.
* These values match the ones defined by ISO/IEC 23001-8_2013 § 7.3.
*/
enum AVColorSpace {
AVCOL_SPC_RGB = 0, ///< order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB)
@ -456,7 +460,8 @@ enum AVColorSpace {
AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
AVCOL_SPC_SMPTE240M = 7, ///< functionally identical to above
AVCOL_SPC_YCOCG = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16
AVCOL_SPC_YCGCO = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16
AVCOL_SPC_YCOCG = AVCOL_SPC_YCGCO,
AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system
AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system
AVCOL_SPC_SMPTE2085 = 11, ///< SMPTE 2085, Y'D'zD'x

View File

@ -63,6 +63,13 @@ enum AVSphericalProjection {
* to the back.
*/
AV_SPHERICAL_CUBEMAP,
/**
* Video represents a portion of a sphere mapped on a flat surface
* using equirectangular projection. The @ref bounding fields indicate
* the position of the current video in a larger surface.
*/
AV_SPHERICAL_EQUIRECTANGULAR_TILE,
};
/**
@ -122,6 +129,57 @@ typedef struct AVSphericalMapping {
/**
* @}
*/
/**
* @name Bounding rectangle
* @anchor bounding
* @{
* These fields indicate the location of the current tile, and where
* it should be mapped relative to the original surface. They are
* exported as 0.32 fixed point, and can be converted to classic
* pixel values with av_spherical_bounds().
*
* @code{.unparsed}
* +----------------+----------+
* | |bound_top |
* | +--------+ |
* | bound_left |tile | |
* +<---------->| |<--->+bound_right
* | +--------+ |
* | | |
* | bound_bottom| |
* +----------------+----------+
* @endcode
*
* If needed, the original video surface dimensions can be derived
* by adding the current stream or frame size to the related bounds,
* like in the following example:
*
* @code{c}
* original_width = tile->width + bound_left + bound_right;
* original_height = tile->height + bound_top + bound_bottom;
* @endcode
*
* @note These values are valid only for the tiled equirectangular
* projection type (@ref AV_SPHERICAL_EQUIRECTANGULAR_TILE),
* and should be ignored in all other cases.
*/
uint32_t bound_left; ///< Distance from the left edge
uint32_t bound_top; ///< Distance from the top edge
uint32_t bound_right; ///< Distance from the right edge
uint32_t bound_bottom; ///< Distance from the bottom edge
/**
* @}
*/
/**
* Number of pixels to pad from the edge of each cube face.
*
* @note This value is valid for only for the cubemap projection type
* (@ref AV_SPHERICAL_CUBEMAP), and should be ignored in all other
* cases.
*/
uint32_t padding;
} AVSphericalMapping;
/**
@ -132,6 +190,40 @@ typedef struct AVSphericalMapping {
*/
AVSphericalMapping *av_spherical_alloc(size_t *size);
/**
* Convert the @ref bounding fields from an AVSphericalVideo
* from 0.32 fixed point to pixels.
*
* @param map The AVSphericalVideo map to read bound values from.
* @param width Width of the current frame or stream.
* @param height Height of the current frame or stream.
* @param left Pixels from the left edge.
* @param top Pixels from the top edge.
* @param right Pixels from the right edge.
* @param bottom Pixels from the bottom edge.
*/
void av_spherical_tile_bounds(const AVSphericalMapping *map,
size_t width, size_t height,
size_t *left, size_t *top,
size_t *right, size_t *bottom);
/**
* Provide a human-readable name of a given AVSphericalProjection.
*
* @param projection The input AVSphericalProjection.
*
* @return The name of the AVSphericalProjection, or "unknown".
*/
const char *av_spherical_projection_name(enum AVSphericalProjection projection);
/**
* Get the AVSphericalProjection form a human-readable name.
*
* @param name The input string.
*
* @return The AVSphericalProjection value, or -1 if not found.
*/
int av_spherical_from_name(const char *name);
/**
* @}
* @}

View File

@ -18,6 +18,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* Stereoscopic video
*/
#ifndef AVUTIL_STEREO3D_H
#define AVUTIL_STEREO3D_H
@ -25,6 +30,21 @@
#include "frame.h"
/**
* @addtogroup lavu_video
* @{
*
* @defgroup lavu_video_stereo3d Stereo3D types and functions
* @{
*/
/**
* @addtogroup lavu_video_stereo3d
* A stereoscopic video file consists in multiple views embedded in a single
* frame, usually describing two views of a scene. This file describes all
* possible codec-independent view arrangements.
* */
/**
* List of possible 3D Types
*/
@ -37,41 +57,49 @@ enum AVStereo3DType {
/**
* Views are next to each other.
*
* @code{.unparsed}
* LLLLRRRR
* LLLLRRRR
* LLLLRRRR
* ...
* @endcode
*/
AV_STEREO3D_SIDEBYSIDE,
/**
* Views are on top of each other.
*
* @code{.unparsed}
* LLLLLLLL
* LLLLLLLL
* RRRRRRRR
* RRRRRRRR
* @endcode
*/
AV_STEREO3D_TOPBOTTOM,
/**
* Views are alternated temporally.
*
* @code{.unparsed}
* frame0 frame1 frame2 ...
* LLLLLLLL RRRRRRRR LLLLLLLL
* LLLLLLLL RRRRRRRR LLLLLLLL
* LLLLLLLL RRRRRRRR LLLLLLLL
* ... ... ...
* @endcode
*/
AV_STEREO3D_FRAMESEQUENCE,
/**
* Views are packed in a checkerboard-like structure per pixel.
*
* @code{.unparsed}
* LRLRLRLR
* RLRLRLRL
* LRLRLRLR
* ...
* @endcode
*/
AV_STEREO3D_CHECKERBOARD,
@ -79,30 +107,36 @@ enum AVStereo3DType {
* Views are next to each other, but when upscaling
* apply a checkerboard pattern.
*
* @code{.unparsed}
* LLLLRRRR L L L L R R R R
* LLLLRRRR => L L L L R R R R
* LLLLRRRR L L L L R R R R
* LLLLRRRR L L L L R R R R
* @endcode
*/
AV_STEREO3D_SIDEBYSIDE_QUINCUNX,
/**
* Views are packed per line, as if interlaced.
*
* @code{.unparsed}
* LLLLLLLL
* RRRRRRRR
* LLLLLLLL
* ...
* @endcode
*/
AV_STEREO3D_LINES,
/**
* Views are packed per column.
*
* @code{.unparsed}
* LRLRLRLR
* LRLRLRLR
* LRLRLRLR
* ...
* @endcode
*/
AV_STEREO3D_COLUMNS,
};
@ -161,10 +195,15 @@ const char *av_stereo3d_type_name(unsigned int type);
/**
* Get the AVStereo3DType form a human-readable name.
*
* @param type The input string.
* @param name The input string.
*
* @return The AVStereo3DType value, or -1 if not found.
*/
int av_stereo3d_from_name(const char *name);
/**
* @}
* @}
*/
#endif /* AVUTIL_STEREO3D_H */

View File

@ -79,7 +79,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 55
#define LIBAVUTIL_VERSION_MINOR 47
#define LIBAVUTIL_VERSION_MINOR 61
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

Binary file not shown.

View File

@ -1,17 +1,17 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAABCAAGBQJYtjy/AAoJEI1smEefSt5xtqgQAKFIkXsgO9lJqY+UZ+/kx+l6
oASaOAl8UFM+L7VXg1NJ4WCETc5M/OY2D0d45HBEfHwRYlLMOqNIXiI4VumPYrFQ
Fg1VQyfKNCQiGdjpY0Klu5Ew3EW/PSFOHTqAXK8wavXzBG7jWOYiv7jM11/r21mJ
4yyuPR3RWxUMGrC7DEek4yatdnjWgmVgTrEPy1d6s6AVMihtKL5zEfUUEj9NA64m
7BGLMBCa6K4XoK1ZZQMVFHLDkd3xrR1fbgqVRXYfWuUv3bR/izLxd93zV+aHoBhb
DdsK+7ERlMbkIWwHnGDTsdqrO5v+qk+Ec73sd+lMqJUshX/eO9EXkhsFM98F4is8
r1wgRQiXtgUp80qDGDgQktTDpW+pwqxk/r/dgDBBN9sRP0LZk4Vv7uXUEoxhH7Ao
4v9KZ7i1YRQ3D2HU/CsN/KXPgwq2erhhG7jdWwwttnTl/DFtjsjwtRZgi5iU65Wg
i9dxNcScsM4VUKt+vCaSgU90jElmph31WIxeGMJfzHoQeXd5Qu0oW17nIPH2YfhM
2V928h6X7otHVX4QAueOAG102h5uD3Lacbm04el37PHpq2XjPiGgxm4WGCV1ZOEm
5HMeanR/M2J3mid7nLCCho8RVvdGQVISTan0XfX3KtY0R4tdmkNd6UV6o+TH49A1
1gZhrZflzueWCCJjBhE5
=Odm/
iQIcBAABCAAGBQJY+9BjAAoJEI1smEefSt5xFmgP/iR+RQYIkkrgR/idxJrbd07y
bRLYyYFErK7K6dl5fSqQs0IuQd71EQX/fiJnVLR1CtLWNco5x7DfKSsclXY+pGto
AYskzYikh1MHJDPXd4nOOlSYNcIP6KAVPm5TzWOehOaUzT8Ce/QViNeC956ikggC
qa4DsK7JkdOPX9vILVOMuWEerYDqewnlFx07JY5EjOXzitmYddZBtdv9kW8dxyVT
6xyNXHFuHVtpVT5DHqrfjn79HkDr0tUpeWErJ5rVItB7X5YZqi+8aQOXHhUCvcI9
4gTo+KE9NhKsuIPpC6L5rffge2HUR2BflcxL5/FI/lXwGmr6vAhztKcQMGeZVtEJ
mZMrJUAShRSgNxxUgstYXQKU/f8CsS1JTodpKhXIy4OtBuKS4eZcP6T0sORYdhlt
+0+ZnFbptIqV/EKSjkDUQTgmKn7dTXfq5/TzwT34I4igBKZk8bxv9HUL6z+mjF53
utBpMtudBb8Flp/N+HQKm4yUOm6x/p4iaNZdKWJ1nx6y/j7ryvo4ZeIS8jXvBC6k
V+AHJuUO6FgksJyJHDd61T0bLbsuqmzvE58sDX+VL7O21vjfQby4ojEtg3S72BSS
BZcefaasjXKZwOe07PX28y+d2iSLq5bC6OV/+ZpGfX8T6kj8mD0Z3rwHrPv0nbg0
WovFGfrHjCBtUKEjV/Xj
=3IXm
-----END PGP SIGNATURE-----

Binary file not shown.

View File

@ -1,17 +1,17 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAABCAAGBQJYtjy+AAoJEI1smEefSt5xlHUP/2Owe7YF26Gp2rC8D3RY7FnQ
vi3CSFXCzovL2zxXu8JLlGzAKv5YB8JQQQHuizeXe1YwMIhznHb6w7AHWRDhpaKc
lhaRb89hiToN9MZQH/X3jXjl/sKe1oqGKxpfe3pmbsueNyegHsfLi3CxqC2OLvtT
T9bRFR8jAKecejmNTwgves0yYCKFXGAFHwhbTeNpxWtllmTOJ0/u0260shNKXsUH
qTzLfjm4Rx0rNTNKWd1UA4yJFV/glLuF+qvUIJvJ5YUx9IfiWeE88EfZ1kZjrxv5
0Q9VFsNc23jiqKCjRdo1BmCacHXB+2fl7yV0gMEIH5kA4BPv+gZBOn9QUuCnuHr1
AHTNO7ZP4GsD3E8jL+F5nxZHxjpT7PNlouB0zwpBvFeD7UAf+cX0gvHahYWLBG38
H2gygSd+HE/u/xJ6xyQJvey1ZAFKNlw7nuyfNs2DzpciB/k1eQ7nkuULSjANj/G9
gkfESZEd8jztpY229IjdYzZqk/6VtXfjhhHNp1WJh+7ItwcPW1tcVpYeegvz6TsA
U3uUGrObMGWVnfK+6XGpaGECfytxC84uSIESH80pKgs8n3DtBmLtdJiV/UPRXpIB
3liwDpHqTcc/xbHc1ux684cgbGdeE1VzdUgPJ4vbb1CSerRJrNWX7bllO2tYaaBW
ZGsPc8H5WBTcySMIziqp
=uNjj
iQIcBAABCAAGBQJY+9BkAAoJEI1smEefSt5xKukQALI1r4pS+FcdktXyGiShXAI0
k9KdKEc1B0jGbaryEf/5A2uxK3wsG2K7tKFrS+03/Kyaf3u5zQNIBfLmj3aa3mMz
toMK9a8h54AycqWPOFLlZufDUY6o8cAkH1MJ/2WnfbyBG8m/EKSd7sdYcWGWgtwL
WQcIxKLuSJsn6bykXLKgAUtjrGmvhn91vqgfKUhAeKvJdGnI8FSinxtJhxCxhkta
uHcj2w2oOK82tyzQiuIoWqc51Rf9w1Ce6MzKXN7CuD63abFEBtHFyn/cR/UAIQlJ
lRQJ6J4mgYS2oyXC+cH6mVXz13Zq+qiNWLO96xUYBoWhCF1NmYBBJvKP7BCmjGXr
KVeAtfhOCc3/BeGcKbci0ccMC2Q31u79jEwoPeQJBNUCobrpjqCuT/Qi7zaxd1k7
E0eArVUusjRqjlgFiqp1wTM2zWuSrOvRLmY5F3j+4gECExMJ4kCO5zWY1SLptBJY
U0LKn3Be7dup2ORhPqEh0xQiOeixkeuhCkvHLJP9bxoqUxVs31Si3bqSghzLZGAd
jSbhrnGC0h76RP4u7ES8MmSMFA5RoyE0YR23SgftROanzIhWI6RCzYQQAPaZXAWO
jgcue2YjfN1s1I9vvY0N7DX1ja6SthNRbS75EVoJbcIfq+hlwUto1aGdwqzyvqOK
UsOrYQKLBFLOSdLeq66t
=egCI
-----END PGP SIGNATURE-----

View File

@ -82,6 +82,8 @@ EXPORTS
av_color_transfer_name
av_compare_mod
av_compare_ts
av_content_light_metadata_alloc
av_content_light_metadata_create_side_data
av_cpu_count
av_crc
av_crc_get_table
@ -141,6 +143,7 @@ EXPORTS
av_find_nearest_q_idx
av_fopen_utf8
av_force_cpu_flags
av_fourcc_make_string
av_frame_alloc
av_frame_clone
av_frame_copy
@ -241,8 +244,10 @@ EXPORTS
av_hwdevice_hwconfig_alloc
av_hwframe_constraints_free
av_hwframe_ctx_alloc
av_hwframe_ctx_create_derived
av_hwframe_ctx_init
av_hwframe_get_buffer
av_hwframe_map
av_hwframe_transfer_data
av_hwframe_transfer_get_formats
av_i2int
@ -253,6 +258,7 @@ EXPORTS
av_image_copy
av_image_copy_plane
av_image_copy_to_buffer
av_image_copy_uc_from
av_image_fill_arrays
av_image_fill_linesizes
av_image_fill_max_pixsteps
@ -405,6 +411,9 @@ EXPORTS
av_shr_i
av_small_strptime
av_spherical_alloc
av_spherical_from_name
av_spherical_projection_name
av_spherical_tile_bounds
av_stereo3d_alloc
av_stereo3d_create_side_data
av_stereo3d_from_name
@ -412,6 +421,7 @@ EXPORTS
av_strcasecmp
av_strdup
av_strerror
av_strireplace
av_stristart
av_stristr
av_strlcat

Binary file not shown.

View File

@ -1,17 +1,17 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAABCAAGBQJYtjy/AAoJEI1smEefSt5xt4sQAKyE3m1GiNEpwAEeH+1lDQnM
ZDdr570cwkXvHyu+5opmQrBK/BQZsQSVvf8/S3X/yE2SXQdtAQEFFHc/OxuKYeKn
FctOvdBtWe4TmJeN3tL/teGRZ8ZQiIjPmyrlt2Dw0CD0Q6iO/qy+4Cc7sGYoDwJB
THReZm3QeqRnve8nv8seqRkR7DBnLtOZMM/pAjREKlbTb0ad0kY5OTfLTdR1UJum
lWU7LNekZGdb0hPpcSNk7HimBbxeQuVPVFXmFTgenpHt+wu8lPgrOGGiG/I/uDAJ
OZHILGhrR9i4n1H8yk2CcJT/kQuXvaYaAuvfV5xLnMwMtiv8Gf8ztyTLp3nH0T2r
dtC2cEzB0maffH+eVd26r/D2NsGU6HWrgXweiOfnfH5TpwHF7mM7MT2wbDzvOJGw
MTIPALIlrrJ3G29qvTjfiW33oQz3VUmeasuq00TE6sU85kn162Mzu5qilgKQYAEi
o9VE0NHFQRGzWeJQCTTpFPROWyNVm5JjB8LeXPHqZdoGSIm6+bL+mTO0lpXgriRS
7hSeELPjT+osY/4ipKHKUVNJWQzc897+c8Li4IdZZzdhnDowoiBkdUSEx/FPbpOV
I8Lg7mwc6gMYmljvxV5x9yRonA+OSdOYJ0pFg9e3g8hT3AoQrAWFhwb7vulqMHim
SBBuGvINQCjeS4WIxWn2
=yEf5
iQIcBAABCAAGBQJY+9BhAAoJEI1smEefSt5xZrwP/RAA0lmV/PIiP7QcxFPUJuqz
M35vBimlqBocyFJuNunjqAq37I6OR/uT0lPHZjUvGoLT/5FjHiVuZfZdevBNokEp
dRTXvphpG+q5aHFyKu+pYbvMiKzvCpIOPtQSYiV4gOxBsjFdBzscxOhyFdMlnpIr
TVDcKA7jB3TmcEFCpjfjTmDq84vzlpgTPbQs5uLBq+/+/NP+VzlAAdEFTXaAdQU4
J1Eb52x3oSjzZVDQsrn+D2JmUhzFwgFFIU3ovw3TjAvMbqVtMJQaClq1f/gPXWA2
SM4O9tQCZrA2lc0Ae01kJOUFaQzv816aW9lVb5R1tpB9BZkqypqXxdv4TzSS6d3U
ygd4ZUDMknL6ypQzcXC0WfKJzK75KUmUdXt+UaLrjTjg7XuDwZ3FlLJpAltmHiDk
jiO2M6Gyd4N0Ue7OkqeuUhDxJzVvARFyIZ2bGhM9d+bvbzumilNcuLm8DYjLWyfZ
suTdn+IP11IOkEu23sA0hmlAtJAqmWW7WuRYCXsqU78mlAu74GgdggAec5KtElR1
1e7ZEV+j1Sp+9wq5GbYSrheEkYWV7QL0DcWSJ5q0pTTyf8O74R9jHpZZ4uAoiol6
1FRbK9L1fcMP0/m8rR9fA4le7/mF0W5fyPrrsxKCrs677U2fzaSUU809Zb07QiQ2
9z+txjajPnixgiQIr+6/
=qeAu
-----END PGP SIGNATURE-----