Update OSX thirparties
This commit is contained in:
parent
64812c0129
commit
846740f5a0
|
@ -30,11 +30,11 @@
|
|||
#include "libavutil/samplefmt.h"
|
||||
#include "libavutil/avutil.h"
|
||||
#include "libavutil/cpu.h"
|
||||
#include "libavutil/channel_layout.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/log.h"
|
||||
#include "libavutil/pixfmt.h"
|
||||
#include "libavutil/rational.h"
|
||||
#include "libavutil/audioconvert.h"
|
||||
|
||||
#include "libavcodec/version.h"
|
||||
/**
|
||||
|
@ -267,14 +267,18 @@ enum AVCodecID {
|
|||
AV_CODEC_ID_MTS2,
|
||||
AV_CODEC_ID_CLLC,
|
||||
AV_CODEC_ID_MSS2,
|
||||
AV_CODEC_ID_VP9,
|
||||
AV_CODEC_ID_BRENDER_PIX= MKBETAG('B','P','I','X'),
|
||||
AV_CODEC_ID_Y41P = MKBETAG('Y','4','1','P'),
|
||||
AV_CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'),
|
||||
AV_CODEC_ID_EXR = MKBETAG('0','E','X','R'),
|
||||
AV_CODEC_ID_AVRP = MKBETAG('A','V','R','P'),
|
||||
|
||||
AV_CODEC_ID_012V = MKBETAG('0','1','2','V'),
|
||||
AV_CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'),
|
||||
AV_CODEC_ID_AVUI = MKBETAG('A','V','U','I'),
|
||||
AV_CODEC_ID_AYUV = MKBETAG('A','Y','U','V'),
|
||||
AV_CODEC_ID_TARGA_Y216 = MKBETAG('T','2','1','6'),
|
||||
AV_CODEC_ID_V308 = MKBETAG('V','3','0','8'),
|
||||
AV_CODEC_ID_V408 = MKBETAG('V','4','0','8'),
|
||||
AV_CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'),
|
||||
|
@ -282,6 +286,10 @@ enum AVCodecID {
|
|||
AV_CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'),
|
||||
AV_CODEC_ID_AVRN = MKBETAG('A','V','R','n'),
|
||||
AV_CODEC_ID_CPIA = MKBETAG('C','P','I','A'),
|
||||
AV_CODEC_ID_XFACE = MKBETAG('X','F','A','C'),
|
||||
AV_CODEC_ID_SGIRLE = MKBETAG('S','G','I','R'),
|
||||
AV_CODEC_ID_MVC1 = MKBETAG('M','V','C','1'),
|
||||
AV_CODEC_ID_MVC2 = MKBETAG('M','V','C','2'),
|
||||
|
||||
/* various PCM "codecs" */
|
||||
AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
|
||||
|
@ -313,6 +321,9 @@ enum AVCodecID {
|
|||
AV_CODEC_ID_PCM_LXF,
|
||||
AV_CODEC_ID_S302M,
|
||||
AV_CODEC_ID_PCM_S8_PLANAR,
|
||||
AV_CODEC_ID_PCM_S24LE_PLANAR = MKBETAG(24,'P','S','P'),
|
||||
AV_CODEC_ID_PCM_S32LE_PLANAR = MKBETAG(32,'P','S','P'),
|
||||
AV_CODEC_ID_PCM_S16BE_PLANAR = MKBETAG('P','S','P',16),
|
||||
|
||||
/* various ADPCM codecs */
|
||||
AV_CODEC_ID_ADPCM_IMA_QT = 0x11000,
|
||||
|
@ -346,6 +357,8 @@ enum AVCodecID {
|
|||
AV_CODEC_ID_ADPCM_G722,
|
||||
AV_CODEC_ID_ADPCM_IMA_APC,
|
||||
AV_CODEC_ID_VIMA = MKBETAG('V','I','M','A'),
|
||||
AV_CODEC_ID_ADPCM_AFC = MKBETAG('A','F','C',' '),
|
||||
AV_CODEC_ID_ADPCM_IMA_OKI = MKBETAG('O','K','I',' '),
|
||||
|
||||
/* AMR */
|
||||
AV_CODEC_ID_AMR_NB = 0x12000,
|
||||
|
@ -424,12 +437,19 @@ enum AVCodecID {
|
|||
AV_CODEC_ID_IAC,
|
||||
AV_CODEC_ID_ILBC,
|
||||
AV_CODEC_ID_OPUS_DEPRECATED,
|
||||
AV_CODEC_ID_COMFORT_NOISE,
|
||||
AV_CODEC_ID_TAK_DEPRECATED,
|
||||
AV_CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'),
|
||||
#if LIBAVCODEC_VERSION_MAJOR <= 54
|
||||
AV_CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'),
|
||||
#endif
|
||||
AV_CODEC_ID_SONIC = MKBETAG('S','O','N','C'),
|
||||
AV_CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'),
|
||||
AV_CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'),
|
||||
AV_CODEC_ID_OPUS = MKBETAG('O','P','U','S'),
|
||||
AV_CODEC_ID_TAK = MKBETAG('t','B','a','K'),
|
||||
AV_CODEC_ID_EVRC = MKBETAG('s','e','v','c'),
|
||||
AV_CODEC_ID_SMV = MKBETAG('s','s','m','v'),
|
||||
|
||||
/* subtitle codecs */
|
||||
AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
|
||||
|
@ -447,9 +467,13 @@ enum AVCodecID {
|
|||
AV_CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'),
|
||||
AV_CODEC_ID_SAMI = MKBETAG('S','A','M','I'),
|
||||
AV_CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'),
|
||||
AV_CODEC_ID_SUBVIEWER1 = MKBETAG('S','b','V','1'),
|
||||
AV_CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'),
|
||||
AV_CODEC_ID_SUBRIP = MKBETAG('S','R','i','p'),
|
||||
AV_CODEC_ID_WEBVTT = MKBETAG('W','V','T','T'),
|
||||
AV_CODEC_ID_MPL2 = MKBETAG('M','P','L','2'),
|
||||
AV_CODEC_ID_VPLAYER = MKBETAG('V','P','l','r'),
|
||||
AV_CODEC_ID_PJS = MKBETAG('P','h','J','S'),
|
||||
|
||||
/* other specific kind of codecs (generally used for attachments) */
|
||||
AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs.
|
||||
|
@ -458,6 +482,7 @@ enum AVCodecID {
|
|||
AV_CODEC_ID_XBIN = MKBETAG('X','B','I','N'),
|
||||
AV_CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'),
|
||||
AV_CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'),
|
||||
AV_CODEC_ID_SMPTE_KLV = MKBETAG('K','L','V','A'),
|
||||
|
||||
AV_CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it
|
||||
|
||||
|
@ -515,6 +540,10 @@ typedef struct AVCodecDescriptor {
|
|||
* Codec supports lossless compression. Audio and video codecs only.
|
||||
*/
|
||||
#define AV_CODEC_PROP_LOSSLESS (1 << 2)
|
||||
/**
|
||||
* Subtitle codec is bitmap based
|
||||
*/
|
||||
#define AV_CODEC_PROP_BITMAP_SUB (1 << 16)
|
||||
|
||||
#if FF_API_OLD_DECODE_AUDIO
|
||||
/* in bytes */
|
||||
|
@ -688,6 +717,8 @@ typedef struct RcOverride{
|
|||
#define CODEC_FLAG2_NO_OUTPUT 0x00000004 ///< Skip bitstream encoding.
|
||||
#define CODEC_FLAG2_LOCAL_HEADER 0x00000008 ///< Place global headers at every keyframe instead of in extradata.
|
||||
#define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format. DEPRECATED!!!!
|
||||
#define CODEC_FLAG2_IGNORE_CROP 0x00010000 ///< Discard cropping information from SPS.
|
||||
|
||||
#if FF_API_MPV_GLOBAL_OPTS
|
||||
#define CODEC_FLAG_CBP_RD 0x04000000 ///< Use rate distortion optimization for cbp.
|
||||
#define CODEC_FLAG_QP_RD 0x08000000 ///< Use rate distortion optimization for qp selectioon.
|
||||
|
@ -939,8 +970,55 @@ enum AVPacketSideDataType {
|
|||
* @endcode
|
||||
*/
|
||||
AV_PKT_DATA_JP_DUALMONO,
|
||||
|
||||
/**
|
||||
* A list of zero terminated key/value strings. There is no end marker for
|
||||
* the list, so it is required to rely on the side data size to stop.
|
||||
*/
|
||||
AV_PKT_DATA_STRINGS_METADATA,
|
||||
|
||||
/**
|
||||
* Subtitle event position
|
||||
* @code
|
||||
* u32le x1
|
||||
* u32le y1
|
||||
* u32le x2
|
||||
* u32le y2
|
||||
* @endcode
|
||||
*/
|
||||
AV_PKT_DATA_SUBTITLE_POSITION,
|
||||
|
||||
/**
|
||||
* Data found in BlockAdditional element of matroska container. There is
|
||||
* no end marker for the data, so it is required to rely on the side data
|
||||
* size to recognize the end. 8 byte id (as found in BlockAddId) followed
|
||||
* by data.
|
||||
*/
|
||||
AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL,
|
||||
};
|
||||
|
||||
/**
|
||||
* This structure stores compressed data. It is typically exported by demuxers
|
||||
* and then passed as input to decoders, or received as output from encoders and
|
||||
* then passed to muxers.
|
||||
*
|
||||
* For video, it should typically contain one compressed frame. For audio it may
|
||||
* contain several compressed frames.
|
||||
*
|
||||
* AVPacket is one of the few structs in FFmpeg, whose size is a part of public
|
||||
* ABI. Thus it may be allocated on stack and no new fields can be added to it
|
||||
* without libavcodec and libavformat major bump.
|
||||
*
|
||||
* The semantics of data ownership depends on the destruct field.
|
||||
* If it is set, the packet data is dynamically allocated and is valid
|
||||
* indefinitely until av_free_packet() is called (which in turn calls the
|
||||
* destruct callback to free the data). If destruct is not set, the packet data
|
||||
* is typically backed by some static buffer somewhere and is only valid for a
|
||||
* limited time (e.g. until the next read call when demuxing).
|
||||
*
|
||||
* The side data is always allocated with av_malloc() and is freed in
|
||||
* av_free_packet().
|
||||
*/
|
||||
typedef struct AVPacket {
|
||||
/**
|
||||
* Presentation timestamp in AVStream->time_base units; the time at which
|
||||
|
@ -1018,14 +1096,22 @@ enum AVSideDataParamChangeFlags {
|
|||
*/
|
||||
|
||||
/**
|
||||
* Audio Video Frame.
|
||||
* New fields can be added to the end of AVFRAME with minor version
|
||||
* bumps. Similarly fields that are marked as to be only accessed by
|
||||
* This structure describes decoded (raw) audio or video data.
|
||||
*
|
||||
* AVFrame must be allocated using avcodec_alloc_frame() and freed with
|
||||
* avcodec_free_frame(). Note that this allocates only the AVFrame itself. The
|
||||
* buffers for the data must be managed through other means.
|
||||
*
|
||||
* AVFrame is typically allocated once and then reused multiple times to hold
|
||||
* different data (e.g. a single AVFrame to hold frames received from a
|
||||
* decoder). In such a case, avcodec_get_frame_defaults() should be used to
|
||||
* reset the frame to its original clean state before it is reused again.
|
||||
*
|
||||
* 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.
|
||||
* Removal, reordering and changes in the remaining cases require
|
||||
* a major version bump.
|
||||
* sizeof(AVFrame) must not be used outside libavcodec.
|
||||
*/
|
||||
typedef struct AVFrame {
|
||||
#define AV_NUM_DATA_POINTERS 8
|
||||
|
@ -1063,7 +1149,7 @@ typedef struct AVFrame {
|
|||
* extended_data must be used by the decoder in order to access all
|
||||
* channels.
|
||||
*
|
||||
* encoding: unused
|
||||
* encoding: set by user
|
||||
* decoding: set by AVCodecContext.get_buffer()
|
||||
*/
|
||||
uint8_t **extended_data;
|
||||
|
@ -1084,7 +1170,7 @@ typedef struct AVFrame {
|
|||
|
||||
/**
|
||||
* format of the frame, -1 if unknown or unset
|
||||
* Values correspond to enum PixelFormat for video frames,
|
||||
* Values correspond to enum AVPixelFormat for video frames,
|
||||
* enum AVSampleFormat for audio)
|
||||
* - encoding: unused
|
||||
* - decoding: Read by user.
|
||||
|
@ -1129,14 +1215,14 @@ typedef struct AVFrame {
|
|||
int64_t pts;
|
||||
|
||||
/**
|
||||
* reordered pts from the last AVPacket that has been input into the decoder
|
||||
* pts copied from the AVPacket that was decoded to produce this frame
|
||||
* - encoding: unused
|
||||
* - decoding: Read by user.
|
||||
*/
|
||||
int64_t pkt_pts;
|
||||
|
||||
/**
|
||||
* dts from the last AVPacket that has been input into the decoder
|
||||
* dts copied from the AVPacket that triggered returning this frame
|
||||
* - encoding: unused
|
||||
* - decoding: Read by user.
|
||||
*/
|
||||
|
@ -1415,7 +1501,17 @@ typedef struct AVFrame {
|
|||
* - encoding: unused
|
||||
* - decoding: Read by user.
|
||||
*/
|
||||
int64_t channels;
|
||||
int channels;
|
||||
|
||||
/**
|
||||
* 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().
|
||||
* It is set to a negative value if unknown.
|
||||
* - encoding: unused
|
||||
* - decoding: set by libavcodec, read by user.
|
||||
*/
|
||||
int pkt_size;
|
||||
} AVFrame;
|
||||
|
||||
/**
|
||||
|
@ -1439,6 +1535,8 @@ AVDictionary *av_frame_get_metadata (const AVFrame *frame);
|
|||
void av_frame_set_metadata (AVFrame *frame, AVDictionary *val);
|
||||
int av_frame_get_decode_error_flags (const AVFrame *frame);
|
||||
void av_frame_set_decode_error_flags (AVFrame *frame, int val);
|
||||
int av_frame_get_pkt_size(const AVFrame *frame);
|
||||
void av_frame_set_pkt_size(AVFrame *frame, int val);
|
||||
|
||||
struct AVCodecInternal;
|
||||
|
||||
|
@ -1598,6 +1696,8 @@ typedef struct AVCodecContext {
|
|||
int ticks_per_frame;
|
||||
|
||||
/**
|
||||
* Codec delay.
|
||||
*
|
||||
* Encoding: Number of frames delay there will be from the encoder input to
|
||||
* the decoder output. (we assume the decoder matches the spec)
|
||||
* Decoding: Number of frames delay in addition to what a standard decoder
|
||||
|
@ -1608,12 +1708,15 @@ typedef struct AVCodecContext {
|
|||
* encoded input.
|
||||
*
|
||||
* Audio:
|
||||
* Number of "priming" samples added to the beginning of the stream
|
||||
* during encoding. The decoded output will be delayed by this many
|
||||
* samples relative to the input to the encoder. Note that this field is
|
||||
* purely informational and does not directly affect the pts output by
|
||||
* the encoder, which should always be based on the actual presentation
|
||||
* time, including any delay.
|
||||
* For encoding, this is the number of "priming" samples added to the
|
||||
* beginning of the stream. The decoded output will be delayed by this
|
||||
* many samples relative to the input to the encoder. Note that this
|
||||
* field is purely informational and does not directly affect the pts
|
||||
* output by the encoder, which should always be based on the actual
|
||||
* presentation time, including any delay.
|
||||
* For decoding, this is the number of samples the decoder needs to
|
||||
* output before the decoder's output is valid. When seeking, you should
|
||||
* start decoding this many samples prior to your desired seek point.
|
||||
*
|
||||
* - encoding: Set by libavcodec.
|
||||
* - decoding: Set by libavcodec.
|
||||
|
@ -1648,13 +1751,13 @@ typedef struct AVCodecContext {
|
|||
int gop_size;
|
||||
|
||||
/**
|
||||
* Pixel format, see PIX_FMT_xxx.
|
||||
* Pixel format, see AV_PIX_FMT_xxx.
|
||||
* May be set by the demuxer if known from headers.
|
||||
* May be overridden by the decoder if it knows better.
|
||||
* - encoding: Set by user.
|
||||
* - decoding: Set by user if known, overridden by libavcodec if known
|
||||
*/
|
||||
enum PixelFormat pix_fmt;
|
||||
enum AVPixelFormat pix_fmt;
|
||||
|
||||
/**
|
||||
* Motion estimation algorithm used for video coding.
|
||||
|
@ -1701,7 +1804,7 @@ typedef struct AVCodecContext {
|
|||
* - encoding: unused
|
||||
* - decoding: Set by user, if not set the native format will be chosen.
|
||||
*/
|
||||
enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt);
|
||||
enum AVPixelFormat (*get_format)(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
|
||||
|
||||
/**
|
||||
* maximum number of B-frames between non-B-frames
|
||||
|
@ -2220,7 +2323,7 @@ typedef struct AVCodecContext {
|
|||
|
||||
/** Field order
|
||||
* - encoding: set by libavcodec
|
||||
* - decoding: Set by libavcodec
|
||||
* - decoding: Set by user.
|
||||
*/
|
||||
enum AVFieldOrder field_order;
|
||||
|
||||
|
@ -2237,7 +2340,13 @@ typedef struct AVCodecContext {
|
|||
|
||||
/* The following data should not be initialized. */
|
||||
/**
|
||||
* Samples per packet, initialized when calling 'init'.
|
||||
* Number of samples per channel in an audio frame.
|
||||
*
|
||||
* - encoding: set by libavcodec in avcodec_open2(). Each submitted frame
|
||||
* except the last must contain exactly frame_size samples per channel.
|
||||
* May be 0 when the codec has CODEC_CAP_VARIABLE_FRAME_SIZE set, then the
|
||||
* frame size is not restricted.
|
||||
* - decoding: may be set by some decoders to indicate constant frame size
|
||||
*/
|
||||
int frame_size;
|
||||
|
||||
|
@ -2346,7 +2455,12 @@ typedef struct AVCodecContext {
|
|||
*
|
||||
* Decoders cannot use the buffer after returning from
|
||||
* avcodec_decode_audio4(), so they will not call release_buffer(), as it
|
||||
* is assumed to be released immediately upon return.
|
||||
* is assumed to be released immediately upon return. In some rare cases,
|
||||
* a decoder may need to call get_buffer() more than once in a single
|
||||
* call to avcodec_decode_audio4(). In that case, when get_buffer() is
|
||||
* called again after it has already been called once, the previously
|
||||
* acquired buffer is assumed to be released at that time and may not be
|
||||
* reused by the decoder.
|
||||
*
|
||||
* As a convenience, av_samples_get_buffer_size() and
|
||||
* av_samples_fill_arrays() in libavutil may be used by custom get_buffer()
|
||||
|
@ -2783,25 +2897,29 @@ typedef struct AVCodecContext {
|
|||
#define FF_IDCT_SIMPLE 2
|
||||
#define FF_IDCT_SIMPLEMMX 3
|
||||
#define FF_IDCT_LIBMPEG2MMX 4
|
||||
#if FF_API_MMI
|
||||
#define FF_IDCT_MMI 5
|
||||
#endif
|
||||
#define FF_IDCT_ARM 7
|
||||
#define FF_IDCT_ALTIVEC 8
|
||||
#define FF_IDCT_SH4 9
|
||||
#define FF_IDCT_SIMPLEARM 10
|
||||
#define FF_IDCT_H264 11
|
||||
#define FF_IDCT_VP3 12
|
||||
#define FF_IDCT_IPP 13
|
||||
#define FF_IDCT_XVIDMMX 14
|
||||
#define FF_IDCT_CAVS 15
|
||||
#define FF_IDCT_SIMPLEARMV5TE 16
|
||||
#define FF_IDCT_SIMPLEARMV6 17
|
||||
#define FF_IDCT_SIMPLEVIS 18
|
||||
#define FF_IDCT_WMV2 19
|
||||
#define FF_IDCT_FAAN 20
|
||||
#define FF_IDCT_EA 21
|
||||
#define FF_IDCT_SIMPLENEON 22
|
||||
#define FF_IDCT_SIMPLEALPHA 23
|
||||
#if FF_API_IDCT
|
||||
#define FF_IDCT_H264 11
|
||||
#define FF_IDCT_VP3 12
|
||||
#define FF_IDCT_CAVS 15
|
||||
#define FF_IDCT_WMV2 19
|
||||
#define FF_IDCT_EA 21
|
||||
#define FF_IDCT_BINK 24
|
||||
#endif
|
||||
|
||||
#if FF_API_DSP_MASK
|
||||
/**
|
||||
|
@ -3059,7 +3177,7 @@ typedef struct AVCodecContext {
|
|||
/**
|
||||
* Timebase in which pkt_dts/pts and AVPacket.dts/pts are.
|
||||
* Code outside libavcodec should access this field using:
|
||||
* avcodec_set_pkt_timebase(avctx)
|
||||
* av_codec_{get,set}_pkt_timebase(avctx)
|
||||
* - encoding unused.
|
||||
* - decodimg set by user
|
||||
*/
|
||||
|
@ -3068,7 +3186,7 @@ typedef struct AVCodecContext {
|
|||
/**
|
||||
* AVCodecDescriptor
|
||||
* Code outside libavcodec should access this field using:
|
||||
* avcodec_get_codec_descriptior(avctx)
|
||||
* av_codec_{get,set}_codec_descriptor(avctx)
|
||||
* - encoding: unused.
|
||||
* - decoding: set by libavcodec.
|
||||
*/
|
||||
|
@ -3083,6 +3201,31 @@ typedef struct AVCodecContext {
|
|||
int64_t pts_correction_num_faulty_dts; /// Number of incorrect DTS values so far
|
||||
int64_t pts_correction_last_pts; /// PTS of the last frame
|
||||
int64_t pts_correction_last_dts; /// DTS of the last frame
|
||||
|
||||
/**
|
||||
* Current frame metadata.
|
||||
* - decoding: maintained and used by libavcodec, not intended to be used by user apps
|
||||
* - encoding: unused
|
||||
*/
|
||||
AVDictionary *metadata;
|
||||
|
||||
/**
|
||||
* Character encoding of the input subtitles file.
|
||||
* - decoding: set by user
|
||||
* - encoding: unused
|
||||
*/
|
||||
char *sub_charenc;
|
||||
|
||||
/**
|
||||
* Subtitles character encoding mode. Formats or codecs might be adjusting
|
||||
* this setting (if they are doing the conversion themselves for instance).
|
||||
* - decoding: set by libavcodec
|
||||
* - encoding: unused
|
||||
*/
|
||||
int sub_charenc_mode;
|
||||
#define FF_SUB_CHARENC_MODE_DO_NOTHING -1 ///< do nothing (demuxer outputs a stream supposed to be already in UTF-8, or the codec is bitmap for instance)
|
||||
#define FF_SUB_CHARENC_MODE_AUTOMATIC 0 ///< libavcodec will select the mode itself
|
||||
#define FF_SUB_CHARENC_MODE_PRE_DECODER 1 ///< the AVPacket data needs to be recoded to UTF-8 before being fed to the decoder, requires iconv
|
||||
} AVCodecContext;
|
||||
|
||||
AVRational av_codec_get_pkt_timebase (const AVCodecContext *avctx);
|
||||
|
@ -3127,7 +3270,7 @@ typedef struct AVCodec {
|
|||
*/
|
||||
int capabilities;
|
||||
const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0}
|
||||
const enum PixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
|
||||
const enum AVPixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
|
||||
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
|
||||
|
@ -3228,7 +3371,7 @@ typedef struct AVHWAccel {
|
|||
*
|
||||
* Only hardware accelerated formats are supported here.
|
||||
*/
|
||||
enum PixelFormat pix_fmt;
|
||||
enum AVPixelFormat pix_fmt;
|
||||
|
||||
/**
|
||||
* Hardware accelerated codec capabilities.
|
||||
|
@ -3326,6 +3469,8 @@ enum AVSubtitleType {
|
|||
SUBTITLE_ASS,
|
||||
};
|
||||
|
||||
#define AV_SUBTITLE_FLAG_FORCED 0x00000001
|
||||
|
||||
typedef struct AVSubtitleRect {
|
||||
int x; ///< top left corner of pict, undefined when pict is not set
|
||||
int y; ///< top left corner of pict, undefined when pict is not set
|
||||
|
@ -3349,11 +3494,7 @@ typedef struct AVSubtitleRect {
|
|||
*/
|
||||
char *ass;
|
||||
|
||||
/**
|
||||
* 1 indicates this subtitle is a forced subtitle.
|
||||
* A forced subtitle should be displayed even when subtitles are hidden.
|
||||
*/
|
||||
int forced;
|
||||
int flags;
|
||||
} AVSubtitleRect;
|
||||
|
||||
typedef struct AVSubtitle {
|
||||
|
@ -4150,6 +4291,10 @@ int av_parser_parse2(AVCodecParserContext *s,
|
|||
int64_t pts, int64_t dts,
|
||||
int64_t pos);
|
||||
|
||||
/**
|
||||
* @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed
|
||||
* @deprecated use AVBitstreamFilter
|
||||
*/
|
||||
int av_parser_change(AVCodecParserContext *s,
|
||||
AVCodecContext *avctx,
|
||||
uint8_t **poutbuf, int *poutbuf_size,
|
||||
|
@ -4319,9 +4464,11 @@ int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
|
|||
* @}
|
||||
*/
|
||||
|
||||
#if FF_API_AVCODEC_RESAMPLE
|
||||
/**
|
||||
* @defgroup lavc_resample Audio resampling
|
||||
* @ingroup libavc
|
||||
* @deprecated use libswresample instead
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
@ -4346,6 +4493,7 @@ typedef struct ReSampleContext ReSampleContext;
|
|||
* @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate
|
||||
* @return allocated ReSampleContext, NULL if error occurred
|
||||
*/
|
||||
attribute_deprecated
|
||||
ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
|
||||
int output_rate, int input_rate,
|
||||
enum AVSampleFormat sample_fmt_out,
|
||||
|
@ -4353,6 +4501,7 @@ ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
|
|||
int filter_length, int log2_phase_count,
|
||||
int linear, double cutoff);
|
||||
|
||||
attribute_deprecated
|
||||
int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);
|
||||
|
||||
/**
|
||||
|
@ -4361,6 +4510,7 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl
|
|||
* @param s a non-NULL pointer to a resample context previously
|
||||
* created with av_audio_resample_init()
|
||||
*/
|
||||
attribute_deprecated
|
||||
void audio_resample_close(ReSampleContext *s);
|
||||
|
||||
|
||||
|
@ -4373,6 +4523,7 @@ void audio_resample_close(ReSampleContext *s);
|
|||
between the 2 closest, if 0 the closest will be used
|
||||
* @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate
|
||||
*/
|
||||
attribute_deprecated
|
||||
struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff);
|
||||
|
||||
/**
|
||||
|
@ -4384,6 +4535,7 @@ struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter
|
|||
* @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context.
|
||||
* @return the number of samples written in dst or -1 if an error occurred
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx);
|
||||
|
||||
|
||||
|
@ -4399,12 +4551,15 @@ int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consum
|
|||
* note, due to rounding the actual compensation might be slightly different,
|
||||
* especially if the compensation_distance is large and the in_rate used during init is small
|
||||
*/
|
||||
attribute_deprecated
|
||||
void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance);
|
||||
attribute_deprecated
|
||||
void av_resample_close(struct AVResampleContext *c);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @addtogroup lavc_picture
|
||||
|
@ -4422,7 +4577,7 @@ void av_resample_close(struct AVResampleContext *c);
|
|||
* @param height the height of the picture
|
||||
* @return zero if successful, a negative value if not
|
||||
*/
|
||||
int avpicture_alloc(AVPicture *picture, enum PixelFormat pix_fmt, int width, int height);
|
||||
int avpicture_alloc(AVPicture *picture, enum AVPixelFormat pix_fmt, int width, int height);
|
||||
|
||||
/**
|
||||
* Free a picture previously allocated by avpicture_alloc().
|
||||
|
@ -4439,8 +4594,8 @@ void avpicture_free(AVPicture *picture);
|
|||
*
|
||||
* @see av_image_fill_arrays()
|
||||
*/
|
||||
int avpicture_fill(AVPicture *picture, uint8_t *ptr,
|
||||
enum PixelFormat pix_fmt, int width, int height);
|
||||
int avpicture_fill(AVPicture *picture, const uint8_t *ptr,
|
||||
enum AVPixelFormat pix_fmt, int width, int height);
|
||||
|
||||
/**
|
||||
* Copy pixel data from an AVPicture into a buffer, always assume a
|
||||
|
@ -4448,7 +4603,8 @@ int avpicture_fill(AVPicture *picture, uint8_t *ptr,
|
|||
*
|
||||
* @see av_image_copy_to_buffer()
|
||||
*/
|
||||
int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, int height,
|
||||
int avpicture_layout(const AVPicture* src, enum AVPixelFormat pix_fmt,
|
||||
int width, int height,
|
||||
unsigned char *dest, int dest_size);
|
||||
|
||||
/**
|
||||
|
@ -4458,29 +4614,34 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width,
|
|||
*
|
||||
* @see av_image_get_buffer_size().
|
||||
*/
|
||||
int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height);
|
||||
int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
|
||||
|
||||
#if FF_API_DEINTERLACE
|
||||
/**
|
||||
* deinterlace - if not supported return -1
|
||||
*
|
||||
* @deprecated - use yadif (in libavfilter) instead
|
||||
*/
|
||||
attribute_deprecated
|
||||
int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
|
||||
enum PixelFormat pix_fmt, int width, int height);
|
||||
enum AVPixelFormat pix_fmt, int width, int height);
|
||||
#endif
|
||||
/**
|
||||
* Copy image src to dst. Wraps av_image_copy().
|
||||
*/
|
||||
void av_picture_copy(AVPicture *dst, const AVPicture *src,
|
||||
enum PixelFormat pix_fmt, int width, int height);
|
||||
enum AVPixelFormat pix_fmt, int width, int height);
|
||||
|
||||
/**
|
||||
* Crop image top and left side.
|
||||
*/
|
||||
int av_picture_crop(AVPicture *dst, const AVPicture *src,
|
||||
enum PixelFormat pix_fmt, int top_band, int left_band);
|
||||
enum AVPixelFormat pix_fmt, int top_band, int left_band);
|
||||
|
||||
/**
|
||||
* Pad image.
|
||||
*/
|
||||
int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum PixelFormat pix_fmt,
|
||||
int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum AVPixelFormat pix_fmt,
|
||||
int padtop, int padbottom, int padleft, int padright, int *color);
|
||||
|
||||
/**
|
||||
|
@ -4503,14 +4664,29 @@ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width,
|
|||
* @{
|
||||
*/
|
||||
|
||||
void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift);
|
||||
/**
|
||||
* Utility function to access log2_chroma_w log2_chroma_h from
|
||||
* the pixel format AVPixFmtDescriptor.
|
||||
*
|
||||
* This function asserts that pix_fmt is valid. See av_pix_fmt_get_chroma_sub_sample
|
||||
* for one that returns a failure code and continues in case of invalid
|
||||
* pix_fmts.
|
||||
*
|
||||
* @param[in] pix_fmt the pixel format
|
||||
* @param[out] h_shift store log2_chroma_h
|
||||
* @param[out] v_shift store log2_chroma_w
|
||||
*
|
||||
* @see av_pix_fmt_get_chroma_sub_sample
|
||||
*/
|
||||
|
||||
void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift);
|
||||
|
||||
/**
|
||||
* Return 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);
|
||||
unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat pix_fmt);
|
||||
|
||||
#define FF_LOSS_RESOLUTION 0x0001 /**< loss due to resolution change */
|
||||
#define FF_LOSS_DEPTH 0x0002 /**< loss due to color depth change */
|
||||
|
@ -4537,7 +4713,7 @@ unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat pix_fmt);
|
|||
* @return Combination of flags informing you what kind of losses will occur
|
||||
* (maximum loss for an invalid dst_pix_fmt).
|
||||
*/
|
||||
int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_pix_fmt,
|
||||
int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt,
|
||||
int has_alpha);
|
||||
|
||||
#if FF_API_FIND_BEST_PIX_FMT
|
||||
|
@ -4556,8 +4732,8 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_
|
|||
* Note, only the first 64 pixel formats will fit in pix_fmt_mask.
|
||||
*
|
||||
* @code
|
||||
* src_pix_fmt = PIX_FMT_YUV420P;
|
||||
* pix_fmt_mask = (1 << PIX_FMT_YUV422P) | (1 << PIX_FMT_RGB24);
|
||||
* src_pix_fmt = AV_PIX_FMT_YUV420P;
|
||||
* pix_fmt_mask = (1 << AV_PIX_FMT_YUV422P) | (1 << AV_PIX_FMT_RGB24);
|
||||
* dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss);
|
||||
* @endcode
|
||||
*
|
||||
|
@ -4568,7 +4744,7 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_
|
|||
* @return The best pixel format to convert to or -1 if none was found.
|
||||
*/
|
||||
attribute_deprecated
|
||||
enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt,
|
||||
enum AVPixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum AVPixelFormat src_pix_fmt,
|
||||
int has_alpha, int *loss_ptr);
|
||||
#endif /* FF_API_FIND_BEST_PIX_FMT */
|
||||
|
||||
|
@ -4583,14 +4759,14 @@ enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelForma
|
|||
* pix_fmt_list parameter.
|
||||
*
|
||||
*
|
||||
* @param[in] pix_fmt_list PIX_FMT_NONE terminated array of pixel formats to choose from
|
||||
* @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from
|
||||
* @param[in] src_pix_fmt source pixel format
|
||||
* @param[in] has_alpha Whether the source pixel format alpha channel is used.
|
||||
* @param[out] loss_ptr Combination of flags informing you what kind of losses will occur.
|
||||
* @return The best pixel format to convert to or -1 if none was found.
|
||||
*/
|
||||
enum PixelFormat avcodec_find_best_pix_fmt_of_list(enum PixelFormat *pix_fmt_list,
|
||||
enum PixelFormat src_pix_fmt,
|
||||
enum AVPixelFormat avcodec_find_best_pix_fmt_of_list(enum AVPixelFormat *pix_fmt_list,
|
||||
enum AVPixelFormat src_pix_fmt,
|
||||
int has_alpha, int *loss_ptr);
|
||||
|
||||
/**
|
||||
|
@ -4601,14 +4777,14 @@ enum PixelFormat avcodec_find_best_pix_fmt_of_list(enum PixelFormat *pix_fmt_lis
|
|||
* converting from some formats to other formats. avcodec_find_best_pix_fmt_of_2() selects which of
|
||||
* the given pixel formats should be used to suffer the least amount of loss.
|
||||
*
|
||||
* If one of the destination formats is PIX_FMT_NONE the other pixel format (if valid) will be
|
||||
* If one of the destination formats is AV_PIX_FMT_NONE the other pixel format (if valid) will be
|
||||
* returned.
|
||||
*
|
||||
* @code
|
||||
* src_pix_fmt = PIX_FMT_YUV420P;
|
||||
* dst_pix_fmt1= PIX_FMT_RGB24;
|
||||
* dst_pix_fmt2= PIX_FMT_GRAY8;
|
||||
* dst_pix_fmt3= PIX_FMT_RGB8;
|
||||
* src_pix_fmt = AV_PIX_FMT_YUV420P;
|
||||
* dst_pix_fmt1= AV_PIX_FMT_RGB24;
|
||||
* dst_pix_fmt2= AV_PIX_FMT_GRAY8;
|
||||
* dst_pix_fmt3= AV_PIX_FMT_RGB8;
|
||||
* loss= FF_LOSS_CHROMA; // don't care about chroma loss, so chroma loss will be ignored.
|
||||
* dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1, dst_pix_fmt2, src_pix_fmt, alpha, &loss);
|
||||
* dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt, dst_pix_fmt3, src_pix_fmt, alpha, &loss);
|
||||
|
@ -4623,21 +4799,21 @@ enum PixelFormat avcodec_find_best_pix_fmt_of_list(enum PixelFormat *pix_fmt_lis
|
|||
* that occurs when converting from src to selected dst pixel format.
|
||||
* @return The best pixel format to convert to or -1 if none was found.
|
||||
*/
|
||||
enum PixelFormat avcodec_find_best_pix_fmt_of_2(enum PixelFormat dst_pix_fmt1, enum PixelFormat dst_pix_fmt2,
|
||||
enum PixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
|
||||
enum AVPixelFormat avcodec_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
|
||||
enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
|
||||
|
||||
attribute_deprecated
|
||||
#if AV_HAVE_INCOMPATIBLE_FORK_ABI
|
||||
enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat *pix_fmt_list,
|
||||
enum PixelFormat src_pix_fmt,
|
||||
int has_alpha, int *loss_ptr);
|
||||
enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat *pix_fmt_list,
|
||||
enum AVPixelFormat src_pix_fmt,
|
||||
int has_alpha, int *loss_ptr);
|
||||
#else
|
||||
enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat dst_pix_fmt1, enum PixelFormat dst_pix_fmt2,
|
||||
enum PixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
|
||||
enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
|
||||
enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
|
||||
#endif
|
||||
|
||||
|
||||
enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt);
|
||||
enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
@ -4670,7 +4846,12 @@ int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2,
|
|||
//FIXME func typedef
|
||||
|
||||
/**
|
||||
* Fill audio frame data and linesize.
|
||||
* Fill AVFrame audio data and linesize pointers.
|
||||
*
|
||||
* The buffer buf must be a preallocated buffer with a size big enough
|
||||
* to contain the specified samples amount. The filled AVFrame data
|
||||
* pointers will point to this buffer.
|
||||
*
|
||||
* AVFrame extended_data channel pointers are allocated if necessary for
|
||||
* planar audio.
|
||||
*
|
||||
|
@ -4683,7 +4864,9 @@ int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2,
|
|||
* @param buf buffer to use for frame data
|
||||
* @param buf_size size of buffer
|
||||
* @param align plane size sample alignment (0 = default)
|
||||
* @return 0 on success, negative error code on failure
|
||||
* @return >=0 on success, negative error code on failure
|
||||
* @todo return the size in bytes required to store the samples in
|
||||
* case of success, at the next libavutil bump
|
||||
*/
|
||||
int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels,
|
||||
enum AVSampleFormat sample_fmt, const uint8_t *buf,
|
||||
|
@ -4787,7 +4970,7 @@ void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size);
|
|||
|
||||
/**
|
||||
* Same behaviour av_fast_malloc but the buffer has additional
|
||||
* FF_INPUT_PADDING_SIZE at the end which will will always be 0.
|
||||
* FF_INPUT_BUFFER_PADDING_SIZE at the end which will will always be 0.
|
||||
*
|
||||
* In addition the whole buffer will initially and after resizes
|
||||
* be 0-initialized so that no uninitialized data will ever appear.
|
||||
|
|
|
@ -29,8 +29,15 @@
|
|||
* Public libavcodec DXVA2 header.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0600
|
||||
#undef _WIN32_WINNT
|
||||
#endif
|
||||
|
||||
#if !defined(_WIN32_WINNT)
|
||||
#define _WIN32_WINNT 0x0600
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <d3d9.h>
|
||||
#include <dxva2api.h>
|
||||
|
||||
|
|
|
@ -29,12 +29,6 @@
|
|||
* Public libavcodec VDA header.
|
||||
*/
|
||||
|
||||
#include "libavcodec/version.h"
|
||||
|
||||
#if FF_API_VDA_ASYNC
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes
|
||||
|
@ -45,6 +39,12 @@
|
|||
#include <VideoDecodeAcceleration/VDADecoder.h>
|
||||
#undef Picture
|
||||
|
||||
#include "libavcodec/version.h"
|
||||
|
||||
#if FF_API_VDA_ASYNC
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @defgroup lavc_codec_hwaccel_vda VDA
|
||||
* @ingroup lavc_codec_hwaccel
|
||||
|
|
|
@ -52,6 +52,68 @@
|
|||
#include <vdpau/vdpau.h>
|
||||
#include <vdpau/vdpau_x11.h>
|
||||
|
||||
union FFVdpPictureInfo {
|
||||
VdpPictureInfoH264 h264;
|
||||
VdpPictureInfoMPEG1Or2 mpeg;
|
||||
VdpPictureInfoVC1 vc1;
|
||||
VdpPictureInfoMPEG4Part2 mpeg4;
|
||||
};
|
||||
|
||||
/**
|
||||
* This structure is used to share data between the libavcodec library and
|
||||
* the client video application.
|
||||
* The user shall zero-allocate the structure and make it available as
|
||||
* AVCodecContext.hwaccel_context. Members can be set by the user once
|
||||
* during initialization or through each AVCodecContext.get_buffer()
|
||||
* function call. In any case, they must be valid prior to calling
|
||||
* decoding functions.
|
||||
*/
|
||||
typedef struct AVVDPAUContext {
|
||||
/**
|
||||
* VDPAU decoder handle
|
||||
*
|
||||
* Set by user.
|
||||
*/
|
||||
VdpDecoder decoder;
|
||||
|
||||
/**
|
||||
* VDPAU decoder render callback
|
||||
*
|
||||
* Set by the user.
|
||||
*/
|
||||
VdpDecoderRender *render;
|
||||
|
||||
/**
|
||||
* VDPAU picture information
|
||||
*
|
||||
* Set by libavcodec.
|
||||
*/
|
||||
union FFVdpPictureInfo info;
|
||||
|
||||
/**
|
||||
* Allocated size of the bitstream_buffers table.
|
||||
*
|
||||
* Set by libavcodec.
|
||||
*/
|
||||
int bitstream_buffers_allocated;
|
||||
|
||||
/**
|
||||
* Useful bitstream buffers in the bitstream buffers table.
|
||||
*
|
||||
* Set by libavcodec.
|
||||
*/
|
||||
int bitstream_buffers_used;
|
||||
|
||||
/**
|
||||
* Table of bitstream buffers.
|
||||
* The user is responsible for freeing this buffer using av_freep().
|
||||
*
|
||||
* Set by libavcodec.
|
||||
*/
|
||||
VdpBitstreamBuffer *bitstream_buffers;
|
||||
} AVVDPAUContext;
|
||||
|
||||
|
||||
/** @brief The videoSurface is used for rendering. */
|
||||
#define FF_VDPAU_STATE_USED_FOR_RENDER 1
|
||||
|
||||
|
@ -81,12 +143,7 @@ struct vdpau_render_state {
|
|||
VdpBitstreamBuffer *bitstream_buffers;
|
||||
|
||||
/** picture parameter information for all supported codecs */
|
||||
union VdpPictureInfo {
|
||||
VdpPictureInfoH264 h264;
|
||||
VdpPictureInfoMPEG1Or2 mpeg;
|
||||
VdpPictureInfoVC1 vc1;
|
||||
VdpPictureInfoMPEG4Part2 mpeg4;
|
||||
} info;
|
||||
union FFVdpPictureInfo info;
|
||||
};
|
||||
|
||||
/* @}*/
|
||||
|
|
|
@ -26,8 +26,10 @@
|
|||
* Libavcodec version macros.
|
||||
*/
|
||||
|
||||
#include "libavutil/avutil.h"
|
||||
|
||||
#define LIBAVCODEC_VERSION_MAJOR 54
|
||||
#define LIBAVCODEC_VERSION_MINOR 60
|
||||
#define LIBAVCODEC_VERSION_MINOR 92
|
||||
#define LIBAVCODEC_VERSION_MICRO 100
|
||||
|
||||
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
||||
|
@ -92,5 +94,20 @@
|
|||
#ifndef FF_API_VDA_ASYNC
|
||||
#define FF_API_VDA_ASYNC (LIBAVCODEC_VERSION_MAJOR < 55)
|
||||
#endif
|
||||
#ifndef FF_API_AVCODEC_RESAMPLE
|
||||
#define FF_API_AVCODEC_RESAMPLE (LIBAVCODEC_VERSION_MAJOR < 55)
|
||||
#endif
|
||||
#ifndef FF_API_LIBMPEG2
|
||||
#define FF_API_LIBMPEG2 (LIBAVCODEC_VERSION_MAJOR < 55)
|
||||
#endif
|
||||
#ifndef FF_API_MMI
|
||||
#define FF_API_MMI (LIBAVCODEC_VERSION_MAJOR < 55)
|
||||
#endif
|
||||
#ifndef FF_API_IDCT
|
||||
#define FF_API_IDCT (LIBAVCODEC_VERSION_MAJOR < 55)
|
||||
#endif
|
||||
#ifndef FF_API_DEINTERLACE
|
||||
#define FF_API_DEINTERLACE (LIBAVCODEC_VERSION_MAJOR < 56)
|
||||
#endif
|
||||
|
||||
#endif /* AVCODEC_VERSION_H */
|
||||
|
|
|
@ -28,8 +28,8 @@
|
|||
#include "libavutil/avutil.h"
|
||||
|
||||
#define LIBAVDEVICE_VERSION_MAJOR 54
|
||||
#define LIBAVDEVICE_VERSION_MINOR 2
|
||||
#define LIBAVDEVICE_VERSION_MICRO 101
|
||||
#define LIBAVDEVICE_VERSION_MINOR 3
|
||||
#define LIBAVDEVICE_VERSION_MICRO 103
|
||||
|
||||
#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
|
||||
LIBAVDEVICE_VERSION_MINOR, \
|
||||
|
@ -39,6 +39,8 @@
|
|||
LIBAVDEVICE_VERSION_MICRO)
|
||||
#define LIBAVDEVICE_BUILD LIBAVDEVICE_VERSION_INT
|
||||
|
||||
#define LIBAVDEVICE_IDENT "Lavd" AV_STRINGIFY(LIBAVDEVICE_VERSION)
|
||||
|
||||
/**
|
||||
* FF_API_* defines may be placed below to indicate public API that will be
|
||||
* dropped at a future version bump. The defines themselves are not part of
|
||||
|
|
|
@ -22,9 +22,21 @@
|
|||
#ifndef AVFILTER_AVFILTER_H
|
||||
#define AVFILTER_AVFILTER_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lavfi
|
||||
* external API header
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup lavfi Libavfilter
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "libavutil/avutil.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/log.h"
|
||||
#include "libavutil/samplefmt.h"
|
||||
#include "libavutil/pixfmt.h"
|
||||
|
@ -116,6 +128,7 @@ typedef struct AVFilterBufferRefAudioProps {
|
|||
uint64_t channel_layout; ///< channel layout of audio buffer
|
||||
int nb_samples; ///< number of audio samples per channel
|
||||
int sample_rate; ///< audio buffer sample rate
|
||||
int channels; ///< number of channels (do not access directly)
|
||||
} AVFilterBufferRefAudioProps;
|
||||
|
||||
/**
|
||||
|
@ -180,6 +193,8 @@ typedef struct AVFilterBufferRef {
|
|||
int perms; ///< permissions, see the AV_PERM_* flags
|
||||
|
||||
enum AVMediaType type; ///< media type of buffer data
|
||||
|
||||
AVDictionary *metadata; ///< dictionary containing metadata key=value tags
|
||||
} AVFilterBufferRef;
|
||||
|
||||
/**
|
||||
|
@ -218,6 +233,11 @@ void avfilter_unref_buffer(AVFilterBufferRef *ref);
|
|||
*/
|
||||
void avfilter_unref_bufferp(AVFilterBufferRef **ref);
|
||||
|
||||
/**
|
||||
* Get the number of channels of a buffer reference.
|
||||
*/
|
||||
int avfilter_ref_get_channels(AVFilterBufferRef *ref);
|
||||
|
||||
#if FF_API_AVFILTERPAD_PUBLIC
|
||||
/**
|
||||
* A filter pad used for either input or output.
|
||||
|
@ -270,26 +290,13 @@ struct AVFilterPad {
|
|||
int rej_perms;
|
||||
|
||||
/**
|
||||
* Callback called before passing the first slice of a new frame. If
|
||||
* NULL, the filter layer will default to storing a reference to the
|
||||
* picture inside the link structure.
|
||||
*
|
||||
* The reference given as argument is also available in link->cur_buf.
|
||||
* It can be stored elsewhere or given away, but then clearing
|
||||
* link->cur_buf is advised, as it is automatically unreferenced.
|
||||
* The reference must not be unreferenced before end_frame(), as it may
|
||||
* still be in use by the automatic copy mechanism.
|
||||
*
|
||||
* Input video pads only.
|
||||
*
|
||||
* @return >= 0 on success, a negative AVERROR on error. picref will be
|
||||
* unreferenced by the caller in case of error.
|
||||
* @deprecated unused
|
||||
*/
|
||||
int (*start_frame)(AVFilterLink *link, AVFilterBufferRef *picref);
|
||||
|
||||
/**
|
||||
* Callback function to get a video buffer. If NULL, the filter system will
|
||||
* use avfilter_default_get_video_buffer().
|
||||
* use ff_default_get_video_buffer().
|
||||
*
|
||||
* Input video pads only.
|
||||
*/
|
||||
|
@ -297,7 +304,7 @@ struct AVFilterPad {
|
|||
|
||||
/**
|
||||
* Callback function to get an audio buffer. If NULL, the filter system will
|
||||
* use avfilter_default_get_audio_buffer().
|
||||
* use ff_default_get_audio_buffer().
|
||||
*
|
||||
* Input audio pads only.
|
||||
*/
|
||||
|
@ -305,37 +312,26 @@ struct AVFilterPad {
|
|||
int nb_samples);
|
||||
|
||||
/**
|
||||
* Callback called after the slices of a frame are completely sent. If
|
||||
* NULL, the filter layer will default to releasing the reference stored
|
||||
* in the link structure during start_frame().
|
||||
*
|
||||
* Input video pads only.
|
||||
*
|
||||
* @return >= 0 on success, a negative AVERROR on error.
|
||||
* @deprecated unused
|
||||
*/
|
||||
int (*end_frame)(AVFilterLink *link);
|
||||
|
||||
/**
|
||||
* Slice drawing callback. This is where a filter receives video data
|
||||
* and should do its processing.
|
||||
*
|
||||
* Input video pads only.
|
||||
*
|
||||
* @return >= 0 on success, a negative AVERROR on error.
|
||||
* @deprecated unused
|
||||
*/
|
||||
int (*draw_slice)(AVFilterLink *link, int y, int height, int slice_dir);
|
||||
|
||||
/**
|
||||
* Samples filtering callback. This is where a filter receives audio data
|
||||
* and should do its processing.
|
||||
* Filtering callback. This is where a filter receives a frame with
|
||||
* audio/video data and should do its processing.
|
||||
*
|
||||
* Input audio pads only.
|
||||
* Input pads only.
|
||||
*
|
||||
* @return >= 0 on success, a negative AVERROR on error. This function
|
||||
* must ensure that samplesref is properly unreferenced on error if it
|
||||
* must ensure that frame is properly unreferenced on error if it
|
||||
* hasn't been passed on to another filter.
|
||||
*/
|
||||
int (*filter_samples)(AVFilterLink *link, AVFilterBufferRef *samplesref);
|
||||
int (*filter_frame)(AVFilterLink *link, AVFilterBufferRef *frame);
|
||||
|
||||
/**
|
||||
* Frame poll callback. This returns the number of immediately available
|
||||
|
@ -531,7 +527,7 @@ struct AVFilterLink {
|
|||
int h; ///< agreed upon image height
|
||||
AVRational sample_aspect_ratio; ///< agreed upon sample aspect ratio
|
||||
/* These parameters apply only to audio */
|
||||
uint64_t channel_layout; ///< channel layout of current buffer (see libavutil/audioconvert.h)
|
||||
uint64_t channel_layout; ///< channel layout of current buffer (see libavutil/channel_layout.h)
|
||||
int sample_rate; ///< samples per second
|
||||
|
||||
int format; ///< agreed upon media format
|
||||
|
@ -587,51 +583,6 @@ struct AVFilterLink {
|
|||
AVLINK_INIT ///< complete
|
||||
} init_state;
|
||||
|
||||
/**
|
||||
* The buffer reference currently being sent across the link by the source
|
||||
* filter. This is used internally by the filter system to allow
|
||||
* automatic copying of buffers which do not have sufficient permissions
|
||||
* for the destination. This should not be accessed directly by the
|
||||
* filters.
|
||||
*/
|
||||
AVFilterBufferRef *src_buf;
|
||||
|
||||
/**
|
||||
* The buffer reference to the frame sent across the link by the
|
||||
* source filter, which is read by the destination filter. It is
|
||||
* automatically set up by ff_start_frame().
|
||||
*
|
||||
* Depending on the permissions, it may either be the same as
|
||||
* src_buf or an automatic copy of it.
|
||||
*
|
||||
* It is automatically freed by the filter system when calling
|
||||
* ff_end_frame(). In case you save the buffer reference
|
||||
* internally (e.g. if you cache it for later reuse), or give it
|
||||
* away (e.g. if you pass the reference to the next filter) it
|
||||
* must be set to NULL before calling ff_end_frame().
|
||||
*/
|
||||
AVFilterBufferRef *cur_buf;
|
||||
|
||||
/**
|
||||
* The buffer reference to the frame which is sent to output by
|
||||
* the source filter.
|
||||
*
|
||||
* If no start_frame callback is defined on a link,
|
||||
* ff_start_frame() will automatically request a new buffer on the
|
||||
* first output link of the destination filter. The reference to
|
||||
* the buffer so obtained is stored in the out_buf field on the
|
||||
* output link.
|
||||
*
|
||||
* It can also be set by the filter code in case the filter needs
|
||||
* to access the output buffer later. For example the filter code
|
||||
* may set it in a custom start_frame, and access it in
|
||||
* draw_slice.
|
||||
*
|
||||
* It is automatically freed by the filter system in
|
||||
* ff_end_frame().
|
||||
*/
|
||||
AVFilterBufferRef *out_buf;
|
||||
|
||||
struct AVFilterPool *pool;
|
||||
|
||||
/**
|
||||
|
@ -674,7 +625,7 @@ struct AVFilterLink {
|
|||
int partial_buf_size;
|
||||
|
||||
/**
|
||||
* Minimum number of samples to filter at once. If filter_samples() is
|
||||
* Minimum number of samples to filter at once. If filter_frame() is
|
||||
* called with fewer samples, it will accumulate them in partial_buf.
|
||||
* This field and the related ones must not be changed after filtering
|
||||
* has started.
|
||||
|
@ -683,7 +634,7 @@ struct AVFilterLink {
|
|||
int min_samples;
|
||||
|
||||
/**
|
||||
* Maximum number of samples to filter at once. If filter_samples() is
|
||||
* Maximum number of samples to filter at once. If filter_frame() is
|
||||
* called with more samples, it will split them.
|
||||
*/
|
||||
int max_samples;
|
||||
|
@ -699,7 +650,7 @@ struct AVFilterLink {
|
|||
|
||||
/**
|
||||
* True if the link is closed.
|
||||
* If set, all attemps of start_frame, filter_samples or request_frame
|
||||
* If set, all attemps of start_frame, filter_frame or request_frame
|
||||
* will fail with AVERROR_EOF, and if necessary the reference will be
|
||||
* destroyed.
|
||||
* If request_frame returns AVERROR_EOF, this flag is set on the
|
||||
|
@ -708,6 +659,11 @@ struct AVFilterLink {
|
|||
* filter.
|
||||
*/
|
||||
int closed;
|
||||
|
||||
/**
|
||||
* Number of channels.
|
||||
*/
|
||||
int channels;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -727,6 +683,11 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad,
|
|||
*/
|
||||
void avfilter_link_free(AVFilterLink **link);
|
||||
|
||||
/**
|
||||
* Get the number of channels of a link.
|
||||
*/
|
||||
int avfilter_link_get_channels(AVFilterLink *link);
|
||||
|
||||
/**
|
||||
* Set the closed field of a link.
|
||||
*/
|
||||
|
@ -753,12 +714,15 @@ int avfilter_config_links(AVFilterContext *filter);
|
|||
*/
|
||||
AVFilterBufferRef *
|
||||
avfilter_get_video_buffer_ref_from_arrays(uint8_t * const data[4], const int linesize[4], int perms,
|
||||
int w, int h, enum PixelFormat format);
|
||||
int w, int h, enum AVPixelFormat format);
|
||||
|
||||
/**
|
||||
* Create an audio buffer reference wrapped around an already
|
||||
* allocated samples buffer.
|
||||
*
|
||||
* See avfilter_get_audio_buffer_ref_from_arrays_channels() for a version
|
||||
* that can handle unknown channel layouts.
|
||||
*
|
||||
* @param data pointers to the samples plane buffers
|
||||
* @param linesize linesize for the samples plane buffers
|
||||
* @param perms the required access permissions
|
||||
|
@ -772,6 +736,27 @@ AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_arrays(uint8_t **data,
|
|||
int nb_samples,
|
||||
enum AVSampleFormat sample_fmt,
|
||||
uint64_t channel_layout);
|
||||
/**
|
||||
* Create an audio buffer reference wrapped around an already
|
||||
* allocated samples buffer.
|
||||
*
|
||||
* @param data pointers to the samples plane buffers
|
||||
* @param linesize linesize for the samples plane buffers
|
||||
* @param perms the required access permissions
|
||||
* @param nb_samples number of samples per channel
|
||||
* @param sample_fmt the format of each sample in the buffer to allocate
|
||||
* @param channels the number of channels of the buffer
|
||||
* @param channel_layout the channel layout of the buffer,
|
||||
* must be either 0 or consistent with channels
|
||||
*/
|
||||
AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_arrays_channels(uint8_t **data,
|
||||
int linesize,
|
||||
int perms,
|
||||
int nb_samples,
|
||||
enum AVSampleFormat sample_fmt,
|
||||
int channels,
|
||||
uint64_t channel_layout);
|
||||
|
||||
|
||||
|
||||
#define AVFILTER_CMD_FLAG_ONE 1 ///< Stop once a filter understood the command (for target=all for example), fast filters are favored automatically
|
||||
|
@ -860,4 +845,8 @@ void avfilter_free(AVFilterContext *filter);
|
|||
int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt,
|
||||
unsigned filt_srcpad_idx, unsigned filt_dstpad_idx);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVFILTER_AVFILTER_H */
|
||||
|
|
|
@ -31,6 +31,8 @@ typedef struct AVFilterGraph {
|
|||
AVFilterContext **filters;
|
||||
|
||||
char *scale_sws_opts; ///< sws options to use for the auto-inserted scale filters
|
||||
char *resample_lavr_opts; ///< libavresample options to use for the auto-inserted resample filters
|
||||
char *aresample_swr_opts; ///< swr options to use for the auto-inserted aresample filters, Access ONLY through AVOptions
|
||||
|
||||
/**
|
||||
* Private fields
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
* Struct to use for initializing a buffersink context.
|
||||
*/
|
||||
typedef struct {
|
||||
const enum PixelFormat *pixel_fmts; ///< list of allowed pixel formats, terminated by PIX_FMT_NONE
|
||||
const enum AVPixelFormat *pixel_fmts; ///< list of allowed pixel formats, terminated by AV_PIX_FMT_NONE
|
||||
} AVBufferSinkParams;
|
||||
|
||||
/**
|
||||
|
@ -46,6 +46,9 @@ AVBufferSinkParams *av_buffersink_params_alloc(void);
|
|||
typedef struct {
|
||||
const enum AVSampleFormat *sample_fmts; ///< list of allowed sample formats, terminated by AV_SAMPLE_FMT_NONE
|
||||
const int64_t *channel_layouts; ///< list of allowed channel layouts, terminated by -1
|
||||
const int *channel_counts; ///< list of allowed channel counts, terminated by -1
|
||||
int all_channel_counts; ///< if not 0, accept any channel count or layout
|
||||
int *sample_rates; ///< list of allowed sample rates, terminated by -1
|
||||
} AVABufferSinkParams;
|
||||
|
||||
/**
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
#include "libavutil/avutil.h"
|
||||
|
||||
#define LIBAVFILTER_VERSION_MAJOR 3
|
||||
#define LIBAVFILTER_VERSION_MINOR 17
|
||||
#define LIBAVFILTER_VERSION_MICRO 100
|
||||
#define LIBAVFILTER_VERSION_MINOR 42
|
||||
#define LIBAVFILTER_VERSION_MICRO 103
|
||||
|
||||
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
|
||||
LIBAVFILTER_VERSION_MINOR, \
|
||||
|
@ -40,15 +40,14 @@
|
|||
LIBAVFILTER_VERSION_MICRO)
|
||||
#define LIBAVFILTER_BUILD LIBAVFILTER_VERSION_INT
|
||||
|
||||
#define LIBAVFILTER_IDENT "Lavfi" AV_STRINGIFY(LIBAVFILTER_VERSION)
|
||||
|
||||
/**
|
||||
* FF_API_* defines may be placed below to indicate public API that will be
|
||||
* dropped at a future version bump. The defines themselves are not part of
|
||||
* the public API and may change, break or disappear at any time.
|
||||
*/
|
||||
|
||||
#ifndef FF_API_OLD_ALL_FORMATS_API
|
||||
#define FF_API_OLD_ALL_FORMATS_API (LIBAVFILTER_VERSION_MAJOR < 3)
|
||||
#endif
|
||||
#ifndef FF_API_AVFILTERPAD_PUBLIC
|
||||
#define FF_API_AVFILTERPAD_PUBLIC (LIBAVFILTER_VERSION_MAJOR < 4)
|
||||
#endif
|
||||
|
|
|
@ -158,9 +158,15 @@
|
|||
* information will be in AVStream.time_base units, i.e. it has to be
|
||||
* multiplied by the timebase to convert them to seconds.
|
||||
*
|
||||
* The packet data belongs to the demuxer and is invalid after the next call to
|
||||
* av_read_frame(). The user must free the packet with av_free_packet() before
|
||||
* calling av_read_frame() again or closing the file.
|
||||
* If AVPacket.destruct is set on the returned packet, then the packet is
|
||||
* allocated dynamically and the user may keep it indefinitely.
|
||||
* Otherwise, if AVPacket.destruct is NULL, the packet data is backed by a
|
||||
* static storage somewhere inside the demuxer and the packet is only valid
|
||||
* until the next av_read_frame() call or closing the file. If the caller
|
||||
* requires a longer lifetime, av_dup_packet() will make an av_malloc()ed copy
|
||||
* of it.
|
||||
* In both cases, the packet must be freed with av_free_packet() when it is no
|
||||
* longer needed.
|
||||
*
|
||||
* @section lavf_decoding_seek Seeking
|
||||
* @}
|
||||
|
@ -336,6 +342,7 @@ typedef struct AVProbeData {
|
|||
} AVProbeData;
|
||||
|
||||
#define AVPROBE_SCORE_MAX 100 ///< maximum score, half of that is used for file-extension-based detection
|
||||
#define AVPROBE_SCORE_RETRY (AVPROBE_SCORE_MAX/4)
|
||||
#define AVPROBE_PADDING_SIZE 32 ///< extra allocated bytes at the end of the probe buffer
|
||||
|
||||
/// Demuxer will use avio_open, no opened file should be provided by the caller.
|
||||
|
@ -581,7 +588,7 @@ enum AVStreamParseType {
|
|||
AVSTREAM_PARSE_FULL_ONCE, /**< full parsing and repack of the first frame only, only implemented for H.264 currently */
|
||||
AVSTREAM_PARSE_FULL_RAW=MKTAG(0,'R','A','W'), /**< full parsing and repack with timestamp and position generation by parser for raw
|
||||
this assumes that each packet in the file contains no demuxer level headers and
|
||||
just codec level data, otherwise position generaion would fail */
|
||||
just codec level data, otherwise position generation would fail */
|
||||
};
|
||||
|
||||
typedef struct AVIndexEntry {
|
||||
|
@ -622,6 +629,13 @@ typedef struct AVIndexEntry {
|
|||
*/
|
||||
#define AV_DISPOSITION_ATTACHED_PIC 0x0400
|
||||
|
||||
/**
|
||||
* Options for behavior on timestamp wrap detection.
|
||||
*/
|
||||
#define AV_PTS_WRAP_IGNORE 0 ///< ignore the wrap
|
||||
#define AV_PTS_WRAP_ADD_OFFSET 1 ///< add the format specific offset on wrap detection
|
||||
#define AV_PTS_WRAP_SUB_OFFSET -1 ///< subtract the format specific offset on wrap detection
|
||||
|
||||
/**
|
||||
* Stream structure.
|
||||
* New fields can be added to the end with minor version bumps.
|
||||
|
@ -634,7 +648,7 @@ typedef struct AVStream {
|
|||
/**
|
||||
* Format-specific stream ID.
|
||||
* decoding: set by libavformat
|
||||
* encoding: set by the user
|
||||
* encoding: set by the user, replaced by libavformat if left unset
|
||||
*/
|
||||
int id;
|
||||
/**
|
||||
|
@ -672,7 +686,7 @@ typedef struct AVStream {
|
|||
* of which frame timestamps are represented.
|
||||
*
|
||||
* decoding: set by libavformat
|
||||
* encoding: set by libavformat in av_write_header. The muxer may use the
|
||||
* encoding: set by libavformat in avformat_write_header. The muxer may use the
|
||||
* user-provided value of @ref AVCodecContext.time_base "codec->time_base"
|
||||
* as a hint.
|
||||
*/
|
||||
|
@ -740,10 +754,13 @@ typedef struct AVStream {
|
|||
int64_t last_dts;
|
||||
int64_t duration_gcd;
|
||||
int duration_count;
|
||||
double duration_error[2][2][MAX_STD_TIMEBASES];
|
||||
double (*duration_error)[2][MAX_STD_TIMEBASES];
|
||||
int64_t codec_info_duration;
|
||||
int64_t codec_info_duration_fields;
|
||||
int found_decoder;
|
||||
|
||||
int64_t last_duration;
|
||||
|
||||
/**
|
||||
* Those are used for average framerate estimation.
|
||||
*/
|
||||
|
@ -829,7 +846,7 @@ typedef struct AVStream {
|
|||
|
||||
/**
|
||||
* Number of internally decoded frames, used internally in libavformat, do not access
|
||||
* its lifetime differs from info which is why its not in that structure.
|
||||
* its lifetime differs from info which is why it is not in that structure.
|
||||
*/
|
||||
int nb_decoded_frames;
|
||||
|
||||
|
@ -839,6 +856,23 @@ typedef struct AVStream {
|
|||
*/
|
||||
int64_t mux_ts_offset;
|
||||
|
||||
/**
|
||||
* Internal data to check for wrapping of the time stamp
|
||||
*/
|
||||
int64_t pts_wrap_reference;
|
||||
|
||||
/**
|
||||
* Options for behavior, when a wrap is detected.
|
||||
*
|
||||
* Defined by AV_PTS_WRAP_ values.
|
||||
*
|
||||
* If correction is enabled, there are two possibilities:
|
||||
* If the first time stamp is near the wrap point, the wrap offset
|
||||
* will be subtracted, which will create negative time stamps.
|
||||
* Otherwise the offset will be added.
|
||||
*/
|
||||
int pts_wrap_behavior;
|
||||
|
||||
} AVStream;
|
||||
|
||||
#define AV_PROGRAM_RUNNING 1
|
||||
|
@ -860,6 +894,19 @@ typedef struct AVProgram {
|
|||
int program_num;
|
||||
int pmt_pid;
|
||||
int pcr_pid;
|
||||
|
||||
/*****************************************************************
|
||||
* 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.
|
||||
*****************************************************************
|
||||
*/
|
||||
int64_t start_time;
|
||||
int64_t end_time;
|
||||
|
||||
int64_t pts_wrap_reference; ///< reference dts for wrap detection
|
||||
int pts_wrap_behavior; ///< behavior on wrap detection
|
||||
} AVProgram;
|
||||
|
||||
#define AVFMTCTX_NOHEADER 0x0001 /**< signal that no header is present
|
||||
|
@ -1144,6 +1191,27 @@ typedef struct AVFormatContext {
|
|||
*/
|
||||
enum AVDurationEstimationMethod duration_estimation_method;
|
||||
|
||||
/**
|
||||
* Skip initial bytes when opening stream
|
||||
* - encoding: unused
|
||||
* - decoding: Set by user via AVOptions (NO direct access)
|
||||
*/
|
||||
unsigned int skip_initial_bytes;
|
||||
|
||||
/**
|
||||
* Correct single timestamp overflows
|
||||
* - encoding: unused
|
||||
* - decoding: Set by user via AVOPtions (NO direct access)
|
||||
*/
|
||||
unsigned int correct_ts_overflow;
|
||||
|
||||
/**
|
||||
* Force seeking to any (also non key) frames.
|
||||
* - encoding: unused
|
||||
* - decoding: Set by user via AVOPtions (NO direct access)
|
||||
*/
|
||||
int seek2any;
|
||||
|
||||
/*****************************************************************
|
||||
* 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
|
||||
|
@ -1227,7 +1295,6 @@ const char *avformat_license(void);
|
|||
*
|
||||
* @see av_register_input_format()
|
||||
* @see av_register_output_format()
|
||||
* @see av_register_protocol()
|
||||
*/
|
||||
void av_register_all(void);
|
||||
|
||||
|
@ -1299,7 +1366,7 @@ const AVClass *avformat_get_class(void);
|
|||
*
|
||||
* @return newly created stream or NULL on error.
|
||||
*/
|
||||
AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c);
|
||||
AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c);
|
||||
|
||||
AVProgram *av_new_program(AVFormatContext *s, int id);
|
||||
|
||||
|
@ -1538,13 +1605,13 @@ int av_read_packet(AVFormatContext *s, AVPacket *pkt);
|
|||
* omit invalid data between valid frames so as to give the decoder the maximum
|
||||
* information possible for decoding.
|
||||
*
|
||||
* The returned packet is valid
|
||||
* until the next av_read_frame() or until av_close_input_file() and
|
||||
* must be freed with av_free_packet. For video, the packet contains
|
||||
* exactly one frame. For audio, it contains an integer number of
|
||||
* frames if each frame has a known fixed size (e.g. PCM or ADPCM
|
||||
* data). If the audio frames have a variable size (e.g. MPEG audio),
|
||||
* then it contains one frame.
|
||||
* If pkt->destruct is NULL, then the packet is valid until the next
|
||||
* av_read_frame() or until av_close_input_file(). Otherwise the packet is valid
|
||||
* indefinitely. In both cases the packet must be freed with
|
||||
* av_free_packet when it is no longer needed. For video, the packet contains
|
||||
* exactly one frame. For audio, it contains an integer number of frames if each
|
||||
* frame has a known fixed size (e.g. PCM or ADPCM data). If the audio frames
|
||||
* have a variable size (e.g. MPEG audio), then it contains one frame.
|
||||
*
|
||||
* pkt->pts, pkt->dts and pkt->duration are always set to correct
|
||||
* values in AVStream.time_base units (and guessed if the format cannot
|
||||
|
@ -1712,10 +1779,10 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt);
|
|||
* @param s media file handle
|
||||
* @param pkt The packet containing the data to be written. Libavformat takes
|
||||
* ownership of the data and will free it when it sees fit using the packet's
|
||||
* This can be NULL (at any time, not just at the end), to flush the
|
||||
* interleaving queues.
|
||||
* @ref AVPacket.destruct "destruct" field. The caller must not access the data
|
||||
* after this function returns, as it may already be freed.
|
||||
* This can be NULL (at any time, not just at the end), to flush the
|
||||
* interleaving queues.
|
||||
* Packet's @ref AVPacket.stream_index "stream_index" field must be set to the
|
||||
* index of the corresponding stream in @ref AVFormatContext.streams
|
||||
* "s.streams".
|
||||
|
@ -1741,7 +1808,7 @@ int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out,
|
|||
* Write the stream trailer to an output media file and free the
|
||||
* file private data.
|
||||
*
|
||||
* May only be called after a successful call to av_write_header.
|
||||
* May only be called after a successful call to avformat_write_header.
|
||||
*
|
||||
* @param s media file handle
|
||||
* @return 0 if OK, AVERROR_xxx on error
|
||||
|
@ -1778,9 +1845,9 @@ enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
|
|||
* work in real time.
|
||||
* @param s media file handle
|
||||
* @param stream stream in the media file
|
||||
* @param dts[out] DTS of the last packet output for the stream, in stream
|
||||
* @param[out] dts DTS of the last packet output for the stream, in stream
|
||||
* time_base units
|
||||
* @param wall[out] absolute time when that packet whas output,
|
||||
* @param[out] wall absolute time when that packet whas output,
|
||||
* in microsecond
|
||||
* @return 0 if OK, AVERROR(ENOSYS) if the format does not support it
|
||||
* Note: some formats or devices may not allow to measure dts and wall
|
||||
|
@ -1813,7 +1880,7 @@ int av_get_output_timestamp(struct AVFormatContext *s, int stream,
|
|||
*
|
||||
* @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2
|
||||
*/
|
||||
void av_hex_dump(FILE *f, uint8_t *buf, int size);
|
||||
void av_hex_dump(FILE *f, const uint8_t *buf, int size);
|
||||
|
||||
/**
|
||||
* Send a nice hexadecimal dump of a buffer to the log.
|
||||
|
@ -1827,7 +1894,7 @@ void av_hex_dump(FILE *f, uint8_t *buf, int size);
|
|||
*
|
||||
* @see av_hex_dump, av_pkt_dump2, av_pkt_dump_log2
|
||||
*/
|
||||
void av_hex_dump_log(void *avcl, int level, uint8_t *buf, int size);
|
||||
void av_hex_dump_log(void *avcl, int level, const uint8_t *buf, int size);
|
||||
|
||||
/**
|
||||
* Send a nice dump of a packet to the specified file stream.
|
||||
|
@ -1872,6 +1939,18 @@ enum AVCodecID av_codec_get_id(const struct AVCodecTag * const *tags, unsigned i
|
|||
*/
|
||||
unsigned int av_codec_get_tag(const struct AVCodecTag * const *tags, enum AVCodecID id);
|
||||
|
||||
/**
|
||||
* Get the codec tag for the given codec id.
|
||||
*
|
||||
* @param tags list of supported codec_id - codec_tag pairs, as stored
|
||||
* in AVInputFormat.codec_tag and AVOutputFormat.codec_tag
|
||||
* @param id codec id that should be searched for in the list
|
||||
* @param tag A pointer to the found tag
|
||||
* @return 0 if id was not found in tags, > 0 if it was found
|
||||
*/
|
||||
int av_codec_get_tag2(const struct AVCodecTag * const *tags, enum AVCodecID id,
|
||||
unsigned int *tag);
|
||||
|
||||
int av_find_default_stream_index(AVFormatContext *s);
|
||||
|
||||
/**
|
||||
|
@ -1952,6 +2031,9 @@ int av_filename_number_test(const char *filename);
|
|||
/**
|
||||
* Generate an SDP for an RTP session.
|
||||
*
|
||||
* Note, this overwrites the id values of AVStreams in the muxer contexts
|
||||
* for getting unique dynamic payload types.
|
||||
*
|
||||
* @param ac array of AVFormatContexts describing the RTP streams. If the
|
||||
* array is composed by only one context, such context can contain
|
||||
* multiple AVStreams (one AVStream per RTP stream). Otherwise,
|
||||
|
|
|
@ -395,9 +395,24 @@ int avio_open2(AVIOContext **s, const char *url, int flags,
|
|||
* resource.
|
||||
*
|
||||
* @return 0 on success, an AVERROR < 0 on error.
|
||||
* @see avio_closep
|
||||
*/
|
||||
int avio_close(AVIOContext *s);
|
||||
|
||||
/**
|
||||
* Close the resource accessed by the AVIOContext *s, free it
|
||||
* and set the pointer pointing to it to NULL.
|
||||
* This function can only be used if s was opened by avio_open().
|
||||
*
|
||||
* The internal buffer is automatically flushed before closing the
|
||||
* resource.
|
||||
*
|
||||
* @return 0 on success, an AVERROR < 0 on error.
|
||||
* @see avio_close
|
||||
*/
|
||||
int avio_closep(AVIOContext **s);
|
||||
|
||||
|
||||
/**
|
||||
* Open a write only memory stream.
|
||||
*
|
||||
|
|
|
@ -30,8 +30,8 @@
|
|||
#include "libavutil/avutil.h"
|
||||
|
||||
#define LIBAVFORMAT_VERSION_MAJOR 54
|
||||
#define LIBAVFORMAT_VERSION_MINOR 29
|
||||
#define LIBAVFORMAT_VERSION_MICRO 105
|
||||
#define LIBAVFORMAT_VERSION_MINOR 63
|
||||
#define LIBAVFORMAT_VERSION_MICRO 104
|
||||
|
||||
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
|
||||
LIBAVFORMAT_VERSION_MINOR, \
|
||||
|
|
|
@ -23,6 +23,9 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "attributes.h"
|
||||
#include "version.h"
|
||||
|
||||
/**
|
||||
* @defgroup lavu_aes AES
|
||||
* @ingroup lavu_crypto
|
||||
|
@ -33,6 +36,11 @@ extern const int av_aes_size;
|
|||
|
||||
struct AVAES;
|
||||
|
||||
/**
|
||||
* Allocate an AVAES context.
|
||||
*/
|
||||
struct AVAES *av_aes_alloc(void);
|
||||
|
||||
/**
|
||||
* Initialize an AVAES context.
|
||||
* @param key_bits 128, 192 or 256
|
||||
|
|
|
@ -1,208 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
|
||||
* Copyright (c) 2008 Peter Ross
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_AUDIOCONVERT_H
|
||||
#define AVUTIL_AUDIOCONVERT_H
|
||||
#include "version.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @file
|
||||
* audio conversion routines
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup lavu_audio
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup channel_masks Audio channel masks
|
||||
* @{
|
||||
*/
|
||||
#define AV_CH_FRONT_LEFT 0x00000001
|
||||
#define AV_CH_FRONT_RIGHT 0x00000002
|
||||
#define AV_CH_FRONT_CENTER 0x00000004
|
||||
#define AV_CH_LOW_FREQUENCY 0x00000008
|
||||
#define AV_CH_BACK_LEFT 0x00000010
|
||||
#define AV_CH_BACK_RIGHT 0x00000020
|
||||
#define AV_CH_FRONT_LEFT_OF_CENTER 0x00000040
|
||||
#define AV_CH_FRONT_RIGHT_OF_CENTER 0x00000080
|
||||
#define AV_CH_BACK_CENTER 0x00000100
|
||||
#define AV_CH_SIDE_LEFT 0x00000200
|
||||
#define AV_CH_SIDE_RIGHT 0x00000400
|
||||
#define AV_CH_TOP_CENTER 0x00000800
|
||||
#define AV_CH_TOP_FRONT_LEFT 0x00001000
|
||||
#define AV_CH_TOP_FRONT_CENTER 0x00002000
|
||||
#define AV_CH_TOP_FRONT_RIGHT 0x00004000
|
||||
#define AV_CH_TOP_BACK_LEFT 0x00008000
|
||||
#define AV_CH_TOP_BACK_CENTER 0x00010000
|
||||
#define AV_CH_TOP_BACK_RIGHT 0x00020000
|
||||
#define AV_CH_STEREO_LEFT 0x20000000 ///< Stereo downmix.
|
||||
#define AV_CH_STEREO_RIGHT 0x40000000 ///< See AV_CH_STEREO_LEFT.
|
||||
#define AV_CH_WIDE_LEFT 0x0000000080000000ULL
|
||||
#define AV_CH_WIDE_RIGHT 0x0000000100000000ULL
|
||||
#define AV_CH_SURROUND_DIRECT_LEFT 0x0000000200000000ULL
|
||||
#define AV_CH_SURROUND_DIRECT_RIGHT 0x0000000400000000ULL
|
||||
#define AV_CH_LOW_FREQUENCY_2 0x0000000800000000ULL
|
||||
|
||||
/** 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 AV_CH_LAYOUT_NATIVE 0x8000000000000000ULL
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @defgroup channel_mask_c Audio channel convenience macros
|
||||
* @{
|
||||
* */
|
||||
#define AV_CH_LAYOUT_MONO (AV_CH_FRONT_CENTER)
|
||||
#define AV_CH_LAYOUT_STEREO (AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT)
|
||||
#define AV_CH_LAYOUT_2POINT1 (AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY)
|
||||
#define AV_CH_LAYOUT_2_1 (AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER)
|
||||
#define AV_CH_LAYOUT_SURROUND (AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER)
|
||||
#define AV_CH_LAYOUT_3POINT1 (AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY)
|
||||
#define AV_CH_LAYOUT_4POINT0 (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_CENTER)
|
||||
#define AV_CH_LAYOUT_4POINT1 (AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY)
|
||||
#define AV_CH_LAYOUT_2_2 (AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
|
||||
#define AV_CH_LAYOUT_QUAD (AV_CH_LAYOUT_STEREO|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_5POINT0 (AV_CH_LAYOUT_SURROUND|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
|
||||
#define AV_CH_LAYOUT_5POINT1 (AV_CH_LAYOUT_5POINT0|AV_CH_LOW_FREQUENCY)
|
||||
#define AV_CH_LAYOUT_5POINT0_BACK (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_5POINT1_BACK (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_LOW_FREQUENCY)
|
||||
#define AV_CH_LAYOUT_6POINT0 (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_CENTER)
|
||||
#define AV_CH_LAYOUT_6POINT0_FRONT (AV_CH_LAYOUT_2_2|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
|
||||
#define AV_CH_LAYOUT_HEXAGONAL (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_BACK_CENTER)
|
||||
#define AV_CH_LAYOUT_6POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER)
|
||||
#define AV_CH_LAYOUT_6POINT1_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_BACK_CENTER)
|
||||
#define AV_CH_LAYOUT_6POINT1_FRONT (AV_CH_LAYOUT_6POINT0_FRONT|AV_CH_LOW_FREQUENCY)
|
||||
#define AV_CH_LAYOUT_7POINT0 (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_7POINT0_FRONT (AV_CH_LAYOUT_5POINT0|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
|
||||
#define AV_CH_LAYOUT_7POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_7POINT1_WIDE (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
|
||||
#define AV_CH_LAYOUT_7POINT1_WIDE_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
|
||||
#define AV_CH_LAYOUT_OCTAGONAL (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_CENTER|AV_CH_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_STEREO_DOWNMIX (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT)
|
||||
|
||||
enum AVMatrixEncoding {
|
||||
AV_MATRIX_ENCODING_NONE,
|
||||
AV_MATRIX_ENCODING_DOLBY,
|
||||
AV_MATRIX_ENCODING_DPLII,
|
||||
AV_MATRIX_ENCODING_NB
|
||||
};
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Return a channel layout id that matches name, or 0 if no match is found.
|
||||
*
|
||||
* name can be one or several of the following notations,
|
||||
* separated by '+' or '|':
|
||||
* - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0,
|
||||
* 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix);
|
||||
* - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC,
|
||||
* SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR);
|
||||
* - a number of channels, in decimal, optionally followed by 'c', yielding
|
||||
* the default channel layout for that number of channels (@see
|
||||
* av_get_default_channel_layout);
|
||||
* - a channel layout mask, in hexadecimal starting with "0x" (see the
|
||||
* AV_CH_* macros).
|
||||
*
|
||||
* Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7"
|
||||
*/
|
||||
uint64_t av_get_channel_layout(const char *name);
|
||||
|
||||
/**
|
||||
* Return a description of a channel layout.
|
||||
* If nb_channels is <= 0, it is guessed from the channel_layout.
|
||||
*
|
||||
* @param buf put here the string containing the channel layout
|
||||
* @param buf_size size in bytes of the buffer
|
||||
*/
|
||||
void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout);
|
||||
|
||||
struct AVBPrint;
|
||||
/**
|
||||
* Append a description of a channel layout to a bprint buffer.
|
||||
*/
|
||||
void av_bprint_channel_layout(struct AVBPrint *bp, int nb_channels, uint64_t channel_layout);
|
||||
|
||||
/**
|
||||
* Return the number of channels in the channel layout.
|
||||
*/
|
||||
int av_get_channel_layout_nb_channels(uint64_t channel_layout);
|
||||
|
||||
/**
|
||||
* Return default channel layout for a given number of channels.
|
||||
*/
|
||||
int64_t av_get_default_channel_layout(int nb_channels);
|
||||
|
||||
/**
|
||||
* Get the index of a channel in channel_layout.
|
||||
*
|
||||
* @param channel a channel layout describing exactly one channel which must be
|
||||
* present in channel_layout.
|
||||
*
|
||||
* @return index of channel in channel_layout on success, a negative AVERROR
|
||||
* on error.
|
||||
*/
|
||||
int av_get_channel_layout_channel_index(uint64_t channel_layout,
|
||||
uint64_t channel);
|
||||
|
||||
/**
|
||||
* Get the channel with the given index in channel_layout.
|
||||
*/
|
||||
uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index);
|
||||
|
||||
/**
|
||||
* Get the name of a given channel.
|
||||
*
|
||||
* @return channel name on success, NULL on error.
|
||||
*/
|
||||
const char *av_get_channel_name(uint64_t channel);
|
||||
|
||||
/**
|
||||
* Get the description of a given channel.
|
||||
*
|
||||
* @param channel a channel layout with a single channel
|
||||
* @return channel description on success, NULL on error
|
||||
*/
|
||||
const char *av_get_channel_description(uint64_t channel);
|
||||
|
||||
/**
|
||||
* Get the value and name of a standard channel layout.
|
||||
*
|
||||
* @param[in] index index in an internal list, starting at 0
|
||||
* @param[out] layout channel layout mask
|
||||
* @param[out] name name of the layout
|
||||
* @return 0 if the layout exists,
|
||||
* <0 if index is beyond the limits
|
||||
*/
|
||||
int av_get_standard_channel_layout(unsigned index, uint64_t *layout,
|
||||
const char **name);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_AUDIOCONVERT_H */
|
||||
#if FF_API_AUDIOCONVERT
|
||||
#include "channel_layout.h"
|
||||
#endif
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
*/
|
||||
#define av_assert0(cond) do { \
|
||||
if (!(cond)) { \
|
||||
av_log(NULL, AV_LOG_FATAL, "Assertion %s failed at %s:%d\n", \
|
||||
av_log(NULL, AV_LOG_PANIC, "Assertion %s failed at %s:%d\n", \
|
||||
AV_STRINGIFY(cond), __FILE__, __LINE__); \
|
||||
abort(); \
|
||||
} \
|
||||
|
|
|
@ -66,6 +66,21 @@ int av_stristart(const char *str, const char *pfx, const char **ptr);
|
|||
*/
|
||||
char *av_stristr(const char *haystack, const char *needle);
|
||||
|
||||
/**
|
||||
* Locate the first occurrence of the string needle in the string haystack
|
||||
* where not more than hay_length characters are searched. A zero-length
|
||||
* string needle is considered to match at the start of haystack.
|
||||
*
|
||||
* This function is a length-limited version of the standard strstr().
|
||||
*
|
||||
* @param haystack string to search in
|
||||
* @param needle string to search for
|
||||
* @param hay_length length of string to search in
|
||||
* @return pointer to the located match within haystack
|
||||
* or a null pointer if no match
|
||||
*/
|
||||
char *av_strnstr(const char *haystack, const char *needle, size_t hay_length);
|
||||
|
||||
/**
|
||||
* Copy the string src to dst, but no more than size - 1 bytes, and
|
||||
* null-terminate dst.
|
||||
|
@ -170,6 +185,30 @@ char *av_get_token(const char **buf, const char *term);
|
|||
*/
|
||||
char *av_strtok(char *s, const char *delim, char **saveptr);
|
||||
|
||||
/**
|
||||
* Locale-independent conversion of ASCII isdigit.
|
||||
*/
|
||||
static inline int av_isdigit(int c)
|
||||
{
|
||||
return c >= '0' && c <= '9';
|
||||
}
|
||||
|
||||
/**
|
||||
* Locale-independent conversion of ASCII isgraph.
|
||||
*/
|
||||
static inline int av_isgraph(int c)
|
||||
{
|
||||
return c > 32 && c < 127;
|
||||
}
|
||||
|
||||
/**
|
||||
* Locale-independent conversion of ASCII isspace.
|
||||
*/
|
||||
static inline int av_isspace(int c)
|
||||
{
|
||||
return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v';
|
||||
}
|
||||
|
||||
/**
|
||||
* Locale-independent conversion of ASCII characters to uppercase.
|
||||
*/
|
||||
|
@ -190,6 +229,15 @@ static inline int av_tolower(int c)
|
|||
return c;
|
||||
}
|
||||
|
||||
/**
|
||||
* Locale-independent conversion of ASCII isxdigit.
|
||||
*/
|
||||
static inline int av_isxdigit(int c)
|
||||
{
|
||||
c = av_tolower(c);
|
||||
return av_isdigit(c) || (c >= 'a' && c <= 'z');
|
||||
}
|
||||
|
||||
/**
|
||||
* Locale-independent case-insensitive compare.
|
||||
* @note This means only ASCII-range characters are case-insensitive
|
||||
|
@ -202,6 +250,64 @@ int av_strcasecmp(const char *a, const char *b);
|
|||
*/
|
||||
int av_strncasecmp(const char *a, const char *b, size_t n);
|
||||
|
||||
|
||||
/**
|
||||
* Thread safe basename.
|
||||
* @param path the path, on DOS both \ and / are considered separators.
|
||||
* @return pointer to the basename substring.
|
||||
*/
|
||||
const char *av_basename(const char *path);
|
||||
|
||||
/**
|
||||
* Thread safe dirname.
|
||||
* @param path the path, on DOS both \ and / are considered separators.
|
||||
* @return the path with the separator replaced by the string terminator or ".".
|
||||
* @note the function may change the input string.
|
||||
*/
|
||||
const char *av_dirname(char *path);
|
||||
|
||||
enum AVEscapeMode {
|
||||
AV_ESCAPE_MODE_AUTO, ///< Use auto-selected escaping mode.
|
||||
AV_ESCAPE_MODE_BACKSLASH, ///< Use backslash escaping.
|
||||
AV_ESCAPE_MODE_QUOTE, ///< Use single-quote escaping.
|
||||
};
|
||||
|
||||
/**
|
||||
* Consider spaces special and escape them even in the middle of the
|
||||
* string.
|
||||
*
|
||||
* This is equivalent to adding the whitespace characters to the special
|
||||
* characters lists, except it is guaranteed to use the exact same list
|
||||
* of whitespace characters as the rest of libavutil.
|
||||
*/
|
||||
#define AV_ESCAPE_FLAG_WHITESPACE 0x01
|
||||
|
||||
/**
|
||||
* Escape only specified special characters.
|
||||
* Without this flag, escape also any characters that may be considered
|
||||
* special by av_get_token(), such as the single quote.
|
||||
*/
|
||||
#define AV_ESCAPE_FLAG_STRICT 0x02
|
||||
|
||||
/**
|
||||
* Escape string in src, and put the escaped string in an allocated
|
||||
* string in *dst, which must be freed with av_free().
|
||||
*
|
||||
* @param dst pointer where an allocated string is put
|
||||
* @param src string to escape, must be non-NULL
|
||||
* @param special_chars string containing the special characters which
|
||||
* need to be escaped, can be NULL
|
||||
* @param mode escape mode to employ, see AV_ESCAPE_MODE_* macros.
|
||||
* Any unknown value for mode will be considered equivalent to
|
||||
* AV_ESCAPE_MODE_BACKSLASH, but this behaviour can change without
|
||||
* notice.
|
||||
* @param flags flags which control how to escape, see AV_ESCAPE_FLAG_ macros
|
||||
* @return the length of the allocated string, or a negative error code in case of error
|
||||
* @see av_bprint_escape()
|
||||
*/
|
||||
int av_escape(char **dst, const char *src, const char *special_chars,
|
||||
enum AVEscapeMode mode, int flags);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
* external API header
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
* @mainpage
|
||||
*
|
||||
* @section ffmpeg_intro Introduction
|
||||
|
@ -35,12 +35,13 @@
|
|||
* provided by FFmpeg.
|
||||
*
|
||||
* @li @ref libavc "libavcodec" encoding/decoding library
|
||||
* @li @subpage libavfilter graph based frame editing library
|
||||
* @li @ref lavfi "libavfilter" graph based frame editing library
|
||||
* @li @ref libavf "libavformat" I/O and muxing/demuxing library
|
||||
* @li @ref lavd "libavdevice" special devices muxing/demuxing library
|
||||
* @li @ref lavu "libavutil" common utility library
|
||||
* @li @subpage libpostproc post processing library
|
||||
* @li @subpage libswscale color conversion and scaling library
|
||||
* @li @ref lswr "libswresample" audio resampling, format conversion and mixing
|
||||
* @li @ref lpp "libpostproc" post processing library
|
||||
* @li @ref lsws "libswscale" color conversion and scaling library
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -108,43 +109,6 @@
|
|||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @defgroup preproc_misc Preprocessor String Macros
|
||||
*
|
||||
* String manipulation macros
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#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)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup version_utils Library Version Macros
|
||||
*
|
||||
* Useful to check and match library version in order to maintain
|
||||
* backward compatibility.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#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)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup lavu_ver
|
||||
* @{
|
||||
|
|
|
@ -46,15 +46,17 @@ int av_base64_decode(uint8_t *out, const char *in, int out_size);
|
|||
* Encode data to base64 and null-terminate.
|
||||
*
|
||||
* @param out buffer for encoded data
|
||||
* @param out_size size in bytes of the output buffer, must be at
|
||||
* least AV_BASE64_SIZE(in_size)
|
||||
* @param in_size size in bytes of the 'in' buffer
|
||||
* @return 'out' or NULL in case of error
|
||||
* @param out_size size in bytes of the out buffer (including the
|
||||
* null terminator), must be at least AV_BASE64_SIZE(in_size)
|
||||
* @param in input buffer containing the data to encode
|
||||
* @param in_size size in bytes of the in buffer
|
||||
* @return out or NULL in case of error
|
||||
*/
|
||||
char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size);
|
||||
|
||||
/**
|
||||
* Calculate the output size needed to base64-encode x bytes.
|
||||
* Calculate the output size needed to base64-encode x bytes to a
|
||||
* null-terminated string.
|
||||
*/
|
||||
#define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1)
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#define AVUTIL_BPRINT_H
|
||||
|
||||
#include "attributes.h"
|
||||
#include "avstring.h"
|
||||
|
||||
/**
|
||||
* Define a structure with extra padding to a fixed size
|
||||
|
@ -116,7 +117,7 @@ void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max);
|
|||
void av_bprint_init_for_buffer(AVBPrint *buf, char *buffer, unsigned size);
|
||||
|
||||
/**
|
||||
* Append a formated string to a print buffer.
|
||||
* Append a formatted string to a print buffer.
|
||||
*/
|
||||
void av_bprintf(AVBPrint *buf, const char *fmt, ...) av_printf_format(2, 3);
|
||||
|
||||
|
@ -125,6 +126,32 @@ void av_bprintf(AVBPrint *buf, const char *fmt, ...) av_printf_format(2, 3);
|
|||
*/
|
||||
void av_bprint_chars(AVBPrint *buf, char c, unsigned n);
|
||||
|
||||
struct tm;
|
||||
/**
|
||||
* Append a formatted date and time to a print buffer.
|
||||
*
|
||||
* param buf bprint buffer to use
|
||||
* param fmt date and time format string, see strftime()
|
||||
* param tm broken-down time structure to translate
|
||||
*
|
||||
* @note due to poor design of the standard strftime function, it may
|
||||
* produce poor results if the format string expands to a very long text and
|
||||
* the bprint buffer is near the limit stated by the size_max option.
|
||||
*/
|
||||
void av_bprint_strftime(AVBPrint *buf, const char *fmt, const struct tm *tm);
|
||||
|
||||
/**
|
||||
* Allocate bytes in the buffer for external use.
|
||||
*
|
||||
* @param[in] buf buffer structure
|
||||
* @param[in] size required size
|
||||
* @param[out] mem pointer to the memory area
|
||||
* @param[out] actual_size size of the memory area after allocation;
|
||||
* can be larger or smaller than size
|
||||
*/
|
||||
void av_bprint_get_buffer(AVBPrint *buf, unsigned size,
|
||||
unsigned char **mem, unsigned *actual_size);
|
||||
|
||||
/**
|
||||
* Reset the string to "" but keep internal allocated data.
|
||||
*/
|
||||
|
@ -154,4 +181,20 @@ static inline int av_bprint_is_complete(AVBPrint *buf)
|
|||
*/
|
||||
int av_bprint_finalize(AVBPrint *buf, char **ret_str);
|
||||
|
||||
/**
|
||||
* Escape the content in src and append it to dstbuf.
|
||||
*
|
||||
* @param dstbuf already inited destination bprint buffer
|
||||
* @param src string containing the text to escape
|
||||
* @param special_chars string containing the special characters which
|
||||
* need to be escaped, can be NULL
|
||||
* @param mode escape mode to employ, see AV_ESCAPE_MODE_* macros.
|
||||
* Any unknown value for mode will be considered equivalent to
|
||||
* AV_ESCAPE_MODE_BACKSLASH, but this behaviour can change without
|
||||
* notice.
|
||||
* @param flags flags which control how to escape, see AV_ESCAPE_FLAG_* macros
|
||||
*/
|
||||
void av_bprint_escape(AVBPrint *dstbuf, const char *src, const char *special_chars,
|
||||
enum AVEscapeMode mode, int flags);
|
||||
|
||||
#endif /* AVUTIL_BPRINT_H */
|
||||
|
|
|
@ -0,0 +1,216 @@
|
|||
/*
|
||||
* Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
|
||||
* Copyright (c) 2008 Peter Ross
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_CHANNEL_LAYOUT_H
|
||||
#define AVUTIL_CHANNEL_LAYOUT_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @file
|
||||
* audio channel layout utility functions
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup lavu_audio
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup channel_masks Audio channel masks
|
||||
*
|
||||
* A channel layout is a 64-bits integer with a bit set for every channel.
|
||||
* The number of bits set must be equal to the number of channels.
|
||||
* The value 0 means that the channel layout is not known.
|
||||
* @note this data structure is not powerful enough to handle channels
|
||||
* combinations that have the same channel multiple times, such as
|
||||
* dual-mono.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
#define AV_CH_FRONT_LEFT 0x00000001
|
||||
#define AV_CH_FRONT_RIGHT 0x00000002
|
||||
#define AV_CH_FRONT_CENTER 0x00000004
|
||||
#define AV_CH_LOW_FREQUENCY 0x00000008
|
||||
#define AV_CH_BACK_LEFT 0x00000010
|
||||
#define AV_CH_BACK_RIGHT 0x00000020
|
||||
#define AV_CH_FRONT_LEFT_OF_CENTER 0x00000040
|
||||
#define AV_CH_FRONT_RIGHT_OF_CENTER 0x00000080
|
||||
#define AV_CH_BACK_CENTER 0x00000100
|
||||
#define AV_CH_SIDE_LEFT 0x00000200
|
||||
#define AV_CH_SIDE_RIGHT 0x00000400
|
||||
#define AV_CH_TOP_CENTER 0x00000800
|
||||
#define AV_CH_TOP_FRONT_LEFT 0x00001000
|
||||
#define AV_CH_TOP_FRONT_CENTER 0x00002000
|
||||
#define AV_CH_TOP_FRONT_RIGHT 0x00004000
|
||||
#define AV_CH_TOP_BACK_LEFT 0x00008000
|
||||
#define AV_CH_TOP_BACK_CENTER 0x00010000
|
||||
#define AV_CH_TOP_BACK_RIGHT 0x00020000
|
||||
#define AV_CH_STEREO_LEFT 0x20000000 ///< Stereo downmix.
|
||||
#define AV_CH_STEREO_RIGHT 0x40000000 ///< See AV_CH_STEREO_LEFT.
|
||||
#define AV_CH_WIDE_LEFT 0x0000000080000000ULL
|
||||
#define AV_CH_WIDE_RIGHT 0x0000000100000000ULL
|
||||
#define AV_CH_SURROUND_DIRECT_LEFT 0x0000000200000000ULL
|
||||
#define AV_CH_SURROUND_DIRECT_RIGHT 0x0000000400000000ULL
|
||||
#define AV_CH_LOW_FREQUENCY_2 0x0000000800000000ULL
|
||||
|
||||
/** 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 AV_CH_LAYOUT_NATIVE 0x8000000000000000ULL
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @defgroup channel_mask_c Audio channel convenience macros
|
||||
* @{
|
||||
* */
|
||||
#define AV_CH_LAYOUT_MONO (AV_CH_FRONT_CENTER)
|
||||
#define AV_CH_LAYOUT_STEREO (AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT)
|
||||
#define AV_CH_LAYOUT_2POINT1 (AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY)
|
||||
#define AV_CH_LAYOUT_2_1 (AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER)
|
||||
#define AV_CH_LAYOUT_SURROUND (AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER)
|
||||
#define AV_CH_LAYOUT_3POINT1 (AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY)
|
||||
#define AV_CH_LAYOUT_4POINT0 (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_CENTER)
|
||||
#define AV_CH_LAYOUT_4POINT1 (AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY)
|
||||
#define AV_CH_LAYOUT_2_2 (AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
|
||||
#define AV_CH_LAYOUT_QUAD (AV_CH_LAYOUT_STEREO|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_5POINT0 (AV_CH_LAYOUT_SURROUND|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
|
||||
#define AV_CH_LAYOUT_5POINT1 (AV_CH_LAYOUT_5POINT0|AV_CH_LOW_FREQUENCY)
|
||||
#define AV_CH_LAYOUT_5POINT0_BACK (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_5POINT1_BACK (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_LOW_FREQUENCY)
|
||||
#define AV_CH_LAYOUT_6POINT0 (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_CENTER)
|
||||
#define AV_CH_LAYOUT_6POINT0_FRONT (AV_CH_LAYOUT_2_2|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
|
||||
#define AV_CH_LAYOUT_HEXAGONAL (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_BACK_CENTER)
|
||||
#define AV_CH_LAYOUT_6POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER)
|
||||
#define AV_CH_LAYOUT_6POINT1_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_BACK_CENTER)
|
||||
#define AV_CH_LAYOUT_6POINT1_FRONT (AV_CH_LAYOUT_6POINT0_FRONT|AV_CH_LOW_FREQUENCY)
|
||||
#define AV_CH_LAYOUT_7POINT0 (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_7POINT0_FRONT (AV_CH_LAYOUT_5POINT0|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
|
||||
#define AV_CH_LAYOUT_7POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_7POINT1_WIDE (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
|
||||
#define AV_CH_LAYOUT_7POINT1_WIDE_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
|
||||
#define AV_CH_LAYOUT_OCTAGONAL (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_CENTER|AV_CH_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_STEREO_DOWNMIX (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT)
|
||||
|
||||
enum AVMatrixEncoding {
|
||||
AV_MATRIX_ENCODING_NONE,
|
||||
AV_MATRIX_ENCODING_DOLBY,
|
||||
AV_MATRIX_ENCODING_DPLII,
|
||||
AV_MATRIX_ENCODING_NB
|
||||
};
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Return a channel layout id that matches name, or 0 if no match is found.
|
||||
*
|
||||
* name can be one or several of the following notations,
|
||||
* separated by '+' or '|':
|
||||
* - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0,
|
||||
* 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix);
|
||||
* - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC,
|
||||
* SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR);
|
||||
* - a number of channels, in decimal, optionally followed by 'c', yielding
|
||||
* the default channel layout for that number of channels (@see
|
||||
* av_get_default_channel_layout);
|
||||
* - a channel layout mask, in hexadecimal starting with "0x" (see the
|
||||
* AV_CH_* macros).
|
||||
*
|
||||
* Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7"
|
||||
*/
|
||||
uint64_t av_get_channel_layout(const char *name);
|
||||
|
||||
/**
|
||||
* Return a description of a channel layout.
|
||||
* If nb_channels is <= 0, it is guessed from the channel_layout.
|
||||
*
|
||||
* @param buf put here the string containing the channel layout
|
||||
* @param buf_size size in bytes of the buffer
|
||||
*/
|
||||
void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout);
|
||||
|
||||
struct AVBPrint;
|
||||
/**
|
||||
* Append a description of a channel layout to a bprint buffer.
|
||||
*/
|
||||
void av_bprint_channel_layout(struct AVBPrint *bp, int nb_channels, uint64_t channel_layout);
|
||||
|
||||
/**
|
||||
* Return the number of channels in the channel layout.
|
||||
*/
|
||||
int av_get_channel_layout_nb_channels(uint64_t channel_layout);
|
||||
|
||||
/**
|
||||
* Return default channel layout for a given number of channels.
|
||||
*/
|
||||
int64_t av_get_default_channel_layout(int nb_channels);
|
||||
|
||||
/**
|
||||
* Get the index of a channel in channel_layout.
|
||||
*
|
||||
* @param channel a channel layout describing exactly one channel which must be
|
||||
* present in channel_layout.
|
||||
*
|
||||
* @return index of channel in channel_layout on success, a negative AVERROR
|
||||
* on error.
|
||||
*/
|
||||
int av_get_channel_layout_channel_index(uint64_t channel_layout,
|
||||
uint64_t channel);
|
||||
|
||||
/**
|
||||
* Get the channel with the given index in channel_layout.
|
||||
*/
|
||||
uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index);
|
||||
|
||||
/**
|
||||
* Get the name of a given channel.
|
||||
*
|
||||
* @return channel name on success, NULL on error.
|
||||
*/
|
||||
const char *av_get_channel_name(uint64_t channel);
|
||||
|
||||
/**
|
||||
* Get the description of a given channel.
|
||||
*
|
||||
* @param channel a channel layout with a single channel
|
||||
* @return channel description on success, NULL on error
|
||||
*/
|
||||
const char *av_get_channel_description(uint64_t channel);
|
||||
|
||||
/**
|
||||
* Get the value and name of a standard channel layout.
|
||||
*
|
||||
* @param[in] index index in an internal list, starting at 0
|
||||
* @param[out] layout channel layout mask
|
||||
* @param[out] name name of the layout
|
||||
* @return 0 if the layout exists,
|
||||
* <0 if index is beyond the limits
|
||||
*/
|
||||
int av_get_standard_channel_layout(unsigned index, uint64_t *layout,
|
||||
const char **name);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_CHANNEL_LAYOUT_H */
|
|
@ -26,7 +26,6 @@
|
|||
#ifndef AVUTIL_COMMON_H
|
||||
#define AVUTIL_COMMON_H
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
#include <limits.h>
|
||||
|
@ -34,7 +33,9 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "attributes.h"
|
||||
#include "version.h"
|
||||
#include "libavutil/avconfig.h"
|
||||
|
||||
#if AV_HAVE_BIGENDIAN
|
||||
|
@ -62,40 +63,13 @@
|
|||
#define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1))
|
||||
|
||||
/* misc math functions */
|
||||
extern const uint8_t ff_log2_tab[256];
|
||||
|
||||
/**
|
||||
* Reverse the order of the bits of an 8-bits unsigned integer.
|
||||
*/
|
||||
extern const uint8_t av_reverse[256];
|
||||
|
||||
static av_always_inline av_const int av_log2_c(unsigned int v)
|
||||
{
|
||||
int n = 0;
|
||||
if (v & 0xffff0000) {
|
||||
v >>= 16;
|
||||
n += 16;
|
||||
}
|
||||
if (v & 0xff00) {
|
||||
v >>= 8;
|
||||
n += 8;
|
||||
}
|
||||
n += ff_log2_tab[v];
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
static av_always_inline av_const int av_log2_16bit_c(unsigned int v)
|
||||
{
|
||||
int n = 0;
|
||||
if (v & 0xff00) {
|
||||
v >>= 8;
|
||||
n += 8;
|
||||
}
|
||||
n += ff_log2_tab[v];
|
||||
|
||||
return n;
|
||||
}
|
||||
#if FF_API_AV_REVERSE
|
||||
extern attribute_deprecated const uint8_t av_reverse[256];
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AV_CONFIG_H
|
||||
# include "config.h"
|
||||
|
@ -105,6 +79,14 @@ static av_always_inline av_const int av_log2_16bit_c(unsigned int v)
|
|||
/* Pull in unguarded fallback defines at the end of this file. */
|
||||
#include "common.h"
|
||||
|
||||
#ifndef av_log2
|
||||
av_const int av_log2(unsigned v);
|
||||
#endif
|
||||
|
||||
#ifndef av_log2_16bit
|
||||
av_const int av_log2_16bit(unsigned v);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Clip a signed integer value into the amin-amax range.
|
||||
* @param a value to clip
|
||||
|
@ -114,6 +96,26 @@ static av_always_inline av_const int av_log2_16bit_c(unsigned int v)
|
|||
*/
|
||||
static av_always_inline av_const int av_clip_c(int a, int amin, int amax)
|
||||
{
|
||||
#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
|
||||
if (amin > amax) abort();
|
||||
#endif
|
||||
if (a < amin) return amin;
|
||||
else if (a > amax) return amax;
|
||||
else return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clip a signed 64bit integer value into the amin-amax range.
|
||||
* @param a value to clip
|
||||
* @param amin minimum value of the clip range
|
||||
* @param amax maximum value of the clip range
|
||||
* @return clipped value
|
||||
*/
|
||||
static av_always_inline av_const int64_t av_clip64_c(int64_t a, int64_t amin, int64_t amax)
|
||||
{
|
||||
#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
|
||||
if (amin > amax) abort();
|
||||
#endif
|
||||
if (a < amin) return amin;
|
||||
else if (a > amax) return amax;
|
||||
else return a;
|
||||
|
@ -219,6 +221,9 @@ static av_always_inline int av_sat_dadd32_c(int a, int b)
|
|||
*/
|
||||
static av_always_inline av_const float av_clipf_c(float a, float amin, float amax)
|
||||
{
|
||||
#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
|
||||
if (amin > amax) abort();
|
||||
#endif
|
||||
if (a < amin) return amin;
|
||||
else if (a > amax) return amax;
|
||||
else return a;
|
||||
|
@ -274,16 +279,17 @@ static av_always_inline av_const int av_popcount64_c(uint64_t x)
|
|||
#define GET_UTF8(val, GET_BYTE, ERROR)\
|
||||
val= GET_BYTE;\
|
||||
{\
|
||||
int ones= 7 - av_log2(val ^ 255);\
|
||||
if(ones==1)\
|
||||
uint32_t top = (val & 128) >> 1;\
|
||||
if ((val & 0xc0) == 0x80)\
|
||||
ERROR\
|
||||
val&= 127>>ones;\
|
||||
while(--ones > 0){\
|
||||
while (val & top) {\
|
||||
int tmp= GET_BYTE - 128;\
|
||||
if(tmp>>6)\
|
||||
ERROR\
|
||||
val= (val<<6) + tmp;\
|
||||
top <<= 5;\
|
||||
}\
|
||||
val &= (top << 1) - 1;\
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -386,18 +392,15 @@ static av_always_inline av_const int av_popcount64_c(uint64_t x)
|
|||
* to ensure they are immediately available in intmath.h.
|
||||
*/
|
||||
|
||||
#ifndef av_log2
|
||||
# define av_log2 av_log2_c
|
||||
#endif
|
||||
#ifndef av_log2_16bit
|
||||
# define av_log2_16bit av_log2_16bit_c
|
||||
#endif
|
||||
#ifndef av_ceil_log2
|
||||
# define av_ceil_log2 av_ceil_log2_c
|
||||
#endif
|
||||
#ifndef av_clip
|
||||
# define av_clip av_clip_c
|
||||
#endif
|
||||
#ifndef av_clip64
|
||||
# define av_clip64 av_clip64_c
|
||||
#endif
|
||||
#ifndef av_clip_uint8
|
||||
# define av_clip_uint8 av_clip_uint8_c
|
||||
#endif
|
||||
|
|
|
@ -60,6 +60,9 @@
|
|||
|
||||
/**
|
||||
* Return the flags which specify extensions supported by the CPU.
|
||||
* The returned value is affected by av_force_cpu_flags() if that was used
|
||||
* before. So av_get_cpu_flags() can easily be used in a application to
|
||||
* detect the enabled cpu flags.
|
||||
*/
|
||||
int av_get_cpu_flags(void);
|
||||
|
||||
|
|
|
@ -36,8 +36,39 @@ typedef enum {
|
|||
AV_CRC_MAX, /*< Not part of public API! Do not use outside libavutil. */
|
||||
}AVCRCId;
|
||||
|
||||
/**
|
||||
* Initialize a CRC table.
|
||||
* @param ctx must be an array of size sizeof(AVCRC)*257 or sizeof(AVCRC)*1024
|
||||
* @param le If 1, the lowest bit represents the coefficient for the highest
|
||||
* exponent of the corresponding polynomial (both for poly and
|
||||
* actual CRC).
|
||||
* If 0, you must swap the CRC parameter and the result of av_crc
|
||||
* if you need the standard representation (can be simplified in
|
||||
* most cases to e.g. bswap16):
|
||||
* av_bswap32(crc << (32-bits))
|
||||
* @param bits number of bits for the CRC
|
||||
* @param poly generator polynomial without the x**bits coefficient, in the
|
||||
* representation as specified by le
|
||||
* @param ctx_size size of ctx in bytes
|
||||
* @return <0 on failure
|
||||
*/
|
||||
int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size);
|
||||
|
||||
/**
|
||||
* Get an initialized standard CRC table.
|
||||
* @param crc_id ID of a standard CRC
|
||||
* @return a pointer to the CRC table or NULL on failure
|
||||
*/
|
||||
const AVCRC *av_crc_get_table(AVCRCId crc_id);
|
||||
uint32_t av_crc(const AVCRC *ctx, uint32_t start_crc, const uint8_t *buffer, size_t length) av_pure;
|
||||
|
||||
/**
|
||||
* Calculate the CRC of a block.
|
||||
* @param crc CRC of previous blocks if any or initial value for CRC
|
||||
* @return CRC updated with the data from the given block
|
||||
*
|
||||
* @see av_crc_init() "le" parameter
|
||||
*/
|
||||
uint32_t av_crc(const AVCRC *ctx, uint32_t crc,
|
||||
const uint8_t *buffer, size_t length) av_pure;
|
||||
|
||||
#endif /* AVUTIL_CRC_H */
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
#define AV_DICT_APPEND 32 /**< If the entry already exists, append to it. Note that no
|
||||
delimiter is added, the strings are simply concatenated. */
|
||||
|
||||
typedef struct {
|
||||
typedef struct AVDictionaryEntry {
|
||||
char *key;
|
||||
char *value;
|
||||
} AVDictionaryEntry;
|
||||
|
@ -112,6 +112,23 @@ int av_dict_count(const AVDictionary *m);
|
|||
*/
|
||||
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags);
|
||||
|
||||
/**
|
||||
* Parse the key/value pairs list and add to a dictionary.
|
||||
*
|
||||
* @param key_val_sep a 0-terminated list of characters used to separate
|
||||
* key from value
|
||||
* @param pairs_sep a 0-terminated list of characters used to separate
|
||||
* two pairs from each other
|
||||
* @param flags flags to use when adding to dictionary.
|
||||
* AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL
|
||||
* are ignored since the key/value tokens will always
|
||||
* be duplicated.
|
||||
* @return 0 on success, negative AVERROR code on failure
|
||||
*/
|
||||
int av_dict_parse_string(AVDictionary **pm, const char *str,
|
||||
const char *key_val_sep, const char *pairs_sep,
|
||||
int flags);
|
||||
|
||||
/**
|
||||
* Copy entries from one AVDictionary struct into another.
|
||||
* @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL,
|
||||
|
|
|
@ -61,14 +61,15 @@
|
|||
#define AVERROR_OPTION_NOT_FOUND FFERRTAG(0xF8,'O','P','T') ///< Option not found
|
||||
#define AVERROR_PATCHWELCOME FFERRTAG( 'P','A','W','E') ///< Not yet implemented in FFmpeg, patches welcome
|
||||
#define AVERROR_PROTOCOL_NOT_FOUND FFERRTAG(0xF8,'P','R','O') ///< Protocol not found
|
||||
#define AVERROR_STREAM_NOT_FOUND FFERRTAG(0xF8,'S','T','R') ///< Stream not found
|
||||
|
||||
#define AVERROR_STREAM_NOT_FOUND FFERRTAG(0xF8,'S','T','R') ///< Stream not found
|
||||
/**
|
||||
* This is semantically identical to AVERROR_BUG
|
||||
* it has been introduced in Libav after our AVERROR_BUG and with a modified value.
|
||||
*/
|
||||
#define AVERROR_BUG2 FFERRTAG( 'B','U','G',' ')
|
||||
#define AVERROR_UNKNOWN FFERRTAG( 'U','N','K','N') ///< Unknown error, typically from an external library
|
||||
#define AVERROR_EXPERIMENTAL (-0x2bb2afa8) ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it.
|
||||
|
||||
#define AV_ERROR_MAX_STRING_SIZE 64
|
||||
|
||||
|
|
|
@ -91,39 +91,6 @@ double av_expr_eval(AVExpr *e, const double *const_values, void *opaque);
|
|||
*/
|
||||
void av_expr_free(AVExpr *e);
|
||||
|
||||
#if FF_API_OLD_EVAL_NAMES
|
||||
/**
|
||||
* @deprecated Deprecated in favor of av_expr_parse_and_eval().
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_parse_and_eval_expr(double *res, const char *s,
|
||||
const char * const *const_names, const double *const_values,
|
||||
const char * const *func1_names, double (* const *funcs1)(void *, double),
|
||||
const char * const *func2_names, double (* const *funcs2)(void *, double, double),
|
||||
void *opaque, int log_offset, void *log_ctx);
|
||||
|
||||
/**
|
||||
* @deprecated Deprecated in favor of av_expr_parse().
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_parse_expr(AVExpr **expr, const char *s,
|
||||
const char * const *const_names,
|
||||
const char * const *func1_names, double (* const *funcs1)(void *, double),
|
||||
const char * const *func2_names, double (* const *funcs2)(void *, double, double),
|
||||
int log_offset, void *log_ctx);
|
||||
/**
|
||||
* @deprecated Deprecated in favor of av_expr_eval().
|
||||
*/
|
||||
attribute_deprecated
|
||||
double av_eval_expr(AVExpr *e, const double *const_values, void *opaque);
|
||||
|
||||
/**
|
||||
* @deprecated Deprecated in favor of av_expr_free().
|
||||
*/
|
||||
attribute_deprecated
|
||||
void av_free_expr(AVExpr *e);
|
||||
#endif /* FF_API_OLD_EVAL_NAMES */
|
||||
|
||||
/**
|
||||
* Parse the string in numstr and return its value as a double. If
|
||||
* the string is empty, contains only whitespaces, or does not contain
|
||||
|
|
|
@ -141,15 +141,4 @@ static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs)
|
|||
return ptr;
|
||||
}
|
||||
|
||||
#if FF_API_AV_FIFO_PEEK
|
||||
/**
|
||||
* @deprecated Use av_fifo_peek2() instead.
|
||||
*/
|
||||
attribute_deprecated
|
||||
static inline uint8_t av_fifo_peek(AVFifoBuffer *f, int offs)
|
||||
{
|
||||
return *av_fifo_peek2(f, offs);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* AVUTIL_FIFO_H */
|
||||
|
|
|
@ -57,6 +57,9 @@ void av_file_unmap(uint8_t *bufptr, size_t size);
|
|||
* *prefix can be a character constant; *filename will be allocated internally.
|
||||
* @return file descriptor of opened file (or -1 on error)
|
||||
* and opened file name in **filename.
|
||||
* @note On very old libcs it is necessary to set a secure umask before
|
||||
* calling this, av_tempfile() cant call umask itself as it is used in
|
||||
* libraries and could interfere with the calling application.
|
||||
*/
|
||||
int av_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx);
|
||||
|
||||
|
|
|
@ -0,0 +1,95 @@
|
|||
/*
|
||||
* Copyright (C) 2012 Martin Storsjo
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_HMAC_H
|
||||
#define AVUTIL_HMAC_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @defgroup lavu_hmac HMAC
|
||||
* @ingroup lavu_crypto
|
||||
* @{
|
||||
*/
|
||||
|
||||
enum AVHMACType {
|
||||
AV_HMAC_MD5,
|
||||
AV_HMAC_SHA1,
|
||||
};
|
||||
|
||||
typedef struct AVHMAC AVHMAC;
|
||||
|
||||
/**
|
||||
* Allocate an AVHMAC context.
|
||||
* @param type The hash function used for the HMAC.
|
||||
*/
|
||||
AVHMAC *av_hmac_alloc(enum AVHMACType type);
|
||||
|
||||
/**
|
||||
* Free an AVHMAC context.
|
||||
* @param ctx The context to free, may be NULL
|
||||
*/
|
||||
void av_hmac_free(AVHMAC *ctx);
|
||||
|
||||
/**
|
||||
* Initialize an AVHMAC context with an authentication key.
|
||||
* @param ctx The HMAC context
|
||||
* @param key The authentication key
|
||||
* @param keylen The length of the key, in bytes
|
||||
*/
|
||||
void av_hmac_init(AVHMAC *ctx, const uint8_t *key, unsigned int keylen);
|
||||
|
||||
/**
|
||||
* Hash data with the HMAC.
|
||||
* @param ctx The HMAC context
|
||||
* @param data The data to hash
|
||||
* @param len The length of the data, in bytes
|
||||
*/
|
||||
void av_hmac_update(AVHMAC *ctx, const uint8_t *data, unsigned int len);
|
||||
|
||||
/**
|
||||
* Finish hashing and output the HMAC digest.
|
||||
* @param ctx The HMAC context
|
||||
* @param out The output buffer to write the digest into
|
||||
* @param outlen The length of the out buffer, in bytes
|
||||
* @return The number of bytes written to out, or a negative error code.
|
||||
*/
|
||||
int av_hmac_final(AVHMAC *ctx, uint8_t *out, unsigned int outlen);
|
||||
|
||||
/**
|
||||
* Hash an array of data with a key.
|
||||
* @param ctx The HMAC context
|
||||
* @param data The data to hash
|
||||
* @param len The length of the data, in bytes
|
||||
* @param key The authentication key
|
||||
* @param keylen The length of the key, in bytes
|
||||
* @param out The output buffer to write the digest into
|
||||
* @param outlen The length of the out buffer, in bytes
|
||||
* @return The number of bytes written to out, or a negative error code.
|
||||
*/
|
||||
int av_hmac_calc(AVHMAC *ctx, const uint8_t *data, unsigned int len,
|
||||
const uint8_t *key, unsigned int keylen,
|
||||
uint8_t *out, unsigned int outlen);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_HMAC_H */
|
|
@ -55,7 +55,7 @@ void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4],
|
|||
*
|
||||
* @return the computed size in bytes
|
||||
*/
|
||||
int av_image_get_linesize(enum PixelFormat pix_fmt, int width, int plane);
|
||||
int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane);
|
||||
|
||||
/**
|
||||
* Fill plane linesizes for an image with pixel format pix_fmt and
|
||||
|
@ -64,7 +64,7 @@ int av_image_get_linesize(enum PixelFormat pix_fmt, int width, int plane);
|
|||
* @param linesizes array to be filled with the linesize for each plane
|
||||
* @return >= 0 in case of success, a negative error code otherwise
|
||||
*/
|
||||
int av_image_fill_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int width);
|
||||
int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width);
|
||||
|
||||
/**
|
||||
* Fill plane data pointers for an image with pixel format pix_fmt and
|
||||
|
@ -77,7 +77,7 @@ int av_image_fill_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int widt
|
|||
* @return the size in bytes required for the image buffer, a negative
|
||||
* error code in case of failure
|
||||
*/
|
||||
int av_image_fill_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int height,
|
||||
int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int height,
|
||||
uint8_t *ptr, const int linesizes[4]);
|
||||
|
||||
/**
|
||||
|
@ -91,7 +91,7 @@ int av_image_fill_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int heigh
|
|||
* error code in case of failure
|
||||
*/
|
||||
int av_image_alloc(uint8_t *pointers[4], int linesizes[4],
|
||||
int w, int h, enum PixelFormat pix_fmt, int align);
|
||||
int w, int h, enum AVPixelFormat pix_fmt, int align);
|
||||
|
||||
/**
|
||||
* Copy image plane from src to dst.
|
||||
|
@ -99,6 +99,9 @@ int av_image_alloc(uint8_t *pointers[4], int linesizes[4],
|
|||
* The first byte of each successive line is separated by *_linesize
|
||||
* bytes.
|
||||
*
|
||||
* bytewidth must be contained by both absolute values of dst_linesize
|
||||
* and src_linesize, otherwise the function behavior is undefined.
|
||||
*
|
||||
* @param dst_linesize linesize for the image plane in dst
|
||||
* @param src_linesize linesize for the image plane in src
|
||||
*/
|
||||
|
@ -114,7 +117,7 @@ void av_image_copy_plane(uint8_t *dst, int dst_linesize,
|
|||
*/
|
||||
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 PixelFormat pix_fmt, int width, int height);
|
||||
enum AVPixelFormat pix_fmt, int width, int height);
|
||||
|
||||
/**
|
||||
* Setup the data pointers and linesizes based on the specified image
|
||||
|
@ -144,7 +147,7 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
|
|||
*/
|
||||
int av_image_fill_arrays(uint8_t *dst_data[4], int dst_linesize[4],
|
||||
const uint8_t *src,
|
||||
enum PixelFormat pix_fmt, int width, int height, int align);
|
||||
enum AVPixelFormat pix_fmt, int width, int height, int align);
|
||||
|
||||
/**
|
||||
* Return the size in bytes of the amount of data required to store an
|
||||
|
@ -152,7 +155,7 @@ int av_image_fill_arrays(uint8_t *dst_data[4], int dst_linesize[4],
|
|||
*
|
||||
* @param[in] align the assumed linesize alignment
|
||||
*/
|
||||
int av_image_get_buffer_size(enum PixelFormat pix_fmt, int width, int height, int align);
|
||||
int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, int width, int height, int align);
|
||||
|
||||
/**
|
||||
* Copy image data from an image into a buffer.
|
||||
|
@ -173,7 +176,7 @@ int av_image_get_buffer_size(enum PixelFormat pix_fmt, int width, int height, in
|
|||
*/
|
||||
int av_image_copy_to_buffer(uint8_t *dst, int dst_size,
|
||||
const uint8_t * const src_data[4], const int src_linesize[4],
|
||||
enum PixelFormat pix_fmt, int width, int height, int align);
|
||||
enum AVPixelFormat pix_fmt, int width, int height, int align);
|
||||
|
||||
/**
|
||||
* Check if the given dimension of an image is valid, meaning that all
|
||||
|
@ -187,7 +190,7 @@ int av_image_copy_to_buffer(uint8_t *dst, int dst_size,
|
|||
*/
|
||||
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx);
|
||||
|
||||
int ff_set_systematic_pal2(uint32_t pal[256], enum PixelFormat pix_fmt);
|
||||
int avpriv_set_systematic_pal2(uint32_t pal[256], enum AVPixelFormat pix_fmt);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
|
|
@ -47,7 +47,7 @@ typedef union {
|
|||
|
||||
/*
|
||||
* Arch-specific headers can provide any combination of
|
||||
* AV_[RW][BLN](16|24|32|64) and AV_(COPY|SWAP|ZERO)(64|128) macros.
|
||||
* AV_[RW][BLN](16|24|32|48|64) and AV_(COPY|SWAP|ZERO)(64|128) macros.
|
||||
* Preprocessor symbols must be defined, even if these are implemented
|
||||
* as inline functions.
|
||||
*/
|
||||
|
@ -114,6 +114,18 @@ typedef union {
|
|||
# define AV_WN32(p, v) AV_WB32(p, v)
|
||||
# endif
|
||||
|
||||
# if defined(AV_RN48) && !defined(AV_RB48)
|
||||
# define AV_RB48(p) AV_RN48(p)
|
||||
# elif !defined(AV_RN48) && defined(AV_RB48)
|
||||
# define AV_RN48(p) AV_RB48(p)
|
||||
# endif
|
||||
|
||||
# if defined(AV_WN48) && !defined(AV_WB48)
|
||||
# define AV_WB48(p, v) AV_WN48(p, v)
|
||||
# elif !defined(AV_WN48) && defined(AV_WB48)
|
||||
# define AV_WN48(p, v) AV_WB48(p, v)
|
||||
# endif
|
||||
|
||||
# if defined(AV_RN64) && !defined(AV_RB64)
|
||||
# define AV_RB64(p) AV_RN64(p)
|
||||
# elif !defined(AV_RN64) && defined(AV_RB64)
|
||||
|
@ -164,6 +176,18 @@ typedef union {
|
|||
# define AV_WN32(p, v) AV_WL32(p, v)
|
||||
# endif
|
||||
|
||||
# if defined(AV_RN48) && !defined(AV_RL48)
|
||||
# define AV_RL48(p) AV_RN48(p)
|
||||
# elif !defined(AV_RN48) && defined(AV_RL48)
|
||||
# define AV_RN48(p) AV_RL48(p)
|
||||
# endif
|
||||
|
||||
# if defined(AV_WN48) && !defined(AV_WL48)
|
||||
# define AV_WL48(p, v) AV_WN48(p, v)
|
||||
# elif !defined(AV_WN48) && defined(AV_WL48)
|
||||
# define AV_WN48(p, v) AV_WL48(p, v)
|
||||
# endif
|
||||
|
||||
# if defined(AV_RN64) && !defined(AV_RL64)
|
||||
# define AV_RL64(p) AV_RN64(p)
|
||||
# elif !defined(AV_RN64) && defined(AV_RL64)
|
||||
|
@ -436,6 +460,48 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
|
|||
} while(0)
|
||||
#endif
|
||||
|
||||
#ifndef AV_RB48
|
||||
# define AV_RB48(x) \
|
||||
(((uint64_t)((const uint8_t*)(x))[0] << 40) | \
|
||||
((uint64_t)((const uint8_t*)(x))[1] << 32) | \
|
||||
((uint64_t)((const uint8_t*)(x))[2] << 24) | \
|
||||
((uint64_t)((const uint8_t*)(x))[3] << 16) | \
|
||||
((uint64_t)((const uint8_t*)(x))[4] << 8) | \
|
||||
(uint64_t)((const uint8_t*)(x))[5])
|
||||
#endif
|
||||
#ifndef AV_WB48
|
||||
# define AV_WB48(p, darg) do { \
|
||||
uint64_t d = (darg); \
|
||||
((uint8_t*)(p))[5] = (d); \
|
||||
((uint8_t*)(p))[4] = (d)>>8; \
|
||||
((uint8_t*)(p))[3] = (d)>>16; \
|
||||
((uint8_t*)(p))[2] = (d)>>24; \
|
||||
((uint8_t*)(p))[1] = (d)>>32; \
|
||||
((uint8_t*)(p))[0] = (d)>>40; \
|
||||
} while(0)
|
||||
#endif
|
||||
|
||||
#ifndef AV_RL48
|
||||
# define AV_RL48(x) \
|
||||
(((uint64_t)((const uint8_t*)(x))[5] << 40) | \
|
||||
((uint64_t)((const uint8_t*)(x))[4] << 32) | \
|
||||
((uint64_t)((const uint8_t*)(x))[3] << 24) | \
|
||||
((uint64_t)((const uint8_t*)(x))[2] << 16) | \
|
||||
((uint64_t)((const uint8_t*)(x))[1] << 8) | \
|
||||
(uint64_t)((const uint8_t*)(x))[0])
|
||||
#endif
|
||||
#ifndef AV_WL48
|
||||
# define AV_WL48(p, darg) do { \
|
||||
uint64_t d = (darg); \
|
||||
((uint8_t*)(p))[0] = (d); \
|
||||
((uint8_t*)(p))[1] = (d)>>8; \
|
||||
((uint8_t*)(p))[2] = (d)>>16; \
|
||||
((uint8_t*)(p))[3] = (d)>>24; \
|
||||
((uint8_t*)(p))[4] = (d)>>32; \
|
||||
((uint8_t*)(p))[5] = (d)>>40; \
|
||||
} while(0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The AV_[RW]NA macros access naturally aligned data
|
||||
* in a type-safe way.
|
||||
|
@ -468,6 +534,33 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
|
|||
# define AV_WN64A(p, v) AV_WNA(64, p, v)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The AV_COPYxxU macros are suitable for copying data to/from unaligned
|
||||
* memory locations.
|
||||
*/
|
||||
|
||||
#define AV_COPYU(n, d, s) AV_WN##n(d, AV_RN##n(s));
|
||||
|
||||
#ifndef AV_COPY16U
|
||||
# define AV_COPY16U(d, s) AV_COPYU(16, d, s)
|
||||
#endif
|
||||
|
||||
#ifndef AV_COPY32U
|
||||
# define AV_COPY32U(d, s) AV_COPYU(32, d, s)
|
||||
#endif
|
||||
|
||||
#ifndef AV_COPY64U
|
||||
# define AV_COPY64U(d, s) AV_COPYU(64, d, s)
|
||||
#endif
|
||||
|
||||
#ifndef AV_COPY128U
|
||||
# define AV_COPY128U(d, s) \
|
||||
do { \
|
||||
AV_COPY64U(d, s); \
|
||||
AV_COPY64U((char *)(d) + 8, (const char *)(s) + 8); \
|
||||
} while(0)
|
||||
#endif
|
||||
|
||||
/* Parameters for AV_COPY*, AV_SWAP*, AV_ZERO* must be
|
||||
* naturally aligned. They may be implemented using MMX,
|
||||
* so emms_c() must be called before using any float code
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#ifndef AVUTIL_LFG_H
|
||||
#define AVUTIL_LFG_H
|
||||
|
||||
typedef struct {
|
||||
typedef struct AVLFG {
|
||||
unsigned int state[64];
|
||||
int index;
|
||||
} AVLFG;
|
||||
|
|
|
@ -40,6 +40,8 @@ typedef enum {
|
|||
AV_CLASS_CATEGORY_NB, ///< not part of ABI/API
|
||||
}AVClassCategory;
|
||||
|
||||
struct AVOptionRanges;
|
||||
|
||||
/**
|
||||
* Describe the class of an AVClass context structure. That is an
|
||||
* arbitrary struct of which the first field is a pointer to an
|
||||
|
@ -80,10 +82,11 @@ typedef struct AVClass {
|
|||
int log_level_offset_offset;
|
||||
|
||||
/**
|
||||
* Offset in the structure where a pointer to the parent context for loging is stored.
|
||||
* for example a decoder that uses eval.c could pass its AVCodecContext to eval as such
|
||||
* parent context. And a av_log() implementation could then display the parent context
|
||||
* can be NULL of course
|
||||
* Offset in the structure where a pointer to the parent context for
|
||||
* logging is stored. For example a decoder could pass its AVCodecContext
|
||||
* to eval as such a parent context, which an av_log() implementation
|
||||
* could then leverage to display the parent context.
|
||||
* The offset can be NULL.
|
||||
*/
|
||||
int parent_log_context_offset;
|
||||
|
||||
|
@ -93,7 +96,7 @@ typedef struct AVClass {
|
|||
void* (*child_next)(void *obj, void *prev);
|
||||
|
||||
/**
|
||||
* Return an AVClass corresponding to next potential
|
||||
* Return an AVClass corresponding to the next potential
|
||||
* AVOptions-enabled child.
|
||||
*
|
||||
* The difference between child_next and this is that
|
||||
|
@ -114,6 +117,12 @@ typedef struct AVClass {
|
|||
* available since version (51 << 16 | 59 << 8 | 100)
|
||||
*/
|
||||
AVClassCategory (*get_category)(void* ctx);
|
||||
|
||||
/**
|
||||
* Callback to return the supported/allowed ranges.
|
||||
* available since version (52.12)
|
||||
*/
|
||||
int (*query_ranges)(struct AVOptionRanges **, void *obj, const char *key, int flags);
|
||||
} AVClass;
|
||||
|
||||
/* av_log API */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* copyright (c) 2005 Michael Niedermayer <michaelni@gmx.at>
|
||||
* copyright (c) 2005-2012 Michael Niedermayer <michaelni@gmx.at>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
|
@ -70,6 +70,7 @@ enum AVRounding {
|
|||
AV_ROUND_DOWN = 2, ///< Round toward -infinity.
|
||||
AV_ROUND_UP = 3, ///< Round toward +infinity.
|
||||
AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero.
|
||||
AV_ROUND_PASS_MINMAX = 8192, ///< Flag to pass INT64_MIN/MAX through instead of rescaling, this avoids special cases for AV_NOPTS_VALUE
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -88,6 +89,9 @@ int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const;
|
|||
/**
|
||||
* Rescale a 64-bit integer with specified rounding.
|
||||
* A simple a*b/c isn't possible as it can overflow.
|
||||
*
|
||||
* @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is
|
||||
* INT64_MIN or INT64_MAX then a is passed through unchanged.
|
||||
*/
|
||||
int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding) av_const;
|
||||
|
||||
|
@ -98,6 +102,9 @@ int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const;
|
|||
|
||||
/**
|
||||
* Rescale a 64-bit integer by 2 rational numbers with specified rounding.
|
||||
*
|
||||
* @return rescaled value a, or if AV_ROUND_PASS_MINMAX is set and a is
|
||||
* INT64_MIN or INT64_MAX then a is passed through unchanged.
|
||||
*/
|
||||
int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq,
|
||||
enum AVRounding) av_const;
|
||||
|
@ -122,6 +129,17 @@ int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b);
|
|||
*/
|
||||
int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod);
|
||||
|
||||
/**
|
||||
* Rescale a timestamp while preserving known durations.
|
||||
*
|
||||
* @param in_ts Input timestamp
|
||||
* @param in_tb Input timesbase
|
||||
* @param fs_tb Duration and *last timebase
|
||||
* @param duration duration till the next call
|
||||
* @param out_tb Output timesbase
|
||||
*/
|
||||
int64_t av_rescale_delta(AVRational in_tb, int64_t in_ts, AVRational fs_tb, int duration, int64_t *last, AVRational out_tb);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
|
@ -23,6 +23,9 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "attributes.h"
|
||||
#include "version.h"
|
||||
|
||||
/**
|
||||
* @defgroup lavu_md5 MD5
|
||||
* @ingroup lavu_crypto
|
||||
|
@ -33,6 +36,7 @@ extern const int av_md5_size;
|
|||
|
||||
struct AVMD5;
|
||||
|
||||
struct AVMD5 *av_md5_alloc(void);
|
||||
void av_md5_init(struct AVMD5 *ctx);
|
||||
void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, const int len);
|
||||
void av_md5_final(struct AVMD5 *ctx, uint8_t *dst);
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#define AVUTIL_MEM_H
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "attributes.h"
|
||||
#include "error.h"
|
||||
|
@ -90,7 +91,7 @@ void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1);
|
|||
* be allocated.
|
||||
* @see av_malloc()
|
||||
*/
|
||||
av_alloc_size(1,2) static inline void *av_malloc_array(size_t nmemb, size_t size)
|
||||
av_alloc_size(1, 2) static inline void *av_malloc_array(size_t nmemb, size_t size)
|
||||
{
|
||||
if (size <= 0 || nmemb >= INT_MAX / size)
|
||||
return NULL;
|
||||
|
@ -163,7 +164,7 @@ void *av_calloc(size_t nmemb, size_t size) av_malloc_attrib;
|
|||
* @see av_mallocz()
|
||||
* @see av_malloc_array()
|
||||
*/
|
||||
av_alloc_size(1,2) static inline void *av_mallocz_array(size_t nmemb, size_t size)
|
||||
av_alloc_size(1, 2) static inline void *av_mallocz_array(size_t nmemb, size_t size)
|
||||
{
|
||||
if (size <= 0 || nmemb >= INT_MAX / size)
|
||||
return NULL;
|
||||
|
@ -216,6 +217,17 @@ static inline int av_size_mult(size_t a, size_t b, size_t *r)
|
|||
*/
|
||||
void av_max_alloc(size_t max);
|
||||
|
||||
/**
|
||||
* @brief deliberately overlapping memcpy implementation
|
||||
* @param dst destination buffer
|
||||
* @param back how many bytes back we start (the initial size of the overlapping window), must be > 0
|
||||
* @param cnt number of bytes to copy, must be >= 0
|
||||
*
|
||||
* cnt > back is valid, this will copy the bytes we just copied,
|
||||
* thus creating a repeating pattern with a period length of back.
|
||||
*/
|
||||
void av_memcpy_backptr(uint8_t *dst, int back, int cnt);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,171 @@
|
|||
/*
|
||||
* copyright (c) 2006-2012 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
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_OLD_PIX_FMTS_H
|
||||
#define AVUTIL_OLD_PIX_FMTS_H
|
||||
|
||||
/*
|
||||
* This header exists to prevent new pixel formats from being accidentally added
|
||||
* to the deprecated list.
|
||||
* Do not include it directly. It will be removed on next major bump
|
||||
*
|
||||
* Do not add new items to this list. Use the AVPixelFormat enum instead.
|
||||
*/
|
||||
PIX_FMT_NONE = AV_PIX_FMT_NONE,
|
||||
PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
|
||||
PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
|
||||
PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB...
|
||||
PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR...
|
||||
PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
|
||||
PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
|
||||
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, 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), deprecated in favor of PIX_FMT_YUV420P and setting color_range
|
||||
PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
|
||||
PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
|
||||
PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
|
||||
PIX_FMT_XVMC_MPEG2_IDCT,
|
||||
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 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 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 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...
|
||||
PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
|
||||
PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
|
||||
PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
|
||||
|
||||
PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian
|
||||
PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian
|
||||
PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
|
||||
PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
|
||||
PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
|
||||
PIX_FMT_VDPAU_H264,///< H.264 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_MPEG1,///< MPEG-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_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, 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
|
||||
PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
|
||||
PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
|
||||
|
||||
PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
|
||||
PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
|
||||
PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
|
||||
PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
|
||||
|
||||
PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
|
||||
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_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_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
|
||||
PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
|
||||
PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
|
||||
PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
|
||||
PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha
|
||||
PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
|
||||
PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
|
||||
|
||||
//the following 10 formats have the disadvantage of needing 1 format for each bit depth, thus
|
||||
//If you want to support multiple bit depths, then using PIX_FMT_YUV420P16* with the bpp stored separately
|
||||
//is better
|
||||
PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
|
||||
PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
|
||||
PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
|
||||
PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
|
||||
PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
|
||||
PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
|
||||
PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
|
||||
PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
|
||||
PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
|
||||
PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
|
||||
PIX_FMT_VDA_VLD, ///< hardware decoding through VDA
|
||||
|
||||
#ifdef AV_PIX_FMT_ABI_GIT_MASTER
|
||||
PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
|
||||
PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
|
||||
PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
|
||||
PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
|
||||
#endif
|
||||
PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp
|
||||
PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big endian
|
||||
PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little endian
|
||||
PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big endian
|
||||
PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little endian
|
||||
PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big endian
|
||||
PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little endian
|
||||
|
||||
#ifndef AV_PIX_FMT_ABI_GIT_MASTER
|
||||
PIX_FMT_RGBA64BE=0x123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
|
||||
PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
|
||||
PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
|
||||
PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
|
||||
#endif
|
||||
PIX_FMT_0RGB=0x123+4, ///< packed RGB 8:8:8, 32bpp, 0RGB0RGB...
|
||||
PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGB0RGB0...
|
||||
PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, 0BGR0BGR...
|
||||
PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGR0BGR0...
|
||||
PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
|
||||
PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
|
||||
|
||||
PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
|
||||
PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
|
||||
PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
|
||||
PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
|
||||
PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
|
||||
PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
|
||||
PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
|
||||
PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
|
||||
PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
|
||||
PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
|
||||
PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big endian
|
||||
PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little endian
|
||||
PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big endian
|
||||
PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little endian
|
||||
|
||||
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
|
||||
#endif /* AVUTIL_OLD_PIX_FMTS_H */
|
|
@ -31,6 +31,8 @@
|
|||
#include "avutil.h"
|
||||
#include "dict.h"
|
||||
#include "log.h"
|
||||
#include "pixfmt.h"
|
||||
#include "samplefmt.h"
|
||||
|
||||
/**
|
||||
* @defgroup avoptions AVOptions
|
||||
|
@ -227,6 +229,7 @@ enum AVOptionType{
|
|||
AV_OPT_TYPE_CONST = 128,
|
||||
AV_OPT_TYPE_IMAGE_SIZE = MKBETAG('S','I','Z','E'), ///< offset must point to two consecutive integers
|
||||
AV_OPT_TYPE_PIXEL_FMT = MKBETAG('P','F','M','T'),
|
||||
AV_OPT_TYPE_SAMPLE_FMT = MKBETAG('S','F','M','T'),
|
||||
#if FF_API_OLD_AVOPTIONS
|
||||
FF_OPT_TYPE_FLAGS = 0,
|
||||
FF_OPT_TYPE_INT,
|
||||
|
@ -290,6 +293,25 @@ typedef struct AVOption {
|
|||
const char *unit;
|
||||
} AVOption;
|
||||
|
||||
/**
|
||||
* A single allowed range of values, or a single allowed value.
|
||||
*/
|
||||
typedef struct AVOptionRange {
|
||||
const char *str;
|
||||
double value_min, value_max; ///< For string ranges this represents the min/max length, for dimensions this represents the min/max pixel count
|
||||
double component_min, component_max; ///< For string this represents the unicode range for chars, 0-127 limits to ASCII
|
||||
int is_range; ///< if set to 1 the struct encodes a range, if set to 0 a single value
|
||||
} AVOptionRange;
|
||||
|
||||
/**
|
||||
* List of AVOptionRange structs
|
||||
*/
|
||||
typedef struct AVOptionRanges {
|
||||
AVOptionRange **range;
|
||||
int nb_ranges;
|
||||
} AVOptionRanges;
|
||||
|
||||
|
||||
#if FF_API_FIND_OPT
|
||||
/**
|
||||
* Look for an option in obj. Look only for the options which
|
||||
|
@ -393,6 +415,36 @@ void av_opt_set_defaults2(void *s, int mask, int flags);
|
|||
int av_set_options_string(void *ctx, const char *opts,
|
||||
const char *key_val_sep, const char *pairs_sep);
|
||||
|
||||
/**
|
||||
* Parse the key-value pairs list in opts. For each key=value pair found,
|
||||
* set the value of the corresponding option in ctx.
|
||||
*
|
||||
* @param ctx the AVClass object to set options on
|
||||
* @param opts the options string, key-value pairs separated by a
|
||||
* delimiter
|
||||
* @param shorthand a NULL-terminated array of options names for shorthand
|
||||
* notation: if the first field in opts has no key part,
|
||||
* the key is taken from the first element of shorthand;
|
||||
* then again for the second, etc., until either opts is
|
||||
* finished, shorthand is finished or a named option is
|
||||
* found; after that, all options must be named
|
||||
* @param key_val_sep a 0-terminated list of characters used to separate
|
||||
* key from value, for example '='
|
||||
* @param pairs_sep a 0-terminated list of characters used to separate
|
||||
* two pairs from each other, for example ':' or ','
|
||||
* @return the number of successfully set key=value pairs, or a negative
|
||||
* value corresponding to an AVERROR code in case of error:
|
||||
* AVERROR(EINVAL) if opts cannot be parsed,
|
||||
* the error code issued by av_set_string3() if a key/value pair
|
||||
* cannot be set
|
||||
*
|
||||
* Options names must use only the following characters: a-z A-Z 0-9 - . / _
|
||||
* Separators must use characters distinct from option names and from each
|
||||
* other.
|
||||
*/
|
||||
int av_opt_set_from_string(void *ctx, const char *opts,
|
||||
const char *const *shorthand,
|
||||
const char *key_val_sep, const char *pairs_sep);
|
||||
/**
|
||||
* Free all string and binary options in obj.
|
||||
*/
|
||||
|
@ -408,7 +460,7 @@ void av_opt_free(void *obj);
|
|||
*/
|
||||
int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name);
|
||||
|
||||
/*
|
||||
/**
|
||||
* Set all the options from a given dictionary on an object.
|
||||
*
|
||||
* @param obj a struct whose first element is a pointer to AVClass
|
||||
|
@ -424,6 +476,39 @@ int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name)
|
|||
*/
|
||||
int av_opt_set_dict(void *obj, struct AVDictionary **options);
|
||||
|
||||
/**
|
||||
* Extract a key-value pair from the beginning of a string.
|
||||
*
|
||||
* @param ropts pointer to the options string, will be updated to
|
||||
* point to the rest of the string (one of the pairs_sep
|
||||
* or the final NUL)
|
||||
* @param key_val_sep a 0-terminated list of characters used to separate
|
||||
* key from value, for example '='
|
||||
* @param pairs_sep a 0-terminated list of characters used to separate
|
||||
* two pairs from each other, for example ':' or ','
|
||||
* @param flags flags; see the AV_OPT_FLAG_* values below
|
||||
* @param rkey parsed key; must be freed using av_free()
|
||||
* @param rval parsed value; must be freed using av_free()
|
||||
*
|
||||
* @return >=0 for success, or a negative value corresponding to an
|
||||
* AVERROR code in case of error; in particular:
|
||||
* AVERROR(EINVAL) if no key is present
|
||||
*
|
||||
*/
|
||||
int av_opt_get_key_value(const char **ropts,
|
||||
const char *key_val_sep, const char *pairs_sep,
|
||||
unsigned flags,
|
||||
char **rkey, char **rval);
|
||||
|
||||
enum {
|
||||
|
||||
/**
|
||||
* Accept to parse a value without a key; the key will then be returned
|
||||
* as NULL.
|
||||
*/
|
||||
AV_OPT_FLAG_IMPLICIT_KEY = 1,
|
||||
};
|
||||
|
||||
/**
|
||||
* @defgroup opt_eval_funcs Evaluating option strings
|
||||
* @{
|
||||
|
@ -565,6 +650,9 @@ int av_opt_set_int (void *obj, const char *name, int64_t val, int search_f
|
|||
int av_opt_set_double(void *obj, const char *name, double val, int search_flags);
|
||||
int av_opt_set_q (void *obj, const char *name, AVRational val, int search_flags);
|
||||
int av_opt_set_bin (void *obj, const char *name, const uint8_t *val, int size, int search_flags);
|
||||
int av_opt_set_image_size(void *obj, const char *name, int w, int h, int search_flags);
|
||||
int av_opt_set_pixel_fmt (void *obj, const char *name, enum AVPixelFormat fmt, int search_flags);
|
||||
int av_opt_set_sample_fmt(void *obj, const char *name, enum AVSampleFormat fmt, int search_flags);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
@ -588,6 +676,9 @@ int av_opt_get (void *obj, const char *name, int search_flags, uint8_t *
|
|||
int av_opt_get_int (void *obj, const char *name, int search_flags, int64_t *out_val);
|
||||
int av_opt_get_double(void *obj, const char *name, int search_flags, double *out_val);
|
||||
int av_opt_get_q (void *obj, const char *name, int search_flags, AVRational *out_val);
|
||||
int av_opt_get_image_size(void *obj, const char *name, int search_flags, int *w_out, int *h_out);
|
||||
int av_opt_get_pixel_fmt (void *obj, const char *name, int search_flags, enum AVPixelFormat *out_fmt);
|
||||
int av_opt_get_sample_fmt(void *obj, const char *name, int search_flags, enum AVSampleFormat *out_fmt);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
@ -600,6 +691,41 @@ int av_opt_get_q (void *obj, const char *name, int search_flags, AVRational
|
|||
* or written to.
|
||||
*/
|
||||
void *av_opt_ptr(const AVClass *avclass, void *obj, const char *name);
|
||||
|
||||
/**
|
||||
* Free an AVOptionRanges struct and set it to NULL.
|
||||
*/
|
||||
void av_opt_freep_ranges(AVOptionRanges **ranges);
|
||||
|
||||
/**
|
||||
* Get a list of allowed ranges for the given option.
|
||||
*
|
||||
* The returned list may depend on other fields in obj like for example profile.
|
||||
*
|
||||
* @param flags is a bitmask of flags, undefined flags should not be set and should be ignored
|
||||
* AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance
|
||||
*
|
||||
* The result must be freed with av_opt_freep_ranges.
|
||||
*
|
||||
* @return >= 0 on success, a negative errro code otherwise
|
||||
*/
|
||||
int av_opt_query_ranges(AVOptionRanges **, void *obj, const char *key, int flags);
|
||||
|
||||
/**
|
||||
* Get a default list of allowed ranges for the given option.
|
||||
*
|
||||
* This list is constructed without using the AVClass.query_ranges() callback
|
||||
* and can be used as fallback from within the callback.
|
||||
*
|
||||
* @param flags is a bitmask of flags, undefined flags should not be set and should be ignored
|
||||
* AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance
|
||||
*
|
||||
* The result must be freed with av_opt_free_ranges.
|
||||
*
|
||||
* @return >= 0 on success, a negative errro code otherwise
|
||||
*/
|
||||
int av_opt_query_ranges_default(AVOptionRanges **, void *obj, const char *key, int flags);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
|
@ -122,7 +122,7 @@ int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen,
|
|||
* year-month-day.
|
||||
* - If a duration the syntax is:
|
||||
* @code
|
||||
* [-]HH:MM:SS[.m...]]]
|
||||
* [-][HH:]MM:SS[.m...]
|
||||
* [-]S+[.m...]
|
||||
* @endcode
|
||||
* @param duration flag which tells how to interpret timestr, if not
|
||||
|
@ -141,6 +141,7 @@ int av_parse_time(int64_t *timeval, const char *timestr, int duration);
|
|||
* In particular it actually supports the parameters:
|
||||
* - %H: the hour as a decimal number, using a 24-hour clock, in the
|
||||
* range '00' through '23'
|
||||
* - %J: hours as a decimal number, in the range '0' through INT_MAX
|
||||
* - %M: the minute as a decimal number, using a 24-hour clock, in the
|
||||
* range '00' through '59'
|
||||
* - %S: the second as a decimal number, using a 24-hour clock, in the
|
||||
|
|
|
@ -99,10 +99,15 @@ typedef struct AVPixFmtDescriptor{
|
|||
*/
|
||||
#define PIX_FMT_PSEUDOPAL 64
|
||||
|
||||
#define PIX_FMT_ALPHA 128 ///< The pixel format has an alpha channel
|
||||
|
||||
|
||||
#if FF_API_PIX_FMT_DESC
|
||||
/**
|
||||
* The array of all the pixel format descriptors.
|
||||
*/
|
||||
extern const AVPixFmtDescriptor av_pix_fmt_descriptors[];
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Read a line from an image, and write the values of the
|
||||
|
@ -149,9 +154,9 @@ void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesi
|
|||
* For example in a little-endian system, first looks for "gray16",
|
||||
* then for "gray16le".
|
||||
*
|
||||
* Finally if no pixel format has been found, returns PIX_FMT_NONE.
|
||||
* Finally if no pixel format has been found, returns AV_PIX_FMT_NONE.
|
||||
*/
|
||||
enum PixelFormat av_get_pix_fmt(const char *name);
|
||||
enum AVPixelFormat av_get_pix_fmt(const char *name);
|
||||
|
||||
/**
|
||||
* Return the short name for a pixel format, NULL in case pix_fmt is
|
||||
|
@ -159,7 +164,7 @@ enum PixelFormat av_get_pix_fmt(const char *name);
|
|||
*
|
||||
* @see av_get_pix_fmt(), av_get_pix_fmt_string()
|
||||
*/
|
||||
const char *av_get_pix_fmt_name(enum PixelFormat pix_fmt);
|
||||
const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt);
|
||||
|
||||
/**
|
||||
* Print in buf the string corresponding to the pixel format with
|
||||
|
@ -171,7 +176,7 @@ const char *av_get_pix_fmt_name(enum PixelFormat pix_fmt);
|
|||
* corresponding info string, or a negative value to print the
|
||||
* corresponding header.
|
||||
*/
|
||||
char *av_get_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt);
|
||||
char *av_get_pix_fmt_string (char *buf, int buf_size, enum AVPixelFormat pix_fmt);
|
||||
|
||||
/**
|
||||
* Return the number of bits per pixel used by the pixel format
|
||||
|
@ -183,4 +188,50 @@ char *av_get_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt);
|
|||
*/
|
||||
int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc);
|
||||
|
||||
/**
|
||||
* Return the number of bits per pixel for the pixel format
|
||||
* described by pixdesc, including any padding or unused bits.
|
||||
*/
|
||||
int av_get_padded_bits_per_pixel(const AVPixFmtDescriptor *pixdesc);
|
||||
|
||||
/**
|
||||
* @return a pixel format descriptor for provided pixel format or NULL if
|
||||
* this pixel format is unknown.
|
||||
*/
|
||||
const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt);
|
||||
|
||||
/**
|
||||
* Iterate over all pixel format descriptors known to libavutil.
|
||||
*
|
||||
* @param prev previous descriptor. NULL to get the first descriptor.
|
||||
*
|
||||
* @return next descriptor or NULL after the last descriptor
|
||||
*/
|
||||
const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev);
|
||||
|
||||
/**
|
||||
* @return an AVPixelFormat id described by desc, or AV_PIX_FMT_NONE if desc
|
||||
* is not a valid pointer to a pixel format descriptor.
|
||||
*/
|
||||
enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc);
|
||||
|
||||
/**
|
||||
* Utility function to access log2_chroma_w log2_chroma_h from
|
||||
* the pixel format AVPixFmtDescriptor.
|
||||
*
|
||||
* See avcodec_get_chroma_sub_sample() for a function that asserts a
|
||||
* valid pixel format instead of returning an error code.
|
||||
* Its recommanded that you use avcodec_get_chroma_sub_sample unless
|
||||
* you do check the return code!
|
||||
*
|
||||
* @param[in] pix_fmt the pixel format
|
||||
* @param[out] h_shift store log2_chroma_h
|
||||
* @param[out] v_shift store log2_chroma_w
|
||||
*
|
||||
* @return 0 on success, AVERROR(ENOSYS) on invalid or unknown pixel format
|
||||
*/
|
||||
int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt,
|
||||
int *h_shift, int *v_shift);
|
||||
|
||||
|
||||
#endif /* AVUTIL_PIXDESC_H */
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
*/
|
||||
|
||||
#include "libavutil/avconfig.h"
|
||||
#include "libavutil/version.h"
|
||||
|
||||
#define AVPALETTE_SIZE 1024
|
||||
#define AVPALETTE_COUNT 256
|
||||
|
@ -58,201 +59,299 @@
|
|||
* allocating the picture.
|
||||
*
|
||||
* @note
|
||||
* make sure that all newly added big endian formats have pix_fmt&1==1
|
||||
* and that all newly added little endian formats have pix_fmt&1==0
|
||||
* this allows simpler detection of big vs little endian.
|
||||
* Make sure that all newly added big-endian formats have pix_fmt & 1 == 1
|
||||
* and that all newly added little-endian formats have pix_fmt & 1 == 0.
|
||||
* This allows simpler detection of big vs little-endian.
|
||||
*/
|
||||
enum PixelFormat {
|
||||
PIX_FMT_NONE= -1,
|
||||
PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
|
||||
PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
|
||||
PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB...
|
||||
PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR...
|
||||
PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
|
||||
PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
|
||||
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, 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), deprecated in favor of PIX_FMT_YUV420P and setting color_range
|
||||
PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
|
||||
PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
|
||||
PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
|
||||
PIX_FMT_XVMC_MPEG2_IDCT,
|
||||
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 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 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 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
|
||||
enum AVPixelFormat {
|
||||
AV_PIX_FMT_NONE = -1,
|
||||
AV_PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
|
||||
AV_PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
|
||||
AV_PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB...
|
||||
AV_PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR...
|
||||
AV_PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
|
||||
AV_PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
|
||||
AV_PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
|
||||
AV_PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
|
||||
AV_PIX_FMT_GRAY8, ///< Y , 8bpp
|
||||
AV_PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
|
||||
AV_PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
|
||||
AV_PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette
|
||||
AV_PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range
|
||||
AV_PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
|
||||
AV_PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
|
||||
AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
|
||||
AV_PIX_FMT_XVMC_MPEG2_IDCT,
|
||||
AV_PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
|
||||
AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
|
||||
AV_PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
|
||||
AV_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
|
||||
AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
|
||||
AV_PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
|
||||
AV_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
|
||||
AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
|
||||
AV_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)
|
||||
AV_PIX_FMT_NV21, ///< as above, but U and V bytes are swapped
|
||||
|
||||
PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
|
||||
PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
|
||||
PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
|
||||
PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
|
||||
AV_PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
|
||||
AV_PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
|
||||
AV_PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
|
||||
AV_PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
|
||||
|
||||
PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian
|
||||
PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian
|
||||
PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
|
||||
PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
|
||||
PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
|
||||
PIX_FMT_VDPAU_H264,///< H.264 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_MPEG1,///< MPEG-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_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, 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
|
||||
AV_PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian
|
||||
AV_PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian
|
||||
AV_PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
|
||||
AV_PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
|
||||
AV_PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
|
||||
AV_PIX_FMT_VDPAU_H264,///< H.264 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
|
||||
AV_PIX_FMT_VDPAU_MPEG1,///< MPEG-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
|
||||
AV_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
|
||||
AV_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
|
||||
AV_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
|
||||
AV_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
|
||||
AV_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
|
||||
PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
|
||||
PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
|
||||
AV_PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
|
||||
AV_PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
|
||||
AV_PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
|
||||
AV_PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
|
||||
|
||||
PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
|
||||
PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
|
||||
PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
|
||||
PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
|
||||
AV_PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
|
||||
AV_PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
|
||||
AV_PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
|
||||
AV_PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
|
||||
|
||||
PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
|
||||
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
|
||||
AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
|
||||
AV_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
|
||||
AV_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_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
|
||||
AV_PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
|
||||
AV_PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
|
||||
AV_PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
|
||||
AV_PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
|
||||
AV_PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
AV_PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
|
||||
AV_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
|
||||
AV_PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
|
||||
|
||||
PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
|
||||
PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
|
||||
PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
|
||||
PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
|
||||
PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha
|
||||
PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
|
||||
PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
|
||||
AV_PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
|
||||
AV_PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
|
||||
AV_PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
|
||||
AV_PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
|
||||
AV_PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha
|
||||
AV_PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
|
||||
AV_PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
|
||||
|
||||
//the following 10 formats have the disadvantage of needing 1 format for each bit depth, thus
|
||||
//If you want to support multiple bit depths, then using PIX_FMT_YUV420P16* with the bpp stored separately
|
||||
//If you want to support multiple bit depths, then using AV_PIX_FMT_YUV420P16* with the bpp stored separately
|
||||
//is better
|
||||
PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
|
||||
PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
|
||||
PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
|
||||
PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
|
||||
PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
|
||||
PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
|
||||
PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
|
||||
PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
|
||||
PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
|
||||
PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
|
||||
PIX_FMT_VDA_VLD, ///< hardware decoding through VDA
|
||||
AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
|
||||
AV_PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
|
||||
AV_PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
|
||||
AV_PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
|
||||
AV_PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
|
||||
AV_PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
|
||||
AV_PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
|
||||
AV_PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
AV_PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
|
||||
AV_PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
|
||||
AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
|
||||
AV_PIX_FMT_VDA_VLD, ///< hardware decoding through VDA
|
||||
|
||||
#ifdef AV_PIX_FMT_ABI_GIT_MASTER
|
||||
PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
|
||||
PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
|
||||
PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
|
||||
PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
|
||||
AV_PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
|
||||
AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
|
||||
AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
|
||||
AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
|
||||
#endif
|
||||
PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp
|
||||
PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big endian
|
||||
PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little endian
|
||||
PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big endian
|
||||
PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little endian
|
||||
PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big endian
|
||||
PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little endian
|
||||
AV_PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp
|
||||
AV_PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big-endian
|
||||
AV_PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little-endian
|
||||
AV_PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big-endian
|
||||
AV_PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little-endian
|
||||
AV_PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big-endian
|
||||
AV_PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little-endian
|
||||
|
||||
/**
|
||||
* duplicated pixel formats for compatibility with libav.
|
||||
* FFmpeg supports these formats since May 8 2012 and Jan 28 2012 (commits f9ca1ac7 and 143a5c55)
|
||||
* Libav added them Oct 12 2012 with incompatible values (commit 6d5600e85)
|
||||
*/
|
||||
AV_PIX_FMT_YUVA422P_LIBAV, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
|
||||
AV_PIX_FMT_YUVA444P_LIBAV, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
|
||||
|
||||
AV_PIX_FMT_YUVA420P9BE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian
|
||||
AV_PIX_FMT_YUVA420P9LE, ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian
|
||||
AV_PIX_FMT_YUVA422P9BE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian
|
||||
AV_PIX_FMT_YUVA422P9LE, ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian
|
||||
AV_PIX_FMT_YUVA444P9BE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
|
||||
AV_PIX_FMT_YUVA444P9LE, ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
|
||||
AV_PIX_FMT_YUVA420P10BE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
|
||||
AV_PIX_FMT_YUVA420P10LE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
|
||||
AV_PIX_FMT_YUVA422P10BE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
|
||||
AV_PIX_FMT_YUVA422P10LE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
|
||||
AV_PIX_FMT_YUVA444P10BE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
|
||||
AV_PIX_FMT_YUVA444P10LE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
|
||||
AV_PIX_FMT_YUVA420P16BE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
|
||||
AV_PIX_FMT_YUVA420P16LE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
|
||||
AV_PIX_FMT_YUVA422P16BE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
|
||||
AV_PIX_FMT_YUVA422P16LE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
|
||||
AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
|
||||
AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
|
||||
|
||||
AV_PIX_FMT_VDPAU, ///< HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface
|
||||
|
||||
#ifndef AV_PIX_FMT_ABI_GIT_MASTER
|
||||
PIX_FMT_RGBA64BE=0x123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
|
||||
PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
|
||||
PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
|
||||
PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
|
||||
AV_PIX_FMT_RGBA64BE=0x123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
|
||||
AV_PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
|
||||
AV_PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
|
||||
AV_PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
|
||||
#endif
|
||||
PIX_FMT_0RGB=0x123+4, ///< packed RGB 8:8:8, 32bpp, 0RGB0RGB...
|
||||
PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGB0RGB0...
|
||||
PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, 0BGR0BGR...
|
||||
PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGR0BGR0...
|
||||
PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
|
||||
PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
|
||||
AV_PIX_FMT_0RGB=0x123+4, ///< packed RGB 8:8:8, 32bpp, 0RGB0RGB...
|
||||
AV_PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGB0RGB0...
|
||||
AV_PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, 0BGR0BGR...
|
||||
AV_PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGR0BGR0...
|
||||
AV_PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
|
||||
AV_PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
|
||||
|
||||
PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
|
||||
PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
|
||||
PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
|
||||
PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
|
||||
PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
|
||||
PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
|
||||
PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
|
||||
PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
|
||||
PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
|
||||
PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
|
||||
PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big endian
|
||||
PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little endian
|
||||
PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big endian
|
||||
PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little endian
|
||||
AV_PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
|
||||
AV_PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
|
||||
AV_PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
|
||||
AV_PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
|
||||
AV_PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
|
||||
AV_PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
|
||||
AV_PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
|
||||
AV_PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
|
||||
AV_PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
|
||||
AV_PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
AV_PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
|
||||
AV_PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
AV_PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big-endian
|
||||
AV_PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little-endian
|
||||
AV_PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big-endian
|
||||
AV_PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little-endian
|
||||
AV_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
|
||||
|
||||
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
|
||||
#if FF_API_PIX_FMT
|
||||
#include "old_pix_fmts.h"
|
||||
#endif
|
||||
};
|
||||
|
||||
#define PIX_FMT_Y400A PIX_FMT_GRAY8A
|
||||
#define PIX_FMT_GBR24P PIX_FMT_GBRP
|
||||
|
||||
#if AV_HAVE_BIGENDIAN
|
||||
# define PIX_FMT_NE(be, le) PIX_FMT_##be
|
||||
#else
|
||||
# define PIX_FMT_NE(be, le) PIX_FMT_##le
|
||||
#if AV_HAVE_INCOMPATIBLE_FORK_ABI
|
||||
#define AV_PIX_FMT_YUVA422P AV_PIX_FMT_YUVA422P_LIBAV
|
||||
#define AV_PIX_FMT_YUVA444P AV_PIX_FMT_YUVA444P_LIBAV
|
||||
#endif
|
||||
|
||||
#define PIX_FMT_RGB32 PIX_FMT_NE(ARGB, BGRA)
|
||||
#define PIX_FMT_RGB32_1 PIX_FMT_NE(RGBA, ABGR)
|
||||
#define PIX_FMT_BGR32 PIX_FMT_NE(ABGR, RGBA)
|
||||
#define PIX_FMT_BGR32_1 PIX_FMT_NE(BGRA, ARGB)
|
||||
#define PIX_FMT_0RGB32 PIX_FMT_NE(0RGB, BGR0)
|
||||
#define PIX_FMT_0BGR32 PIX_FMT_NE(0BGR, RGB0)
|
||||
|
||||
#define PIX_FMT_GRAY16 PIX_FMT_NE(GRAY16BE, GRAY16LE)
|
||||
#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_BGR48 PIX_FMT_NE(BGR48BE, BGR48LE)
|
||||
#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 AV_PIX_FMT_Y400A AV_PIX_FMT_GRAY8A
|
||||
#define AV_PIX_FMT_GBR24P AV_PIX_FMT_GBRP
|
||||
|
||||
#define PIX_FMT_YUV420P9 PIX_FMT_NE(YUV420P9BE , YUV420P9LE)
|
||||
#define PIX_FMT_YUV422P9 PIX_FMT_NE(YUV422P9BE , YUV422P9LE)
|
||||
#define PIX_FMT_YUV444P9 PIX_FMT_NE(YUV444P9BE , YUV444P9LE)
|
||||
#define PIX_FMT_YUV420P10 PIX_FMT_NE(YUV420P10BE, YUV420P10LE)
|
||||
#define PIX_FMT_YUV422P10 PIX_FMT_NE(YUV422P10BE, YUV422P10LE)
|
||||
#define PIX_FMT_YUV444P10 PIX_FMT_NE(YUV444P10BE, YUV444P10LE)
|
||||
#define PIX_FMT_YUV420P12 PIX_FMT_NE(YUV420P12BE, YUV420P12LE)
|
||||
#define PIX_FMT_YUV422P12 PIX_FMT_NE(YUV422P12BE, YUV422P12LE)
|
||||
#define PIX_FMT_YUV444P12 PIX_FMT_NE(YUV444P12BE, YUV444P12LE)
|
||||
#define PIX_FMT_YUV420P14 PIX_FMT_NE(YUV420P14BE, YUV420P14LE)
|
||||
#define PIX_FMT_YUV422P14 PIX_FMT_NE(YUV422P14BE, YUV422P14LE)
|
||||
#define PIX_FMT_YUV444P14 PIX_FMT_NE(YUV444P14BE, YUV444P14LE)
|
||||
#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)
|
||||
#if AV_HAVE_BIGENDIAN
|
||||
# define AV_PIX_FMT_NE(be, le) AV_PIX_FMT_##be
|
||||
#else
|
||||
# define AV_PIX_FMT_NE(be, le) AV_PIX_FMT_##le
|
||||
#endif
|
||||
|
||||
#define PIX_FMT_RGBA64 PIX_FMT_NE(RGBA64BE, RGBA64LE)
|
||||
#define PIX_FMT_BGRA64 PIX_FMT_NE(BGRA64BE, BGRA64LE)
|
||||
#define PIX_FMT_GBRP9 PIX_FMT_NE(GBRP9BE , GBRP9LE)
|
||||
#define PIX_FMT_GBRP10 PIX_FMT_NE(GBRP10BE, GBRP10LE)
|
||||
#define PIX_FMT_GBRP12 PIX_FMT_NE(GBRP12BE, GBRP12LE)
|
||||
#define PIX_FMT_GBRP14 PIX_FMT_NE(GBRP14BE, GBRP14LE)
|
||||
#define PIX_FMT_GBRP16 PIX_FMT_NE(GBRP16BE, GBRP16LE)
|
||||
#define AV_PIX_FMT_RGB32 AV_PIX_FMT_NE(ARGB, BGRA)
|
||||
#define AV_PIX_FMT_RGB32_1 AV_PIX_FMT_NE(RGBA, ABGR)
|
||||
#define AV_PIX_FMT_BGR32 AV_PIX_FMT_NE(ABGR, RGBA)
|
||||
#define AV_PIX_FMT_BGR32_1 AV_PIX_FMT_NE(BGRA, ARGB)
|
||||
#define AV_PIX_FMT_0RGB32 AV_PIX_FMT_NE(0RGB, BGR0)
|
||||
#define AV_PIX_FMT_0BGR32 AV_PIX_FMT_NE(0BGR, RGB0)
|
||||
|
||||
#define AV_PIX_FMT_GRAY16 AV_PIX_FMT_NE(GRAY16BE, GRAY16LE)
|
||||
#define AV_PIX_FMT_RGB48 AV_PIX_FMT_NE(RGB48BE, RGB48LE)
|
||||
#define AV_PIX_FMT_RGB565 AV_PIX_FMT_NE(RGB565BE, RGB565LE)
|
||||
#define AV_PIX_FMT_RGB555 AV_PIX_FMT_NE(RGB555BE, RGB555LE)
|
||||
#define AV_PIX_FMT_RGB444 AV_PIX_FMT_NE(RGB444BE, RGB444LE)
|
||||
#define AV_PIX_FMT_BGR48 AV_PIX_FMT_NE(BGR48BE, BGR48LE)
|
||||
#define AV_PIX_FMT_BGR565 AV_PIX_FMT_NE(BGR565BE, BGR565LE)
|
||||
#define AV_PIX_FMT_BGR555 AV_PIX_FMT_NE(BGR555BE, BGR555LE)
|
||||
#define AV_PIX_FMT_BGR444 AV_PIX_FMT_NE(BGR444BE, BGR444LE)
|
||||
|
||||
#define AV_PIX_FMT_YUV420P9 AV_PIX_FMT_NE(YUV420P9BE , YUV420P9LE)
|
||||
#define AV_PIX_FMT_YUV422P9 AV_PIX_FMT_NE(YUV422P9BE , YUV422P9LE)
|
||||
#define AV_PIX_FMT_YUV444P9 AV_PIX_FMT_NE(YUV444P9BE , YUV444P9LE)
|
||||
#define AV_PIX_FMT_YUV420P10 AV_PIX_FMT_NE(YUV420P10BE, YUV420P10LE)
|
||||
#define AV_PIX_FMT_YUV422P10 AV_PIX_FMT_NE(YUV422P10BE, YUV422P10LE)
|
||||
#define AV_PIX_FMT_YUV444P10 AV_PIX_FMT_NE(YUV444P10BE, YUV444P10LE)
|
||||
#define AV_PIX_FMT_YUV420P12 AV_PIX_FMT_NE(YUV420P12BE, YUV420P12LE)
|
||||
#define AV_PIX_FMT_YUV422P12 AV_PIX_FMT_NE(YUV422P12BE, YUV422P12LE)
|
||||
#define AV_PIX_FMT_YUV444P12 AV_PIX_FMT_NE(YUV444P12BE, YUV444P12LE)
|
||||
#define AV_PIX_FMT_YUV420P14 AV_PIX_FMT_NE(YUV420P14BE, YUV420P14LE)
|
||||
#define AV_PIX_FMT_YUV422P14 AV_PIX_FMT_NE(YUV422P14BE, YUV422P14LE)
|
||||
#define AV_PIX_FMT_YUV444P14 AV_PIX_FMT_NE(YUV444P14BE, YUV444P14LE)
|
||||
#define AV_PIX_FMT_YUV420P16 AV_PIX_FMT_NE(YUV420P16BE, YUV420P16LE)
|
||||
#define AV_PIX_FMT_YUV422P16 AV_PIX_FMT_NE(YUV422P16BE, YUV422P16LE)
|
||||
#define AV_PIX_FMT_YUV444P16 AV_PIX_FMT_NE(YUV444P16BE, YUV444P16LE)
|
||||
|
||||
#define AV_PIX_FMT_RGBA64 AV_PIX_FMT_NE(RGBA64BE, RGBA64LE)
|
||||
#define AV_PIX_FMT_BGRA64 AV_PIX_FMT_NE(BGRA64BE, BGRA64LE)
|
||||
#define AV_PIX_FMT_GBRP9 AV_PIX_FMT_NE(GBRP9BE , GBRP9LE)
|
||||
#define AV_PIX_FMT_GBRP10 AV_PIX_FMT_NE(GBRP10BE, GBRP10LE)
|
||||
#define AV_PIX_FMT_GBRP12 AV_PIX_FMT_NE(GBRP12BE, GBRP12LE)
|
||||
#define AV_PIX_FMT_GBRP14 AV_PIX_FMT_NE(GBRP14BE, GBRP14LE)
|
||||
#define AV_PIX_FMT_GBRP16 AV_PIX_FMT_NE(GBRP16BE, GBRP16LE)
|
||||
|
||||
#define AV_PIX_FMT_YUVA420P9 AV_PIX_FMT_NE(YUVA420P9BE , YUVA420P9LE)
|
||||
#define AV_PIX_FMT_YUVA422P9 AV_PIX_FMT_NE(YUVA422P9BE , YUVA422P9LE)
|
||||
#define AV_PIX_FMT_YUVA444P9 AV_PIX_FMT_NE(YUVA444P9BE , YUVA444P9LE)
|
||||
#define AV_PIX_FMT_YUVA420P10 AV_PIX_FMT_NE(YUVA420P10BE, YUVA420P10LE)
|
||||
#define AV_PIX_FMT_YUVA422P10 AV_PIX_FMT_NE(YUVA422P10BE, YUVA422P10LE)
|
||||
#define AV_PIX_FMT_YUVA444P10 AV_PIX_FMT_NE(YUVA444P10BE, YUVA444P10LE)
|
||||
#define AV_PIX_FMT_YUVA420P16 AV_PIX_FMT_NE(YUVA420P16BE, YUVA420P16LE)
|
||||
#define AV_PIX_FMT_YUVA422P16 AV_PIX_FMT_NE(YUVA422P16BE, YUVA422P16LE)
|
||||
#define AV_PIX_FMT_YUVA444P16 AV_PIX_FMT_NE(YUVA444P16BE, YUVA444P16LE)
|
||||
|
||||
#if FF_API_PIX_FMT
|
||||
#define PixelFormat AVPixelFormat
|
||||
|
||||
#define PIX_FMT_Y400A AV_PIX_FMT_Y400A
|
||||
#define PIX_FMT_GBR24P AV_PIX_FMT_GBR24P
|
||||
|
||||
#define PIX_FMT_NE(be, le) AV_PIX_FMT_NE(be, le)
|
||||
|
||||
#define PIX_FMT_RGB32 AV_PIX_FMT_RGB32
|
||||
#define PIX_FMT_RGB32_1 AV_PIX_FMT_RGB32_1
|
||||
#define PIX_FMT_BGR32 AV_PIX_FMT_BGR32
|
||||
#define PIX_FMT_BGR32_1 AV_PIX_FMT_BGR32_1
|
||||
#define PIX_FMT_0RGB32 AV_PIX_FMT_0RGB32
|
||||
#define PIX_FMT_0BGR32 AV_PIX_FMT_0BGR32
|
||||
|
||||
#define PIX_FMT_GRAY16 AV_PIX_FMT_GRAY16
|
||||
#define PIX_FMT_RGB48 AV_PIX_FMT_RGB48
|
||||
#define PIX_FMT_RGB565 AV_PIX_FMT_RGB565
|
||||
#define PIX_FMT_RGB555 AV_PIX_FMT_RGB555
|
||||
#define PIX_FMT_RGB444 AV_PIX_FMT_RGB444
|
||||
#define PIX_FMT_BGR48 AV_PIX_FMT_BGR48
|
||||
#define PIX_FMT_BGR565 AV_PIX_FMT_BGR565
|
||||
#define PIX_FMT_BGR555 AV_PIX_FMT_BGR555
|
||||
#define PIX_FMT_BGR444 AV_PIX_FMT_BGR444
|
||||
|
||||
#define PIX_FMT_YUV420P9 AV_PIX_FMT_YUV420P9
|
||||
#define PIX_FMT_YUV422P9 AV_PIX_FMT_YUV422P9
|
||||
#define PIX_FMT_YUV444P9 AV_PIX_FMT_YUV444P9
|
||||
#define PIX_FMT_YUV420P10 AV_PIX_FMT_YUV420P10
|
||||
#define PIX_FMT_YUV422P10 AV_PIX_FMT_YUV422P10
|
||||
#define PIX_FMT_YUV444P10 AV_PIX_FMT_YUV444P10
|
||||
#define PIX_FMT_YUV420P12 AV_PIX_FMT_YUV420P12
|
||||
#define PIX_FMT_YUV422P12 AV_PIX_FMT_YUV422P12
|
||||
#define PIX_FMT_YUV444P12 AV_PIX_FMT_YUV444P12
|
||||
#define PIX_FMT_YUV420P14 AV_PIX_FMT_YUV420P14
|
||||
#define PIX_FMT_YUV422P14 AV_PIX_FMT_YUV422P14
|
||||
#define PIX_FMT_YUV444P14 AV_PIX_FMT_YUV444P14
|
||||
#define PIX_FMT_YUV420P16 AV_PIX_FMT_YUV420P16
|
||||
#define PIX_FMT_YUV422P16 AV_PIX_FMT_YUV422P16
|
||||
#define PIX_FMT_YUV444P16 AV_PIX_FMT_YUV444P16
|
||||
|
||||
#define PIX_FMT_RGBA64 AV_PIX_FMT_RGBA64
|
||||
#define PIX_FMT_BGRA64 AV_PIX_FMT_BGRA64
|
||||
#define PIX_FMT_GBRP9 AV_PIX_FMT_GBRP9
|
||||
#define PIX_FMT_GBRP10 AV_PIX_FMT_GBRP10
|
||||
#define PIX_FMT_GBRP12 AV_PIX_FMT_GBRP12
|
||||
#define PIX_FMT_GBRP14 AV_PIX_FMT_GBRP14
|
||||
#define PIX_FMT_GBRP16 AV_PIX_FMT_GBRP16
|
||||
#endif
|
||||
|
||||
#endif /* AVUTIL_PIXFMT_H */
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
* [-1.0, 1.0]. Any values outside this range are beyond full volume level.
|
||||
*
|
||||
* @par
|
||||
* The data layout as used in av_samples_fill_arrays() and elsewhere in Libav
|
||||
* The data layout as used in av_samples_fill_arrays() and elsewhere in FFmpeg
|
||||
* (such as AVFrame in libavcodec) is as follows:
|
||||
*
|
||||
* For planar sample formats, each audio channel is in a separate data plane,
|
||||
|
@ -183,7 +183,9 @@ int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
|
|||
* @param nb_samples the number of samples in a single channel
|
||||
* @param sample_fmt the sample format
|
||||
* @param align buffer size alignment (0 = default, 1 = no alignment)
|
||||
* @return 0 on success or a negative error code on failure
|
||||
* @return >=0 on success or a negative error code on failure
|
||||
* @todo return minimum size in bytes required for the buffer in case
|
||||
* of success at the next bump
|
||||
*/
|
||||
int av_samples_fill_arrays(uint8_t **audio_data, int *linesize,
|
||||
const uint8_t *buf,
|
||||
|
@ -194,6 +196,7 @@ int av_samples_fill_arrays(uint8_t **audio_data, int *linesize,
|
|||
* Allocate a samples buffer for nb_samples samples, and fill data pointers and
|
||||
* linesize accordingly.
|
||||
* The allocated samples buffer can be freed by using av_freep(&audio_data[0])
|
||||
* Allocated data will be initialized to silence.
|
||||
*
|
||||
* @see enum AVSampleFormat
|
||||
* The documentation for AVSampleFormat describes the data layout.
|
||||
|
@ -203,7 +206,8 @@ int av_samples_fill_arrays(uint8_t **audio_data, int *linesize,
|
|||
* @param nb_channels number of audio channels
|
||||
* @param nb_samples number of samples per channel
|
||||
* @param align buffer size alignment (0 = default, 1 = no alignment)
|
||||
* @return 0 on success or a negative error code on failure
|
||||
* @return >=0 on success or a negative error code on failure
|
||||
* @todo return the size of the allocated buffer in case of success at the next bump
|
||||
* @see av_samples_fill_arrays()
|
||||
*/
|
||||
int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels,
|
||||
|
|
|
@ -23,6 +23,9 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "attributes.h"
|
||||
#include "version.h"
|
||||
|
||||
/**
|
||||
* @defgroup lavu_sha SHA
|
||||
* @ingroup lavu_crypto
|
||||
|
@ -33,6 +36,11 @@ extern const int av_sha_size;
|
|||
|
||||
struct AVSHA;
|
||||
|
||||
/**
|
||||
* Allocate an AVSHA context.
|
||||
*/
|
||||
struct AVSHA *av_sha_alloc(void);
|
||||
|
||||
/**
|
||||
* Initialize SHA-1 or SHA-2 hashing.
|
||||
*
|
||||
|
|
|
@ -45,16 +45,6 @@ typedef struct {
|
|||
unsigned fps; ///< frame per second; must be consistent with the rate field
|
||||
} AVTimecode;
|
||||
|
||||
/**
|
||||
* Adjust frame number for NTSC drop frame time code.
|
||||
*
|
||||
* @param framenum frame number to adjust
|
||||
* @return adjusted frame number
|
||||
* @warning adjustment is only valid in NTSC 29.97
|
||||
* @deprecated use av_timecode_adjust_ntsc_framenum2 instead
|
||||
*/
|
||||
attribute_deprecated int av_timecode_adjust_ntsc_framenum(int framenum);
|
||||
|
||||
/**
|
||||
* Adjust frame number for NTSC drop frame time code.
|
||||
*
|
||||
|
@ -73,7 +63,7 @@ int av_timecode_adjust_ntsc_framenum2(int framenum, int fps);
|
|||
* @return the SMPTE binary representation
|
||||
*
|
||||
* @note Frame number adjustment is automatically done in case of drop timecode,
|
||||
* you do NOT have to call av_timecode_adjust_ntsc_framenum().
|
||||
* you do NOT have to call av_timecode_adjust_ntsc_framenum2().
|
||||
* @note The frame number is relative to tc->start.
|
||||
* @note Color frame (CF), binary group flags (BGF) and biphase mark polarity
|
||||
* correction (PC) bits are set to zero.
|
||||
|
|
|
@ -21,7 +21,43 @@
|
|||
#ifndef AVUTIL_VERSION_H
|
||||
#define AVUTIL_VERSION_H
|
||||
|
||||
#include "avutil.h"
|
||||
/**
|
||||
* @defgroup preproc_misc Preprocessor String Macros
|
||||
*
|
||||
* String manipulation macros
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#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)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup version_utils Library Version Macros
|
||||
*
|
||||
* Useful to check and match library version in order to maintain
|
||||
* backward compatibility.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#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)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @file
|
||||
|
@ -38,9 +74,9 @@
|
|||
* @{
|
||||
*/
|
||||
|
||||
#define LIBAVUTIL_VERSION_MAJOR 51
|
||||
#define LIBAVUTIL_VERSION_MINOR 73
|
||||
#define LIBAVUTIL_VERSION_MICRO 101
|
||||
#define LIBAVUTIL_VERSION_MAJOR 52
|
||||
#define LIBAVUTIL_VERSION_MINOR 18
|
||||
#define LIBAVUTIL_VERSION_MICRO 100
|
||||
|
||||
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
|
||||
LIBAVUTIL_VERSION_MINOR, \
|
||||
|
@ -63,24 +99,40 @@
|
|||
* @{
|
||||
*/
|
||||
|
||||
#ifndef FF_API_OLD_EVAL_NAMES
|
||||
#define FF_API_OLD_EVAL_NAMES (LIBAVUTIL_VERSION_MAJOR < 52)
|
||||
#endif
|
||||
#ifndef FF_API_GET_BITS_PER_SAMPLE_FMT
|
||||
#define FF_API_GET_BITS_PER_SAMPLE_FMT (LIBAVUTIL_VERSION_MAJOR < 52)
|
||||
#define FF_API_GET_BITS_PER_SAMPLE_FMT (LIBAVUTIL_VERSION_MAJOR < 53)
|
||||
#endif
|
||||
#ifndef FF_API_FIND_OPT
|
||||
#define FF_API_FIND_OPT (LIBAVUTIL_VERSION_MAJOR < 52)
|
||||
#endif
|
||||
#ifndef FF_API_AV_FIFO_PEEK
|
||||
#define FF_API_AV_FIFO_PEEK (LIBAVUTIL_VERSION_MAJOR < 52)
|
||||
#define FF_API_FIND_OPT (LIBAVUTIL_VERSION_MAJOR < 53)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_AVOPTIONS
|
||||
#define FF_API_OLD_AVOPTIONS (LIBAVUTIL_VERSION_MAJOR < 52)
|
||||
#define FF_API_OLD_AVOPTIONS (LIBAVUTIL_VERSION_MAJOR < 53)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_TC_ADJUST_FRAMENUM
|
||||
#define FF_API_OLD_TC_ADJUST_FRAMENUM (LIBAVUTIL_VERSION_MAJOR < 52)
|
||||
#ifndef FF_API_PIX_FMT
|
||||
#define FF_API_PIX_FMT (LIBAVUTIL_VERSION_MAJOR < 53)
|
||||
#endif
|
||||
#ifndef FF_API_CONTEXT_SIZE
|
||||
#define FF_API_CONTEXT_SIZE (LIBAVUTIL_VERSION_MAJOR < 53)
|
||||
#endif
|
||||
#ifndef FF_API_PIX_FMT_DESC
|
||||
#define FF_API_PIX_FMT_DESC (LIBAVUTIL_VERSION_MAJOR < 53)
|
||||
#endif
|
||||
#ifndef FF_API_AV_REVERSE
|
||||
#define FF_API_AV_REVERSE (LIBAVUTIL_VERSION_MAJOR < 53)
|
||||
#endif
|
||||
#ifndef FF_API_AUDIOCONVERT
|
||||
#define FF_API_AUDIOCONVERT (LIBAVUTIL_VERSION_MAJOR < 53)
|
||||
#endif
|
||||
#ifndef FF_API_CPU_FLAG_MMX2
|
||||
#define FF_API_CPU_FLAG_MMX2 (LIBAVUTIL_VERSION_MAJOR < 53)
|
||||
#endif
|
||||
#ifndef FF_API_SAMPLES_UTILS_RETURN_ZERO
|
||||
#define FF_API_SAMPLES_UTILS_RETURN_ZERO (LIBAVUTIL_VERSION_MAJOR < 53)
|
||||
#endif
|
||||
#ifndef FF_API_LLS_PRIVATE
|
||||
#define FF_API_LLS_PRIVATE (LIBAVUTIL_VERSION_MAJOR < 53)
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
|
|
@ -23,27 +23,16 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* @brief
|
||||
* external postprocessing API
|
||||
* @ingroup lpp
|
||||
* external API header
|
||||
*/
|
||||
|
||||
#include "libavutil/avutil.h"
|
||||
/**
|
||||
* @defgroup lpp Libpostproc
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef LIBPOSTPROC_VERSION_MAJOR
|
||||
#define LIBPOSTPROC_VERSION_MAJOR 52
|
||||
#define LIBPOSTPROC_VERSION_MINOR 0
|
||||
#define LIBPOSTPROC_VERSION_MICRO 100
|
||||
#endif
|
||||
|
||||
#define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \
|
||||
LIBPOSTPROC_VERSION_MINOR, \
|
||||
LIBPOSTPROC_VERSION_MICRO)
|
||||
#define LIBPOSTPROC_VERSION AV_VERSION(LIBPOSTPROC_VERSION_MAJOR, \
|
||||
LIBPOSTPROC_VERSION_MINOR, \
|
||||
LIBPOSTPROC_VERSION_MICRO)
|
||||
#define LIBPOSTPROC_BUILD LIBPOSTPROC_VERSION_INT
|
||||
|
||||
#define LIBPOSTPROC_IDENT "postproc" AV_STRINGIFY(LIBPOSTPROC_VERSION)
|
||||
#include "libpostproc/version.h"
|
||||
|
||||
/**
|
||||
* Return the LIBPOSTPROC_VERSION_INT constant.
|
||||
|
@ -100,6 +89,7 @@ void pp_free_context(pp_context *ppContext);
|
|||
#define PP_CPU_CAPS_MMX2 0x20000000
|
||||
#define PP_CPU_CAPS_3DNOW 0x40000000
|
||||
#define PP_CPU_CAPS_ALTIVEC 0x10000000
|
||||
#define PP_CPU_CAPS_AUTO 0x00080000
|
||||
|
||||
#define PP_FORMAT 0x00000008
|
||||
#define PP_FORMAT_420 (0x00000011|PP_FORMAT)
|
||||
|
@ -109,4 +99,8 @@ void pp_free_context(pp_context *ppContext);
|
|||
|
||||
#define PP_PICT_TYPE_QP2 0x00000010 ///< MPEG2 style QScale
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* POSTPROC_POSTPROCESS_H */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2011-2012 Michael Niedermayer (michaelni@gmx.at)
|
||||
* Copyright (C) 2011-2013 Michael Niedermayer (michaelni@gmx.at)
|
||||
*
|
||||
* This file is part of libswresample
|
||||
*
|
||||
|
@ -18,24 +18,85 @@
|
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef SWRESAMPLE_SWRESAMPLE_H
|
||||
#define SWRESAMPLE_SWRESAMPLE_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lswr
|
||||
* libswresample public header
|
||||
*/
|
||||
|
||||
#ifndef SWR_H
|
||||
#define SWR_H
|
||||
/**
|
||||
* @defgroup lswr Libswresample
|
||||
* @{
|
||||
*
|
||||
* Libswresample (lswr) is a library that handles audio resampling, sample
|
||||
* format conversion and mixing.
|
||||
*
|
||||
* Interaction with lswr is done through SwrContext, which is
|
||||
* allocated with swr_alloc() or swr_alloc_set_opts(). It is opaque, so all parameters
|
||||
* must be set with the @ref avoptions API.
|
||||
*
|
||||
* For example the following code will setup conversion from planar float sample
|
||||
* format to interleaved signed 16-bit integer, downsampling from 48kHz to
|
||||
* 44.1kHz and downmixing from 5.1 channels to stereo (using the default mixing
|
||||
* matrix):
|
||||
* @code
|
||||
* SwrContext *swr = swr_alloc();
|
||||
* av_opt_set_int(swr, "in_channel_layout", AV_CH_LAYOUT_5POINT1, 0);
|
||||
* av_opt_set_int(swr, "out_channel_layout", AV_CH_LAYOUT_STEREO, 0);
|
||||
* av_opt_set_int(swr, "in_sample_rate", 48000, 0);
|
||||
* av_opt_set_int(swr, "out_sample_rate", 44100, 0);
|
||||
* av_opt_set_sample_fmt(swr, "in_sample_fmt", AV_SAMPLE_FMT_FLTP, 0);
|
||||
* av_opt_set_sample_fmt(swr, "out_sample_fmt", AV_SAMPLE_FMT_S16, 0);
|
||||
* @endcode
|
||||
*
|
||||
* Once all values have been set, it must be initialized with swr_init(). If
|
||||
* you need to change the conversion parameters, you can change the parameters
|
||||
* as described above, or by using swr_alloc_set_opts(), then call swr_init()
|
||||
* again.
|
||||
*
|
||||
* The conversion itself is done by repeatedly calling swr_convert().
|
||||
* Note that the samples may get buffered in swr if you provide insufficient
|
||||
* output space or if sample rate conversion is done, which requires "future"
|
||||
* samples. Samples that do not require future input can be retrieved at any
|
||||
* time by using swr_convert() (in_count can be set to 0).
|
||||
* At the end of conversion the resampling buffer can be flushed by calling
|
||||
* swr_convert() with NULL in and 0 in_count.
|
||||
*
|
||||
* The delay between input and output, can at any time be found by using
|
||||
* swr_get_delay().
|
||||
*
|
||||
* The following code demonstrates the conversion loop assuming the parameters
|
||||
* from above and caller-defined functions get_input() and handle_output():
|
||||
* @code
|
||||
* uint8_t **input;
|
||||
* int in_samples;
|
||||
*
|
||||
* while (get_input(&input, &in_samples)) {
|
||||
* uint8_t *output;
|
||||
* int out_samples = av_rescale_rnd(swr_get_delay(swr, 48000) +
|
||||
* in_samples, 44100, 48000, AV_ROUND_UP);
|
||||
* av_samples_alloc(&output, NULL, 2, out_samples,
|
||||
* AV_SAMPLE_FMT_S16, 0);
|
||||
* out_samples = swr_convert(swr, &output, out_samples,
|
||||
* input, in_samples);
|
||||
* handle_output(output, out_samples);
|
||||
* av_freep(&output);
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* When the conversion is finished, the conversion
|
||||
* context and everything associated with it must be freed with swr_free().
|
||||
* There will be no memory leak if the data is not completely flushed before
|
||||
* swr_free().
|
||||
*/
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdint.h>
|
||||
#include "libavutil/samplefmt.h"
|
||||
|
||||
#define LIBSWRESAMPLE_VERSION_MAJOR 0
|
||||
#define LIBSWRESAMPLE_VERSION_MINOR 15
|
||||
#define LIBSWRESAMPLE_VERSION_MICRO 100
|
||||
|
||||
#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
|
||||
LIBSWRESAMPLE_VERSION_MINOR, \
|
||||
LIBSWRESAMPLE_VERSION_MICRO)
|
||||
#include "libswresample/version.h"
|
||||
|
||||
#if LIBSWRESAMPLE_VERSION_MAJOR < 1
|
||||
#define SWR_CH_MAX 32 ///< Maximum number of channels
|
||||
|
@ -50,9 +111,25 @@ enum SwrDitherType {
|
|||
SWR_DITHER_RECTANGULAR,
|
||||
SWR_DITHER_TRIANGULAR,
|
||||
SWR_DITHER_TRIANGULAR_HIGHPASS,
|
||||
|
||||
SWR_DITHER_NS = 64, ///< not part of API/ABI
|
||||
SWR_DITHER_NS_LIPSHITZ,
|
||||
SWR_DITHER_NS_F_WEIGHTED,
|
||||
SWR_DITHER_NS_MODIFIED_E_WEIGHTED,
|
||||
SWR_DITHER_NS_IMPROVED_E_WEIGHTED,
|
||||
SWR_DITHER_NS_SHIBATA,
|
||||
SWR_DITHER_NS_LOW_SHIBATA,
|
||||
SWR_DITHER_NS_HIGH_SHIBATA,
|
||||
SWR_DITHER_NB, ///< not part of API/ABI
|
||||
};
|
||||
|
||||
/** Resampling Engines */
|
||||
enum SwrEngine {
|
||||
SWR_ENGINE_SWR, /**< SW Resampler */
|
||||
SWR_ENGINE_SOXR, /**< SoX Resampler */
|
||||
SWR_ENGINE_NB, ///< not part of API/ABI
|
||||
};
|
||||
|
||||
/** Resampling Filter Types */
|
||||
enum SwrFilterType {
|
||||
SWR_FILTER_TYPE_CUBIC, /**< Cubic */
|
||||
|
@ -141,7 +218,7 @@ int swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
|
|||
|
||||
/**
|
||||
* Convert the next timestamp from input to output
|
||||
* timestampe are in 1/(in_sample_rate * out_sample_rate) units.
|
||||
* timestamps are in 1/(in_sample_rate * out_sample_rate) units.
|
||||
*
|
||||
* @note There are 2 slightly differently behaving modes.
|
||||
* First is when automatic timestamp compensation is not used, (min_compensation >= FLT_MAX)
|
||||
|
@ -149,8 +226,8 @@ int swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
|
|||
* Second is when automatic timestamp compensation is used, (min_compensation < FLT_MAX)
|
||||
* in this case the output timestamps will match output sample numbers
|
||||
*
|
||||
* @param pts timstamp for the next input sample, INT64_MIN if unknown
|
||||
* @returns the output timestamp for the next output sample
|
||||
* @param pts timestamp for the next input sample, INT64_MIN if unknown
|
||||
* @return the output timestamp for the next output sample
|
||||
*/
|
||||
int64_t swr_next_pts(struct SwrContext *s, int64_t pts);
|
||||
|
||||
|
@ -196,6 +273,10 @@ int swr_inject_silence(struct SwrContext *s, int count);
|
|||
* Swresample can buffer data if more input has been provided than available
|
||||
* output space, also converting between sample rates needs a delay.
|
||||
* This function returns the sum of all such delays.
|
||||
* The exact delay is not necessarily an integer value in either input or
|
||||
* output sample rate. Especially when downsampling by a large value, the
|
||||
* output sample rate may be a poor choice to represent the delay, similarly
|
||||
* for upsampling and the input sample rate.
|
||||
*
|
||||
* @param s swr context
|
||||
* @param base timebase in which the returned delay will be
|
||||
|
@ -223,4 +304,8 @@ const char *swresample_configuration(void);
|
|||
*/
|
||||
const char *swresample_license(void);
|
||||
|
||||
#endif
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* SWRESAMPLE_SWRESAMPLE_H */
|
||||
|
|
|
@ -23,8 +23,13 @@
|
|||
|
||||
/**
|
||||
* @file
|
||||
* @brief
|
||||
* external api for the swscale stuff
|
||||
* @ingroup lsws
|
||||
* external API header
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup lsws Libswscale
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
@ -77,6 +82,7 @@ const char *swscale_license(void);
|
|||
#define SWS_DIRECT_BGR 0x8000
|
||||
#define SWS_ACCURATE_RND 0x40000
|
||||
#define SWS_BITEXACT 0x80000
|
||||
#define SWS_ERROR_DIFFUSION 0x800000
|
||||
|
||||
#if FF_API_SWS_CPU_CAPS
|
||||
/**
|
||||
|
@ -85,9 +91,7 @@ const char *swscale_license(void);
|
|||
*/
|
||||
#define SWS_CPU_CAPS_MMX 0x80000000
|
||||
#define SWS_CPU_CAPS_MMXEXT 0x20000000
|
||||
#if LIBSWSCALE_VERSION_MAJOR < 3
|
||||
#define SWS_CPU_CAPS_MMX2 0x20000000
|
||||
#endif
|
||||
#define SWS_CPU_CAPS_3DNOW 0x40000000
|
||||
#define SWS_CPU_CAPS_ALTIVEC 0x10000000
|
||||
#define SWS_CPU_CAPS_BFIN 0x01000000
|
||||
|
@ -115,13 +119,13 @@ const int *sws_getCoefficients(int colorspace);
|
|||
|
||||
// when used for filters they must have an odd number of elements
|
||||
// coeffs cannot be shared between vectors
|
||||
typedef struct {
|
||||
typedef struct SwsVector {
|
||||
double *coeff; ///< pointer to the list of coefficients
|
||||
int length; ///< number of coefficients in the vector
|
||||
} SwsVector;
|
||||
|
||||
// vectors can be shared
|
||||
typedef struct {
|
||||
typedef struct SwsFilter {
|
||||
SwsVector *lumH;
|
||||
SwsVector *lumV;
|
||||
SwsVector *chrH;
|
||||
|
@ -134,13 +138,13 @@ struct SwsContext;
|
|||
* Return a positive value if pix_fmt is a supported input format, 0
|
||||
* otherwise.
|
||||
*/
|
||||
int sws_isSupportedInput(enum PixelFormat pix_fmt);
|
||||
int sws_isSupportedInput(enum AVPixelFormat pix_fmt);
|
||||
|
||||
/**
|
||||
* Return a positive value if pix_fmt is a supported output format, 0
|
||||
* otherwise.
|
||||
*/
|
||||
int sws_isSupportedOutput(enum PixelFormat pix_fmt);
|
||||
int sws_isSupportedOutput(enum AVPixelFormat pix_fmt);
|
||||
|
||||
/**
|
||||
* Allocate an empty SwsContext. This must be filled and passed to
|
||||
|
@ -180,8 +184,8 @@ void sws_freeContext(struct SwsContext *swsContext);
|
|||
* written
|
||||
* @deprecated Use sws_getCachedContext() instead.
|
||||
*/
|
||||
struct SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
|
||||
int dstW, int dstH, enum PixelFormat dstFormat,
|
||||
struct SwsContext *sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat,
|
||||
int dstW, int dstH, enum AVPixelFormat dstFormat,
|
||||
int flags, SwsFilter *srcFilter,
|
||||
SwsFilter *dstFilter, const double *param);
|
||||
#endif
|
||||
|
@ -307,8 +311,8 @@ void sws_freeFilter(SwsFilter *filter);
|
|||
* are assumed to remain the same.
|
||||
*/
|
||||
struct SwsContext *sws_getCachedContext(struct SwsContext *context,
|
||||
int srcW, int srcH, enum PixelFormat srcFormat,
|
||||
int dstW, int dstH, enum PixelFormat dstFormat,
|
||||
int srcW, int srcH, enum AVPixelFormat srcFormat,
|
||||
int dstW, int dstH, enum AVPixelFormat dstFormat,
|
||||
int flags, SwsFilter *srcFilter,
|
||||
SwsFilter *dstFilter, const double *param);
|
||||
|
||||
|
@ -344,4 +348,8 @@ void sws_convertPalette8ToPacked24(const uint8_t *src, uint8_t *dst, int num_pix
|
|||
*/
|
||||
const AVClass *sws_get_class(void);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* SWSCALE_SWSCALE_H */
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
#include "libavutil/avutil.h"
|
||||
|
||||
#define LIBSWSCALE_VERSION_MAJOR 2
|
||||
#define LIBSWSCALE_VERSION_MINOR 1
|
||||
#define LIBSWSCALE_VERSION_MICRO 101
|
||||
#define LIBSWSCALE_VERSION_MINOR 2
|
||||
#define LIBSWSCALE_VERSION_MICRO 100
|
||||
|
||||
#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
|
||||
LIBSWSCALE_VERSION_MINOR, \
|
||||
|
|
|
@ -90,6 +90,11 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
|||
int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key);
|
||||
|
||||
int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key);
|
||||
int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits,
|
||||
AES_KEY *key);
|
||||
|
||||
void AES_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const AES_KEY *key);
|
||||
void AES_decrypt(const unsigned char *in, unsigned char *out,
|
||||
|
|
|
@ -235,7 +235,7 @@ typedef struct asn1_object_st
|
|||
*/
|
||||
#define ASN1_STRING_FLAG_MSTRING 0x040
|
||||
/* This is the base type that holds just about everything :-) */
|
||||
typedef struct asn1_string_st
|
||||
struct asn1_string_st
|
||||
{
|
||||
int length;
|
||||
int type;
|
||||
|
@ -245,7 +245,7 @@ typedef struct asn1_string_st
|
|||
* input data has a non-zero 'unused bits' value, it will be
|
||||
* handled correctly */
|
||||
long flags;
|
||||
} ASN1_STRING;
|
||||
};
|
||||
|
||||
/* ASN1_ENCODING structure: this is used to save the received
|
||||
* encoding of an ASN1 type. This is useful to get round
|
||||
|
@ -293,7 +293,6 @@ DECLARE_STACK_OF(ASN1_STRING_TABLE)
|
|||
* see asn1t.h
|
||||
*/
|
||||
typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE;
|
||||
typedef struct ASN1_ITEM_st ASN1_ITEM;
|
||||
typedef struct ASN1_TLC_st ASN1_TLC;
|
||||
/* This is just an opaque pointer */
|
||||
typedef struct ASN1_VALUE_st ASN1_VALUE;
|
||||
|
@ -1194,6 +1193,7 @@ void ERR_load_ASN1_strings(void);
|
|||
#define ASN1_F_ASN1_ITEM_I2D_FP 193
|
||||
#define ASN1_F_ASN1_ITEM_PACK 198
|
||||
#define ASN1_F_ASN1_ITEM_SIGN 195
|
||||
#define ASN1_F_ASN1_ITEM_SIGN_CTX 220
|
||||
#define ASN1_F_ASN1_ITEM_UNPACK 199
|
||||
#define ASN1_F_ASN1_ITEM_VERIFY 197
|
||||
#define ASN1_F_ASN1_MBSTRING_NCOPY 122
|
||||
|
@ -1266,6 +1266,7 @@ void ERR_load_ASN1_strings(void);
|
|||
#define ASN1_F_PKCS5_PBE2_SET_IV 167
|
||||
#define ASN1_F_PKCS5_PBE_SET 202
|
||||
#define ASN1_F_PKCS5_PBE_SET0_ALGOR 215
|
||||
#define ASN1_F_PKCS5_PBKDF2_SET 219
|
||||
#define ASN1_F_SMIME_READ_ASN1 212
|
||||
#define ASN1_F_SMIME_TEXT 213
|
||||
#define ASN1_F_X509_CINF_NEW 168
|
||||
|
@ -1291,6 +1292,7 @@ void ERR_load_ASN1_strings(void);
|
|||
#define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 106
|
||||
#define ASN1_R_BUFFER_TOO_SMALL 107
|
||||
#define ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 108
|
||||
#define ASN1_R_CONTEXT_NOT_INITIALISED 217
|
||||
#define ASN1_R_DATA_IS_WRONG 109
|
||||
#define ASN1_R_DECODE_ERROR 110
|
||||
#define ASN1_R_DECODING_ERROR 111
|
||||
|
|
|
@ -68,6 +68,14 @@
|
|||
|
||||
#include <openssl/crypto.h>
|
||||
|
||||
#ifndef OPENSSL_NO_SCTP
|
||||
# ifndef OPENSSL_SYS_VMS
|
||||
# include <stdint.h>
|
||||
# else
|
||||
# include <inttypes.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -95,6 +103,9 @@ extern "C" {
|
|||
#define BIO_TYPE_BIO (19|0x0400) /* (half a) BIO pair */
|
||||
#define BIO_TYPE_LINEBUFFER (20|0x0200) /* filter */
|
||||
#define BIO_TYPE_DGRAM (21|0x0400|0x0100)
|
||||
#ifndef OPENSSL_NO_SCTP
|
||||
#define BIO_TYPE_DGRAM_SCTP (24|0x0400|0x0100)
|
||||
#endif
|
||||
#define BIO_TYPE_ASN1 (22|0x0200) /* filter */
|
||||
#define BIO_TYPE_COMP (23|0x0200) /* filter */
|
||||
|
||||
|
@ -146,6 +157,7 @@ extern "C" {
|
|||
/* #endif */
|
||||
|
||||
#define BIO_CTRL_DGRAM_QUERY_MTU 40 /* as kernel for current MTU */
|
||||
#define BIO_CTRL_DGRAM_GET_FALLBACK_MTU 47
|
||||
#define BIO_CTRL_DGRAM_GET_MTU 41 /* get cached value for MTU */
|
||||
#define BIO_CTRL_DGRAM_SET_MTU 42 /* set cached value for
|
||||
* MTU. want to use this
|
||||
|
@ -161,7 +173,22 @@ extern "C" {
|
|||
#define BIO_CTRL_DGRAM_SET_PEER 44 /* Destination for the data */
|
||||
|
||||
#define BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT 45 /* Next DTLS handshake timeout to
|
||||
* adjust socket timeouts */
|
||||
* adjust socket timeouts */
|
||||
|
||||
#ifndef OPENSSL_NO_SCTP
|
||||
/* SCTP stuff */
|
||||
#define BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE 50
|
||||
#define BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY 51
|
||||
#define BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY 52
|
||||
#define BIO_CTRL_DGRAM_SCTP_AUTH_CCS_RCVD 53
|
||||
#define BIO_CTRL_DGRAM_SCTP_GET_SNDINFO 60
|
||||
#define BIO_CTRL_DGRAM_SCTP_SET_SNDINFO 61
|
||||
#define BIO_CTRL_DGRAM_SCTP_GET_RCVINFO 62
|
||||
#define BIO_CTRL_DGRAM_SCTP_SET_RCVINFO 63
|
||||
#define BIO_CTRL_DGRAM_SCTP_GET_PRINFO 64
|
||||
#define BIO_CTRL_DGRAM_SCTP_SET_PRINFO 65
|
||||
#define BIO_CTRL_DGRAM_SCTP_SAVE_SHUTDOWN 70
|
||||
#endif
|
||||
|
||||
/* modifiers */
|
||||
#define BIO_FP_READ 0x02
|
||||
|
@ -306,6 +333,15 @@ DECLARE_STACK_OF(BIO)
|
|||
|
||||
typedef struct bio_f_buffer_ctx_struct
|
||||
{
|
||||
/* Buffers are setup like this:
|
||||
*
|
||||
* <---------------------- size ----------------------->
|
||||
* +---------------------------------------------------+
|
||||
* | consumed | remaining | free space |
|
||||
* +---------------------------------------------------+
|
||||
* <-- off --><------- len ------->
|
||||
*/
|
||||
|
||||
/* BIO *bio; */ /* this is now in the BIO struct */
|
||||
int ibuf_size; /* how big is the input buffer */
|
||||
int obuf_size; /* how big is the output buffer */
|
||||
|
@ -322,6 +358,34 @@ typedef struct bio_f_buffer_ctx_struct
|
|||
/* Prefix and suffix callback in ASN1 BIO */
|
||||
typedef int asn1_ps_func(BIO *b, unsigned char **pbuf, int *plen, void *parg);
|
||||
|
||||
#ifndef OPENSSL_NO_SCTP
|
||||
/* SCTP parameter structs */
|
||||
struct bio_dgram_sctp_sndinfo
|
||||
{
|
||||
uint16_t snd_sid;
|
||||
uint16_t snd_flags;
|
||||
uint32_t snd_ppid;
|
||||
uint32_t snd_context;
|
||||
};
|
||||
|
||||
struct bio_dgram_sctp_rcvinfo
|
||||
{
|
||||
uint16_t rcv_sid;
|
||||
uint16_t rcv_ssn;
|
||||
uint16_t rcv_flags;
|
||||
uint32_t rcv_ppid;
|
||||
uint32_t rcv_tsn;
|
||||
uint32_t rcv_cumtsn;
|
||||
uint32_t rcv_context;
|
||||
};
|
||||
|
||||
struct bio_dgram_sctp_prinfo
|
||||
{
|
||||
uint16_t pr_policy;
|
||||
uint32_t pr_value;
|
||||
};
|
||||
#endif
|
||||
|
||||
/* connect BIO stuff */
|
||||
#define BIO_CONN_S_BEFORE 1
|
||||
#define BIO_CONN_S_GET_IP 2
|
||||
|
@ -619,6 +683,9 @@ BIO_METHOD *BIO_f_linebuffer(void);
|
|||
BIO_METHOD *BIO_f_nbio_test(void);
|
||||
#ifndef OPENSSL_NO_DGRAM
|
||||
BIO_METHOD *BIO_s_datagram(void);
|
||||
#ifndef OPENSSL_NO_SCTP
|
||||
BIO_METHOD *BIO_s_datagram_sctp(void);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* BIO_METHOD *BIO_f_ber(void); */
|
||||
|
@ -661,6 +728,15 @@ int BIO_set_tcp_ndelay(int sock,int turn_on);
|
|||
|
||||
BIO *BIO_new_socket(int sock, int close_flag);
|
||||
BIO *BIO_new_dgram(int fd, int close_flag);
|
||||
#ifndef OPENSSL_NO_SCTP
|
||||
BIO *BIO_new_dgram_sctp(int fd, int close_flag);
|
||||
int BIO_dgram_is_sctp(BIO *bio);
|
||||
int BIO_dgram_sctp_notification_cb(BIO *b,
|
||||
void (*handle_notifications)(BIO *bio, void *context, void *buf),
|
||||
void *context);
|
||||
int BIO_dgram_sctp_wait_for_dry(BIO *b);
|
||||
int BIO_dgram_sctp_msg_waiting(BIO *b);
|
||||
#endif
|
||||
BIO *BIO_new_fd(int fd, int close_flag);
|
||||
BIO *BIO_new_connect(char *host_port);
|
||||
BIO *BIO_new_accept(char *host_port);
|
||||
|
@ -725,6 +801,7 @@ void ERR_load_BIO_strings(void);
|
|||
#define BIO_F_BUFFER_CTRL 114
|
||||
#define BIO_F_CONN_CTRL 127
|
||||
#define BIO_F_CONN_STATE 115
|
||||
#define BIO_F_DGRAM_SCTP_READ 132
|
||||
#define BIO_F_FILE_CTRL 116
|
||||
#define BIO_F_FILE_READ 130
|
||||
#define BIO_F_LINEBUFFER_CTRL 129
|
||||
|
|
|
@ -104,7 +104,9 @@ typedef struct bf_key_st
|
|||
BF_LONG S[4*256];
|
||||
} BF_KEY;
|
||||
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
void private_BF_set_key(BF_KEY *key, int len, const unsigned char *data);
|
||||
#endif
|
||||
void BF_set_key(BF_KEY *key, int len, const unsigned char *data);
|
||||
|
||||
void BF_encrypt(BF_LONG *data,const BF_KEY *key);
|
||||
|
|
|
@ -558,6 +558,17 @@ int BN_is_prime_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx, BN_GENCB *cb);
|
|||
int BN_is_prime_fasttest_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx,
|
||||
int do_trial_division, BN_GENCB *cb);
|
||||
|
||||
int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx);
|
||||
|
||||
int BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
|
||||
const BIGNUM *Xp, const BIGNUM *Xp1, const BIGNUM *Xp2,
|
||||
const BIGNUM *e, BN_CTX *ctx, BN_GENCB *cb);
|
||||
int BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
|
||||
BIGNUM *Xp1, BIGNUM *Xp2,
|
||||
const BIGNUM *Xp,
|
||||
const BIGNUM *e, BN_CTX *ctx,
|
||||
BN_GENCB *cb);
|
||||
|
||||
BN_MONT_CTX *BN_MONT_CTX_new(void );
|
||||
void BN_MONT_CTX_init(BN_MONT_CTX *ctx);
|
||||
int BN_mod_mul_montgomery(BIGNUM *r,const BIGNUM *a,const BIGNUM *b,
|
||||
|
@ -612,6 +623,8 @@ int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
|||
int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,
|
||||
BN_RECP_CTX *recp, BN_CTX *ctx);
|
||||
|
||||
#ifndef OPENSSL_NO_EC2M
|
||||
|
||||
/* Functions for arithmetic over binary polynomials represented by BIGNUMs.
|
||||
*
|
||||
* The BIGNUM::neg property of BIGNUMs representing binary polynomials is
|
||||
|
@ -663,6 +676,8 @@ int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a,
|
|||
int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max);
|
||||
int BN_GF2m_arr2poly(const int p[], BIGNUM *a);
|
||||
|
||||
#endif
|
||||
|
||||
/* faster mod functions for the 'NIST primes'
|
||||
* 0 <= a < p^2 */
|
||||
int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
|
||||
|
|
|
@ -88,6 +88,10 @@ struct camellia_key_st
|
|||
};
|
||||
typedef struct camellia_key_st CAMELLIA_KEY;
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
int private_Camellia_set_key(const unsigned char *userKey, const int bits,
|
||||
CAMELLIA_KEY *key);
|
||||
#endif
|
||||
int Camellia_set_key(const unsigned char *userKey, const int bits,
|
||||
CAMELLIA_KEY *key);
|
||||
|
||||
|
|
|
@ -83,7 +83,9 @@ typedef struct cast_key_st
|
|||
int short_key; /* Use reduced rounds for short key */
|
||||
} CAST_KEY;
|
||||
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
void private_CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);
|
||||
#endif
|
||||
void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);
|
||||
void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out, const CAST_KEY *key,
|
||||
int enc);
|
||||
|
|
|
@ -111,6 +111,7 @@ DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
|
|||
#define CMS_PARTIAL 0x4000
|
||||
#define CMS_REUSE_DIGEST 0x8000
|
||||
#define CMS_USE_KEYID 0x10000
|
||||
#define CMS_DEBUG_DECRYPT 0x20000
|
||||
|
||||
const ASN1_OBJECT *CMS_get0_type(CMS_ContentInfo *cms);
|
||||
|
||||
|
@ -184,6 +185,8 @@ int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert);
|
|||
int CMS_decrypt_set1_key(CMS_ContentInfo *cms,
|
||||
unsigned char *key, size_t keylen,
|
||||
unsigned char *id, size_t idlen);
|
||||
int CMS_decrypt_set1_password(CMS_ContentInfo *cms,
|
||||
unsigned char *pass, ossl_ssize_t passlen);
|
||||
|
||||
STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms);
|
||||
int CMS_RecipientInfo_type(CMS_RecipientInfo *ri);
|
||||
|
@ -219,6 +222,16 @@ int CMS_RecipientInfo_set0_key(CMS_RecipientInfo *ri,
|
|||
int CMS_RecipientInfo_kekri_id_cmp(CMS_RecipientInfo *ri,
|
||||
const unsigned char *id, size_t idlen);
|
||||
|
||||
int CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri,
|
||||
unsigned char *pass,
|
||||
ossl_ssize_t passlen);
|
||||
|
||||
CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms,
|
||||
int iter, int wrap_nid, int pbe_nid,
|
||||
unsigned char *pass,
|
||||
ossl_ssize_t passlen,
|
||||
const EVP_CIPHER *kekciph);
|
||||
|
||||
int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
|
||||
|
||||
int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
|
||||
|
@ -330,6 +343,7 @@ void ERR_load_CMS_strings(void);
|
|||
#define CMS_F_CHECK_CONTENT 99
|
||||
#define CMS_F_CMS_ADD0_CERT 164
|
||||
#define CMS_F_CMS_ADD0_RECIPIENT_KEY 100
|
||||
#define CMS_F_CMS_ADD0_RECIPIENT_PASSWORD 165
|
||||
#define CMS_F_CMS_ADD1_RECEIPTREQUEST 158
|
||||
#define CMS_F_CMS_ADD1_RECIPIENT_CERT 101
|
||||
#define CMS_F_CMS_ADD1_SIGNER 102
|
||||
|
@ -344,6 +358,7 @@ void ERR_load_CMS_strings(void);
|
|||
#define CMS_F_CMS_DATAINIT 111
|
||||
#define CMS_F_CMS_DECRYPT 112
|
||||
#define CMS_F_CMS_DECRYPT_SET1_KEY 113
|
||||
#define CMS_F_CMS_DECRYPT_SET1_PASSWORD 166
|
||||
#define CMS_F_CMS_DECRYPT_SET1_PKEY 114
|
||||
#define CMS_F_CMS_DIGESTALGORITHM_FIND_CTX 115
|
||||
#define CMS_F_CMS_DIGESTALGORITHM_INIT_BIO 116
|
||||
|
@ -378,7 +393,9 @@ void ERR_load_CMS_strings(void);
|
|||
#define CMS_F_CMS_RECIPIENTINFO_KTRI_ENCRYPT 141
|
||||
#define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_ALGS 142
|
||||
#define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_SIGNER_ID 143
|
||||
#define CMS_F_CMS_RECIPIENTINFO_PWRI_CRYPT 167
|
||||
#define CMS_F_CMS_RECIPIENTINFO_SET0_KEY 144
|
||||
#define CMS_F_CMS_RECIPIENTINFO_SET0_PASSWORD 168
|
||||
#define CMS_F_CMS_RECIPIENTINFO_SET0_PKEY 145
|
||||
#define CMS_F_CMS_SET1_SIGNERIDENTIFIER 146
|
||||
#define CMS_F_CMS_SET_DETACHED 147
|
||||
|
@ -419,6 +436,7 @@ void ERR_load_CMS_strings(void);
|
|||
#define CMS_R_ERROR_SETTING_KEY 115
|
||||
#define CMS_R_ERROR_SETTING_RECIPIENTINFO 116
|
||||
#define CMS_R_INVALID_ENCRYPTED_KEY_LENGTH 117
|
||||
#define CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER 176
|
||||
#define CMS_R_INVALID_KEY_LENGTH 118
|
||||
#define CMS_R_MD_BIO_INIT_ERROR 119
|
||||
#define CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH 120
|
||||
|
@ -431,6 +449,7 @@ void ERR_load_CMS_strings(void);
|
|||
#define CMS_R_NOT_ENCRYPTED_DATA 122
|
||||
#define CMS_R_NOT_KEK 123
|
||||
#define CMS_R_NOT_KEY_TRANSPORT 124
|
||||
#define CMS_R_NOT_PWRI 177
|
||||
#define CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 125
|
||||
#define CMS_R_NO_CIPHER 126
|
||||
#define CMS_R_NO_CONTENT 127
|
||||
|
@ -443,6 +462,7 @@ void ERR_load_CMS_strings(void);
|
|||
#define CMS_R_NO_MATCHING_RECIPIENT 132
|
||||
#define CMS_R_NO_MATCHING_SIGNATURE 166
|
||||
#define CMS_R_NO_MSGSIGDIGEST 167
|
||||
#define CMS_R_NO_PASSWORD 178
|
||||
#define CMS_R_NO_PRIVATE_KEY 133
|
||||
#define CMS_R_NO_PUBLIC_KEY 134
|
||||
#define CMS_R_NO_RECEIPT_REQUEST 168
|
||||
|
@ -466,10 +486,12 @@ void ERR_load_CMS_strings(void);
|
|||
#define CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM 151
|
||||
#define CMS_R_UNSUPPORTED_CONTENT_TYPE 152
|
||||
#define CMS_R_UNSUPPORTED_KEK_ALGORITHM 153
|
||||
#define CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM 179
|
||||
#define CMS_R_UNSUPPORTED_RECIPIENT_TYPE 154
|
||||
#define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE 155
|
||||
#define CMS_R_UNSUPPORTED_TYPE 156
|
||||
#define CMS_R_UNWRAP_ERROR 157
|
||||
#define CMS_R_UNWRAP_FAILURE 180
|
||||
#define CMS_R_VERIFICATION_FAILURE 158
|
||||
#define CMS_R_WRAP_ERROR 159
|
||||
|
||||
|
|
|
@ -547,6 +547,33 @@ unsigned long *OPENSSL_ia32cap_loc(void);
|
|||
#define OPENSSL_ia32cap (*(OPENSSL_ia32cap_loc()))
|
||||
int OPENSSL_isservice(void);
|
||||
|
||||
int FIPS_mode(void);
|
||||
int FIPS_mode_set(int r);
|
||||
|
||||
void OPENSSL_init(void);
|
||||
|
||||
#define fips_md_init(alg) fips_md_init_ctx(alg, alg)
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
#define fips_md_init_ctx(alg, cx) \
|
||||
int alg##_Init(cx##_CTX *c) \
|
||||
{ \
|
||||
if (FIPS_mode()) OpenSSLDie(__FILE__, __LINE__, \
|
||||
"Low level API call to digest " #alg " forbidden in FIPS mode!"); \
|
||||
return private_##alg##_Init(c); \
|
||||
} \
|
||||
int private_##alg##_Init(cx##_CTX *c)
|
||||
|
||||
#define fips_cipher_abort(alg) \
|
||||
if (FIPS_mode()) OpenSSLDie(__FILE__, __LINE__, \
|
||||
"Low level API call to cipher " #alg " forbidden in FIPS mode!")
|
||||
|
||||
#else
|
||||
#define fips_md_init_ctx(alg, cx) \
|
||||
int alg##_Init(cx##_CTX *c)
|
||||
#define fips_cipher_abort(alg) while(0)
|
||||
#endif
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
|
@ -562,11 +589,13 @@ void ERR_load_CRYPTO_strings(void);
|
|||
#define CRYPTO_F_CRYPTO_SET_EX_DATA 102
|
||||
#define CRYPTO_F_DEF_ADD_INDEX 104
|
||||
#define CRYPTO_F_DEF_GET_CLASS 105
|
||||
#define CRYPTO_F_FIPS_MODE_SET 109
|
||||
#define CRYPTO_F_INT_DUP_EX_DATA 106
|
||||
#define CRYPTO_F_INT_FREE_EX_DATA 107
|
||||
#define CRYPTO_F_INT_NEW_EX_DATA 108
|
||||
|
||||
/* Reason codes. */
|
||||
#define CRYPTO_R_FIPS_MODE_NOT_SUPPORTED 101
|
||||
#define CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK 100
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -224,6 +224,9 @@ int DES_set_key(const_DES_cblock *key,DES_key_schedule *schedule);
|
|||
int DES_key_sched(const_DES_cblock *key,DES_key_schedule *schedule);
|
||||
int DES_set_key_checked(const_DES_cblock *key,DES_key_schedule *schedule);
|
||||
void DES_set_key_unchecked(const_DES_cblock *key,DES_key_schedule *schedule);
|
||||
#ifdef OPENSSL_FIPS
|
||||
void private_DES_set_key_unchecked(const_DES_cblock *key,DES_key_schedule *schedule);
|
||||
#endif
|
||||
void DES_string_to_key(const char *str,DES_cblock *key);
|
||||
void DES_string_to_2keys(const char *str,DES_cblock *key1,DES_cblock *key2);
|
||||
void DES_cfb64_encrypt(const unsigned char *in,unsigned char *out,long length,
|
||||
|
|
|
@ -86,6 +86,21 @@
|
|||
* be used for all exponents.
|
||||
*/
|
||||
|
||||
/* If this flag is set the DH method is FIPS compliant and can be used
|
||||
* in FIPS mode. This is set in the validated module method. If an
|
||||
* application sets this flag in its own methods it is its reposibility
|
||||
* to ensure the result is compliant.
|
||||
*/
|
||||
|
||||
#define DH_FLAG_FIPS_METHOD 0x0400
|
||||
|
||||
/* If this flag is set the operations normally disabled in FIPS mode are
|
||||
* permitted it is then the applications responsibility to ensure that the
|
||||
* usage is compliant.
|
||||
*/
|
||||
|
||||
#define DH_FLAG_NON_FIPS_ALLOW 0x0400
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -230,6 +245,9 @@ void ERR_load_DH_strings(void);
|
|||
#define DH_F_COMPUTE_KEY 102
|
||||
#define DH_F_DHPARAMS_PRINT_FP 101
|
||||
#define DH_F_DH_BUILTIN_GENPARAMS 106
|
||||
#define DH_F_DH_COMPUTE_KEY 114
|
||||
#define DH_F_DH_GENERATE_KEY 115
|
||||
#define DH_F_DH_GENERATE_PARAMETERS_EX 116
|
||||
#define DH_F_DH_NEW_METHOD 105
|
||||
#define DH_F_DH_PARAM_DECODE 107
|
||||
#define DH_F_DH_PRIV_DECODE 110
|
||||
|
@ -249,7 +267,9 @@ void ERR_load_DH_strings(void);
|
|||
#define DH_R_DECODE_ERROR 104
|
||||
#define DH_R_INVALID_PUBKEY 102
|
||||
#define DH_R_KEYS_NOT_SET 108
|
||||
#define DH_R_KEY_SIZE_TOO_SMALL 110
|
||||
#define DH_R_MODULUS_TOO_LARGE 103
|
||||
#define DH_R_NON_FIPS_METHOD 111
|
||||
#define DH_R_NO_PARAMETERS_SET 107
|
||||
#define DH_R_NO_PRIVATE_VALUE 100
|
||||
#define DH_R_PARAMETER_ENCODING_ERROR 105
|
||||
|
|
|
@ -97,6 +97,21 @@
|
|||
* be used for all exponents.
|
||||
*/
|
||||
|
||||
/* If this flag is set the DSA method is FIPS compliant and can be used
|
||||
* in FIPS mode. This is set in the validated module method. If an
|
||||
* application sets this flag in its own methods it is its reposibility
|
||||
* to ensure the result is compliant.
|
||||
*/
|
||||
|
||||
#define DSA_FLAG_FIPS_METHOD 0x0400
|
||||
|
||||
/* If this flag is set the operations normally disabled in FIPS mode are
|
||||
* permitted it is then the applications responsibility to ensure that the
|
||||
* usage is compliant.
|
||||
*/
|
||||
|
||||
#define DSA_FLAG_NON_FIPS_ALLOW 0x0400
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -272,6 +287,8 @@ void ERR_load_DSA_strings(void);
|
|||
#define DSA_F_DSAPARAMS_PRINT_FP 101
|
||||
#define DSA_F_DSA_DO_SIGN 112
|
||||
#define DSA_F_DSA_DO_VERIFY 113
|
||||
#define DSA_F_DSA_GENERATE_KEY 124
|
||||
#define DSA_F_DSA_GENERATE_PARAMETERS_EX 123
|
||||
#define DSA_F_DSA_NEW_METHOD 103
|
||||
#define DSA_F_DSA_PARAM_DECODE 119
|
||||
#define DSA_F_DSA_PRINT_FP 105
|
||||
|
@ -282,6 +299,7 @@ void ERR_load_DSA_strings(void);
|
|||
#define DSA_F_DSA_SIGN 106
|
||||
#define DSA_F_DSA_SIGN_SETUP 107
|
||||
#define DSA_F_DSA_SIG_NEW 109
|
||||
#define DSA_F_DSA_SIG_PRINT 125
|
||||
#define DSA_F_DSA_VERIFY 108
|
||||
#define DSA_F_I2D_DSA_SIG 111
|
||||
#define DSA_F_OLD_DSA_PRIV_DECODE 122
|
||||
|
@ -298,6 +316,8 @@ void ERR_load_DSA_strings(void);
|
|||
#define DSA_R_INVALID_DIGEST_TYPE 106
|
||||
#define DSA_R_MISSING_PARAMETERS 101
|
||||
#define DSA_R_MODULUS_TOO_LARGE 103
|
||||
#define DSA_R_NEED_NEW_SETUP_VALUES 110
|
||||
#define DSA_R_NON_FIPS_DSA_METHOD 111
|
||||
#define DSA_R_NO_PARAMETERS_SET 107
|
||||
#define DSA_R_PARAMETER_ENCODING_ERROR 105
|
||||
|
||||
|
|
|
@ -105,6 +105,11 @@ extern "C" {
|
|||
#define DTLS1_AL_HEADER_LENGTH 2
|
||||
#endif
|
||||
|
||||
#ifndef OPENSSL_NO_SSL_INTERN
|
||||
|
||||
#ifndef OPENSSL_NO_SCTP
|
||||
#define DTLS1_SCTP_AUTH_LABEL "EXPORTER_DTLS_OVER_SCTP"
|
||||
#endif
|
||||
|
||||
typedef struct dtls1_bitmap_st
|
||||
{
|
||||
|
@ -227,7 +232,7 @@ typedef struct dtls1_state_st
|
|||
|
||||
struct dtls1_timeout_st timeout;
|
||||
|
||||
/* Indicates when the last handshake msg sent will timeout */
|
||||
/* Indicates when the last handshake msg or heartbeat sent will timeout */
|
||||
struct timeval next_timeout;
|
||||
|
||||
/* Timeout duration */
|
||||
|
@ -243,6 +248,13 @@ typedef struct dtls1_state_st
|
|||
unsigned int retransmitting;
|
||||
unsigned int change_cipher_spec_ok;
|
||||
|
||||
#ifndef OPENSSL_NO_SCTP
|
||||
/* used when SSL_ST_XX_FLUSH is entered */
|
||||
int next_state;
|
||||
|
||||
int shutdown_received;
|
||||
#endif
|
||||
|
||||
} DTLS1_STATE;
|
||||
|
||||
typedef struct dtls1_record_data_st
|
||||
|
@ -251,8 +263,12 @@ typedef struct dtls1_record_data_st
|
|||
unsigned int packet_length;
|
||||
SSL3_BUFFER rbuf;
|
||||
SSL3_RECORD rrec;
|
||||
#ifndef OPENSSL_NO_SCTP
|
||||
struct bio_dgram_sctp_rcvinfo recordinfo;
|
||||
#endif
|
||||
} DTLS1_RECORD_DATA;
|
||||
|
||||
#endif
|
||||
|
||||
/* Timeout multipliers (timeout slice is defined in apps/timeouts.h */
|
||||
#define DTLS1_TMO_READ_COUNT 2
|
||||
|
|
|
@ -193,8 +193,14 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
/* --------------------------------- VOS ----------------------------------- */
|
||||
#ifdef OPENSSL_SYSNAME_VOS
|
||||
#if defined(__VOS__) || defined(OPENSSL_SYSNAME_VOS)
|
||||
# define OPENSSL_SYS_VOS
|
||||
#ifdef __HPPA__
|
||||
# define OPENSSL_SYS_VOS_HPPA
|
||||
#endif
|
||||
#ifdef __IA32__
|
||||
# define OPENSSL_SYS_VOS_IA32
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* ------------------------------- VxWorks --------------------------------- */
|
||||
|
@ -283,6 +289,26 @@ extern "C" {
|
|||
# define OPENSSL_GLOBAL_REF(name) _shadow_##name
|
||||
#endif
|
||||
|
||||
#if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && macintosh==1 && !defined(MAC_OS_GUSI_SOURCE)
|
||||
# define ossl_ssize_t long
|
||||
#endif
|
||||
|
||||
#ifdef OPENSSL_SYS_MSDOS
|
||||
# define ossl_ssize_t long
|
||||
#endif
|
||||
|
||||
#if defined(NeXT) || defined(OPENSSL_SYS_NEWS4) || defined(OPENSSL_SYS_SUNOS)
|
||||
# define ssize_t int
|
||||
#endif
|
||||
|
||||
#if defined(__ultrix) && !defined(ssize_t)
|
||||
# define ossl_ssize_t int
|
||||
#endif
|
||||
|
||||
#ifndef ossl_ssize_t
|
||||
# define ossl_ssize_t ssize_t
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -151,7 +151,24 @@ const EC_METHOD *EC_GFp_mont_method(void);
|
|||
*/
|
||||
const EC_METHOD *EC_GFp_nist_method(void);
|
||||
|
||||
#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
|
||||
/** Returns 64-bit optimized methods for nistp224
|
||||
* \return EC_METHOD object
|
||||
*/
|
||||
const EC_METHOD *EC_GFp_nistp224_method(void);
|
||||
|
||||
/** Returns 64-bit optimized methods for nistp256
|
||||
* \return EC_METHOD object
|
||||
*/
|
||||
const EC_METHOD *EC_GFp_nistp256_method(void);
|
||||
|
||||
/** Returns 64-bit optimized methods for nistp521
|
||||
* \return EC_METHOD object
|
||||
*/
|
||||
const EC_METHOD *EC_GFp_nistp521_method(void);
|
||||
#endif
|
||||
|
||||
#ifndef OPENSSL_NO_EC2M
|
||||
/********************************************************************/
|
||||
/* EC_METHOD for curves over GF(2^m) */
|
||||
/********************************************************************/
|
||||
|
@ -161,6 +178,8 @@ const EC_METHOD *EC_GFp_nist_method(void);
|
|||
*/
|
||||
const EC_METHOD *EC_GF2m_simple_method(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/********************************************************************/
|
||||
/* EC_GROUP functions */
|
||||
|
@ -282,6 +301,7 @@ int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, co
|
|||
*/
|
||||
int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx);
|
||||
|
||||
#ifndef OPENSSL_NO_EC2M
|
||||
/** Sets the parameter of a ec over GF2m defined by y^2 + x*y = x^3 + a*x^2 + b
|
||||
* \param group EC_GROUP object
|
||||
* \param p BIGNUM with the polynomial defining the underlying field
|
||||
|
@ -301,7 +321,7 @@ int EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, c
|
|||
* \return 1 on success and 0 if an error occured
|
||||
*/
|
||||
int EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx);
|
||||
|
||||
#endif
|
||||
/** Returns the number of bits needed to represent a field element
|
||||
* \param group EC_GROUP object
|
||||
* \return number of bits needed to represent a field element
|
||||
|
@ -342,7 +362,7 @@ int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx);
|
|||
* \return newly created EC_GROUP object with the specified parameters
|
||||
*/
|
||||
EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
|
||||
|
||||
#ifndef OPENSSL_NO_EC2M
|
||||
/** Creates a new EC_GROUP object with the specified parameters defined
|
||||
* over GF2m (defined by the equation y^2 + x*y = x^3 + a*x^2 + b)
|
||||
* \param p BIGNUM with the polynomial defining the underlying field
|
||||
|
@ -352,7 +372,7 @@ EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM
|
|||
* \return newly created EC_GROUP object with the specified parameters
|
||||
*/
|
||||
EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
|
||||
|
||||
#endif
|
||||
/** Creates a EC_GROUP object with a curve specified by a NID
|
||||
* \param nid NID of the OID of the curve name
|
||||
* \return newly created EC_GROUP object with specified curve or NULL
|
||||
|
@ -481,7 +501,7 @@ int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group,
|
|||
*/
|
||||
int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
|
||||
const BIGNUM *x, int y_bit, BN_CTX *ctx);
|
||||
|
||||
#ifndef OPENSSL_NO_EC2M
|
||||
/** Sets the affine coordinates of a EC_POINT over GF2m
|
||||
* \param group underlying EC_GROUP object
|
||||
* \param p EC_POINT object
|
||||
|
@ -514,7 +534,7 @@ int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group,
|
|||
*/
|
||||
int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p,
|
||||
const BIGNUM *x, int y_bit, BN_CTX *ctx);
|
||||
|
||||
#endif
|
||||
/** Encodes a EC_POINT object to a octet string
|
||||
* \param group underlying EC_GROUP object
|
||||
* \param p EC_POINT object
|
||||
|
@ -653,9 +673,11 @@ int EC_GROUP_have_precompute_mult(const EC_GROUP *group);
|
|||
/* EC_GROUP_get_basis_type() returns the NID of the basis type
|
||||
* used to represent the field elements */
|
||||
int EC_GROUP_get_basis_type(const EC_GROUP *);
|
||||
#ifndef OPENSSL_NO_EC2M
|
||||
int EC_GROUP_get_trinomial_basis(const EC_GROUP *, unsigned int *k);
|
||||
int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1,
|
||||
unsigned int *k2, unsigned int *k3);
|
||||
#endif
|
||||
|
||||
#define OPENSSL_EC_NAMED_CURVE 0x001
|
||||
|
||||
|
@ -689,11 +711,21 @@ typedef struct ec_key_st EC_KEY;
|
|||
#define EC_PKEY_NO_PARAMETERS 0x001
|
||||
#define EC_PKEY_NO_PUBKEY 0x002
|
||||
|
||||
/* some values for the flags field */
|
||||
#define EC_FLAG_NON_FIPS_ALLOW 0x1
|
||||
#define EC_FLAG_FIPS_CHECKED 0x2
|
||||
|
||||
/** Creates a new EC_KEY object.
|
||||
* \return EC_KEY object or NULL if an error occurred.
|
||||
*/
|
||||
EC_KEY *EC_KEY_new(void);
|
||||
|
||||
int EC_KEY_get_flags(const EC_KEY *key);
|
||||
|
||||
void EC_KEY_set_flags(EC_KEY *key, int flags);
|
||||
|
||||
void EC_KEY_clear_flags(EC_KEY *key, int flags);
|
||||
|
||||
/** Creates a new EC_KEY object using a named curve as underlying
|
||||
* EC_GROUP object.
|
||||
* \param nid NID of the named curve.
|
||||
|
@ -799,6 +831,15 @@ int EC_KEY_generate_key(EC_KEY *key);
|
|||
*/
|
||||
int EC_KEY_check_key(const EC_KEY *key);
|
||||
|
||||
/** Sets a public key from affine coordindates performing
|
||||
* neccessary NIST PKV tests.
|
||||
* \param key the EC_KEY object
|
||||
* \param x public key x coordinate
|
||||
* \param y public key y coordinate
|
||||
* \return 1 on success and 0 otherwise.
|
||||
*/
|
||||
int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, BIGNUM *y);
|
||||
|
||||
|
||||
/********************************************************************/
|
||||
/* de- and encoding functions for SEC1 ECPrivateKey */
|
||||
|
@ -926,6 +967,7 @@ void ERR_load_EC_strings(void);
|
|||
/* Error codes for the EC functions. */
|
||||
|
||||
/* Function codes. */
|
||||
#define EC_F_BN_TO_FELEM 224
|
||||
#define EC_F_COMPUTE_WNAF 143
|
||||
#define EC_F_D2I_ECPARAMETERS 144
|
||||
#define EC_F_D2I_ECPKPARAMETERS 145
|
||||
|
@ -968,6 +1010,15 @@ void ERR_load_EC_strings(void);
|
|||
#define EC_F_EC_GFP_MONT_FIELD_SQR 132
|
||||
#define EC_F_EC_GFP_MONT_GROUP_SET_CURVE 189
|
||||
#define EC_F_EC_GFP_MONT_GROUP_SET_CURVE_GFP 135
|
||||
#define EC_F_EC_GFP_NISTP224_GROUP_SET_CURVE 225
|
||||
#define EC_F_EC_GFP_NISTP224_POINTS_MUL 228
|
||||
#define EC_F_EC_GFP_NISTP224_POINT_GET_AFFINE_COORDINATES 226
|
||||
#define EC_F_EC_GFP_NISTP256_GROUP_SET_CURVE 230
|
||||
#define EC_F_EC_GFP_NISTP256_POINTS_MUL 231
|
||||
#define EC_F_EC_GFP_NISTP256_POINT_GET_AFFINE_COORDINATES 232
|
||||
#define EC_F_EC_GFP_NISTP521_GROUP_SET_CURVE 233
|
||||
#define EC_F_EC_GFP_NISTP521_POINTS_MUL 234
|
||||
#define EC_F_EC_GFP_NISTP521_POINT_GET_AFFINE_COORDINATES 235
|
||||
#define EC_F_EC_GFP_NIST_FIELD_MUL 200
|
||||
#define EC_F_EC_GFP_NIST_FIELD_SQR 201
|
||||
#define EC_F_EC_GFP_NIST_GROUP_SET_CURVE 202
|
||||
|
@ -1010,6 +1061,7 @@ void ERR_load_EC_strings(void);
|
|||
#define EC_F_EC_KEY_NEW 182
|
||||
#define EC_F_EC_KEY_PRINT 180
|
||||
#define EC_F_EC_KEY_PRINT_FP 181
|
||||
#define EC_F_EC_KEY_SET_PUBLIC_KEY_AFFINE_COORDINATES 229
|
||||
#define EC_F_EC_POINTS_MAKE_AFFINE 136
|
||||
#define EC_F_EC_POINT_ADD 112
|
||||
#define EC_F_EC_POINT_CMP 113
|
||||
|
@ -1040,6 +1092,9 @@ void ERR_load_EC_strings(void);
|
|||
#define EC_F_I2D_ECPKPARAMETERS 191
|
||||
#define EC_F_I2D_ECPRIVATEKEY 192
|
||||
#define EC_F_I2O_ECPUBLICKEY 151
|
||||
#define EC_F_NISTP224_PRE_COMP_NEW 227
|
||||
#define EC_F_NISTP256_PRE_COMP_NEW 236
|
||||
#define EC_F_NISTP521_PRE_COMP_NEW 237
|
||||
#define EC_F_O2I_ECPUBLICKEY 152
|
||||
#define EC_F_OLD_EC_PRIV_DECODE 222
|
||||
#define EC_F_PKEY_EC_CTRL 197
|
||||
|
@ -1052,12 +1107,15 @@ void ERR_load_EC_strings(void);
|
|||
/* Reason codes. */
|
||||
#define EC_R_ASN1_ERROR 115
|
||||
#define EC_R_ASN1_UNKNOWN_FIELD 116
|
||||
#define EC_R_BIGNUM_OUT_OF_RANGE 144
|
||||
#define EC_R_BUFFER_TOO_SMALL 100
|
||||
#define EC_R_COORDINATES_OUT_OF_RANGE 146
|
||||
#define EC_R_D2I_ECPKPARAMETERS_FAILURE 117
|
||||
#define EC_R_DECODE_ERROR 142
|
||||
#define EC_R_DISCRIMINANT_IS_ZERO 118
|
||||
#define EC_R_EC_GROUP_NEW_BY_NAME_FAILURE 119
|
||||
#define EC_R_FIELD_TOO_LARGE 143
|
||||
#define EC_R_GF2M_NOT_SUPPORTED 147
|
||||
#define EC_R_GROUP2PKPARAMETERS_FAILURE 120
|
||||
#define EC_R_I2D_ECPKPARAMETERS_FAILURE 121
|
||||
#define EC_R_INCOMPATIBLE_OBJECTS 101
|
||||
|
@ -1092,6 +1150,7 @@ void ERR_load_EC_strings(void);
|
|||
#define EC_R_UNKNOWN_GROUP 129
|
||||
#define EC_R_UNKNOWN_ORDER 114
|
||||
#define EC_R_UNSUPPORTED_FIELD 131
|
||||
#define EC_R_WRONG_CURVE_PARAMETERS 145
|
||||
#define EC_R_WRONG_ORDER 130
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -109,11 +109,13 @@ void ERR_load_ECDH_strings(void);
|
|||
/* Error codes for the ECDH functions. */
|
||||
|
||||
/* Function codes. */
|
||||
#define ECDH_F_ECDH_CHECK 102
|
||||
#define ECDH_F_ECDH_COMPUTE_KEY 100
|
||||
#define ECDH_F_ECDH_DATA_NEW_METHOD 101
|
||||
|
||||
/* Reason codes. */
|
||||
#define ECDH_R_KDF_FAILED 102
|
||||
#define ECDH_R_NON_FIPS_METHOD 103
|
||||
#define ECDH_R_NO_PRIVATE_VALUE 100
|
||||
#define ECDH_R_POINT_ARITHMETIC_FAILURE 101
|
||||
|
||||
|
|
|
@ -238,6 +238,7 @@ void ERR_load_ECDSA_strings(void);
|
|||
/* Error codes for the ECDSA functions. */
|
||||
|
||||
/* Function codes. */
|
||||
#define ECDSA_F_ECDSA_CHECK 104
|
||||
#define ECDSA_F_ECDSA_DATA_NEW_METHOD 100
|
||||
#define ECDSA_F_ECDSA_DO_SIGN 101
|
||||
#define ECDSA_F_ECDSA_DO_VERIFY 102
|
||||
|
@ -249,6 +250,7 @@ void ERR_load_ECDSA_strings(void);
|
|||
#define ECDSA_R_ERR_EC_LIB 102
|
||||
#define ECDSA_R_MISSING_PARAMETERS 103
|
||||
#define ECDSA_R_NEED_NEW_SETUP_VALUES 106
|
||||
#define ECDSA_R_NON_FIPS_METHOD 107
|
||||
#define ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED 104
|
||||
#define ECDSA_R_SIGNATURE_MALLOC_FAILED 105
|
||||
|
||||
|
|
|
@ -141,6 +141,13 @@ extern "C" {
|
|||
* the existing ENGINE's structural reference count. */
|
||||
#define ENGINE_FLAGS_BY_ID_COPY (int)0x0004
|
||||
|
||||
/* This flag if for an ENGINE that does not want its methods registered as
|
||||
* part of ENGINE_register_all_complete() for example if the methods are
|
||||
* not usable as default methods.
|
||||
*/
|
||||
|
||||
#define ENGINE_FLAGS_NO_REGISTER_ALL (int)0x0008
|
||||
|
||||
/* ENGINEs can support their own command types, and these flags are used in
|
||||
* ENGINE_CTRL_GET_CMD_FLAGS to indicate to the caller what kind of input each
|
||||
* command expects. Currently only numeric and string input is supported. If a
|
||||
|
@ -344,6 +351,8 @@ void ENGINE_load_gost(void);
|
|||
#endif
|
||||
#endif
|
||||
void ENGINE_load_cryptodev(void);
|
||||
void ENGINE_load_rsax(void);
|
||||
void ENGINE_load_rdrand(void);
|
||||
void ENGINE_load_builtin_engines(void);
|
||||
|
||||
/* Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation
|
||||
|
|
|
@ -344,8 +344,9 @@ void ERR_print_errors_fp(FILE *fp);
|
|||
#endif
|
||||
#ifndef OPENSSL_NO_BIO
|
||||
void ERR_print_errors(BIO *bp);
|
||||
void ERR_add_error_data(int num, ...);
|
||||
#endif
|
||||
void ERR_add_error_data(int num, ...);
|
||||
void ERR_add_error_vdata(int num, va_list args);
|
||||
void ERR_load_strings(int lib,ERR_STRING_DATA str[]);
|
||||
void ERR_unload_strings(int lib,ERR_STRING_DATA str[]);
|
||||
void ERR_load_ERR_strings(void);
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
#define EVP_RC5_32_12_16_KEY_SIZE 16
|
||||
*/
|
||||
#define EVP_MAX_MD_SIZE 64 /* longest known is SHA512 */
|
||||
#define EVP_MAX_KEY_LENGTH 32
|
||||
#define EVP_MAX_KEY_LENGTH 64
|
||||
#define EVP_MAX_IV_LENGTH 16
|
||||
#define EVP_MAX_BLOCK_LENGTH 32
|
||||
|
||||
|
@ -116,6 +116,7 @@
|
|||
#define EVP_PKEY_DH NID_dhKeyAgreement
|
||||
#define EVP_PKEY_EC NID_X9_62_id_ecPublicKey
|
||||
#define EVP_PKEY_HMAC NID_hmac
|
||||
#define EVP_PKEY_CMAC NID_cmac
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -216,6 +217,8 @@ typedef int evp_verify_method(int type,const unsigned char *m,
|
|||
|
||||
#define EVP_MD_FLAG_DIGALGID_CUSTOM 0x0018
|
||||
|
||||
#define EVP_MD_FLAG_FIPS 0x0400 /* Note if suitable for use in FIPS mode */
|
||||
|
||||
/* Digest ctrls */
|
||||
|
||||
#define EVP_MD_CTRL_DIGALGID 0x1
|
||||
|
@ -325,6 +328,10 @@ struct evp_cipher_st
|
|||
#define EVP_CIPH_CBC_MODE 0x2
|
||||
#define EVP_CIPH_CFB_MODE 0x3
|
||||
#define EVP_CIPH_OFB_MODE 0x4
|
||||
#define EVP_CIPH_CTR_MODE 0x5
|
||||
#define EVP_CIPH_GCM_MODE 0x6
|
||||
#define EVP_CIPH_CCM_MODE 0x7
|
||||
#define EVP_CIPH_XTS_MODE 0x10001
|
||||
#define EVP_CIPH_MODE 0xF0007
|
||||
/* Set if variable length cipher */
|
||||
#define EVP_CIPH_VARIABLE_LENGTH 0x8
|
||||
|
@ -346,6 +353,15 @@ struct evp_cipher_st
|
|||
#define EVP_CIPH_FLAG_DEFAULT_ASN1 0x1000
|
||||
/* Buffer length in bits not bytes: CFB1 mode only */
|
||||
#define EVP_CIPH_FLAG_LENGTH_BITS 0x2000
|
||||
/* Note if suitable for use in FIPS mode */
|
||||
#define EVP_CIPH_FLAG_FIPS 0x4000
|
||||
/* Allow non FIPS cipher in FIPS mode */
|
||||
#define EVP_CIPH_FLAG_NON_FIPS_ALLOW 0x8000
|
||||
/* Cipher handles any and all padding logic as well
|
||||
* as finalisation.
|
||||
*/
|
||||
#define EVP_CIPH_FLAG_CUSTOM_CIPHER 0x100000
|
||||
#define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000
|
||||
|
||||
/* ctrl() values */
|
||||
|
||||
|
@ -358,6 +374,34 @@ struct evp_cipher_st
|
|||
#define EVP_CTRL_RAND_KEY 0x6
|
||||
#define EVP_CTRL_PBE_PRF_NID 0x7
|
||||
#define EVP_CTRL_COPY 0x8
|
||||
#define EVP_CTRL_GCM_SET_IVLEN 0x9
|
||||
#define EVP_CTRL_GCM_GET_TAG 0x10
|
||||
#define EVP_CTRL_GCM_SET_TAG 0x11
|
||||
#define EVP_CTRL_GCM_SET_IV_FIXED 0x12
|
||||
#define EVP_CTRL_GCM_IV_GEN 0x13
|
||||
#define EVP_CTRL_CCM_SET_IVLEN EVP_CTRL_GCM_SET_IVLEN
|
||||
#define EVP_CTRL_CCM_GET_TAG EVP_CTRL_GCM_GET_TAG
|
||||
#define EVP_CTRL_CCM_SET_TAG EVP_CTRL_GCM_SET_TAG
|
||||
#define EVP_CTRL_CCM_SET_L 0x14
|
||||
#define EVP_CTRL_CCM_SET_MSGLEN 0x15
|
||||
/* AEAD cipher deduces payload length and returns number of bytes
|
||||
* required to store MAC and eventual padding. Subsequent call to
|
||||
* EVP_Cipher even appends/verifies MAC.
|
||||
*/
|
||||
#define EVP_CTRL_AEAD_TLS1_AAD 0x16
|
||||
/* Used by composite AEAD ciphers, no-op in GCM, CCM... */
|
||||
#define EVP_CTRL_AEAD_SET_MAC_KEY 0x17
|
||||
/* Set the GCM invocation field, decrypt only */
|
||||
#define EVP_CTRL_GCM_SET_IV_INV 0x18
|
||||
|
||||
/* GCM TLS constants */
|
||||
/* Length of fixed part of IV derived from PRF */
|
||||
#define EVP_GCM_TLS_FIXED_IV_LEN 4
|
||||
/* Length of explicit part of IV part of TLS records */
|
||||
#define EVP_GCM_TLS_EXPLICIT_IV_LEN 8
|
||||
/* Length of tag for TLS */
|
||||
#define EVP_GCM_TLS_TAG_LEN 16
|
||||
|
||||
|
||||
typedef struct evp_cipher_info_st
|
||||
{
|
||||
|
@ -375,7 +419,7 @@ struct evp_cipher_ctx_st
|
|||
unsigned char oiv[EVP_MAX_IV_LENGTH]; /* original iv */
|
||||
unsigned char iv[EVP_MAX_IV_LENGTH]; /* working iv */
|
||||
unsigned char buf[EVP_MAX_BLOCK_LENGTH];/* saved partial block */
|
||||
int num; /* used by cfb/ofb mode */
|
||||
int num; /* used by cfb/ofb/ctr mode */
|
||||
|
||||
void *app_data; /* application stuff */
|
||||
int key_len; /* May change for variable length cipher */
|
||||
|
@ -695,6 +739,9 @@ const EVP_MD *EVP_dev_crypto_md5(void);
|
|||
#ifndef OPENSSL_NO_RC4
|
||||
const EVP_CIPHER *EVP_rc4(void);
|
||||
const EVP_CIPHER *EVP_rc4_40(void);
|
||||
#ifndef OPENSSL_NO_MD5
|
||||
const EVP_CIPHER *EVP_rc4_hmac_md5(void);
|
||||
#endif
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_IDEA
|
||||
const EVP_CIPHER *EVP_idea_ecb(void);
|
||||
|
@ -741,9 +788,10 @@ const EVP_CIPHER *EVP_aes_128_cfb8(void);
|
|||
const EVP_CIPHER *EVP_aes_128_cfb128(void);
|
||||
# define EVP_aes_128_cfb EVP_aes_128_cfb128
|
||||
const EVP_CIPHER *EVP_aes_128_ofb(void);
|
||||
#if 0
|
||||
const EVP_CIPHER *EVP_aes_128_ctr(void);
|
||||
#endif
|
||||
const EVP_CIPHER *EVP_aes_128_gcm(void);
|
||||
const EVP_CIPHER *EVP_aes_128_ccm(void);
|
||||
const EVP_CIPHER *EVP_aes_128_xts(void);
|
||||
const EVP_CIPHER *EVP_aes_192_ecb(void);
|
||||
const EVP_CIPHER *EVP_aes_192_cbc(void);
|
||||
const EVP_CIPHER *EVP_aes_192_cfb1(void);
|
||||
|
@ -751,9 +799,9 @@ const EVP_CIPHER *EVP_aes_192_cfb8(void);
|
|||
const EVP_CIPHER *EVP_aes_192_cfb128(void);
|
||||
# define EVP_aes_192_cfb EVP_aes_192_cfb128
|
||||
const EVP_CIPHER *EVP_aes_192_ofb(void);
|
||||
#if 0
|
||||
const EVP_CIPHER *EVP_aes_192_ctr(void);
|
||||
#endif
|
||||
const EVP_CIPHER *EVP_aes_192_gcm(void);
|
||||
const EVP_CIPHER *EVP_aes_192_ccm(void);
|
||||
const EVP_CIPHER *EVP_aes_256_ecb(void);
|
||||
const EVP_CIPHER *EVP_aes_256_cbc(void);
|
||||
const EVP_CIPHER *EVP_aes_256_cfb1(void);
|
||||
|
@ -761,8 +809,13 @@ const EVP_CIPHER *EVP_aes_256_cfb8(void);
|
|||
const EVP_CIPHER *EVP_aes_256_cfb128(void);
|
||||
# define EVP_aes_256_cfb EVP_aes_256_cfb128
|
||||
const EVP_CIPHER *EVP_aes_256_ofb(void);
|
||||
#if 0
|
||||
const EVP_CIPHER *EVP_aes_256_ctr(void);
|
||||
const EVP_CIPHER *EVP_aes_256_gcm(void);
|
||||
const EVP_CIPHER *EVP_aes_256_ccm(void);
|
||||
const EVP_CIPHER *EVP_aes_256_xts(void);
|
||||
#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1)
|
||||
const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha1(void);
|
||||
const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha1(void);
|
||||
#endif
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_CAMELLIA
|
||||
|
@ -1047,13 +1100,22 @@ void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth,
|
|||
#define EVP_PKEY_CTRL_CMS_DECRYPT 10
|
||||
#define EVP_PKEY_CTRL_CMS_SIGN 11
|
||||
|
||||
#define EVP_PKEY_CTRL_CIPHER 12
|
||||
|
||||
#define EVP_PKEY_ALG_CTRL 0x1000
|
||||
|
||||
|
||||
#define EVP_PKEY_FLAG_AUTOARGLEN 2
|
||||
/* Method handles all operations: don't assume any digest related
|
||||
* defaults.
|
||||
*/
|
||||
#define EVP_PKEY_FLAG_SIGCTX_CUSTOM 4
|
||||
|
||||
const EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type);
|
||||
EVP_PKEY_METHOD* EVP_PKEY_meth_new(int id, int flags);
|
||||
void EVP_PKEY_meth_get0_info(int *ppkey_id, int *pflags,
|
||||
const EVP_PKEY_METHOD *meth);
|
||||
void EVP_PKEY_meth_copy(EVP_PKEY_METHOD *dst, const EVP_PKEY_METHOD *src);
|
||||
void EVP_PKEY_meth_free(EVP_PKEY_METHOD *pmeth);
|
||||
int EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth);
|
||||
|
||||
|
@ -1071,7 +1133,7 @@ int EVP_PKEY_CTX_get_operation(EVP_PKEY_CTX *ctx);
|
|||
void EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen);
|
||||
|
||||
EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e,
|
||||
unsigned char *key, int keylen);
|
||||
const unsigned char *key, int keylen);
|
||||
|
||||
void EVP_PKEY_CTX_set_data(EVP_PKEY_CTX *ctx, void *data);
|
||||
void *EVP_PKEY_CTX_get_data(EVP_PKEY_CTX *ctx);
|
||||
|
@ -1190,8 +1252,13 @@ void ERR_load_EVP_strings(void);
|
|||
/* Error codes for the EVP functions. */
|
||||
|
||||
/* Function codes. */
|
||||
#define EVP_F_AESNI_INIT_KEY 165
|
||||
#define EVP_F_AESNI_XTS_CIPHER 176
|
||||
#define EVP_F_AES_INIT_KEY 133
|
||||
#define EVP_F_AES_XTS 172
|
||||
#define EVP_F_AES_XTS_CIPHER 175
|
||||
#define EVP_F_CAMELLIA_INIT_KEY 159
|
||||
#define EVP_F_CMAC_INIT 173
|
||||
#define EVP_F_D2I_PKEY 100
|
||||
#define EVP_F_DO_SIGVER_INIT 161
|
||||
#define EVP_F_DSAPKEY2PKCS8 134
|
||||
|
@ -1246,15 +1313,24 @@ void ERR_load_EVP_strings(void);
|
|||
#define EVP_F_EVP_RIJNDAEL 126
|
||||
#define EVP_F_EVP_SIGNFINAL 107
|
||||
#define EVP_F_EVP_VERIFYFINAL 108
|
||||
#define EVP_F_FIPS_CIPHERINIT 166
|
||||
#define EVP_F_FIPS_CIPHER_CTX_COPY 170
|
||||
#define EVP_F_FIPS_CIPHER_CTX_CTRL 167
|
||||
#define EVP_F_FIPS_CIPHER_CTX_SET_KEY_LENGTH 171
|
||||
#define EVP_F_FIPS_DIGESTINIT 168
|
||||
#define EVP_F_FIPS_MD_CTX_COPY 169
|
||||
#define EVP_F_HMAC_INIT_EX 174
|
||||
#define EVP_F_INT_CTX_NEW 157
|
||||
#define EVP_F_PKCS5_PBE_KEYIVGEN 117
|
||||
#define EVP_F_PKCS5_V2_PBE_KEYIVGEN 118
|
||||
#define EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN 164
|
||||
#define EVP_F_PKCS8_SET_BROKEN 112
|
||||
#define EVP_F_PKEY_SET_TYPE 158
|
||||
#define EVP_F_RC2_MAGIC_TO_METH 109
|
||||
#define EVP_F_RC5_CTRL 125
|
||||
|
||||
/* Reason codes. */
|
||||
#define EVP_R_AES_IV_SETUP_FAILED 162
|
||||
#define EVP_R_AES_KEY_SETUP_FAILED 143
|
||||
#define EVP_R_ASN1_LIB 140
|
||||
#define EVP_R_BAD_BLOCK_LENGTH 136
|
||||
|
@ -1272,6 +1348,7 @@ void ERR_load_EVP_strings(void);
|
|||
#define EVP_R_DECODE_ERROR 114
|
||||
#define EVP_R_DIFFERENT_KEY_TYPES 101
|
||||
#define EVP_R_DIFFERENT_PARAMETERS 153
|
||||
#define EVP_R_DISABLED_FOR_FIPS 163
|
||||
#define EVP_R_ENCODE_ERROR 115
|
||||
#define EVP_R_EVP_PBE_CIPHERINIT_ERROR 119
|
||||
#define EVP_R_EXPECTING_AN_RSA_KEY 127
|
||||
|
@ -1303,6 +1380,7 @@ void ERR_load_EVP_strings(void);
|
|||
#define EVP_R_PRIVATE_KEY_DECODE_ERROR 145
|
||||
#define EVP_R_PRIVATE_KEY_ENCODE_ERROR 146
|
||||
#define EVP_R_PUBLIC_KEY_NOT_RSA 106
|
||||
#define EVP_R_TOO_LARGE 164
|
||||
#define EVP_R_UNKNOWN_CIPHER 160
|
||||
#define EVP_R_UNKNOWN_DIGEST 161
|
||||
#define EVP_R_UNKNOWN_PBE_ALGORITHM 121
|
||||
|
|
|
@ -83,6 +83,9 @@ typedef struct idea_key_st
|
|||
const char *idea_options(void);
|
||||
void idea_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
||||
IDEA_KEY_SCHEDULE *ks);
|
||||
#ifdef OPENSSL_FIPS
|
||||
void private_idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks);
|
||||
#endif
|
||||
void idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks);
|
||||
void idea_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk);
|
||||
void idea_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||
|
|
|
@ -172,6 +172,10 @@ krb5_error_code kssl_check_authent(KSSL_CTX *kssl_ctx, krb5_data *authentp,
|
|||
krb5_timestamp *atimep, KSSL_ERR *kssl_err);
|
||||
unsigned char *kssl_skip_confound(krb5_enctype enctype, unsigned char *authn);
|
||||
|
||||
void SSL_set0_kssl_ctx(SSL *s, KSSL_CTX *kctx);
|
||||
KSSL_CTX * SSL_get0_kssl_ctx(SSL *s);
|
||||
char *kssl_ctx_get0_client_princ(KSSL_CTX *kctx);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -105,6 +105,9 @@ typedef struct MD4state_st
|
|||
unsigned int num;
|
||||
} MD4_CTX;
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
int private_MD4_Init(MD4_CTX *c);
|
||||
#endif
|
||||
int MD4_Init(MD4_CTX *c);
|
||||
int MD4_Update(MD4_CTX *c, const void *data, size_t len);
|
||||
int MD4_Final(unsigned char *md, MD4_CTX *c);
|
||||
|
|
|
@ -105,6 +105,9 @@ typedef struct MD5state_st
|
|||
unsigned int num;
|
||||
} MD5_CTX;
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
int private_MD5_Init(MD5_CTX *c);
|
||||
#endif
|
||||
int MD5_Init(MD5_CTX *c);
|
||||
int MD5_Update(MD5_CTX *c, const void *data, size_t len);
|
||||
int MD5_Final(unsigned char *md, MD5_CTX *c);
|
||||
|
|
|
@ -81,6 +81,9 @@ typedef struct mdc2_ctx_st
|
|||
} MDC2_CTX;
|
||||
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
int private_MDC2_Init(MDC2_CTX *c);
|
||||
#endif
|
||||
int MDC2_Init(MDC2_CTX *c);
|
||||
int MDC2_Update(MDC2_CTX *c, const unsigned char *data, size_t len);
|
||||
int MDC2_Final(unsigned char *md, MDC2_CTX *c);
|
||||
|
|
|
@ -15,6 +15,14 @@ typedef void (*cbc128_f)(const unsigned char *in, unsigned char *out,
|
|||
size_t len, const void *key,
|
||||
unsigned char ivec[16], int enc);
|
||||
|
||||
typedef void (*ctr128_f)(const unsigned char *in, unsigned char *out,
|
||||
size_t blocks, const void *key,
|
||||
const unsigned char ivec[16]);
|
||||
|
||||
typedef void (*ccm128_f)(const unsigned char *in, unsigned char *out,
|
||||
size_t blocks, const void *key,
|
||||
const unsigned char ivec[16],unsigned char cmac[16]);
|
||||
|
||||
void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t len, const void *key,
|
||||
unsigned char ivec[16], block128_f block);
|
||||
|
@ -27,6 +35,11 @@ void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out,
|
|||
unsigned char ivec[16], unsigned char ecount_buf[16],
|
||||
unsigned int *num, block128_f block);
|
||||
|
||||
void CRYPTO_ctr128_encrypt_ctr32(const unsigned char *in, unsigned char *out,
|
||||
size_t len, const void *key,
|
||||
unsigned char ivec[16], unsigned char ecount_buf[16],
|
||||
unsigned int *num, ctr128_f ctr);
|
||||
|
||||
void CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t len, const void *key,
|
||||
unsigned char ivec[16], int *num,
|
||||
|
@ -57,3 +70,66 @@ size_t CRYPTO_cts128_decrypt_block(const unsigned char *in, unsigned char *out,
|
|||
size_t CRYPTO_cts128_decrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t len, const void *key,
|
||||
unsigned char ivec[16], cbc128_f cbc);
|
||||
|
||||
size_t CRYPTO_nistcts128_encrypt_block(const unsigned char *in, unsigned char *out,
|
||||
size_t len, const void *key,
|
||||
unsigned char ivec[16], block128_f block);
|
||||
size_t CRYPTO_nistcts128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t len, const void *key,
|
||||
unsigned char ivec[16], cbc128_f cbc);
|
||||
size_t CRYPTO_nistcts128_decrypt_block(const unsigned char *in, unsigned char *out,
|
||||
size_t len, const void *key,
|
||||
unsigned char ivec[16], block128_f block);
|
||||
size_t CRYPTO_nistcts128_decrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t len, const void *key,
|
||||
unsigned char ivec[16], cbc128_f cbc);
|
||||
|
||||
typedef struct gcm128_context GCM128_CONTEXT;
|
||||
|
||||
GCM128_CONTEXT *CRYPTO_gcm128_new(void *key, block128_f block);
|
||||
void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx,void *key,block128_f block);
|
||||
void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const unsigned char *iv,
|
||||
size_t len);
|
||||
int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const unsigned char *aad,
|
||||
size_t len);
|
||||
int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx,
|
||||
const unsigned char *in, unsigned char *out,
|
||||
size_t len);
|
||||
int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx,
|
||||
const unsigned char *in, unsigned char *out,
|
||||
size_t len);
|
||||
int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx,
|
||||
const unsigned char *in, unsigned char *out,
|
||||
size_t len, ctr128_f stream);
|
||||
int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx,
|
||||
const unsigned char *in, unsigned char *out,
|
||||
size_t len, ctr128_f stream);
|
||||
int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx,const unsigned char *tag,
|
||||
size_t len);
|
||||
void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len);
|
||||
void CRYPTO_gcm128_release(GCM128_CONTEXT *ctx);
|
||||
|
||||
typedef struct ccm128_context CCM128_CONTEXT;
|
||||
|
||||
void CRYPTO_ccm128_init(CCM128_CONTEXT *ctx,
|
||||
unsigned int M, unsigned int L, void *key,block128_f block);
|
||||
int CRYPTO_ccm128_setiv(CCM128_CONTEXT *ctx,
|
||||
const unsigned char *nonce, size_t nlen, size_t mlen);
|
||||
void CRYPTO_ccm128_aad(CCM128_CONTEXT *ctx,
|
||||
const unsigned char *aad, size_t alen);
|
||||
int CRYPTO_ccm128_encrypt(CCM128_CONTEXT *ctx,
|
||||
const unsigned char *inp, unsigned char *out, size_t len);
|
||||
int CRYPTO_ccm128_decrypt(CCM128_CONTEXT *ctx,
|
||||
const unsigned char *inp, unsigned char *out, size_t len);
|
||||
int CRYPTO_ccm128_encrypt_ccm64(CCM128_CONTEXT *ctx,
|
||||
const unsigned char *inp, unsigned char *out, size_t len,
|
||||
ccm128_f stream);
|
||||
int CRYPTO_ccm128_decrypt_ccm64(CCM128_CONTEXT *ctx,
|
||||
const unsigned char *inp, unsigned char *out, size_t len,
|
||||
ccm128_f stream);
|
||||
size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len);
|
||||
|
||||
typedef struct xts128_context XTS128_CONTEXT;
|
||||
|
||||
int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, const unsigned char iv[16],
|
||||
const unsigned char *inp, unsigned char *out, size_t len, int enc);
|
||||
|
|
|
@ -580,6 +580,21 @@
|
|||
#define NID_sha1WithRSAEncryption 65
|
||||
#define OBJ_sha1WithRSAEncryption OBJ_pkcs1,5L
|
||||
|
||||
#define SN_rsaesOaep "RSAES-OAEP"
|
||||
#define LN_rsaesOaep "rsaesOaep"
|
||||
#define NID_rsaesOaep 919
|
||||
#define OBJ_rsaesOaep OBJ_pkcs1,7L
|
||||
|
||||
#define SN_mgf1 "MGF1"
|
||||
#define LN_mgf1 "mgf1"
|
||||
#define NID_mgf1 911
|
||||
#define OBJ_mgf1 OBJ_pkcs1,8L
|
||||
|
||||
#define SN_rsassaPss "RSASSA-PSS"
|
||||
#define LN_rsassaPss "rsassaPss"
|
||||
#define NID_rsassaPss 912
|
||||
#define OBJ_rsassaPss OBJ_pkcs1,10L
|
||||
|
||||
#define SN_sha256WithRSAEncryption "RSA-SHA256"
|
||||
#define LN_sha256WithRSAEncryption "sha256WithRSAEncryption"
|
||||
#define NID_sha256WithRSAEncryption 668
|
||||
|
@ -981,6 +996,10 @@
|
|||
#define NID_id_smime_alg_CMSRC2wrap 247
|
||||
#define OBJ_id_smime_alg_CMSRC2wrap OBJ_id_smime_alg,7L
|
||||
|
||||
#define SN_id_alg_PWRI_KEK "id-alg-PWRI-KEK"
|
||||
#define NID_id_alg_PWRI_KEK 893
|
||||
#define OBJ_id_alg_PWRI_KEK OBJ_id_smime_alg,9L
|
||||
|
||||
#define SN_id_smime_cd_ldap "id-smime-cd-ldap"
|
||||
#define NID_id_smime_cd_ldap 248
|
||||
#define OBJ_id_smime_cd_ldap OBJ_id_smime_cd,1L
|
||||
|
@ -2399,6 +2418,11 @@
|
|||
#define NID_no_rev_avail 403
|
||||
#define OBJ_no_rev_avail OBJ_id_ce,56L
|
||||
|
||||
#define SN_anyExtendedKeyUsage "anyExtendedKeyUsage"
|
||||
#define LN_anyExtendedKeyUsage "Any Extended Key Usage"
|
||||
#define NID_anyExtendedKeyUsage 910
|
||||
#define OBJ_anyExtendedKeyUsage OBJ_ext_key_usage,0L
|
||||
|
||||
#define SN_netscape "Netscape"
|
||||
#define LN_netscape "Netscape Communications Corp."
|
||||
#define NID_netscape 57
|
||||
|
@ -2586,6 +2610,24 @@
|
|||
#define NID_aes_128_cfb128 421
|
||||
#define OBJ_aes_128_cfb128 OBJ_aes,4L
|
||||
|
||||
#define SN_id_aes128_wrap "id-aes128-wrap"
|
||||
#define NID_id_aes128_wrap 788
|
||||
#define OBJ_id_aes128_wrap OBJ_aes,5L
|
||||
|
||||
#define SN_aes_128_gcm "id-aes128-GCM"
|
||||
#define LN_aes_128_gcm "aes-128-gcm"
|
||||
#define NID_aes_128_gcm 895
|
||||
#define OBJ_aes_128_gcm OBJ_aes,6L
|
||||
|
||||
#define SN_aes_128_ccm "id-aes128-CCM"
|
||||
#define LN_aes_128_ccm "aes-128-ccm"
|
||||
#define NID_aes_128_ccm 896
|
||||
#define OBJ_aes_128_ccm OBJ_aes,7L
|
||||
|
||||
#define SN_id_aes128_wrap_pad "id-aes128-wrap-pad"
|
||||
#define NID_id_aes128_wrap_pad 897
|
||||
#define OBJ_id_aes128_wrap_pad OBJ_aes,8L
|
||||
|
||||
#define SN_aes_192_ecb "AES-192-ECB"
|
||||
#define LN_aes_192_ecb "aes-192-ecb"
|
||||
#define NID_aes_192_ecb 422
|
||||
|
@ -2606,6 +2648,24 @@
|
|||
#define NID_aes_192_cfb128 425
|
||||
#define OBJ_aes_192_cfb128 OBJ_aes,24L
|
||||
|
||||
#define SN_id_aes192_wrap "id-aes192-wrap"
|
||||
#define NID_id_aes192_wrap 789
|
||||
#define OBJ_id_aes192_wrap OBJ_aes,25L
|
||||
|
||||
#define SN_aes_192_gcm "id-aes192-GCM"
|
||||
#define LN_aes_192_gcm "aes-192-gcm"
|
||||
#define NID_aes_192_gcm 898
|
||||
#define OBJ_aes_192_gcm OBJ_aes,26L
|
||||
|
||||
#define SN_aes_192_ccm "id-aes192-CCM"
|
||||
#define LN_aes_192_ccm "aes-192-ccm"
|
||||
#define NID_aes_192_ccm 899
|
||||
#define OBJ_aes_192_ccm OBJ_aes,27L
|
||||
|
||||
#define SN_id_aes192_wrap_pad "id-aes192-wrap-pad"
|
||||
#define NID_id_aes192_wrap_pad 900
|
||||
#define OBJ_id_aes192_wrap_pad OBJ_aes,28L
|
||||
|
||||
#define SN_aes_256_ecb "AES-256-ECB"
|
||||
#define LN_aes_256_ecb "aes-256-ecb"
|
||||
#define NID_aes_256_ecb 426
|
||||
|
@ -2626,6 +2686,24 @@
|
|||
#define NID_aes_256_cfb128 429
|
||||
#define OBJ_aes_256_cfb128 OBJ_aes,44L
|
||||
|
||||
#define SN_id_aes256_wrap "id-aes256-wrap"
|
||||
#define NID_id_aes256_wrap 790
|
||||
#define OBJ_id_aes256_wrap OBJ_aes,45L
|
||||
|
||||
#define SN_aes_256_gcm "id-aes256-GCM"
|
||||
#define LN_aes_256_gcm "aes-256-gcm"
|
||||
#define NID_aes_256_gcm 901
|
||||
#define OBJ_aes_256_gcm OBJ_aes,46L
|
||||
|
||||
#define SN_aes_256_ccm "id-aes256-CCM"
|
||||
#define LN_aes_256_ccm "aes-256-ccm"
|
||||
#define NID_aes_256_ccm 902
|
||||
#define OBJ_aes_256_ccm OBJ_aes,47L
|
||||
|
||||
#define SN_id_aes256_wrap_pad "id-aes256-wrap-pad"
|
||||
#define NID_id_aes256_wrap_pad 903
|
||||
#define OBJ_id_aes256_wrap_pad OBJ_aes,48L
|
||||
|
||||
#define SN_aes_128_cfb1 "AES-128-CFB1"
|
||||
#define LN_aes_128_cfb1 "aes-128-cfb1"
|
||||
#define NID_aes_128_cfb1 650
|
||||
|
@ -2650,6 +2728,26 @@
|
|||
#define LN_aes_256_cfb8 "aes-256-cfb8"
|
||||
#define NID_aes_256_cfb8 655
|
||||
|
||||
#define SN_aes_128_ctr "AES-128-CTR"
|
||||
#define LN_aes_128_ctr "aes-128-ctr"
|
||||
#define NID_aes_128_ctr 904
|
||||
|
||||
#define SN_aes_192_ctr "AES-192-CTR"
|
||||
#define LN_aes_192_ctr "aes-192-ctr"
|
||||
#define NID_aes_192_ctr 905
|
||||
|
||||
#define SN_aes_256_ctr "AES-256-CTR"
|
||||
#define LN_aes_256_ctr "aes-256-ctr"
|
||||
#define NID_aes_256_ctr 906
|
||||
|
||||
#define SN_aes_128_xts "AES-128-XTS"
|
||||
#define LN_aes_128_xts "aes-128-xts"
|
||||
#define NID_aes_128_xts 913
|
||||
|
||||
#define SN_aes_256_xts "AES-256-XTS"
|
||||
#define LN_aes_256_xts "aes-256-xts"
|
||||
#define NID_aes_256_xts 914
|
||||
|
||||
#define SN_des_cfb1 "DES-CFB1"
|
||||
#define LN_des_cfb1 "des-cfb1"
|
||||
#define NID_des_cfb1 656
|
||||
|
@ -2666,18 +2764,6 @@
|
|||
#define LN_des_ede3_cfb8 "des-ede3-cfb8"
|
||||
#define NID_des_ede3_cfb8 659
|
||||
|
||||
#define SN_id_aes128_wrap "id-aes128-wrap"
|
||||
#define NID_id_aes128_wrap 788
|
||||
#define OBJ_id_aes128_wrap OBJ_aes,5L
|
||||
|
||||
#define SN_id_aes192_wrap "id-aes192-wrap"
|
||||
#define NID_id_aes192_wrap 789
|
||||
#define OBJ_id_aes192_wrap OBJ_aes,25L
|
||||
|
||||
#define SN_id_aes256_wrap "id-aes256-wrap"
|
||||
#define NID_id_aes256_wrap 790
|
||||
#define OBJ_id_aes256_wrap OBJ_aes,45L
|
||||
|
||||
#define OBJ_nist_hashalgs OBJ_nistAlgorithms,2L
|
||||
|
||||
#define SN_sha256 "SHA256"
|
||||
|
@ -3810,6 +3896,18 @@
|
|||
#define NID_camellia_256_cbc 753
|
||||
#define OBJ_camellia_256_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,4L
|
||||
|
||||
#define SN_id_camellia128_wrap "id-camellia128-wrap"
|
||||
#define NID_id_camellia128_wrap 907
|
||||
#define OBJ_id_camellia128_wrap 1L,2L,392L,200011L,61L,1L,1L,3L,2L
|
||||
|
||||
#define SN_id_camellia192_wrap "id-camellia192-wrap"
|
||||
#define NID_id_camellia192_wrap 908
|
||||
#define OBJ_id_camellia192_wrap 1L,2L,392L,200011L,61L,1L,1L,3L,3L
|
||||
|
||||
#define SN_id_camellia256_wrap "id-camellia256-wrap"
|
||||
#define NID_id_camellia256_wrap 909
|
||||
#define OBJ_id_camellia256_wrap 1L,2L,392L,200011L,61L,1L,1L,3L,4L
|
||||
|
||||
#define OBJ_ntt_ds 0L,3L,4401L,5L
|
||||
|
||||
#define OBJ_camellia OBJ_ntt_ds,3L,1L,9L
|
||||
|
@ -3912,3 +4010,23 @@
|
|||
#define LN_hmac "hmac"
|
||||
#define NID_hmac 855
|
||||
|
||||
#define SN_cmac "CMAC"
|
||||
#define LN_cmac "cmac"
|
||||
#define NID_cmac 894
|
||||
|
||||
#define SN_rc4_hmac_md5 "RC4-HMAC-MD5"
|
||||
#define LN_rc4_hmac_md5 "rc4-hmac-md5"
|
||||
#define NID_rc4_hmac_md5 915
|
||||
|
||||
#define SN_aes_128_cbc_hmac_sha1 "AES-128-CBC-HMAC-SHA1"
|
||||
#define LN_aes_128_cbc_hmac_sha1 "aes-128-cbc-hmac-sha1"
|
||||
#define NID_aes_128_cbc_hmac_sha1 916
|
||||
|
||||
#define SN_aes_192_cbc_hmac_sha1 "AES-192-CBC-HMAC-SHA1"
|
||||
#define LN_aes_192_cbc_hmac_sha1 "aes-192-cbc-hmac-sha1"
|
||||
#define NID_aes_192_cbc_hmac_sha1 917
|
||||
|
||||
#define SN_aes_256_cbc_hmac_sha1 "AES-256-CBC-HMAC-SHA1"
|
||||
#define LN_aes_256_cbc_hmac_sha1 "aes-256-cbc-hmac-sha1"
|
||||
#define NID_aes_256_cbc_hmac_sha1 918
|
||||
|
||||
|
|
|
@ -2,12 +2,15 @@
|
|||
/* WARNING: Generated automatically from opensslconf.h.in by Configure. */
|
||||
|
||||
/* OpenSSL was configured with the following options: */
|
||||
#ifndef OPENSSL_SYSNAME_MACOSX
|
||||
# define OPENSSL_SYSNAME_MACOSX
|
||||
#ifndef OPENSSL_SYSNAME_MINGW32
|
||||
# define OPENSSL_SYSNAME_MINGW32
|
||||
#endif
|
||||
#ifndef OPENSSL_DOING_MAKEDEPEND
|
||||
|
||||
|
||||
#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
|
||||
# define OPENSSL_NO_EC_NISTP_64_GCC_128
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_GMP
|
||||
# define OPENSSL_NO_GMP
|
||||
#endif
|
||||
|
@ -26,6 +29,9 @@
|
|||
#ifndef OPENSSL_NO_RFC3779
|
||||
# define OPENSSL_NO_RFC3779
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_SCTP
|
||||
# define OPENSSL_NO_SCTP
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_STORE
|
||||
# define OPENSSL_NO_STORE
|
||||
#endif
|
||||
|
@ -44,6 +50,9 @@
|
|||
who haven't had the time to do the appropriate changes in their
|
||||
applications. */
|
||||
#ifdef OPENSSL_ALGORITHM_DEFINES
|
||||
# if defined(OPENSSL_NO_EC_NISTP_64_GCC_128) && !defined(NO_EC_NISTP_64_GCC_128)
|
||||
# define NO_EC_NISTP_64_GCC_128
|
||||
# endif
|
||||
# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP)
|
||||
# define NO_GMP
|
||||
# endif
|
||||
|
@ -62,6 +71,9 @@
|
|||
# if defined(OPENSSL_NO_RFC3779) && !defined(NO_RFC3779)
|
||||
# define NO_RFC3779
|
||||
# endif
|
||||
# if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP)
|
||||
# define NO_SCTP
|
||||
# endif
|
||||
# if defined(OPENSSL_NO_STORE) && !defined(NO_STORE)
|
||||
# define NO_STORE
|
||||
# endif
|
||||
|
@ -76,8 +88,8 @@
|
|||
|
||||
#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */
|
||||
#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR)
|
||||
#define ENGINESDIR "/Users/diopmamadou/Documents/tmp/openssl-1.0.0e/i386/lib/engines"
|
||||
#define OPENSSLDIR "/Users/diopmamadou/Documents/tmp/openssl-1.0.0e/i386"
|
||||
#define ENGINESDIR "c:/tmp/openssl-1.0.1c/win32/lib/engines"
|
||||
#define OPENSSLDIR "c:/tmp/openssl-1.0.1c/win32/ssl"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -85,6 +97,7 @@
|
|||
#define OPENSSL_UNISTD <unistd.h>
|
||||
|
||||
#undef OPENSSL_EXPORT_VAR_AS_FUNCTION
|
||||
#define OPENSSL_EXPORT_VAR_AS_FUNCTION
|
||||
|
||||
#if defined(HEADER_IDEA_H) && !defined(IDEA_INT)
|
||||
#define IDEA_INT unsigned int
|
||||
|
@ -115,7 +128,7 @@
|
|||
* This enables code handling data aligned at natural CPU word
|
||||
* boundary. See crypto/rc4/rc4_enc.c for further details.
|
||||
*/
|
||||
#define RC4_CHUNK unsigned long
|
||||
#undef RC4_CHUNK
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -143,12 +156,12 @@
|
|||
#define CONFIG_HEADER_RC4_LOCL_H
|
||||
/* if this is defined data[i] is used instead of *data, this is a %20
|
||||
* speedup on x86 */
|
||||
#undef RC4_INDEX
|
||||
#define RC4_INDEX
|
||||
#endif
|
||||
|
||||
#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
|
||||
#define CONFIG_HEADER_BF_LOCL_H
|
||||
#define BF_PTR
|
||||
#undef BF_PTR
|
||||
#endif /* HEADER_BF_LOCL_H */
|
||||
|
||||
#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H)
|
||||
|
@ -157,14 +170,14 @@
|
|||
/* the following is tweaked from a config script, that is why it is a
|
||||
* protected undef/define */
|
||||
#ifndef DES_PTR
|
||||
#undef DES_PTR
|
||||
#define DES_PTR
|
||||
#endif
|
||||
|
||||
/* This helps C compiler generate the correct code for multiple functional
|
||||
* units. It reduces register dependancies at the expense of 2 more
|
||||
* registers */
|
||||
#ifndef DES_RISC1
|
||||
#undef DES_RISC1
|
||||
#define DES_RISC1
|
||||
#endif
|
||||
|
||||
#ifndef DES_RISC2
|
||||
|
|
|
@ -25,11 +25,11 @@
|
|||
* (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
|
||||
* major minor fix final patch/beta)
|
||||
*/
|
||||
#define OPENSSL_VERSION_NUMBER 0x1000005fL
|
||||
#define OPENSSL_VERSION_NUMBER 0x1000103fL
|
||||
#ifdef OPENSSL_FIPS
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.0e-fips 6 Sep 2011"
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1c-fips 10 May 2012"
|
||||
#else
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.0e 6 Sep 2011"
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1c 10 May 2012"
|
||||
#endif
|
||||
#define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
|
||||
|
||||
|
|
|
@ -91,10 +91,12 @@ typedef struct asn1_string_st ASN1_TIME;
|
|||
typedef struct asn1_string_st ASN1_GENERALIZEDTIME;
|
||||
typedef struct asn1_string_st ASN1_VISIBLESTRING;
|
||||
typedef struct asn1_string_st ASN1_UTF8STRING;
|
||||
typedef struct asn1_string_st ASN1_STRING;
|
||||
typedef int ASN1_BOOLEAN;
|
||||
typedef int ASN1_NULL;
|
||||
#endif
|
||||
|
||||
typedef struct ASN1_ITEM_st ASN1_ITEM;
|
||||
typedef struct asn1_pctx_st ASN1_PCTX;
|
||||
|
||||
#ifdef OPENSSL_SYS_WIN32
|
||||
|
|
|
@ -119,6 +119,11 @@ int RAND_event(UINT, WPARAM, LPARAM);
|
|||
|
||||
#endif
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
void RAND_set_fips_drbg_type(int type, int flags);
|
||||
int RAND_init_fips(void);
|
||||
#endif
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
|
@ -129,9 +134,13 @@ void ERR_load_RAND_strings(void);
|
|||
|
||||
/* Function codes. */
|
||||
#define RAND_F_RAND_GET_RAND_METHOD 101
|
||||
#define RAND_F_RAND_INIT_FIPS 102
|
||||
#define RAND_F_SSLEAY_RAND_BYTES 100
|
||||
|
||||
/* Reason codes. */
|
||||
#define RAND_R_ERROR_INITIALISING_DRBG 102
|
||||
#define RAND_R_ERROR_INSTANTIATING_DRBG 103
|
||||
#define RAND_R_NO_FIPS_RANDOM_METHOD_SET 101
|
||||
#define RAND_R_PRNG_NOT_SEEDED 100
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -79,7 +79,9 @@ typedef struct rc2_key_st
|
|||
RC2_INT data[64];
|
||||
} RC2_KEY;
|
||||
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
void private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits);
|
||||
#endif
|
||||
void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits);
|
||||
void RC2_ecb_encrypt(const unsigned char *in,unsigned char *out,RC2_KEY *key,
|
||||
int enc);
|
||||
|
|
|
@ -79,6 +79,7 @@ typedef struct rc4_key_st
|
|||
|
||||
const char *RC4_options(void);
|
||||
void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data);
|
||||
void private_RC4_set_key(RC4_KEY *key, int len, const unsigned char *data);
|
||||
void RC4(RC4_KEY *key, size_t len, const unsigned char *indata,
|
||||
unsigned char *outdata);
|
||||
|
||||
|
|
|
@ -91,6 +91,9 @@ typedef struct RIPEMD160state_st
|
|||
unsigned int num;
|
||||
} RIPEMD160_CTX;
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
int private_RIPEMD160_Init(RIPEMD160_CTX *c);
|
||||
#endif
|
||||
int RIPEMD160_Init(RIPEMD160_CTX *c);
|
||||
int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len);
|
||||
int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c);
|
||||
|
|
|
@ -222,12 +222,22 @@ struct rsa_st
|
|||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, -1, EVP_PKEY_CTRL_RSA_PADDING, \
|
||||
pad, NULL)
|
||||
|
||||
#define EVP_PKEY_CTX_get_rsa_padding(ctx, ppad) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, -1, \
|
||||
EVP_PKEY_CTRL_GET_RSA_PADDING, 0, ppad)
|
||||
|
||||
#define EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx, len) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \
|
||||
(EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), \
|
||||
EVP_PKEY_CTRL_RSA_PSS_SALTLEN, \
|
||||
len, NULL)
|
||||
|
||||
#define EVP_PKEY_CTX_get_rsa_pss_saltlen(ctx, plen) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \
|
||||
(EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), \
|
||||
EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN, \
|
||||
0, plen)
|
||||
|
||||
#define EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, bits) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, \
|
||||
EVP_PKEY_CTRL_RSA_KEYGEN_BITS, bits, NULL)
|
||||
|
@ -236,11 +246,24 @@ struct rsa_st
|
|||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, \
|
||||
EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP, 0, pubexp)
|
||||
|
||||
#define EVP_PKEY_CTX_set_rsa_mgf1_md(ctx, md) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_SIG, \
|
||||
EVP_PKEY_CTRL_RSA_MGF1_MD, 0, (void *)md)
|
||||
|
||||
#define EVP_PKEY_CTX_get_rsa_mgf1_md(ctx, pmd) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_SIG, \
|
||||
EVP_PKEY_CTRL_GET_RSA_MGF1_MD, 0, (void *)pmd)
|
||||
|
||||
#define EVP_PKEY_CTRL_RSA_PADDING (EVP_PKEY_ALG_CTRL + 1)
|
||||
#define EVP_PKEY_CTRL_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 2)
|
||||
|
||||
#define EVP_PKEY_CTRL_RSA_KEYGEN_BITS (EVP_PKEY_ALG_CTRL + 3)
|
||||
#define EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP (EVP_PKEY_ALG_CTRL + 4)
|
||||
#define EVP_PKEY_CTRL_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 5)
|
||||
|
||||
#define EVP_PKEY_CTRL_GET_RSA_PADDING (EVP_PKEY_ALG_CTRL + 6)
|
||||
#define EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 7)
|
||||
#define EVP_PKEY_CTRL_GET_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 8)
|
||||
|
||||
#define RSA_PKCS1_PADDING 1
|
||||
#define RSA_SSLV23_PADDING 2
|
||||
|
@ -300,6 +323,16 @@ const RSA_METHOD *RSA_null_method(void);
|
|||
DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPublicKey)
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPrivateKey)
|
||||
|
||||
typedef struct rsa_pss_params_st
|
||||
{
|
||||
X509_ALGOR *hashAlgorithm;
|
||||
X509_ALGOR *maskGenAlgorithm;
|
||||
ASN1_INTEGER *saltLength;
|
||||
ASN1_INTEGER *trailerField;
|
||||
} RSA_PSS_PARAMS;
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS)
|
||||
|
||||
#ifndef OPENSSL_NO_FP_API
|
||||
int RSA_print_fp(FILE *fp, const RSA *r,int offset);
|
||||
#endif
|
||||
|
@ -380,6 +413,14 @@ int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM,
|
|||
const unsigned char *mHash,
|
||||
const EVP_MD *Hash, int sLen);
|
||||
|
||||
int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const unsigned char *mHash,
|
||||
const EVP_MD *Hash, const EVP_MD *mgf1Hash,
|
||||
const unsigned char *EM, int sLen);
|
||||
|
||||
int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM,
|
||||
const unsigned char *mHash,
|
||||
const EVP_MD *Hash, const EVP_MD *mgf1Hash, int sLen);
|
||||
|
||||
int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
|
||||
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
|
||||
int RSA_set_ex_data(RSA *r,int idx,void *arg);
|
||||
|
@ -388,6 +429,25 @@ void *RSA_get_ex_data(const RSA *r, int idx);
|
|||
RSA *RSAPublicKey_dup(RSA *rsa);
|
||||
RSA *RSAPrivateKey_dup(RSA *rsa);
|
||||
|
||||
/* If this flag is set the RSA method is FIPS compliant and can be used
|
||||
* in FIPS mode. This is set in the validated module method. If an
|
||||
* application sets this flag in its own methods it is its responsibility
|
||||
* to ensure the result is compliant.
|
||||
*/
|
||||
|
||||
#define RSA_FLAG_FIPS_METHOD 0x0400
|
||||
|
||||
/* If this flag is set the operations normally disabled in FIPS mode are
|
||||
* permitted it is then the applications responsibility to ensure that the
|
||||
* usage is compliant.
|
||||
*/
|
||||
|
||||
#define RSA_FLAG_NON_FIPS_ALLOW 0x0400
|
||||
/* Application has decided PRNG is good enough to generate a key: don't
|
||||
* check.
|
||||
*/
|
||||
#define RSA_FLAG_CHECKED 0x0800
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
|
@ -405,6 +465,7 @@ void ERR_load_RSA_strings(void);
|
|||
#define RSA_F_PKEY_RSA_CTRL 143
|
||||
#define RSA_F_PKEY_RSA_CTRL_STR 144
|
||||
#define RSA_F_PKEY_RSA_SIGN 142
|
||||
#define RSA_F_PKEY_RSA_VERIFY 154
|
||||
#define RSA_F_PKEY_RSA_VERIFYRECOVER 141
|
||||
#define RSA_F_RSA_BUILTIN_KEYGEN 129
|
||||
#define RSA_F_RSA_CHECK_KEY 123
|
||||
|
@ -413,6 +474,8 @@ void ERR_load_RSA_strings(void);
|
|||
#define RSA_F_RSA_EAY_PUBLIC_DECRYPT 103
|
||||
#define RSA_F_RSA_EAY_PUBLIC_ENCRYPT 104
|
||||
#define RSA_F_RSA_GENERATE_KEY 105
|
||||
#define RSA_F_RSA_GENERATE_KEY_EX 155
|
||||
#define RSA_F_RSA_ITEM_VERIFY 156
|
||||
#define RSA_F_RSA_MEMORY_LOCK 130
|
||||
#define RSA_F_RSA_NEW_METHOD 106
|
||||
#define RSA_F_RSA_NULL 124
|
||||
|
@ -424,6 +487,7 @@ void ERR_load_RSA_strings(void);
|
|||
#define RSA_F_RSA_PADDING_ADD_NONE 107
|
||||
#define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP 121
|
||||
#define RSA_F_RSA_PADDING_ADD_PKCS1_PSS 125
|
||||
#define RSA_F_RSA_PADDING_ADD_PKCS1_PSS_MGF1 148
|
||||
#define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 108
|
||||
#define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 109
|
||||
#define RSA_F_RSA_PADDING_ADD_SSLV23 110
|
||||
|
@ -436,8 +500,12 @@ void ERR_load_RSA_strings(void);
|
|||
#define RSA_F_RSA_PADDING_CHECK_X931 128
|
||||
#define RSA_F_RSA_PRINT 115
|
||||
#define RSA_F_RSA_PRINT_FP 116
|
||||
#define RSA_F_RSA_PRIVATE_DECRYPT 150
|
||||
#define RSA_F_RSA_PRIVATE_ENCRYPT 151
|
||||
#define RSA_F_RSA_PRIV_DECODE 137
|
||||
#define RSA_F_RSA_PRIV_ENCODE 138
|
||||
#define RSA_F_RSA_PUBLIC_DECRYPT 152
|
||||
#define RSA_F_RSA_PUBLIC_ENCRYPT 153
|
||||
#define RSA_F_RSA_PUB_DECODE 139
|
||||
#define RSA_F_RSA_SETUP_BLINDING 136
|
||||
#define RSA_F_RSA_SIGN 117
|
||||
|
@ -445,6 +513,7 @@ void ERR_load_RSA_strings(void);
|
|||
#define RSA_F_RSA_VERIFY 119
|
||||
#define RSA_F_RSA_VERIFY_ASN1_OCTET_STRING 120
|
||||
#define RSA_F_RSA_VERIFY_PKCS1_PSS 126
|
||||
#define RSA_F_RSA_VERIFY_PKCS1_PSS_MGF1 149
|
||||
|
||||
/* Reason codes. */
|
||||
#define RSA_R_ALGORITHM_MISMATCH 100
|
||||
|
@ -470,19 +539,24 @@ void ERR_load_RSA_strings(void);
|
|||
#define RSA_R_INVALID_HEADER 137
|
||||
#define RSA_R_INVALID_KEYBITS 145
|
||||
#define RSA_R_INVALID_MESSAGE_LENGTH 131
|
||||
#define RSA_R_INVALID_MGF1_MD 156
|
||||
#define RSA_R_INVALID_PADDING 138
|
||||
#define RSA_R_INVALID_PADDING_MODE 141
|
||||
#define RSA_R_INVALID_PSS_PARAMETERS 149
|
||||
#define RSA_R_INVALID_PSS_SALTLEN 146
|
||||
#define RSA_R_INVALID_SALT_LENGTH 150
|
||||
#define RSA_R_INVALID_TRAILER 139
|
||||
#define RSA_R_INVALID_X931_DIGEST 142
|
||||
#define RSA_R_IQMP_NOT_INVERSE_OF_Q 126
|
||||
#define RSA_R_KEY_SIZE_TOO_SMALL 120
|
||||
#define RSA_R_LAST_OCTET_INVALID 134
|
||||
#define RSA_R_MODULUS_TOO_LARGE 105
|
||||
#define RSA_R_NON_FIPS_RSA_METHOD 157
|
||||
#define RSA_R_NO_PUBLIC_EXPONENT 140
|
||||
#define RSA_R_NULL_BEFORE_BLOCK_MISSING 113
|
||||
#define RSA_R_N_DOES_NOT_EQUAL_P_Q 127
|
||||
#define RSA_R_OAEP_DECODING_ERROR 121
|
||||
#define RSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE 158
|
||||
#define RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 148
|
||||
#define RSA_R_PADDING_CHECK_FAILED 114
|
||||
#define RSA_R_P_NOT_PRIME 128
|
||||
|
@ -493,7 +567,12 @@ void ERR_load_RSA_strings(void);
|
|||
#define RSA_R_SSLV3_ROLLBACK_ATTACK 115
|
||||
#define RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 116
|
||||
#define RSA_R_UNKNOWN_ALGORITHM_TYPE 117
|
||||
#define RSA_R_UNKNOWN_MASK_DIGEST 151
|
||||
#define RSA_R_UNKNOWN_PADDING_TYPE 118
|
||||
#define RSA_R_UNKNOWN_PSS_DIGEST 152
|
||||
#define RSA_R_UNSUPPORTED_MASK_ALGORITHM 153
|
||||
#define RSA_R_UNSUPPORTED_MASK_PARAMETER 154
|
||||
#define RSA_R_UNSUPPORTED_SIGNATURE_TYPE 155
|
||||
#define RSA_R_VALUE_MISSING 147
|
||||
#define RSA_R_WRONG_SIGNATURE_LENGTH 119
|
||||
|
||||
|
|
|
@ -1459,6 +1459,94 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void)
|
|||
#define sk_POLICY_MAPPING_sort(st) SKM_sk_sort(POLICY_MAPPING, (st))
|
||||
#define sk_POLICY_MAPPING_is_sorted(st) SKM_sk_is_sorted(POLICY_MAPPING, (st))
|
||||
|
||||
#define sk_SRP_gN_new(cmp) SKM_sk_new(SRP_gN, (cmp))
|
||||
#define sk_SRP_gN_new_null() SKM_sk_new_null(SRP_gN)
|
||||
#define sk_SRP_gN_free(st) SKM_sk_free(SRP_gN, (st))
|
||||
#define sk_SRP_gN_num(st) SKM_sk_num(SRP_gN, (st))
|
||||
#define sk_SRP_gN_value(st, i) SKM_sk_value(SRP_gN, (st), (i))
|
||||
#define sk_SRP_gN_set(st, i, val) SKM_sk_set(SRP_gN, (st), (i), (val))
|
||||
#define sk_SRP_gN_zero(st) SKM_sk_zero(SRP_gN, (st))
|
||||
#define sk_SRP_gN_push(st, val) SKM_sk_push(SRP_gN, (st), (val))
|
||||
#define sk_SRP_gN_unshift(st, val) SKM_sk_unshift(SRP_gN, (st), (val))
|
||||
#define sk_SRP_gN_find(st, val) SKM_sk_find(SRP_gN, (st), (val))
|
||||
#define sk_SRP_gN_find_ex(st, val) SKM_sk_find_ex(SRP_gN, (st), (val))
|
||||
#define sk_SRP_gN_delete(st, i) SKM_sk_delete(SRP_gN, (st), (i))
|
||||
#define sk_SRP_gN_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRP_gN, (st), (ptr))
|
||||
#define sk_SRP_gN_insert(st, val, i) SKM_sk_insert(SRP_gN, (st), (val), (i))
|
||||
#define sk_SRP_gN_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRP_gN, (st), (cmp))
|
||||
#define sk_SRP_gN_dup(st) SKM_sk_dup(SRP_gN, st)
|
||||
#define sk_SRP_gN_pop_free(st, free_func) SKM_sk_pop_free(SRP_gN, (st), (free_func))
|
||||
#define sk_SRP_gN_shift(st) SKM_sk_shift(SRP_gN, (st))
|
||||
#define sk_SRP_gN_pop(st) SKM_sk_pop(SRP_gN, (st))
|
||||
#define sk_SRP_gN_sort(st) SKM_sk_sort(SRP_gN, (st))
|
||||
#define sk_SRP_gN_is_sorted(st) SKM_sk_is_sorted(SRP_gN, (st))
|
||||
|
||||
#define sk_SRP_gN_cache_new(cmp) SKM_sk_new(SRP_gN_cache, (cmp))
|
||||
#define sk_SRP_gN_cache_new_null() SKM_sk_new_null(SRP_gN_cache)
|
||||
#define sk_SRP_gN_cache_free(st) SKM_sk_free(SRP_gN_cache, (st))
|
||||
#define sk_SRP_gN_cache_num(st) SKM_sk_num(SRP_gN_cache, (st))
|
||||
#define sk_SRP_gN_cache_value(st, i) SKM_sk_value(SRP_gN_cache, (st), (i))
|
||||
#define sk_SRP_gN_cache_set(st, i, val) SKM_sk_set(SRP_gN_cache, (st), (i), (val))
|
||||
#define sk_SRP_gN_cache_zero(st) SKM_sk_zero(SRP_gN_cache, (st))
|
||||
#define sk_SRP_gN_cache_push(st, val) SKM_sk_push(SRP_gN_cache, (st), (val))
|
||||
#define sk_SRP_gN_cache_unshift(st, val) SKM_sk_unshift(SRP_gN_cache, (st), (val))
|
||||
#define sk_SRP_gN_cache_find(st, val) SKM_sk_find(SRP_gN_cache, (st), (val))
|
||||
#define sk_SRP_gN_cache_find_ex(st, val) SKM_sk_find_ex(SRP_gN_cache, (st), (val))
|
||||
#define sk_SRP_gN_cache_delete(st, i) SKM_sk_delete(SRP_gN_cache, (st), (i))
|
||||
#define sk_SRP_gN_cache_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRP_gN_cache, (st), (ptr))
|
||||
#define sk_SRP_gN_cache_insert(st, val, i) SKM_sk_insert(SRP_gN_cache, (st), (val), (i))
|
||||
#define sk_SRP_gN_cache_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRP_gN_cache, (st), (cmp))
|
||||
#define sk_SRP_gN_cache_dup(st) SKM_sk_dup(SRP_gN_cache, st)
|
||||
#define sk_SRP_gN_cache_pop_free(st, free_func) SKM_sk_pop_free(SRP_gN_cache, (st), (free_func))
|
||||
#define sk_SRP_gN_cache_shift(st) SKM_sk_shift(SRP_gN_cache, (st))
|
||||
#define sk_SRP_gN_cache_pop(st) SKM_sk_pop(SRP_gN_cache, (st))
|
||||
#define sk_SRP_gN_cache_sort(st) SKM_sk_sort(SRP_gN_cache, (st))
|
||||
#define sk_SRP_gN_cache_is_sorted(st) SKM_sk_is_sorted(SRP_gN_cache, (st))
|
||||
|
||||
#define sk_SRP_user_pwd_new(cmp) SKM_sk_new(SRP_user_pwd, (cmp))
|
||||
#define sk_SRP_user_pwd_new_null() SKM_sk_new_null(SRP_user_pwd)
|
||||
#define sk_SRP_user_pwd_free(st) SKM_sk_free(SRP_user_pwd, (st))
|
||||
#define sk_SRP_user_pwd_num(st) SKM_sk_num(SRP_user_pwd, (st))
|
||||
#define sk_SRP_user_pwd_value(st, i) SKM_sk_value(SRP_user_pwd, (st), (i))
|
||||
#define sk_SRP_user_pwd_set(st, i, val) SKM_sk_set(SRP_user_pwd, (st), (i), (val))
|
||||
#define sk_SRP_user_pwd_zero(st) SKM_sk_zero(SRP_user_pwd, (st))
|
||||
#define sk_SRP_user_pwd_push(st, val) SKM_sk_push(SRP_user_pwd, (st), (val))
|
||||
#define sk_SRP_user_pwd_unshift(st, val) SKM_sk_unshift(SRP_user_pwd, (st), (val))
|
||||
#define sk_SRP_user_pwd_find(st, val) SKM_sk_find(SRP_user_pwd, (st), (val))
|
||||
#define sk_SRP_user_pwd_find_ex(st, val) SKM_sk_find_ex(SRP_user_pwd, (st), (val))
|
||||
#define sk_SRP_user_pwd_delete(st, i) SKM_sk_delete(SRP_user_pwd, (st), (i))
|
||||
#define sk_SRP_user_pwd_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRP_user_pwd, (st), (ptr))
|
||||
#define sk_SRP_user_pwd_insert(st, val, i) SKM_sk_insert(SRP_user_pwd, (st), (val), (i))
|
||||
#define sk_SRP_user_pwd_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRP_user_pwd, (st), (cmp))
|
||||
#define sk_SRP_user_pwd_dup(st) SKM_sk_dup(SRP_user_pwd, st)
|
||||
#define sk_SRP_user_pwd_pop_free(st, free_func) SKM_sk_pop_free(SRP_user_pwd, (st), (free_func))
|
||||
#define sk_SRP_user_pwd_shift(st) SKM_sk_shift(SRP_user_pwd, (st))
|
||||
#define sk_SRP_user_pwd_pop(st) SKM_sk_pop(SRP_user_pwd, (st))
|
||||
#define sk_SRP_user_pwd_sort(st) SKM_sk_sort(SRP_user_pwd, (st))
|
||||
#define sk_SRP_user_pwd_is_sorted(st) SKM_sk_is_sorted(SRP_user_pwd, (st))
|
||||
|
||||
#define sk_SRTP_PROTECTION_PROFILE_new(cmp) SKM_sk_new(SRTP_PROTECTION_PROFILE, (cmp))
|
||||
#define sk_SRTP_PROTECTION_PROFILE_new_null() SKM_sk_new_null(SRTP_PROTECTION_PROFILE)
|
||||
#define sk_SRTP_PROTECTION_PROFILE_free(st) SKM_sk_free(SRTP_PROTECTION_PROFILE, (st))
|
||||
#define sk_SRTP_PROTECTION_PROFILE_num(st) SKM_sk_num(SRTP_PROTECTION_PROFILE, (st))
|
||||
#define sk_SRTP_PROTECTION_PROFILE_value(st, i) SKM_sk_value(SRTP_PROTECTION_PROFILE, (st), (i))
|
||||
#define sk_SRTP_PROTECTION_PROFILE_set(st, i, val) SKM_sk_set(SRTP_PROTECTION_PROFILE, (st), (i), (val))
|
||||
#define sk_SRTP_PROTECTION_PROFILE_zero(st) SKM_sk_zero(SRTP_PROTECTION_PROFILE, (st))
|
||||
#define sk_SRTP_PROTECTION_PROFILE_push(st, val) SKM_sk_push(SRTP_PROTECTION_PROFILE, (st), (val))
|
||||
#define sk_SRTP_PROTECTION_PROFILE_unshift(st, val) SKM_sk_unshift(SRTP_PROTECTION_PROFILE, (st), (val))
|
||||
#define sk_SRTP_PROTECTION_PROFILE_find(st, val) SKM_sk_find(SRTP_PROTECTION_PROFILE, (st), (val))
|
||||
#define sk_SRTP_PROTECTION_PROFILE_find_ex(st, val) SKM_sk_find_ex(SRTP_PROTECTION_PROFILE, (st), (val))
|
||||
#define sk_SRTP_PROTECTION_PROFILE_delete(st, i) SKM_sk_delete(SRTP_PROTECTION_PROFILE, (st), (i))
|
||||
#define sk_SRTP_PROTECTION_PROFILE_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRTP_PROTECTION_PROFILE, (st), (ptr))
|
||||
#define sk_SRTP_PROTECTION_PROFILE_insert(st, val, i) SKM_sk_insert(SRTP_PROTECTION_PROFILE, (st), (val), (i))
|
||||
#define sk_SRTP_PROTECTION_PROFILE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRTP_PROTECTION_PROFILE, (st), (cmp))
|
||||
#define sk_SRTP_PROTECTION_PROFILE_dup(st) SKM_sk_dup(SRTP_PROTECTION_PROFILE, st)
|
||||
#define sk_SRTP_PROTECTION_PROFILE_pop_free(st, free_func) SKM_sk_pop_free(SRTP_PROTECTION_PROFILE, (st), (free_func))
|
||||
#define sk_SRTP_PROTECTION_PROFILE_shift(st) SKM_sk_shift(SRTP_PROTECTION_PROFILE, (st))
|
||||
#define sk_SRTP_PROTECTION_PROFILE_pop(st) SKM_sk_pop(SRTP_PROTECTION_PROFILE, (st))
|
||||
#define sk_SRTP_PROTECTION_PROFILE_sort(st) SKM_sk_sort(SRTP_PROTECTION_PROFILE, (st))
|
||||
#define sk_SRTP_PROTECTION_PROFILE_is_sorted(st) SKM_sk_is_sorted(SRTP_PROTECTION_PROFILE, (st))
|
||||
|
||||
#define sk_SSL_CIPHER_new(cmp) SKM_sk_new(SSL_CIPHER, (cmp))
|
||||
#define sk_SSL_CIPHER_new_null() SKM_sk_new_null(SSL_CIPHER)
|
||||
#define sk_SSL_CIPHER_free(st) SKM_sk_free(SSL_CIPHER, (st))
|
||||
|
@ -2056,31 +2144,6 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void)
|
|||
#define sk_OPENSSL_STRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_STRING, (st))
|
||||
|
||||
|
||||
#define sk_OPENSSL_PSTRING_new(cmp) ((STACK_OF(OPENSSL_PSTRING) *)sk_new(CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp)))
|
||||
#define sk_OPENSSL_PSTRING_new_null() ((STACK_OF(OPENSSL_PSTRING) *)sk_new_null())
|
||||
#define sk_OPENSSL_PSTRING_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val))
|
||||
#define sk_OPENSSL_PSTRING_find(st, val) sk_find(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val))
|
||||
#define sk_OPENSSL_PSTRING_value(st, i) ((OPENSSL_PSTRING)sk_value(CHECKED_STACK_OF(OPENSSL_PSTRING, st), i))
|
||||
#define sk_OPENSSL_PSTRING_num(st) SKM_sk_num(OPENSSL_PSTRING, st)
|
||||
#define sk_OPENSSL_PSTRING_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_SK_FREE_FUNC2(OPENSSL_PSTRING, free_func))
|
||||
#define sk_OPENSSL_PSTRING_insert(st, val, i) sk_insert(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val), i)
|
||||
#define sk_OPENSSL_PSTRING_free(st) SKM_sk_free(OPENSSL_PSTRING, st)
|
||||
#define sk_OPENSSL_PSTRING_set(st, i, val) sk_set(CHECKED_STACK_OF(OPENSSL_PSTRING, st), i, CHECKED_PTR_OF(OPENSSL_STRING, val))
|
||||
#define sk_OPENSSL_PSTRING_zero(st) SKM_sk_zero(OPENSSL_PSTRING, (st))
|
||||
#define sk_OPENSSL_PSTRING_unshift(st, val) sk_unshift(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val))
|
||||
#define sk_OPENSSL_PSTRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_CONST_PTR_OF(OPENSSL_STRING, val))
|
||||
#define sk_OPENSSL_PSTRING_delete(st, i) SKM_sk_delete(OPENSSL_PSTRING, (st), (i))
|
||||
#define sk_OPENSSL_PSTRING_delete_ptr(st, ptr) (OPENSSL_PSTRING *)sk_delete_ptr(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, ptr))
|
||||
#define sk_OPENSSL_PSTRING_set_cmp_func(st, cmp) \
|
||||
((int (*)(const OPENSSL_STRING * const *,const OPENSSL_STRING * const *)) \
|
||||
sk_set_cmp_func(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp)))
|
||||
#define sk_OPENSSL_PSTRING_dup(st) SKM_sk_dup(OPENSSL_PSTRING, st)
|
||||
#define sk_OPENSSL_PSTRING_shift(st) SKM_sk_shift(OPENSSL_PSTRING, (st))
|
||||
#define sk_OPENSSL_PSTRING_pop(st) (OPENSSL_STRING *)sk_pop(CHECKED_STACK_OF(OPENSSL_PSTRING, st))
|
||||
#define sk_OPENSSL_PSTRING_sort(st) SKM_sk_sort(OPENSSL_PSTRING, (st))
|
||||
#define sk_OPENSSL_PSTRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_PSTRING, (st))
|
||||
|
||||
|
||||
#define sk_OPENSSL_BLOCK_new(cmp) ((STACK_OF(OPENSSL_BLOCK) *)sk_new(CHECKED_SK_CMP_FUNC(void, cmp)))
|
||||
#define sk_OPENSSL_BLOCK_new_null() ((STACK_OF(OPENSSL_BLOCK) *)sk_new_null())
|
||||
#define sk_OPENSSL_BLOCK_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val))
|
||||
|
@ -2106,6 +2169,31 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void)
|
|||
#define sk_OPENSSL_BLOCK_is_sorted(st) SKM_sk_is_sorted(OPENSSL_BLOCK, (st))
|
||||
|
||||
|
||||
#define sk_OPENSSL_PSTRING_new(cmp) ((STACK_OF(OPENSSL_PSTRING) *)sk_new(CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp)))
|
||||
#define sk_OPENSSL_PSTRING_new_null() ((STACK_OF(OPENSSL_PSTRING) *)sk_new_null())
|
||||
#define sk_OPENSSL_PSTRING_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val))
|
||||
#define sk_OPENSSL_PSTRING_find(st, val) sk_find(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val))
|
||||
#define sk_OPENSSL_PSTRING_value(st, i) ((OPENSSL_PSTRING)sk_value(CHECKED_STACK_OF(OPENSSL_PSTRING, st), i))
|
||||
#define sk_OPENSSL_PSTRING_num(st) SKM_sk_num(OPENSSL_PSTRING, st)
|
||||
#define sk_OPENSSL_PSTRING_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_SK_FREE_FUNC2(OPENSSL_PSTRING, free_func))
|
||||
#define sk_OPENSSL_PSTRING_insert(st, val, i) sk_insert(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val), i)
|
||||
#define sk_OPENSSL_PSTRING_free(st) SKM_sk_free(OPENSSL_PSTRING, st)
|
||||
#define sk_OPENSSL_PSTRING_set(st, i, val) sk_set(CHECKED_STACK_OF(OPENSSL_PSTRING, st), i, CHECKED_PTR_OF(OPENSSL_STRING, val))
|
||||
#define sk_OPENSSL_PSTRING_zero(st) SKM_sk_zero(OPENSSL_PSTRING, (st))
|
||||
#define sk_OPENSSL_PSTRING_unshift(st, val) sk_unshift(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val))
|
||||
#define sk_OPENSSL_PSTRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_CONST_PTR_OF(OPENSSL_STRING, val))
|
||||
#define sk_OPENSSL_PSTRING_delete(st, i) SKM_sk_delete(OPENSSL_PSTRING, (st), (i))
|
||||
#define sk_OPENSSL_PSTRING_delete_ptr(st, ptr) (OPENSSL_PSTRING *)sk_delete_ptr(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, ptr))
|
||||
#define sk_OPENSSL_PSTRING_set_cmp_func(st, cmp) \
|
||||
((int (*)(const OPENSSL_STRING * const *,const OPENSSL_STRING * const *)) \
|
||||
sk_set_cmp_func(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp)))
|
||||
#define sk_OPENSSL_PSTRING_dup(st) SKM_sk_dup(OPENSSL_PSTRING, st)
|
||||
#define sk_OPENSSL_PSTRING_shift(st) SKM_sk_shift(OPENSSL_PSTRING, (st))
|
||||
#define sk_OPENSSL_PSTRING_pop(st) (OPENSSL_STRING *)sk_pop(CHECKED_STACK_OF(OPENSSL_PSTRING, st))
|
||||
#define sk_OPENSSL_PSTRING_sort(st) SKM_sk_sort(OPENSSL_PSTRING, (st))
|
||||
#define sk_OPENSSL_PSTRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_PSTRING, (st))
|
||||
|
||||
|
||||
#define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
|
||||
SKM_ASN1_SET_OF_d2i(ACCESS_DESCRIPTION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
|
||||
#define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, i2d_func, ex_tag, ex_class, is_set) \
|
||||
|
|
|
@ -116,7 +116,9 @@ typedef struct seed_key_st {
|
|||
#endif
|
||||
} SEED_KEY_SCHEDULE;
|
||||
|
||||
|
||||
#ifdef OPENSSL_FIPS
|
||||
void private_SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH], SEED_KEY_SCHEDULE *ks);
|
||||
#endif
|
||||
void SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH], SEED_KEY_SCHEDULE *ks);
|
||||
|
||||
void SEED_encrypt(const unsigned char s[SEED_BLOCK_SIZE], unsigned char d[SEED_BLOCK_SIZE], const SEED_KEY_SCHEDULE *ks);
|
||||
|
|
|
@ -106,6 +106,9 @@ typedef struct SHAstate_st
|
|||
} SHA_CTX;
|
||||
|
||||
#ifndef OPENSSL_NO_SHA0
|
||||
#ifdef OPENSSL_FIPS
|
||||
int private_SHA_Init(SHA_CTX *c);
|
||||
#endif
|
||||
int SHA_Init(SHA_CTX *c);
|
||||
int SHA_Update(SHA_CTX *c, const void *data, size_t len);
|
||||
int SHA_Final(unsigned char *md, SHA_CTX *c);
|
||||
|
@ -113,6 +116,9 @@ unsigned char *SHA(const unsigned char *d, size_t n, unsigned char *md);
|
|||
void SHA_Transform(SHA_CTX *c, const unsigned char *data);
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_SHA1
|
||||
#ifdef OPENSSL_FIPS
|
||||
int private_SHA1_Init(SHA_CTX *c);
|
||||
#endif
|
||||
int SHA1_Init(SHA_CTX *c);
|
||||
int SHA1_Update(SHA_CTX *c, const void *data, size_t len);
|
||||
int SHA1_Final(unsigned char *md, SHA_CTX *c);
|
||||
|
@ -135,6 +141,10 @@ typedef struct SHA256state_st
|
|||
} SHA256_CTX;
|
||||
|
||||
#ifndef OPENSSL_NO_SHA256
|
||||
#ifdef OPENSSL_FIPS
|
||||
int private_SHA224_Init(SHA256_CTX *c);
|
||||
int private_SHA256_Init(SHA256_CTX *c);
|
||||
#endif
|
||||
int SHA224_Init(SHA256_CTX *c);
|
||||
int SHA224_Update(SHA256_CTX *c, const void *data, size_t len);
|
||||
int SHA224_Final(unsigned char *md, SHA256_CTX *c);
|
||||
|
@ -182,6 +192,10 @@ typedef struct SHA512state_st
|
|||
#endif
|
||||
|
||||
#ifndef OPENSSL_NO_SHA512
|
||||
#ifdef OPENSSL_FIPS
|
||||
int private_SHA384_Init(SHA512_CTX *c);
|
||||
int private_SHA512_Init(SHA512_CTX *c);
|
||||
#endif
|
||||
int SHA384_Init(SHA512_CTX *c);
|
||||
int SHA384_Update(SHA512_CTX *c, const void *data, size_t len);
|
||||
int SHA384_Final(unsigned char *md, SHA512_CTX *c);
|
||||
|
|
|
@ -252,6 +252,7 @@ extern "C" {
|
|||
#define SSL_TXT_kEECDH "kEECDH"
|
||||
#define SSL_TXT_kPSK "kPSK"
|
||||
#define SSL_TXT_kGOST "kGOST"
|
||||
#define SSL_TXT_kSRP "kSRP"
|
||||
|
||||
#define SSL_TXT_aRSA "aRSA"
|
||||
#define SSL_TXT_aDSS "aDSS"
|
||||
|
@ -275,6 +276,7 @@ extern "C" {
|
|||
#define SSL_TXT_ECDSA "ECDSA"
|
||||
#define SSL_TXT_KRB5 "KRB5"
|
||||
#define SSL_TXT_PSK "PSK"
|
||||
#define SSL_TXT_SRP "SRP"
|
||||
|
||||
#define SSL_TXT_DES "DES"
|
||||
#define SSL_TXT_3DES "3DES"
|
||||
|
@ -285,6 +287,7 @@ extern "C" {
|
|||
#define SSL_TXT_AES128 "AES128"
|
||||
#define SSL_TXT_AES256 "AES256"
|
||||
#define SSL_TXT_AES "AES"
|
||||
#define SSL_TXT_AES_GCM "AESGCM"
|
||||
#define SSL_TXT_CAMELLIA128 "CAMELLIA128"
|
||||
#define SSL_TXT_CAMELLIA256 "CAMELLIA256"
|
||||
#define SSL_TXT_CAMELLIA "CAMELLIA"
|
||||
|
@ -294,10 +297,14 @@ extern "C" {
|
|||
#define SSL_TXT_SHA "SHA" /* same as "SHA1" */
|
||||
#define SSL_TXT_GOST94 "GOST94"
|
||||
#define SSL_TXT_GOST89MAC "GOST89MAC"
|
||||
#define SSL_TXT_SHA256 "SHA256"
|
||||
#define SSL_TXT_SHA384 "SHA384"
|
||||
|
||||
#define SSL_TXT_SSLV2 "SSLv2"
|
||||
#define SSL_TXT_SSLV3 "SSLv3"
|
||||
#define SSL_TXT_TLSV1 "TLSv1"
|
||||
#define SSL_TXT_TLSV1_1 "TLSv1.1"
|
||||
#define SSL_TXT_TLSV1_2 "TLSv1.2"
|
||||
|
||||
#define SSL_TXT_EXP "EXP"
|
||||
#define SSL_TXT_EXPORT "EXPORT"
|
||||
|
@ -356,9 +363,29 @@ extern "C" {
|
|||
* in SSL_CTX. */
|
||||
typedef struct ssl_st *ssl_crock_st;
|
||||
typedef struct tls_session_ticket_ext_st TLS_SESSION_TICKET_EXT;
|
||||
typedef struct ssl_method_st SSL_METHOD;
|
||||
typedef struct ssl_cipher_st SSL_CIPHER;
|
||||
typedef struct ssl_session_st SSL_SESSION;
|
||||
|
||||
DECLARE_STACK_OF(SSL_CIPHER)
|
||||
|
||||
/* SRTP protection profiles for use with the use_srtp extension (RFC 5764)*/
|
||||
typedef struct srtp_protection_profile_st
|
||||
{
|
||||
const char *name;
|
||||
unsigned long id;
|
||||
} SRTP_PROTECTION_PROFILE;
|
||||
|
||||
DECLARE_STACK_OF(SRTP_PROTECTION_PROFILE)
|
||||
|
||||
typedef int (*tls_session_ticket_ext_cb_fn)(SSL *s, const unsigned char *data, int len, void *arg);
|
||||
typedef int (*tls_session_secret_cb_fn)(SSL *s, void *secret, int *secret_len, STACK_OF(SSL_CIPHER) *peer_ciphers, SSL_CIPHER **cipher, void *arg);
|
||||
|
||||
|
||||
#ifndef OPENSSL_NO_SSL_INTERN
|
||||
|
||||
/* used to hold info on the particular ciphers used */
|
||||
typedef struct ssl_cipher_st
|
||||
struct ssl_cipher_st
|
||||
{
|
||||
int valid;
|
||||
const char *name; /* text name */
|
||||
|
@ -375,15 +402,11 @@ typedef struct ssl_cipher_st
|
|||
unsigned long algorithm2; /* Extra flags */
|
||||
int strength_bits; /* Number of bits really used */
|
||||
int alg_bits; /* Number of bits for algorithm */
|
||||
} SSL_CIPHER;
|
||||
};
|
||||
|
||||
DECLARE_STACK_OF(SSL_CIPHER)
|
||||
|
||||
typedef int (*tls_session_ticket_ext_cb_fn)(SSL *s, const unsigned char *data, int len, void *arg);
|
||||
typedef int (*tls_session_secret_cb_fn)(SSL *s, void *secret, int *secret_len, STACK_OF(SSL_CIPHER) *peer_ciphers, SSL_CIPHER **cipher, void *arg);
|
||||
|
||||
/* Used to hold functions for SSLv2 or SSLv3/TLSv1 functions */
|
||||
typedef struct ssl_method_st
|
||||
struct ssl_method_st
|
||||
{
|
||||
int version;
|
||||
int (*ssl_new)(SSL *s);
|
||||
|
@ -416,7 +439,7 @@ typedef struct ssl_method_st
|
|||
int (*ssl_version)(void);
|
||||
long (*ssl_callback_ctrl)(SSL *s, int cb_id, void (*fp)(void));
|
||||
long (*ssl_ctx_callback_ctrl)(SSL_CTX *s, int cb_id, void (*fp)(void));
|
||||
} SSL_METHOD;
|
||||
};
|
||||
|
||||
/* Lets make this into an ASN.1 type structure as follows
|
||||
* SSL_SESSION_ID ::= SEQUENCE {
|
||||
|
@ -433,14 +456,17 @@ typedef struct ssl_method_st
|
|||
* Session_ID_context [ 4 ] EXPLICIT OCTET STRING, -- the Session ID context
|
||||
* Verify_result [ 5 ] EXPLICIT INTEGER, -- X509_V_... code for `Peer'
|
||||
* HostName [ 6 ] EXPLICIT OCTET STRING, -- optional HostName from servername TLS extension
|
||||
* ECPointFormatList [ 7 ] OCTET STRING, -- optional EC point format list from TLS extension
|
||||
* PSK_identity_hint [ 8 ] EXPLICIT OCTET STRING, -- optional PSK identity hint
|
||||
* PSK_identity [ 9 ] EXPLICIT OCTET STRING -- optional PSK identity
|
||||
* PSK_identity_hint [ 7 ] EXPLICIT OCTET STRING, -- optional PSK identity hint
|
||||
* PSK_identity [ 8 ] EXPLICIT OCTET STRING, -- optional PSK identity
|
||||
* Ticket_lifetime_hint [9] EXPLICIT INTEGER, -- server's lifetime hint for session ticket
|
||||
* Ticket [10] EXPLICIT OCTET STRING, -- session ticket (clients only)
|
||||
* Compression_meth [11] EXPLICIT OCTET STRING, -- optional compression method
|
||||
* SRP_username [ 12 ] EXPLICIT OCTET STRING -- optional SRP username
|
||||
* }
|
||||
* Look in ssl/ssl_asn1.c for more details
|
||||
* I'm using EXPLICIT tags so I can read the damn things using asn1parse :-).
|
||||
*/
|
||||
typedef struct ssl_session_st
|
||||
struct ssl_session_st
|
||||
{
|
||||
int ssl_version; /* what ssl version session info is
|
||||
* being kept in here? */
|
||||
|
@ -512,8 +538,12 @@ typedef struct ssl_session_st
|
|||
size_t tlsext_ticklen; /* Session ticket length */
|
||||
long tlsext_tick_lifetime_hint; /* Session lifetime hint in seconds */
|
||||
#endif
|
||||
} SSL_SESSION;
|
||||
#ifndef OPENSSL_NO_SRP
|
||||
char *srp_username;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#define SSL_OP_MICROSOFT_SESS_ID_BUG 0x00000001L
|
||||
#define SSL_OP_NETSCAPE_CHALLENGE_BUG 0x00000002L
|
||||
|
@ -536,7 +566,7 @@ typedef struct ssl_session_st
|
|||
|
||||
/* SSL_OP_ALL: various bug workarounds that should be rather harmless.
|
||||
* This used to be 0x000FFFFFL before 0.9.7. */
|
||||
#define SSL_OP_ALL 0x80000FFFL
|
||||
#define SSL_OP_ALL 0x80000BFFL
|
||||
|
||||
/* DTLS options */
|
||||
#define SSL_OP_NO_QUERY_MTU 0x00001000L
|
||||
|
@ -572,11 +602,17 @@ typedef struct ssl_session_st
|
|||
#define SSL_OP_NO_SSLv2 0x01000000L
|
||||
#define SSL_OP_NO_SSLv3 0x02000000L
|
||||
#define SSL_OP_NO_TLSv1 0x04000000L
|
||||
#define SSL_OP_NO_TLSv1_2 0x08000000L
|
||||
#define SSL_OP_NO_TLSv1_1 0x10000000L
|
||||
|
||||
/* These next two were never actually used for anything since SSLeay
|
||||
* zap so we have some more flags.
|
||||
*/
|
||||
/* The next flag deliberately changes the ciphertest, this is a check
|
||||
* for the PKCS#1 attack */
|
||||
#define SSL_OP_PKCS1_CHECK_1 0x08000000L
|
||||
#define SSL_OP_PKCS1_CHECK_2 0x10000000L
|
||||
#define SSL_OP_PKCS1_CHECK_1 0x0
|
||||
#define SSL_OP_PKCS1_CHECK_2 0x0
|
||||
|
||||
#define SSL_OP_NETSCAPE_CA_DN_BUG 0x20000000L
|
||||
#define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x40000000L
|
||||
/* Make server add server-hello extension from early version of
|
||||
|
@ -637,12 +673,53 @@ typedef struct ssl_session_st
|
|||
#define SSL_get_secure_renegotiation_support(ssl) \
|
||||
SSL_ctrl((ssl), SSL_CTRL_GET_RI_SUPPORT, 0, NULL)
|
||||
|
||||
#ifndef OPENSSL_NO_HEARTBEATS
|
||||
#define SSL_heartbeat(ssl) \
|
||||
SSL_ctrl((ssl),SSL_CTRL_TLS_EXT_SEND_HEARTBEAT,0,NULL)
|
||||
#endif
|
||||
|
||||
void SSL_CTX_set_msg_callback(SSL_CTX *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg));
|
||||
void SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg));
|
||||
#define SSL_CTX_set_msg_callback_arg(ctx, arg) SSL_CTX_ctrl((ctx), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg))
|
||||
#define SSL_set_msg_callback_arg(ssl, arg) SSL_ctrl((ssl), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg))
|
||||
|
||||
#ifndef OPENSSL_NO_SRP
|
||||
|
||||
#ifndef OPENSSL_NO_SSL_INTERN
|
||||
|
||||
typedef struct srp_ctx_st
|
||||
{
|
||||
/* param for all the callbacks */
|
||||
void *SRP_cb_arg;
|
||||
/* set client Hello login callback */
|
||||
int (*TLS_ext_srp_username_callback)(SSL *, int *, void *);
|
||||
/* set SRP N/g param callback for verification */
|
||||
int (*SRP_verify_param_callback)(SSL *, void *);
|
||||
/* set SRP client passwd callback */
|
||||
char *(*SRP_give_srp_client_pwd_callback)(SSL *, void *);
|
||||
|
||||
char *login;
|
||||
BIGNUM *N,*g,*s,*B,*A;
|
||||
BIGNUM *a,*b,*v;
|
||||
char *info;
|
||||
int strength;
|
||||
|
||||
unsigned long srp_Mask;
|
||||
} SRP_CTX;
|
||||
|
||||
#endif
|
||||
|
||||
/* see tls_srp.c */
|
||||
int SSL_SRP_CTX_init(SSL *s);
|
||||
int SSL_CTX_SRP_CTX_init(SSL_CTX *ctx);
|
||||
int SSL_SRP_CTX_free(SSL *ctx);
|
||||
int SSL_CTX_SRP_CTX_free(SSL_CTX *ctx);
|
||||
int SSL_srp_server_param_with_username(SSL *s, int *ad);
|
||||
int SRP_generate_server_master_secret(SSL *s,unsigned char *master_key);
|
||||
int SRP_Calc_A_param(SSL *s);
|
||||
int SRP_generate_client_master_secret(SSL *s,unsigned char *master_key);
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WIN32)
|
||||
#define SSL_MAX_CERT_LIST_DEFAULT 1024*30 /* 30k max cert list :-) */
|
||||
|
@ -668,7 +745,11 @@ void SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version, int con
|
|||
typedef int (*GEN_SESSION_CB)(const SSL *ssl, unsigned char *id,
|
||||
unsigned int *id_len);
|
||||
|
||||
typedef struct ssl_comp_st
|
||||
typedef struct ssl_comp_st SSL_COMP;
|
||||
|
||||
#ifndef OPENSSL_NO_SSL_INTERN
|
||||
|
||||
struct ssl_comp_st
|
||||
{
|
||||
int id;
|
||||
const char *name;
|
||||
|
@ -677,7 +758,7 @@ typedef struct ssl_comp_st
|
|||
#else
|
||||
char *method;
|
||||
#endif
|
||||
} SSL_COMP;
|
||||
};
|
||||
|
||||
DECLARE_STACK_OF(SSL_COMP)
|
||||
DECLARE_LHASH_OF(SSL_SESSION);
|
||||
|
@ -846,7 +927,6 @@ struct ssl_ctx_st
|
|||
/* Callback for status request */
|
||||
int (*tlsext_status_cb)(SSL *ssl, void *arg);
|
||||
void *tlsext_status_arg;
|
||||
|
||||
/* draft-rescorla-tls-opaque-prf-input-00.txt information */
|
||||
int (*tlsext_opaque_prf_input_callback)(SSL *, void *peerinput, size_t len, void *arg);
|
||||
void *tlsext_opaque_prf_input_callback_arg;
|
||||
|
@ -866,9 +946,37 @@ struct ssl_ctx_st
|
|||
unsigned int freelist_max_len;
|
||||
struct ssl3_buf_freelist_st *wbuf_freelist;
|
||||
struct ssl3_buf_freelist_st *rbuf_freelist;
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_SRP
|
||||
SRP_CTX srp_ctx; /* ctx for SRP authentication */
|
||||
#endif
|
||||
|
||||
#ifndef OPENSSL_NO_TLSEXT
|
||||
# ifndef OPENSSL_NO_NEXTPROTONEG
|
||||
/* Next protocol negotiation information */
|
||||
/* (for experimental NPN extension). */
|
||||
|
||||
/* For a server, this contains a callback function by which the set of
|
||||
* advertised protocols can be provided. */
|
||||
int (*next_protos_advertised_cb)(SSL *s, const unsigned char **buf,
|
||||
unsigned int *len, void *arg);
|
||||
void *next_protos_advertised_cb_arg;
|
||||
/* For a client, this contains a callback function that selects the
|
||||
* next protocol from the list provided by the server. */
|
||||
int (*next_proto_select_cb)(SSL *s, unsigned char **out,
|
||||
unsigned char *outlen,
|
||||
const unsigned char *in,
|
||||
unsigned int inlen,
|
||||
void *arg);
|
||||
void *next_proto_select_cb_arg;
|
||||
# endif
|
||||
/* SRTP profiles we are willing to do from RFC 5764 */
|
||||
STACK_OF(SRTP_PROTECTION_PROFILE) *srtp_profiles;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#define SSL_SESS_CACHE_OFF 0x0000
|
||||
#define SSL_SESS_CACHE_CLIENT 0x0001
|
||||
#define SSL_SESS_CACHE_SERVER 0x0002
|
||||
|
@ -921,6 +1029,32 @@ int SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e);
|
|||
#endif
|
||||
void SSL_CTX_set_cookie_generate_cb(SSL_CTX *ctx, int (*app_gen_cookie_cb)(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len));
|
||||
void SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx, int (*app_verify_cookie_cb)(SSL *ssl, unsigned char *cookie, unsigned int cookie_len));
|
||||
#ifndef OPENSSL_NO_NEXTPROTONEG
|
||||
void SSL_CTX_set_next_protos_advertised_cb(SSL_CTX *s,
|
||||
int (*cb) (SSL *ssl,
|
||||
const unsigned char **out,
|
||||
unsigned int *outlen,
|
||||
void *arg),
|
||||
void *arg);
|
||||
void SSL_CTX_set_next_proto_select_cb(SSL_CTX *s,
|
||||
int (*cb) (SSL *ssl,
|
||||
unsigned char **out,
|
||||
unsigned char *outlen,
|
||||
const unsigned char *in,
|
||||
unsigned int inlen,
|
||||
void *arg),
|
||||
void *arg);
|
||||
|
||||
int SSL_select_next_proto(unsigned char **out, unsigned char *outlen,
|
||||
const unsigned char *in, unsigned int inlen,
|
||||
const unsigned char *client, unsigned int client_len);
|
||||
void SSL_get0_next_proto_negotiated(const SSL *s,
|
||||
const unsigned char **data, unsigned *len);
|
||||
|
||||
#define OPENSSL_NPN_UNSUPPORTED 0
|
||||
#define OPENSSL_NPN_NEGOTIATED 1
|
||||
#define OPENSSL_NPN_NO_OVERLAP 2
|
||||
#endif
|
||||
|
||||
#ifndef OPENSSL_NO_PSK
|
||||
/* the maximum length of the buffer given to callbacks containing the
|
||||
|
@ -961,6 +1095,8 @@ const char *SSL_get_psk_identity(const SSL *s);
|
|||
#define SSL_MAC_FLAG_READ_MAC_STREAM 1
|
||||
#define SSL_MAC_FLAG_WRITE_MAC_STREAM 2
|
||||
|
||||
#ifndef OPENSSL_NO_SSL_INTERN
|
||||
|
||||
struct ssl_st
|
||||
{
|
||||
/* protocol version
|
||||
|
@ -1005,9 +1141,7 @@ struct ssl_st
|
|||
|
||||
int server; /* are we the server side? - mostly used by SSL_clear*/
|
||||
|
||||
int new_session;/* 1 if we are to use a new session.
|
||||
* 2 if we are a server and are inside a handshake
|
||||
* (i.e. not just sending a HelloRequest)
|
||||
int new_session;/* Generate a new session or reuse an old one.
|
||||
* NB: For servers, the 'new' session may actually be a previously
|
||||
* cached session or even the previous session unless
|
||||
* SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION is set */
|
||||
|
@ -1177,12 +1311,46 @@ struct ssl_st
|
|||
void *tls_session_secret_cb_arg;
|
||||
|
||||
SSL_CTX * initial_ctx; /* initial ctx, used to store sessions */
|
||||
|
||||
#ifndef OPENSSL_NO_NEXTPROTONEG
|
||||
/* Next protocol negotiation. For the client, this is the protocol that
|
||||
* we sent in NextProtocol and is set when handling ServerHello
|
||||
* extensions.
|
||||
*
|
||||
* For a server, this is the client's selected_protocol from
|
||||
* NextProtocol and is set when handling the NextProtocol message,
|
||||
* before the Finished message. */
|
||||
unsigned char *next_proto_negotiated;
|
||||
unsigned char next_proto_negotiated_len;
|
||||
#endif
|
||||
|
||||
#define session_ctx initial_ctx
|
||||
|
||||
STACK_OF(SRTP_PROTECTION_PROFILE) *srtp_profiles; /* What we'll do */
|
||||
SRTP_PROTECTION_PROFILE *srtp_profile; /* What's been chosen */
|
||||
|
||||
unsigned int tlsext_heartbeat; /* Is use of the Heartbeat extension negotiated?
|
||||
0: disabled
|
||||
1: enabled
|
||||
2: enabled, but not allowed to send Requests
|
||||
*/
|
||||
unsigned int tlsext_hb_pending; /* Indicates if a HeartbeatRequest is in flight */
|
||||
unsigned int tlsext_hb_seq; /* HeartbeatRequest sequence number */
|
||||
#else
|
||||
#define session_ctx ctx
|
||||
#endif /* OPENSSL_NO_TLSEXT */
|
||||
|
||||
int renegotiate;/* 1 if we are renegotiating.
|
||||
* 2 if we are a server and are inside a handshake
|
||||
* (i.e. not just sending a HelloRequest) */
|
||||
|
||||
#ifndef OPENSSL_NO_SRP
|
||||
SRP_CTX srp_ctx; /* ctx for SRP authentication */
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -1192,6 +1360,7 @@ struct ssl_st
|
|||
#include <openssl/tls1.h> /* This is mostly sslv3 with a few tweaks */
|
||||
#include <openssl/dtls1.h> /* Datagram TLS */
|
||||
#include <openssl/ssl23.h>
|
||||
#include <openssl/srtp.h> /* Support for the use_srtp extension */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -1408,6 +1577,20 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION)
|
|||
#define SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP 71
|
||||
|
||||
#define SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB 72
|
||||
|
||||
#define SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB 75
|
||||
#define SSL_CTRL_SET_SRP_VERIFY_PARAM_CB 76
|
||||
#define SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB 77
|
||||
|
||||
#define SSL_CTRL_SET_SRP_ARG 78
|
||||
#define SSL_CTRL_SET_TLS_EXT_SRP_USERNAME 79
|
||||
#define SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH 80
|
||||
#define SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD 81
|
||||
#ifndef OPENSSL_NO_HEARTBEATS
|
||||
#define SSL_CTRL_TLS_EXT_SEND_HEARTBEAT 85
|
||||
#define SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING 86
|
||||
#define SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS 87
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define DTLS_CTRL_GET_TIMEOUT 73
|
||||
|
@ -1418,6 +1601,9 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION)
|
|||
#define SSL_CTRL_CLEAR_OPTIONS 77
|
||||
#define SSL_CTRL_CLEAR_MODE 78
|
||||
|
||||
#define SSL_CTRL_GET_EXTRA_CHAIN_CERTS 82
|
||||
#define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS 83
|
||||
|
||||
#define DTLSv1_get_timeout(ssl, arg) \
|
||||
SSL_ctrl(ssl,DTLS_CTRL_GET_TIMEOUT,0, (void *)arg)
|
||||
#define DTLSv1_handle_timeout(ssl) \
|
||||
|
@ -1454,6 +1640,10 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION)
|
|||
|
||||
#define SSL_CTX_add_extra_chain_cert(ctx,x509) \
|
||||
SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,(char *)x509)
|
||||
#define SSL_CTX_get_extra_chain_certs(ctx,px509) \
|
||||
SSL_CTX_ctrl(ctx,SSL_CTRL_GET_EXTRA_CHAIN_CERTS,0,px509)
|
||||
#define SSL_CTX_clear_extra_chain_certs(ctx) \
|
||||
SSL_CTX_ctrl(ctx,SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS,0,NULL)
|
||||
|
||||
#ifndef OPENSSL_NO_BIO
|
||||
BIO_METHOD *BIO_f_ssl(void);
|
||||
|
@ -1481,6 +1671,7 @@ const SSL_CIPHER *SSL_get_current_cipher(const SSL *s);
|
|||
int SSL_CIPHER_get_bits(const SSL_CIPHER *c,int *alg_bits);
|
||||
char * SSL_CIPHER_get_version(const SSL_CIPHER *c);
|
||||
const char * SSL_CIPHER_get_name(const SSL_CIPHER *c);
|
||||
unsigned long SSL_CIPHER_get_id(const SSL_CIPHER *c);
|
||||
|
||||
int SSL_get_fd(const SSL *s);
|
||||
int SSL_get_rfd(const SSL *s);
|
||||
|
@ -1546,10 +1737,14 @@ long SSL_SESSION_set_time(SSL_SESSION *s, long t);
|
|||
long SSL_SESSION_get_timeout(const SSL_SESSION *s);
|
||||
long SSL_SESSION_set_timeout(SSL_SESSION *s, long t);
|
||||
void SSL_copy_session_id(SSL *to,const SSL *from);
|
||||
X509 *SSL_SESSION_get0_peer(SSL_SESSION *s);
|
||||
int SSL_SESSION_set1_id_context(SSL_SESSION *s,const unsigned char *sid_ctx,
|
||||
unsigned int sid_ctx_len);
|
||||
|
||||
SSL_SESSION *SSL_SESSION_new(void);
|
||||
const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s,
|
||||
unsigned int *len);
|
||||
unsigned int SSL_SESSION_get_compress_id(const SSL_SESSION *s);
|
||||
#ifndef OPENSSL_NO_FP_API
|
||||
int SSL_SESSION_print_fp(FILE *fp,const SSL_SESSION *ses);
|
||||
#endif
|
||||
|
@ -1612,6 +1807,30 @@ int SSL_set_trust(SSL *s, int trust);
|
|||
int SSL_CTX_set1_param(SSL_CTX *ctx, X509_VERIFY_PARAM *vpm);
|
||||
int SSL_set1_param(SSL *ssl, X509_VERIFY_PARAM *vpm);
|
||||
|
||||
#ifndef OPENSSL_NO_SRP
|
||||
int SSL_CTX_set_srp_username(SSL_CTX *ctx,char *name);
|
||||
int SSL_CTX_set_srp_password(SSL_CTX *ctx,char *password);
|
||||
int SSL_CTX_set_srp_strength(SSL_CTX *ctx, int strength);
|
||||
int SSL_CTX_set_srp_client_pwd_callback(SSL_CTX *ctx,
|
||||
char *(*cb)(SSL *,void *));
|
||||
int SSL_CTX_set_srp_verify_param_callback(SSL_CTX *ctx,
|
||||
int (*cb)(SSL *,void *));
|
||||
int SSL_CTX_set_srp_username_callback(SSL_CTX *ctx,
|
||||
int (*cb)(SSL *,int *,void *));
|
||||
int SSL_CTX_set_srp_cb_arg(SSL_CTX *ctx, void *arg);
|
||||
|
||||
int SSL_set_srp_server_param(SSL *s, const BIGNUM *N, const BIGNUM *g,
|
||||
BIGNUM *sa, BIGNUM *v, char *info);
|
||||
int SSL_set_srp_server_param_pw(SSL *s, const char *user, const char *pass,
|
||||
const char *grp);
|
||||
|
||||
BIGNUM *SSL_get_srp_g(SSL *s);
|
||||
BIGNUM *SSL_get_srp_N(SSL *s);
|
||||
|
||||
char *SSL_get_srp_username(SSL *s);
|
||||
char *SSL_get_srp_userinfo(SSL *s);
|
||||
#endif
|
||||
|
||||
void SSL_free(SSL *ssl);
|
||||
int SSL_accept(SSL *ssl);
|
||||
int SSL_connect(SSL *ssl);
|
||||
|
@ -1647,6 +1866,15 @@ const SSL_METHOD *TLSv1_method(void); /* TLSv1.0 */
|
|||
const SSL_METHOD *TLSv1_server_method(void); /* TLSv1.0 */
|
||||
const SSL_METHOD *TLSv1_client_method(void); /* TLSv1.0 */
|
||||
|
||||
const SSL_METHOD *TLSv1_1_method(void); /* TLSv1.1 */
|
||||
const SSL_METHOD *TLSv1_1_server_method(void); /* TLSv1.1 */
|
||||
const SSL_METHOD *TLSv1_1_client_method(void); /* TLSv1.1 */
|
||||
|
||||
const SSL_METHOD *TLSv1_2_method(void); /* TLSv1.2 */
|
||||
const SSL_METHOD *TLSv1_2_server_method(void); /* TLSv1.2 */
|
||||
const SSL_METHOD *TLSv1_2_client_method(void); /* TLSv1.2 */
|
||||
|
||||
|
||||
const SSL_METHOD *DTLSv1_method(void); /* DTLSv1.0 */
|
||||
const SSL_METHOD *DTLSv1_server_method(void); /* DTLSv1.0 */
|
||||
const SSL_METHOD *DTLSv1_client_method(void); /* DTLSv1.0 */
|
||||
|
@ -1655,6 +1883,7 @@ STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *s);
|
|||
|
||||
int SSL_do_handshake(SSL *s);
|
||||
int SSL_renegotiate(SSL *s);
|
||||
int SSL_renegotiate_abbreviated(SSL *s);
|
||||
int SSL_renegotiate_pending(SSL *s);
|
||||
int SSL_shutdown(SSL *s);
|
||||
|
||||
|
@ -1706,6 +1935,7 @@ void SSL_set_info_callback(SSL *ssl,
|
|||
void (*cb)(const SSL *ssl,int type,int val));
|
||||
void (*SSL_get_info_callback(const SSL *ssl))(const SSL *ssl,int type,int val);
|
||||
int SSL_state(const SSL *ssl);
|
||||
void SSL_set_state(SSL *ssl, int state);
|
||||
|
||||
void SSL_set_verify_result(SSL *ssl,long v);
|
||||
long SSL_get_verify_result(const SSL *ssl);
|
||||
|
@ -1806,6 +2036,9 @@ int SSL_set_session_ticket_ext_cb(SSL *s, tls_session_ticket_ext_cb_fn cb,
|
|||
/* Pre-shared secret session resumption functions */
|
||||
int SSL_set_session_secret_cb(SSL *s, tls_session_secret_cb_fn tls_session_secret_cb, void *arg);
|
||||
|
||||
void SSL_set_debug(SSL *s, int debug);
|
||||
int SSL_cache_hit(SSL *s);
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
|
@ -1825,6 +2058,7 @@ void ERR_load_SSL_strings(void);
|
|||
#define SSL_F_DTLS1_ACCEPT 246
|
||||
#define SSL_F_DTLS1_ADD_CERT_TO_BUF 295
|
||||
#define SSL_F_DTLS1_BUFFER_RECORD 247
|
||||
#define SSL_F_DTLS1_CHECK_TIMEOUT_NUM 316
|
||||
#define SSL_F_DTLS1_CLIENT_HELLO 248
|
||||
#define SSL_F_DTLS1_CONNECT 249
|
||||
#define SSL_F_DTLS1_ENC 250
|
||||
|
@ -1833,6 +2067,7 @@ void ERR_load_SSL_strings(void);
|
|||
#define SSL_F_DTLS1_GET_MESSAGE_FRAGMENT 253
|
||||
#define SSL_F_DTLS1_GET_RECORD 254
|
||||
#define SSL_F_DTLS1_HANDLE_TIMEOUT 297
|
||||
#define SSL_F_DTLS1_HEARTBEAT 305
|
||||
#define SSL_F_DTLS1_OUTPUT_CERT_CHAIN 255
|
||||
#define SSL_F_DTLS1_PREPROCESS_FRAGMENT 288
|
||||
#define SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE 256
|
||||
|
@ -1882,6 +2117,7 @@ void ERR_load_SSL_strings(void);
|
|||
#define SSL_F_SSL3_CALLBACK_CTRL 233
|
||||
#define SSL_F_SSL3_CHANGE_CIPHER_STATE 129
|
||||
#define SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM 130
|
||||
#define SSL_F_SSL3_CHECK_CLIENT_HELLO 304
|
||||
#define SSL_F_SSL3_CLIENT_HELLO 131
|
||||
#define SSL_F_SSL3_CONNECT 132
|
||||
#define SSL_F_SSL3_CTRL 213
|
||||
|
@ -1900,6 +2136,7 @@ void ERR_load_SSL_strings(void);
|
|||
#define SSL_F_SSL3_GET_KEY_EXCHANGE 141
|
||||
#define SSL_F_SSL3_GET_MESSAGE 142
|
||||
#define SSL_F_SSL3_GET_NEW_SESSION_TICKET 283
|
||||
#define SSL_F_SSL3_GET_NEXT_PROTO 306
|
||||
#define SSL_F_SSL3_GET_RECORD 143
|
||||
#define SSL_F_SSL3_GET_SERVER_CERTIFICATE 144
|
||||
#define SSL_F_SSL3_GET_SERVER_DONE 145
|
||||
|
@ -1924,10 +2161,12 @@ void ERR_load_SSL_strings(void);
|
|||
#define SSL_F_SSL3_WRITE_PENDING 159
|
||||
#define SSL_F_SSL_ADD_CLIENTHELLO_RENEGOTIATE_EXT 298
|
||||
#define SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT 277
|
||||
#define SSL_F_SSL_ADD_CLIENTHELLO_USE_SRTP_EXT 307
|
||||
#define SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK 215
|
||||
#define SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK 216
|
||||
#define SSL_F_SSL_ADD_SERVERHELLO_RENEGOTIATE_EXT 299
|
||||
#define SSL_F_SSL_ADD_SERVERHELLO_TLSEXT 278
|
||||
#define SSL_F_SSL_ADD_SERVERHELLO_USE_SRTP_EXT 308
|
||||
#define SSL_F_SSL_BAD_METHOD 160
|
||||
#define SSL_F_SSL_BYTES_TO_CIPHER_LIST 161
|
||||
#define SSL_F_SSL_CERT_DUP 221
|
||||
|
@ -1944,6 +2183,7 @@ void ERR_load_SSL_strings(void);
|
|||
#define SSL_F_SSL_CREATE_CIPHER_LIST 166
|
||||
#define SSL_F_SSL_CTRL 232
|
||||
#define SSL_F_SSL_CTX_CHECK_PRIVATE_KEY 168
|
||||
#define SSL_F_SSL_CTX_MAKE_PROFILES 309
|
||||
#define SSL_F_SSL_CTX_NEW 169
|
||||
#define SSL_F_SSL_CTX_SET_CIPHER_LIST 269
|
||||
#define SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE 290
|
||||
|
@ -1972,8 +2212,10 @@ void ERR_load_SSL_strings(void);
|
|||
#define SSL_F_SSL_NEW 186
|
||||
#define SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT 300
|
||||
#define SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT 302
|
||||
#define SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT 310
|
||||
#define SSL_F_SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT 301
|
||||
#define SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT 303
|
||||
#define SSL_F_SSL_PARSE_SERVERHELLO_USE_SRTP_EXT 311
|
||||
#define SSL_F_SSL_PEEK 270
|
||||
#define SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT 281
|
||||
#define SSL_F_SSL_PREPARE_SERVERHELLO_TLSEXT 282
|
||||
|
@ -1982,6 +2224,7 @@ void ERR_load_SSL_strings(void);
|
|||
#define SSL_F_SSL_RSA_PUBLIC_ENCRYPT 188
|
||||
#define SSL_F_SSL_SESSION_NEW 189
|
||||
#define SSL_F_SSL_SESSION_PRINT_FP 190
|
||||
#define SSL_F_SSL_SESSION_SET1_ID_CONTEXT 312
|
||||
#define SSL_F_SSL_SESS_CERT_NEW 225
|
||||
#define SSL_F_SSL_SET_CERT 191
|
||||
#define SSL_F_SSL_SET_CIPHER_LIST 271
|
||||
|
@ -1995,6 +2238,7 @@ void ERR_load_SSL_strings(void);
|
|||
#define SSL_F_SSL_SET_TRUST 228
|
||||
#define SSL_F_SSL_SET_WFD 196
|
||||
#define SSL_F_SSL_SHUTDOWN 224
|
||||
#define SSL_F_SSL_SRP_CTX_INIT 313
|
||||
#define SSL_F_SSL_UNDEFINED_CONST_FUNCTION 243
|
||||
#define SSL_F_SSL_UNDEFINED_FUNCTION 197
|
||||
#define SSL_F_SSL_UNDEFINED_VOID_FUNCTION 244
|
||||
|
@ -2014,6 +2258,8 @@ void ERR_load_SSL_strings(void);
|
|||
#define SSL_F_TLS1_CHANGE_CIPHER_STATE 209
|
||||
#define SSL_F_TLS1_CHECK_SERVERHELLO_TLSEXT 274
|
||||
#define SSL_F_TLS1_ENC 210
|
||||
#define SSL_F_TLS1_EXPORT_KEYING_MATERIAL 314
|
||||
#define SSL_F_TLS1_HEARTBEAT 315
|
||||
#define SSL_F_TLS1_PREPARE_CLIENTHELLO_TLSEXT 275
|
||||
#define SSL_F_TLS1_PREPARE_SERVERHELLO_TLSEXT 276
|
||||
#define SSL_F_TLS1_PRF 284
|
||||
|
@ -2053,6 +2299,13 @@ void ERR_load_SSL_strings(void);
|
|||
#define SSL_R_BAD_RSA_MODULUS_LENGTH 121
|
||||
#define SSL_R_BAD_RSA_SIGNATURE 122
|
||||
#define SSL_R_BAD_SIGNATURE 123
|
||||
#define SSL_R_BAD_SRP_A_LENGTH 347
|
||||
#define SSL_R_BAD_SRP_B_LENGTH 348
|
||||
#define SSL_R_BAD_SRP_G_LENGTH 349
|
||||
#define SSL_R_BAD_SRP_N_LENGTH 350
|
||||
#define SSL_R_BAD_SRP_S_LENGTH 351
|
||||
#define SSL_R_BAD_SRTP_MKI_VALUE 352
|
||||
#define SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST 353
|
||||
#define SSL_R_BAD_SSL_FILETYPE 124
|
||||
#define SSL_R_BAD_SSL_SESSION_ID_LENGTH 125
|
||||
#define SSL_R_BAD_STATE 126
|
||||
|
@ -2091,12 +2344,15 @@ void ERR_load_SSL_strings(void);
|
|||
#define SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE 322
|
||||
#define SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE 323
|
||||
#define SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER 310
|
||||
#define SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST 354
|
||||
#define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 150
|
||||
#define SSL_R_ERROR_GENERATING_TMP_RSA_KEY 282
|
||||
#define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 151
|
||||
#define SSL_R_EXCESSIVE_MESSAGE_SIZE 152
|
||||
#define SSL_R_EXTRA_DATA_IN_MESSAGE 153
|
||||
#define SSL_R_GOT_A_FIN_BEFORE_A_CCS 154
|
||||
#define SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS 355
|
||||
#define SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION 356
|
||||
#define SSL_R_HTTPS_PROXY_REQUEST 155
|
||||
#define SSL_R_HTTP_REQUEST 156
|
||||
#define SSL_R_ILLEGAL_PADDING 283
|
||||
|
@ -2105,6 +2361,7 @@ void ERR_load_SSL_strings(void);
|
|||
#define SSL_R_INVALID_COMMAND 280
|
||||
#define SSL_R_INVALID_COMPRESSION_ALGORITHM 341
|
||||
#define SSL_R_INVALID_PURPOSE 278
|
||||
#define SSL_R_INVALID_SRP_USERNAME 357
|
||||
#define SSL_R_INVALID_STATUS_RESPONSE 328
|
||||
#define SSL_R_INVALID_TICKET_KEYS_LENGTH 325
|
||||
#define SSL_R_INVALID_TRUST 279
|
||||
|
@ -2134,11 +2391,13 @@ void ERR_load_SSL_strings(void);
|
|||
#define SSL_R_MISSING_RSA_CERTIFICATE 168
|
||||
#define SSL_R_MISSING_RSA_ENCRYPTING_CERT 169
|
||||
#define SSL_R_MISSING_RSA_SIGNING_CERT 170
|
||||
#define SSL_R_MISSING_SRP_PARAM 358
|
||||
#define SSL_R_MISSING_TMP_DH_KEY 171
|
||||
#define SSL_R_MISSING_TMP_ECDH_KEY 311
|
||||
#define SSL_R_MISSING_TMP_RSA_KEY 172
|
||||
#define SSL_R_MISSING_TMP_RSA_PKEY 173
|
||||
#define SSL_R_MISSING_VERIFY_MESSAGE 174
|
||||
#define SSL_R_MULTIPLE_SGC_RESTARTS 346
|
||||
#define SSL_R_NON_SSLV2_INITIAL_PACKET 175
|
||||
#define SSL_R_NO_CERTIFICATES_RETURNED 176
|
||||
#define SSL_R_NO_CERTIFICATE_ASSIGNED 177
|
||||
|
@ -2162,6 +2421,7 @@ void ERR_load_SSL_strings(void);
|
|||
#define SSL_R_NO_RENEGOTIATION 339
|
||||
#define SSL_R_NO_REQUIRED_DIGEST 324
|
||||
#define SSL_R_NO_SHARED_CIPHER 193
|
||||
#define SSL_R_NO_SRTP_PROFILES 359
|
||||
#define SSL_R_NO_VERIFY_CALLBACK 194
|
||||
#define SSL_R_NULL_SSL_CTX 195
|
||||
#define SSL_R_NULL_SSL_METHOD_PASSED 196
|
||||
|
@ -2205,7 +2465,12 @@ void ERR_load_SSL_strings(void);
|
|||
#define SSL_R_SERVERHELLO_TLSEXT 275
|
||||
#define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277
|
||||
#define SSL_R_SHORT_READ 219
|
||||
#define SSL_R_SIGNATURE_ALGORITHMS_ERROR 360
|
||||
#define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220
|
||||
#define SSL_R_SRP_A_CALC 361
|
||||
#define SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES 362
|
||||
#define SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG 363
|
||||
#define SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE 364
|
||||
#define SSL_R_SSL23_DOING_SESSION_ID_REUSE 221
|
||||
#define SSL_R_SSL2_CONNECTION_ID_TOO_LONG 299
|
||||
#define SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT 321
|
||||
|
@ -2250,6 +2515,9 @@ void ERR_load_SSL_strings(void);
|
|||
#define SSL_R_TLSV1_UNRECOGNIZED_NAME 1112
|
||||
#define SSL_R_TLSV1_UNSUPPORTED_EXTENSION 1110
|
||||
#define SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER 232
|
||||
#define SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT 365
|
||||
#define SSL_R_TLS_HEARTBEAT_PENDING 366
|
||||
#define SSL_R_TLS_ILLEGAL_EXPORTER_LABEL 367
|
||||
#define SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST 157
|
||||
#define SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST 233
|
||||
#define SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG 234
|
||||
|
@ -2271,6 +2539,7 @@ void ERR_load_SSL_strings(void);
|
|||
#define SSL_R_UNKNOWN_CERTIFICATE_TYPE 247
|
||||
#define SSL_R_UNKNOWN_CIPHER_RETURNED 248
|
||||
#define SSL_R_UNKNOWN_CIPHER_TYPE 249
|
||||
#define SSL_R_UNKNOWN_DIGEST 368
|
||||
#define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE 250
|
||||
#define SSL_R_UNKNOWN_PKEY_TYPE 251
|
||||
#define SSL_R_UNKNOWN_PROTOCOL 252
|
||||
|
@ -2285,12 +2554,14 @@ void ERR_load_SSL_strings(void);
|
|||
#define SSL_R_UNSUPPORTED_PROTOCOL 258
|
||||
#define SSL_R_UNSUPPORTED_SSL_VERSION 259
|
||||
#define SSL_R_UNSUPPORTED_STATUS_TYPE 329
|
||||
#define SSL_R_USE_SRTP_NOT_NEGOTIATED 369
|
||||
#define SSL_R_WRITE_BIO_NOT_SET 260
|
||||
#define SSL_R_WRONG_CIPHER_RETURNED 261
|
||||
#define SSL_R_WRONG_MESSAGE_TYPE 262
|
||||
#define SSL_R_WRONG_NUMBER_OF_KEY_BITS 263
|
||||
#define SSL_R_WRONG_SIGNATURE_LENGTH 264
|
||||
#define SSL_R_WRONG_SIGNATURE_SIZE 265
|
||||
#define SSL_R_WRONG_SIGNATURE_TYPE 370
|
||||
#define SSL_R_WRONG_SSL_VERSION 266
|
||||
#define SSL_R_WRONG_VERSION_NUMBER 267
|
||||
#define SSL_R_X509_LIB 268
|
||||
|
|
|
@ -155,6 +155,8 @@ extern "C" {
|
|||
#define CERT char
|
||||
#endif
|
||||
|
||||
#ifndef OPENSSL_NO_SSL_INTERN
|
||||
|
||||
typedef struct ssl2_state_st
|
||||
{
|
||||
int three_byte_header;
|
||||
|
@ -219,6 +221,8 @@ typedef struct ssl2_state_st
|
|||
} tmp;
|
||||
} SSL2_STATE;
|
||||
|
||||
#endif
|
||||
|
||||
/* SSLv2 */
|
||||
/* client */
|
||||
#define SSL2_ST_SEND_CLIENT_HELLO_A (0x10|SSL_ST_CONNECT)
|
||||
|
|
|
@ -322,6 +322,7 @@ extern "C" {
|
|||
#define SSL3_RT_ALERT 21
|
||||
#define SSL3_RT_HANDSHAKE 22
|
||||
#define SSL3_RT_APPLICATION_DATA 23
|
||||
#define TLS1_RT_HEARTBEAT 24
|
||||
|
||||
#define SSL3_AL_WARNING 1
|
||||
#define SSL3_AL_FATAL 2
|
||||
|
@ -339,6 +340,11 @@ extern "C" {
|
|||
#define SSL3_AD_CERTIFICATE_UNKNOWN 46
|
||||
#define SSL3_AD_ILLEGAL_PARAMETER 47 /* fatal */
|
||||
|
||||
#define TLS1_HB_REQUEST 1
|
||||
#define TLS1_HB_RESPONSE 2
|
||||
|
||||
#ifndef OPENSSL_NO_SSL_INTERN
|
||||
|
||||
typedef struct ssl3_record_st
|
||||
{
|
||||
/*r */ int type; /* type of record */
|
||||
|
@ -360,6 +366,8 @@ typedef struct ssl3_buffer_st
|
|||
int left; /* how many bytes left */
|
||||
} SSL3_BUFFER;
|
||||
|
||||
#endif
|
||||
|
||||
#define SSL3_CT_RSA_SIGN 1
|
||||
#define SSL3_CT_DSS_SIGN 2
|
||||
#define SSL3_CT_RSA_FIXED_DH 3
|
||||
|
@ -379,6 +387,20 @@ typedef struct ssl3_buffer_st
|
|||
#define SSL3_FLAGS_POP_BUFFER 0x0004
|
||||
#define TLS1_FLAGS_TLS_PADDING_BUG 0x0008
|
||||
#define TLS1_FLAGS_SKIP_CERT_VERIFY 0x0010
|
||||
#define TLS1_FLAGS_KEEP_HANDSHAKE 0x0020
|
||||
|
||||
/* SSL3_FLAGS_SGC_RESTART_DONE is set when we
|
||||
* restart a handshake because of MS SGC and so prevents us
|
||||
* from restarting the handshake in a loop. It's reset on a
|
||||
* renegotiation, so effectively limits the client to one restart
|
||||
* per negotiation. This limits the possibility of a DDoS
|
||||
* attack where the client handshakes in a loop using SGC to
|
||||
* restart. Servers which permit renegotiation can still be
|
||||
* effected, but we can't prevent that.
|
||||
*/
|
||||
#define SSL3_FLAGS_SGC_RESTART_DONE 0x0040
|
||||
|
||||
#ifndef OPENSSL_NO_SSL_INTERN
|
||||
|
||||
typedef struct ssl3_state_st
|
||||
{
|
||||
|
@ -512,13 +534,23 @@ typedef struct ssl3_state_st
|
|||
unsigned char previous_server_finished[EVP_MAX_MD_SIZE];
|
||||
unsigned char previous_server_finished_len;
|
||||
int send_connection_binding; /* TODOEKR */
|
||||
|
||||
#ifndef OPENSSL_NO_NEXTPROTONEG
|
||||
/* Set if we saw the Next Protocol Negotiation extension from our peer. */
|
||||
int next_proto_neg_seen;
|
||||
#endif
|
||||
} SSL3_STATE;
|
||||
|
||||
#endif
|
||||
|
||||
/* SSLv3 */
|
||||
/*client */
|
||||
/* extra state */
|
||||
#define SSL3_ST_CW_FLUSH (0x100|SSL_ST_CONNECT)
|
||||
#ifndef OPENSSL_NO_SCTP
|
||||
#define DTLS1_SCTP_ST_CW_WRITE_SOCK (0x310|SSL_ST_CONNECT)
|
||||
#define DTLS1_SCTP_ST_CR_READ_SOCK (0x320|SSL_ST_CONNECT)
|
||||
#endif
|
||||
/* write to server */
|
||||
#define SSL3_ST_CW_CLNT_HELLO_A (0x110|SSL_ST_CONNECT)
|
||||
#define SSL3_ST_CW_CLNT_HELLO_B (0x111|SSL_ST_CONNECT)
|
||||
|
@ -546,6 +578,8 @@ typedef struct ssl3_state_st
|
|||
#define SSL3_ST_CW_CERT_VRFY_B (0x191|SSL_ST_CONNECT)
|
||||
#define SSL3_ST_CW_CHANGE_A (0x1A0|SSL_ST_CONNECT)
|
||||
#define SSL3_ST_CW_CHANGE_B (0x1A1|SSL_ST_CONNECT)
|
||||
#define SSL3_ST_CW_NEXT_PROTO_A (0x200|SSL_ST_CONNECT)
|
||||
#define SSL3_ST_CW_NEXT_PROTO_B (0x201|SSL_ST_CONNECT)
|
||||
#define SSL3_ST_CW_FINISHED_A (0x1B0|SSL_ST_CONNECT)
|
||||
#define SSL3_ST_CW_FINISHED_B (0x1B1|SSL_ST_CONNECT)
|
||||
/* read from server */
|
||||
|
@ -561,6 +595,10 @@ typedef struct ssl3_state_st
|
|||
/* server */
|
||||
/* extra state */
|
||||
#define SSL3_ST_SW_FLUSH (0x100|SSL_ST_ACCEPT)
|
||||
#ifndef OPENSSL_NO_SCTP
|
||||
#define DTLS1_SCTP_ST_SW_WRITE_SOCK (0x310|SSL_ST_ACCEPT)
|
||||
#define DTLS1_SCTP_ST_SR_READ_SOCK (0x320|SSL_ST_ACCEPT)
|
||||
#endif
|
||||
/* read from client */
|
||||
/* Do not change the number values, they do matter */
|
||||
#define SSL3_ST_SR_CLNT_HELLO_A (0x110|SSL_ST_ACCEPT)
|
||||
|
@ -591,6 +629,8 @@ typedef struct ssl3_state_st
|
|||
#define SSL3_ST_SR_CERT_VRFY_B (0x1A1|SSL_ST_ACCEPT)
|
||||
#define SSL3_ST_SR_CHANGE_A (0x1B0|SSL_ST_ACCEPT)
|
||||
#define SSL3_ST_SR_CHANGE_B (0x1B1|SSL_ST_ACCEPT)
|
||||
#define SSL3_ST_SR_NEXT_PROTO_A (0x210|SSL_ST_ACCEPT)
|
||||
#define SSL3_ST_SR_NEXT_PROTO_B (0x211|SSL_ST_ACCEPT)
|
||||
#define SSL3_ST_SR_FINISHED_A (0x1C0|SSL_ST_ACCEPT)
|
||||
#define SSL3_ST_SR_FINISHED_B (0x1C1|SSL_ST_ACCEPT)
|
||||
/* write to client */
|
||||
|
@ -615,6 +655,7 @@ typedef struct ssl3_state_st
|
|||
#define SSL3_MT_CLIENT_KEY_EXCHANGE 16
|
||||
#define SSL3_MT_FINISHED 20
|
||||
#define SSL3_MT_CERTIFICATE_STATUS 22
|
||||
#define SSL3_MT_NEXT_PROTO 67
|
||||
#define DTLS1_MT_HELLO_VERIFY_REQUEST 3
|
||||
|
||||
|
||||
|
|
|
@ -176,7 +176,6 @@
|
|||
#define SSL_CTX_set_default_passwd_cb_userdata SSL_CTX_set_def_passwd_cb_ud
|
||||
#undef SSL_COMP_get_compression_methods
|
||||
#define SSL_COMP_get_compression_methods SSL_COMP_get_compress_methods
|
||||
|
||||
#undef ssl_add_clienthello_renegotiate_ext
|
||||
#define ssl_add_clienthello_renegotiate_ext ssl_add_clienthello_reneg_ext
|
||||
#undef ssl_add_serverhello_renegotiate_ext
|
||||
|
@ -185,6 +184,26 @@
|
|||
#define ssl_parse_clienthello_renegotiate_ext ssl_parse_clienthello_reneg_ext
|
||||
#undef ssl_parse_serverhello_renegotiate_ext
|
||||
#define ssl_parse_serverhello_renegotiate_ext ssl_parse_serverhello_reneg_ext
|
||||
#undef SSL_srp_server_param_with_username
|
||||
#define SSL_srp_server_param_with_username SSL_srp_server_param_with_un
|
||||
#undef SSL_CTX_set_srp_client_pwd_callback
|
||||
#define SSL_CTX_set_srp_client_pwd_callback SSL_CTX_set_srp_client_pwd_cb
|
||||
#undef SSL_CTX_set_srp_verify_param_callback
|
||||
#define SSL_CTX_set_srp_verify_param_callback SSL_CTX_set_srp_vfy_param_cb
|
||||
#undef SSL_CTX_set_srp_username_callback
|
||||
#define SSL_CTX_set_srp_username_callback SSL_CTX_set_srp_un_cb
|
||||
#undef ssl_add_clienthello_use_srtp_ext
|
||||
#define ssl_add_clienthello_use_srtp_ext ssl_add_clihello_use_srtp_ext
|
||||
#undef ssl_add_serverhello_use_srtp_ext
|
||||
#define ssl_add_serverhello_use_srtp_ext ssl_add_serhello_use_srtp_ext
|
||||
#undef ssl_parse_clienthello_use_srtp_ext
|
||||
#define ssl_parse_clienthello_use_srtp_ext ssl_parse_clihello_use_srtp_ext
|
||||
#undef ssl_parse_serverhello_use_srtp_ext
|
||||
#define ssl_parse_serverhello_use_srtp_ext ssl_parse_serhello_use_srtp_ext
|
||||
#undef SSL_CTX_set_next_protos_advertised_cb
|
||||
#define SSL_CTX_set_next_protos_advertised_cb SSL_CTX_set_next_protos_adv_cb
|
||||
#undef SSL_CTX_set_next_proto_select_cb
|
||||
#define SSL_CTX_set_next_proto_select_cb SSL_CTX_set_next_proto_sel_cb
|
||||
|
||||
/* Hack some long ENGINE names */
|
||||
#undef ENGINE_get_default_BN_mod_exp_crt
|
||||
|
@ -238,6 +257,9 @@
|
|||
#define EC_GROUP_get_point_conversion_form EC_GROUP_get_point_conv_form
|
||||
#undef EC_GROUP_clear_free_all_extra_data
|
||||
#define EC_GROUP_clear_free_all_extra_data EC_GROUP_clr_free_all_xtra_data
|
||||
#undef EC_KEY_set_public_key_affine_coordinates
|
||||
#define EC_KEY_set_public_key_affine_coordinates \
|
||||
EC_KEY_set_pub_key_aff_coords
|
||||
#undef EC_POINT_set_Jprojective_coordinates_GFp
|
||||
#define EC_POINT_set_Jprojective_coordinates_GFp \
|
||||
EC_POINT_set_Jproj_coords_GFp
|
||||
|
@ -399,6 +421,12 @@
|
|||
#undef dtls1_retransmit_buffered_messages
|
||||
#define dtls1_retransmit_buffered_messages dtls1_retransmit_buffered_msgs
|
||||
|
||||
/* Hack some long SRP names */
|
||||
#undef SRP_generate_server_master_secret
|
||||
#define SRP_generate_server_master_secret SRP_gen_server_master_secret
|
||||
#undef SRP_generate_client_master_secret
|
||||
#define SRP_generate_client_master_secret SRP_gen_client_master_secret
|
||||
|
||||
/* Hack some long UI names */
|
||||
#undef UI_method_get_prompt_constructor
|
||||
#define UI_method_get_prompt_constructor UI_method_get_prompt_constructr
|
||||
|
|
|
@ -159,10 +159,24 @@ extern "C" {
|
|||
|
||||
#define TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES 0
|
||||
|
||||
#define TLS1_2_VERSION 0x0303
|
||||
#define TLS1_2_VERSION_MAJOR 0x03
|
||||
#define TLS1_2_VERSION_MINOR 0x03
|
||||
|
||||
#define TLS1_1_VERSION 0x0302
|
||||
#define TLS1_1_VERSION_MAJOR 0x03
|
||||
#define TLS1_1_VERSION_MINOR 0x02
|
||||
|
||||
#define TLS1_VERSION 0x0301
|
||||
#define TLS1_VERSION_MAJOR 0x03
|
||||
#define TLS1_VERSION_MINOR 0x01
|
||||
|
||||
#define TLS1_get_version(s) \
|
||||
((s->version >> 8) == TLS1_VERSION_MAJOR ? s->version : 0)
|
||||
|
||||
#define TLS1_get_client_version(s) \
|
||||
((s->client_version >> 8) == TLS1_VERSION_MAJOR ? s->client_version : 0)
|
||||
|
||||
#define TLS1_AD_DECRYPTION_FAILED 21
|
||||
#define TLS1_AD_RECORD_OVERFLOW 22
|
||||
#define TLS1_AD_UNKNOWN_CA 48 /* fatal */
|
||||
|
@ -183,17 +197,42 @@ extern "C" {
|
|||
#define TLS1_AD_BAD_CERTIFICATE_HASH_VALUE 114
|
||||
#define TLS1_AD_UNKNOWN_PSK_IDENTITY 115 /* fatal */
|
||||
|
||||
/* ExtensionType values from RFC3546 / RFC4366 */
|
||||
/* ExtensionType values from RFC3546 / RFC4366 / RFC6066 */
|
||||
#define TLSEXT_TYPE_server_name 0
|
||||
#define TLSEXT_TYPE_max_fragment_length 1
|
||||
#define TLSEXT_TYPE_client_certificate_url 2
|
||||
#define TLSEXT_TYPE_trusted_ca_keys 3
|
||||
#define TLSEXT_TYPE_truncated_hmac 4
|
||||
#define TLSEXT_TYPE_status_request 5
|
||||
/* ExtensionType values from RFC4681 */
|
||||
#define TLSEXT_TYPE_user_mapping 6
|
||||
|
||||
/* ExtensionType values from RFC5878 */
|
||||
#define TLSEXT_TYPE_client_authz 7
|
||||
#define TLSEXT_TYPE_server_authz 8
|
||||
|
||||
/* ExtensionType values from RFC6091 */
|
||||
#define TLSEXT_TYPE_cert_type 9
|
||||
|
||||
/* ExtensionType values from RFC4492 */
|
||||
#define TLSEXT_TYPE_elliptic_curves 10
|
||||
#define TLSEXT_TYPE_ec_point_formats 11
|
||||
|
||||
/* ExtensionType value from RFC5054 */
|
||||
#define TLSEXT_TYPE_srp 12
|
||||
|
||||
/* ExtensionType values from RFC5246 */
|
||||
#define TLSEXT_TYPE_signature_algorithms 13
|
||||
|
||||
/* ExtensionType value from RFC5764 */
|
||||
#define TLSEXT_TYPE_use_srtp 14
|
||||
|
||||
/* ExtensionType value from RFC5620 */
|
||||
#define TLSEXT_TYPE_heartbeat 15
|
||||
|
||||
/* ExtensionType value from RFC4507 */
|
||||
#define TLSEXT_TYPE_session_ticket 35
|
||||
|
||||
/* ExtensionType value from draft-rescorla-tls-opaque-prf-input-00.txt */
|
||||
#if 0 /* will have to be provided externally for now ,
|
||||
* i.e. build with -DTLSEXT_TYPE_opaque_prf_input=38183
|
||||
|
@ -204,6 +243,11 @@ extern "C" {
|
|||
/* Temporary extension type */
|
||||
#define TLSEXT_TYPE_renegotiate 0xff01
|
||||
|
||||
#ifndef OPENSSL_NO_NEXTPROTONEG
|
||||
/* This is not an IANA defined extension number */
|
||||
#define TLSEXT_TYPE_next_proto_neg 13172
|
||||
#endif
|
||||
|
||||
/* NameType value from RFC 3546 */
|
||||
#define TLSEXT_NAMETYPE_host_name 0
|
||||
/* status request value from RFC 3546 */
|
||||
|
@ -216,12 +260,37 @@ extern "C" {
|
|||
#define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2 2
|
||||
#define TLSEXT_ECPOINTFORMAT_last 2
|
||||
|
||||
/* Signature and hash algorithms from RFC 5246 */
|
||||
|
||||
#define TLSEXT_signature_anonymous 0
|
||||
#define TLSEXT_signature_rsa 1
|
||||
#define TLSEXT_signature_dsa 2
|
||||
#define TLSEXT_signature_ecdsa 3
|
||||
|
||||
#define TLSEXT_hash_none 0
|
||||
#define TLSEXT_hash_md5 1
|
||||
#define TLSEXT_hash_sha1 2
|
||||
#define TLSEXT_hash_sha224 3
|
||||
#define TLSEXT_hash_sha256 4
|
||||
#define TLSEXT_hash_sha384 5
|
||||
#define TLSEXT_hash_sha512 6
|
||||
|
||||
#ifndef OPENSSL_NO_TLSEXT
|
||||
|
||||
#define TLSEXT_MAXLEN_host_name 255
|
||||
|
||||
const char *SSL_get_servername(const SSL *s, const int type) ;
|
||||
int SSL_get_servername_type(const SSL *s) ;
|
||||
const char *SSL_get_servername(const SSL *s, const int type);
|
||||
int SSL_get_servername_type(const SSL *s);
|
||||
/* SSL_export_keying_material exports a value derived from the master secret,
|
||||
* as specified in RFC 5705. It writes |olen| bytes to |out| given a label and
|
||||
* optional context. (Since a zero length context is allowed, the |use_context|
|
||||
* flag controls whether a context is included.)
|
||||
*
|
||||
* It returns 1 on success and zero otherwise.
|
||||
*/
|
||||
int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen,
|
||||
const char *label, size_t llen, const unsigned char *p, size_t plen,
|
||||
int use_context);
|
||||
|
||||
#define SSL_set_tlsext_host_name(s,name) \
|
||||
SSL_ctrl(s,SSL_CTRL_SET_TLSEXT_HOSTNAME,TLSEXT_NAMETYPE_host_name,(char *)name)
|
||||
|
@ -285,6 +354,16 @@ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG, 0, arg)
|
|||
#define SSL_CTX_set_tlsext_ticket_key_cb(ssl, cb) \
|
||||
SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb)
|
||||
|
||||
#ifndef OPENSSL_NO_HEARTBEATS
|
||||
#define SSL_TLSEXT_HB_ENABLED 0x01
|
||||
#define SSL_TLSEXT_HB_DONT_SEND_REQUESTS 0x02
|
||||
#define SSL_TLSEXT_HB_DONT_RECV_REQUESTS 0x04
|
||||
|
||||
#define SSL_get_tlsext_heartbeat_pending(ssl) \
|
||||
SSL_ctrl((ssl),SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING,0,NULL)
|
||||
#define SSL_set_tlsext_heartbeat_no_requests(ssl, arg) \
|
||||
SSL_ctrl((ssl),SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS,arg,NULL)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* PSK ciphersuites from 4279 */
|
||||
|
@ -322,6 +401,14 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb)
|
|||
#define TLS1_CK_DHE_RSA_WITH_AES_256_SHA 0x03000039
|
||||
#define TLS1_CK_ADH_WITH_AES_256_SHA 0x0300003A
|
||||
|
||||
/* TLS v1.2 ciphersuites */
|
||||
#define TLS1_CK_RSA_WITH_NULL_SHA256 0x0300003B
|
||||
#define TLS1_CK_RSA_WITH_AES_128_SHA256 0x0300003C
|
||||
#define TLS1_CK_RSA_WITH_AES_256_SHA256 0x0300003D
|
||||
#define TLS1_CK_DH_DSS_WITH_AES_128_SHA256 0x0300003E
|
||||
#define TLS1_CK_DH_RSA_WITH_AES_128_SHA256 0x0300003F
|
||||
#define TLS1_CK_DHE_DSS_WITH_AES_128_SHA256 0x03000040
|
||||
|
||||
/* Camellia ciphersuites from RFC4132 */
|
||||
#define TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000041
|
||||
#define TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA 0x03000042
|
||||
|
@ -330,6 +417,16 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb)
|
|||
#define TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000045
|
||||
#define TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA 0x03000046
|
||||
|
||||
/* TLS v1.2 ciphersuites */
|
||||
#define TLS1_CK_DHE_RSA_WITH_AES_128_SHA256 0x03000067
|
||||
#define TLS1_CK_DH_DSS_WITH_AES_256_SHA256 0x03000068
|
||||
#define TLS1_CK_DH_RSA_WITH_AES_256_SHA256 0x03000069
|
||||
#define TLS1_CK_DHE_DSS_WITH_AES_256_SHA256 0x0300006A
|
||||
#define TLS1_CK_DHE_RSA_WITH_AES_256_SHA256 0x0300006B
|
||||
#define TLS1_CK_ADH_WITH_AES_128_SHA256 0x0300006C
|
||||
#define TLS1_CK_ADH_WITH_AES_256_SHA256 0x0300006D
|
||||
|
||||
/* Camellia ciphersuites from RFC4132 */
|
||||
#define TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000084
|
||||
#define TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA 0x03000085
|
||||
#define TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000086
|
||||
|
@ -345,6 +442,20 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb)
|
|||
#define TLS1_CK_DHE_RSA_WITH_SEED_SHA 0x0300009A
|
||||
#define TLS1_CK_ADH_WITH_SEED_SHA 0x0300009B
|
||||
|
||||
/* TLS v1.2 GCM ciphersuites from RFC5288 */
|
||||
#define TLS1_CK_RSA_WITH_AES_128_GCM_SHA256 0x0300009C
|
||||
#define TLS1_CK_RSA_WITH_AES_256_GCM_SHA384 0x0300009D
|
||||
#define TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256 0x0300009E
|
||||
#define TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384 0x0300009F
|
||||
#define TLS1_CK_DH_RSA_WITH_AES_128_GCM_SHA256 0x030000A0
|
||||
#define TLS1_CK_DH_RSA_WITH_AES_256_GCM_SHA384 0x030000A1
|
||||
#define TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256 0x030000A2
|
||||
#define TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384 0x030000A3
|
||||
#define TLS1_CK_DH_DSS_WITH_AES_128_GCM_SHA256 0x030000A4
|
||||
#define TLS1_CK_DH_DSS_WITH_AES_256_GCM_SHA384 0x030000A5
|
||||
#define TLS1_CK_ADH_WITH_AES_128_GCM_SHA256 0x030000A6
|
||||
#define TLS1_CK_ADH_WITH_AES_256_GCM_SHA384 0x030000A7
|
||||
|
||||
/* ECC ciphersuites from draft-ietf-tls-ecc-12.txt with changes soon to be in draft 13 */
|
||||
#define TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA 0x0300C001
|
||||
#define TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA 0x0300C002
|
||||
|
@ -376,6 +487,38 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb)
|
|||
#define TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA 0x0300C018
|
||||
#define TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA 0x0300C019
|
||||
|
||||
/* SRP ciphersuites from RFC 5054 */
|
||||
#define TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA 0x0300C01A
|
||||
#define TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA 0x0300C01B
|
||||
#define TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA 0x0300C01C
|
||||
#define TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA 0x0300C01D
|
||||
#define TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA 0x0300C01E
|
||||
#define TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA 0x0300C01F
|
||||
#define TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA 0x0300C020
|
||||
#define TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA 0x0300C021
|
||||
#define TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA 0x0300C022
|
||||
|
||||
/* ECDH HMAC based ciphersuites from RFC5289 */
|
||||
|
||||
#define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256 0x0300C023
|
||||
#define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384 0x0300C024
|
||||
#define TLS1_CK_ECDH_ECDSA_WITH_AES_128_SHA256 0x0300C025
|
||||
#define TLS1_CK_ECDH_ECDSA_WITH_AES_256_SHA384 0x0300C026
|
||||
#define TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256 0x0300C027
|
||||
#define TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384 0x0300C028
|
||||
#define TLS1_CK_ECDH_RSA_WITH_AES_128_SHA256 0x0300C029
|
||||
#define TLS1_CK_ECDH_RSA_WITH_AES_256_SHA384 0x0300C02A
|
||||
|
||||
/* ECDH GCM based ciphersuites from RFC5289 */
|
||||
#define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 0x0300C02B
|
||||
#define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 0x0300C02C
|
||||
#define TLS1_CK_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 0x0300C02D
|
||||
#define TLS1_CK_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 0x0300C02E
|
||||
#define TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256 0x0300C02F
|
||||
#define TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384 0x0300C030
|
||||
#define TLS1_CK_ECDH_RSA_WITH_AES_128_GCM_SHA256 0x0300C031
|
||||
#define TLS1_CK_ECDH_RSA_WITH_AES_256_GCM_SHA384 0x0300C032
|
||||
|
||||
/* XXX
|
||||
* Inconsistency alert:
|
||||
* The OpenSSL names of ciphers with ephemeral DH here include the string
|
||||
|
@ -443,6 +586,17 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb)
|
|||
#define TLS1_TXT_PSK_WITH_AES_128_CBC_SHA "PSK-AES128-CBC-SHA"
|
||||
#define TLS1_TXT_PSK_WITH_AES_256_CBC_SHA "PSK-AES256-CBC-SHA"
|
||||
|
||||
/* SRP ciphersuite from RFC 5054 */
|
||||
#define TLS1_TXT_SRP_SHA_WITH_3DES_EDE_CBC_SHA "SRP-3DES-EDE-CBC-SHA"
|
||||
#define TLS1_TXT_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA "SRP-RSA-3DES-EDE-CBC-SHA"
|
||||
#define TLS1_TXT_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA "SRP-DSS-3DES-EDE-CBC-SHA"
|
||||
#define TLS1_TXT_SRP_SHA_WITH_AES_128_CBC_SHA "SRP-AES-128-CBC-SHA"
|
||||
#define TLS1_TXT_SRP_SHA_RSA_WITH_AES_128_CBC_SHA "SRP-RSA-AES-128-CBC-SHA"
|
||||
#define TLS1_TXT_SRP_SHA_DSS_WITH_AES_128_CBC_SHA "SRP-DSS-AES-128-CBC-SHA"
|
||||
#define TLS1_TXT_SRP_SHA_WITH_AES_256_CBC_SHA "SRP-AES-256-CBC-SHA"
|
||||
#define TLS1_TXT_SRP_SHA_RSA_WITH_AES_256_CBC_SHA "SRP-RSA-AES-256-CBC-SHA"
|
||||
#define TLS1_TXT_SRP_SHA_DSS_WITH_AES_256_CBC_SHA "SRP-DSS-AES-256-CBC-SHA"
|
||||
|
||||
/* Camellia ciphersuites from RFC4132 */
|
||||
#define TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA "CAMELLIA128-SHA"
|
||||
#define TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA "DH-DSS-CAMELLIA128-SHA"
|
||||
|
@ -466,6 +620,55 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb)
|
|||
#define TLS1_TXT_DHE_RSA_WITH_SEED_SHA "DHE-RSA-SEED-SHA"
|
||||
#define TLS1_TXT_ADH_WITH_SEED_SHA "ADH-SEED-SHA"
|
||||
|
||||
/* TLS v1.2 ciphersuites */
|
||||
#define TLS1_TXT_RSA_WITH_NULL_SHA256 "NULL-SHA256"
|
||||
#define TLS1_TXT_RSA_WITH_AES_128_SHA256 "AES128-SHA256"
|
||||
#define TLS1_TXT_RSA_WITH_AES_256_SHA256 "AES256-SHA256"
|
||||
#define TLS1_TXT_DH_DSS_WITH_AES_128_SHA256 "DH-DSS-AES128-SHA256"
|
||||
#define TLS1_TXT_DH_RSA_WITH_AES_128_SHA256 "DH-RSA-AES128-SHA256"
|
||||
#define TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256 "DHE-DSS-AES128-SHA256"
|
||||
#define TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256 "DHE-RSA-AES128-SHA256"
|
||||
#define TLS1_TXT_DH_DSS_WITH_AES_256_SHA256 "DH-DSS-AES256-SHA256"
|
||||
#define TLS1_TXT_DH_RSA_WITH_AES_256_SHA256 "DH-RSA-AES256-SHA256"
|
||||
#define TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256 "DHE-DSS-AES256-SHA256"
|
||||
#define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256 "DHE-RSA-AES256-SHA256"
|
||||
#define TLS1_TXT_ADH_WITH_AES_128_SHA256 "ADH-AES128-SHA256"
|
||||
#define TLS1_TXT_ADH_WITH_AES_256_SHA256 "ADH-AES256-SHA256"
|
||||
|
||||
/* TLS v1.2 GCM ciphersuites from RFC5288 */
|
||||
#define TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256 "AES128-GCM-SHA256"
|
||||
#define TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384 "AES256-GCM-SHA384"
|
||||
#define TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256 "DHE-RSA-AES128-GCM-SHA256"
|
||||
#define TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384 "DHE-RSA-AES256-GCM-SHA384"
|
||||
#define TLS1_TXT_DH_RSA_WITH_AES_128_GCM_SHA256 "DH-RSA-AES128-GCM-SHA256"
|
||||
#define TLS1_TXT_DH_RSA_WITH_AES_256_GCM_SHA384 "DH-RSA-AES256-GCM-SHA384"
|
||||
#define TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256 "DHE-DSS-AES128-GCM-SHA256"
|
||||
#define TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384 "DHE-DSS-AES256-GCM-SHA384"
|
||||
#define TLS1_TXT_DH_DSS_WITH_AES_128_GCM_SHA256 "DH-DSS-AES128-GCM-SHA256"
|
||||
#define TLS1_TXT_DH_DSS_WITH_AES_256_GCM_SHA384 "DH-DSS-AES256-GCM-SHA384"
|
||||
#define TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256 "ADH-AES128-GCM-SHA256"
|
||||
#define TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384 "ADH-AES256-GCM-SHA384"
|
||||
|
||||
/* ECDH HMAC based ciphersuites from RFC5289 */
|
||||
|
||||
#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256 "ECDHE-ECDSA-AES128-SHA256"
|
||||
#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384 "ECDHE-ECDSA-AES256-SHA384"
|
||||
#define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_SHA256 "ECDH-ECDSA-AES128-SHA256"
|
||||
#define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_SHA384 "ECDH-ECDSA-AES256-SHA384"
|
||||
#define TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256 "ECDHE-RSA-AES128-SHA256"
|
||||
#define TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384 "ECDHE-RSA-AES256-SHA384"
|
||||
#define TLS1_TXT_ECDH_RSA_WITH_AES_128_SHA256 "ECDH-RSA-AES128-SHA256"
|
||||
#define TLS1_TXT_ECDH_RSA_WITH_AES_256_SHA384 "ECDH-RSA-AES256-SHA384"
|
||||
|
||||
/* ECDH GCM based ciphersuites from RFC5289 */
|
||||
#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 "ECDHE-ECDSA-AES128-GCM-SHA256"
|
||||
#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 "ECDHE-ECDSA-AES256-GCM-SHA384"
|
||||
#define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 "ECDH-ECDSA-AES128-GCM-SHA256"
|
||||
#define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 "ECDH-ECDSA-AES256-GCM-SHA384"
|
||||
#define TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256 "ECDHE-RSA-AES128-GCM-SHA256"
|
||||
#define TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384 "ECDHE-RSA-AES256-GCM-SHA384"
|
||||
#define TLS1_TXT_ECDH_RSA_WITH_AES_128_GCM_SHA256 "ECDH-RSA-AES128-GCM-SHA256"
|
||||
#define TLS1_TXT_ECDH_RSA_WITH_AES_256_GCM_SHA384 "ECDH-RSA-AES256-GCM-SHA384"
|
||||
|
||||
#define TLS_CT_RSA_SIGN 1
|
||||
#define TLS_CT_DSS_SIGN 2
|
||||
|
|
|
@ -86,9 +86,6 @@
|
|||
#include <openssl/dh.h>
|
||||
#endif
|
||||
|
||||
#include <openssl/evp.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
|
|
@ -316,7 +316,7 @@ int (*UI_method_get_writer(UI_METHOD *method))(UI*,UI_STRING*);
|
|||
int (*UI_method_get_flusher(UI_METHOD *method))(UI*);
|
||||
int (*UI_method_get_reader(UI_METHOD *method))(UI*,UI_STRING*);
|
||||
int (*UI_method_get_closer(UI_METHOD *method))(UI*);
|
||||
char* (*UI_method_get_prompt_constructor(UI_METHOD *method))(UI*, const char*, const char*);
|
||||
char * (*UI_method_get_prompt_constructor(UI_METHOD *method))(UI*, const char*, const char*);
|
||||
|
||||
/* The following functions are helpers for method writers to access relevant
|
||||
data from a UI_STRING. */
|
||||
|
|
|
@ -24,6 +24,9 @@ typedef struct {
|
|||
} WHIRLPOOL_CTX;
|
||||
|
||||
#ifndef OPENSSL_NO_WHIRLPOOL
|
||||
#ifdef OPENSSL_FIPS
|
||||
int private_WHIRLPOOL_Init(WHIRLPOOL_CTX *c);
|
||||
#endif
|
||||
int WHIRLPOOL_Init (WHIRLPOOL_CTX *c);
|
||||
int WHIRLPOOL_Update (WHIRLPOOL_CTX *c,const void *inp,size_t bytes);
|
||||
void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c,const void *inp,size_t bits);
|
||||
|
|
|
@ -657,11 +657,15 @@ int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey);
|
|||
|
||||
int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki);
|
||||
|
||||
int X509_signature_dump(BIO *bp,const ASN1_STRING *sig, int indent);
|
||||
int X509_signature_print(BIO *bp,X509_ALGOR *alg, ASN1_STRING *sig);
|
||||
|
||||
int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);
|
||||
int X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx);
|
||||
int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md);
|
||||
int X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx);
|
||||
int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md);
|
||||
int X509_CRL_sign_ctx(X509_CRL *x, EVP_MD_CTX *ctx);
|
||||
int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md);
|
||||
|
||||
int X509_pubkey_digest(const X509 *data,const EVP_MD *type,
|
||||
|
@ -763,6 +767,7 @@ X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn);
|
|||
int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval);
|
||||
void X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval,
|
||||
X509_ALGOR *algor);
|
||||
void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md);
|
||||
|
||||
X509_NAME *X509_NAME_dup(X509_NAME *xn);
|
||||
X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne);
|
||||
|
@ -896,6 +901,9 @@ int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *algor1,
|
|||
int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
|
||||
ASN1_BIT_STRING *signature,
|
||||
void *data, EVP_PKEY *pkey, const EVP_MD *type);
|
||||
int ASN1_item_sign_ctx(const ASN1_ITEM *it,
|
||||
X509_ALGOR *algor1, X509_ALGOR *algor2,
|
||||
ASN1_BIT_STRING *signature, void *asn, EVP_MD_CTX *ctx);
|
||||
#endif
|
||||
|
||||
int X509_set_version(X509 *x,long version);
|
||||
|
@ -1161,6 +1169,9 @@ X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter,
|
|||
unsigned char *salt, int saltlen,
|
||||
unsigned char *aiv, int prf_nid);
|
||||
|
||||
X509_ALGOR *PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen,
|
||||
int prf_nid, int keylen);
|
||||
|
||||
/* PKCS#8 utilities */
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO)
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
typedef struct {
|
||||
v128_t state; /* cipher chaining state */
|
||||
v128_t previous; /* previous ciphertext block */
|
||||
uint8_t key[32];
|
||||
int key_len;
|
||||
aes_expanded_key_t expanded_key; /* the cipher key */
|
||||
} aes_cbc_ctx_t;
|
||||
|
||||
|
@ -31,10 +33,10 @@ aes_cbc_encrypt(aes_cbc_ctx_t *c,
|
|||
|
||||
err_status_t
|
||||
aes_cbc_context_init(aes_cbc_ctx_t *c, const uint8_t *key,
|
||||
int key_len, cipher_direction_t dir);
|
||||
int key_len);
|
||||
|
||||
err_status_t
|
||||
aes_cbc_set_iv(aes_cbc_ctx_t *c, void *iv);
|
||||
aes_cbc_set_iv(aes_cbc_ctx_t *c, void *iv, int direction);
|
||||
|
||||
err_status_t
|
||||
aes_cbc_nist_encrypt(aes_cbc_ctx_t *c,
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
* aes_gcm_ossl.h
|
||||
*
|
||||
* Header for AES Galois Counter Mode.
|
||||
*
|
||||
* John A. Foley
|
||||
* Cisco Systems, Inc.
|
||||
*
|
||||
*/
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2013, Cisco Systems, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
*
|
||||
* Neither the name of the Cisco Systems, Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef AES_GCM_OSSL_H
|
||||
#define AES_GCM_OSSL_H
|
||||
|
||||
#include "cipher.h"
|
||||
#include "srtp.h"
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/aes.h>
|
||||
|
||||
typedef struct {
|
||||
v256_t key;
|
||||
int key_size;
|
||||
int tag_len;
|
||||
EVP_CIPHER_CTX ctx;
|
||||
cipher_direction_t dir;
|
||||
} aes_gcm_ctx_t;
|
||||
|
||||
#endif /* AES_GCM_OSSL_H */
|
||||
|
|
@ -29,7 +29,7 @@ aes_icm_context_init(aes_icm_ctx_t *c,
|
|||
int key_len);
|
||||
|
||||
err_status_t
|
||||
aes_icm_set_iv(aes_icm_ctx_t *c, void *iv);
|
||||
aes_icm_set_iv(aes_icm_ctx_t *c, void *iv, int direction);
|
||||
|
||||
err_status_t
|
||||
aes_icm_encrypt(aes_icm_ctx_t *c,
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue