diff options
author | Mamadou DIOP <bossiel@yahoo.fr> | 2016-02-23 22:00:35 +0100 |
---|---|---|
committer | Mamadou DIOP <bossiel@yahoo.fr> | 2016-02-23 22:00:35 +0100 |
commit | 50dfb4359619563012997bc3ddafb7667741066c (patch) | |
tree | db234c1edc3240a653363b5735fc4077af4b8720 /thirdparties/mac | |
parent | 94b2219209038e05dd26395f6fb700be4d1062c0 (diff) | |
download | doubango-50dfb4359619563012997bc3ddafb7667741066c.zip doubango-50dfb4359619563012997bc3ddafb7667741066c.tar.gz |
Add new QoS implementation
Code formatting
Diffstat (limited to 'thirdparties/mac')
84 files changed, 4161 insertions, 4113 deletions
diff --git a/thirdparties/mac/include/libavcodec/avcodec.h b/thirdparties/mac/include/libavcodec/avcodec.h index c4db4d7..479a2a4 100755 --- a/thirdparties/mac/include/libavcodec/avcodec.h +++ b/thirdparties/mac/include/libavcodec/avcodec.h @@ -588,7 +588,7 @@ enum Motion_Est_ID { /** * @ingroup lavc_decoding */ -enum AVDiscard{ +enum AVDiscard { /* We leave some space between them for extensions (drop some * keyframes for intra-only or drop just some bidir frames). */ AVDISCARD_NONE =-16, ///< discard nothing @@ -599,7 +599,7 @@ enum AVDiscard{ AVDISCARD_ALL = 48, ///< discard all }; -enum AVColorPrimaries{ +enum AVColorPrimaries { AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B AVCOL_PRI_UNSPECIFIED = 2, AVCOL_PRI_BT470M = 4, @@ -610,7 +610,7 @@ enum AVColorPrimaries{ AVCOL_PRI_NB , ///< Not part of ABI }; -enum AVColorTransferCharacteristic{ +enum AVColorTransferCharacteristic { AVCOL_TRC_BT709 = 1, ///< also ITU-R BT1361 AVCOL_TRC_UNSPECIFIED = 2, AVCOL_TRC_GAMMA22 = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM @@ -619,7 +619,7 @@ enum AVColorTransferCharacteristic{ AVCOL_TRC_NB , ///< Not part of ABI }; -enum AVColorSpace{ +enum AVColorSpace { AVCOL_SPC_RGB = 0, AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B AVCOL_SPC_UNSPECIFIED = 2, @@ -632,7 +632,7 @@ enum AVColorSpace{ }; #define AVCOL_SPC_YCGCO AVCOL_SPC_YCOCG -enum AVColorRange{ +enum AVColorRange { AVCOL_RANGE_UNSPECIFIED = 0, AVCOL_RANGE_MPEG = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges AVCOL_RANGE_JPEG = 2, ///< the normal 2^n-1 "JPEG" YUV ranges @@ -644,7 +644,7 @@ enum AVColorRange{ * 1 2 1-6 are possible chroma positions * X X 5 6 X 0 is undefined/unknown position */ -enum AVChromaLocation{ +enum AVChromaLocation { AVCHROMA_LOC_UNSPECIFIED = 0, AVCHROMA_LOC_LEFT = 1, ///< mpeg2/4, h264 default AVCHROMA_LOC_CENTER = 2, ///< mpeg1, jpeg, h263 @@ -671,7 +671,7 @@ enum AVAudioServiceType { /** * @ingroup lavc_encoding */ -typedef struct RcOverride{ +typedef struct RcOverride { int start_frame; int end_frame; int qscale; // If this is 0 then quality_factor will be used instead. @@ -863,7 +863,7 @@ typedef struct RcOverride{ * This specifies the area which should be displayed. * Note there may be multiple such areas for one frame. */ -typedef struct AVPanScan{ +typedef struct AVPanScan { /** * id * - encoding: Set by user. @@ -885,7 +885,7 @@ typedef struct AVPanScan{ * - decoding: Set by libavcodec. */ int16_t position[3][2]; -}AVPanScan; +} AVPanScan; #define FF_QSCALE_TYPE_MPEG1 0 #define FF_QSCALE_TYPE_MPEG2 1 @@ -1929,7 +1929,7 @@ typedef struct AVCodecContext { * - encoding: Set by user. * - decoding: unused */ - int prediction_method; + int prediction_method; #define FF_PRED_LEFT 0 #define FF_PRED_PLANE 1 #define FF_PRED_MEDIAN 2 @@ -2699,11 +2699,11 @@ typedef struct AVCodecContext { void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb); int rtp_payload_size; /* The size of the RTP payload: the coder will */ - /* do its best to deliver a chunk with size */ - /* below rtp_payload_size, the chunk will start */ - /* with a start code on some codecs like H.263. */ - /* This doesn't take account of any particular */ - /* headers inside the transmitted RTP payload. */ + /* do its best to deliver a chunk with size */ + /* below rtp_payload_size, the chunk will start */ + /* with a start code on some codecs like H.263. */ + /* This doesn't take account of any particular */ + /* headers inside the transmitted RTP payload. */ /* statistics, used for 2-pass encoding */ int mv_bits; @@ -2934,7 +2934,7 @@ typedef struct AVCodecContext { * - encoding: Set by libavcodec. * - decoding: Set by user. */ - int bits_per_coded_sample; + int bits_per_coded_sample; /** * Bits per sample/pixel of internal libavcodec pixel/sample format. @@ -2948,7 +2948,7 @@ typedef struct AVCodecContext { * - encoding: unused * - decoding: Set by user. */ - int lowres; + int lowres; /** * the picture in the bitstream @@ -3038,14 +3038,14 @@ typedef struct AVCodecContext { * - encoding: Set by user. * - decoding: unused */ - int nsse_weight; + int nsse_weight; /** * profile * - encoding: Set by user. * - decoding: Set by libavcodec. */ - int profile; + int profile; #define FF_PROFILE_UNKNOWN -99 #define FF_PROFILE_RESERVED -100 @@ -3115,7 +3115,7 @@ typedef struct AVCodecContext { * - encoding: Set by user. * - decoding: Set by libavcodec. */ - int level; + int level; #define FF_LEVEL_UNKNOWN -99 /** @@ -3992,8 +3992,8 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, * used or zero if no frame data was decompressed (used) from the input AVPacket. */ attribute_deprecated int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples, - int *frame_size_ptr, - AVPacket *avpkt); + int *frame_size_ptr, + AVPacket *avpkt); #endif /** @@ -4074,8 +4074,8 @@ int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame, * used or zero if no frame could be decompressed. */ int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, - int *got_picture_ptr, - const AVPacket *avpkt); + int *got_picture_ptr, + const AVPacket *avpkt); /** * Decode a subtitle message. @@ -4094,8 +4094,8 @@ int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, * @param[in] avpkt The input AVPacket containing the input buffer. */ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub_ptr, - AVPacket *avpkt); + int *got_sub_ptr, + AVPacket *avpkt); /** * @defgroup lavc_parsing Frame parsing @@ -4353,8 +4353,8 @@ AVCodec *avcodec_find_encoder_by_name(const char *name); * of bytes used to encode the data read from the input buffer. */ int attribute_deprecated avcodec_encode_audio(AVCodecContext *avctx, - uint8_t *buf, int buf_size, - const short *samples); + uint8_t *buf, int buf_size, + const short *samples); #endif /** @@ -4642,7 +4642,7 @@ int av_picture_crop(AVPicture *dst, const AVPicture *src, * Pad image. */ 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); + int padtop, int padbottom, int padleft, int padright, int *color); /** * @} @@ -4745,7 +4745,7 @@ int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat */ attribute_deprecated enum AVPixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum AVPixelFormat src_pix_fmt, - int has_alpha, int *loss_ptr); + int has_alpha, int *loss_ptr); #endif /* FF_API_FIND_BEST_PIX_FMT */ /** @@ -4766,8 +4766,8 @@ enum AVPixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum AVPixelF * @return The best pixel format to convert to or -1 if none was found. */ 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); + enum AVPixelFormat src_pix_fmt, + int has_alpha, int *loss_ptr); /** * Find the best pixel format to convert to given a certain source pixel @@ -4800,16 +4800,16 @@ enum AVPixelFormat avcodec_find_best_pix_fmt_of_list(enum AVPixelFormat *pix_fmt * @return The best pixel format to convert to or -1 if none was found. */ 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); + enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); attribute_deprecated #if AV_HAVE_INCOMPATIBLE_FORK_ABI enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat *pix_fmt_list, - enum AVPixelFormat src_pix_fmt, - int has_alpha, int *loss_ptr); + enum AVPixelFormat src_pix_fmt, + int has_alpha, int *loss_ptr); #else 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); + enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); #endif @@ -5033,10 +5033,10 @@ AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel); * Lock operation used by lockmgr */ enum AVLockOp { - AV_LOCK_CREATE, ///< Create a mutex - AV_LOCK_OBTAIN, ///< Lock the mutex - AV_LOCK_RELEASE, ///< Unlock the mutex - AV_LOCK_DESTROY, ///< Free mutex resources + AV_LOCK_CREATE, ///< Create a mutex + AV_LOCK_OBTAIN, ///< Lock the mutex + AV_LOCK_RELEASE, ///< Unlock the mutex + AV_LOCK_DESTROY, ///< Free mutex resources }; /** diff --git a/thirdparties/mac/include/libavcodec/old_codec_ids.h b/thirdparties/mac/include/libavcodec/old_codec_ids.h index ded4cc7..e0d3d7e 100755 --- a/thirdparties/mac/include/libavcodec/old_codec_ids.h +++ b/thirdparties/mac/include/libavcodec/old_codec_ids.h @@ -29,370 +29,370 @@ * Do not add new items to this list. Use the AVCodecID enum instead. */ - CODEC_ID_NONE = AV_CODEC_ID_NONE, +CODEC_ID_NONE = AV_CODEC_ID_NONE, - /* video codecs */ - CODEC_ID_MPEG1VIDEO, - CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding - CODEC_ID_MPEG2VIDEO_XVMC, - CODEC_ID_H261, - CODEC_ID_H263, - CODEC_ID_RV10, - CODEC_ID_RV20, - CODEC_ID_MJPEG, - CODEC_ID_MJPEGB, - CODEC_ID_LJPEG, - CODEC_ID_SP5X, - CODEC_ID_JPEGLS, - CODEC_ID_MPEG4, - CODEC_ID_RAWVIDEO, - CODEC_ID_MSMPEG4V1, - CODEC_ID_MSMPEG4V2, - CODEC_ID_MSMPEG4V3, - CODEC_ID_WMV1, - CODEC_ID_WMV2, - CODEC_ID_H263P, - CODEC_ID_H263I, - CODEC_ID_FLV1, - CODEC_ID_SVQ1, - CODEC_ID_SVQ3, - CODEC_ID_DVVIDEO, - CODEC_ID_HUFFYUV, - CODEC_ID_CYUV, - CODEC_ID_H264, - CODEC_ID_INDEO3, - CODEC_ID_VP3, - CODEC_ID_THEORA, - CODEC_ID_ASV1, - CODEC_ID_ASV2, - CODEC_ID_FFV1, - CODEC_ID_4XM, - CODEC_ID_VCR1, - CODEC_ID_CLJR, - CODEC_ID_MDEC, - CODEC_ID_ROQ, - CODEC_ID_INTERPLAY_VIDEO, - CODEC_ID_XAN_WC3, - CODEC_ID_XAN_WC4, - CODEC_ID_RPZA, - CODEC_ID_CINEPAK, - CODEC_ID_WS_VQA, - CODEC_ID_MSRLE, - CODEC_ID_MSVIDEO1, - CODEC_ID_IDCIN, - CODEC_ID_8BPS, - CODEC_ID_SMC, - CODEC_ID_FLIC, - CODEC_ID_TRUEMOTION1, - CODEC_ID_VMDVIDEO, - CODEC_ID_MSZH, - CODEC_ID_ZLIB, - CODEC_ID_QTRLE, - CODEC_ID_SNOW, - CODEC_ID_TSCC, - CODEC_ID_ULTI, - CODEC_ID_QDRAW, - CODEC_ID_VIXL, - CODEC_ID_QPEG, - CODEC_ID_PNG, - CODEC_ID_PPM, - CODEC_ID_PBM, - CODEC_ID_PGM, - CODEC_ID_PGMYUV, - CODEC_ID_PAM, - CODEC_ID_FFVHUFF, - CODEC_ID_RV30, - CODEC_ID_RV40, - CODEC_ID_VC1, - CODEC_ID_WMV3, - CODEC_ID_LOCO, - CODEC_ID_WNV1, - CODEC_ID_AASC, - CODEC_ID_INDEO2, - CODEC_ID_FRAPS, - CODEC_ID_TRUEMOTION2, - CODEC_ID_BMP, - CODEC_ID_CSCD, - CODEC_ID_MMVIDEO, - CODEC_ID_ZMBV, - CODEC_ID_AVS, - CODEC_ID_SMACKVIDEO, - CODEC_ID_NUV, - CODEC_ID_KMVC, - CODEC_ID_FLASHSV, - CODEC_ID_CAVS, - CODEC_ID_JPEG2000, - CODEC_ID_VMNC, - CODEC_ID_VP5, - CODEC_ID_VP6, - CODEC_ID_VP6F, - CODEC_ID_TARGA, - CODEC_ID_DSICINVIDEO, - CODEC_ID_TIERTEXSEQVIDEO, - CODEC_ID_TIFF, - CODEC_ID_GIF, - CODEC_ID_DXA, - CODEC_ID_DNXHD, - CODEC_ID_THP, - CODEC_ID_SGI, - CODEC_ID_C93, - CODEC_ID_BETHSOFTVID, - CODEC_ID_PTX, - CODEC_ID_TXD, - CODEC_ID_VP6A, - CODEC_ID_AMV, - CODEC_ID_VB, - CODEC_ID_PCX, - CODEC_ID_SUNRAST, - CODEC_ID_INDEO4, - CODEC_ID_INDEO5, - CODEC_ID_MIMIC, - CODEC_ID_RL2, - CODEC_ID_ESCAPE124, - CODEC_ID_DIRAC, - CODEC_ID_BFI, - CODEC_ID_CMV, - CODEC_ID_MOTIONPIXELS, - CODEC_ID_TGV, - CODEC_ID_TGQ, - CODEC_ID_TQI, - CODEC_ID_AURA, - CODEC_ID_AURA2, - CODEC_ID_V210X, - CODEC_ID_TMV, - CODEC_ID_V210, - CODEC_ID_DPX, - CODEC_ID_MAD, - CODEC_ID_FRWU, - CODEC_ID_FLASHSV2, - CODEC_ID_CDGRAPHICS, - CODEC_ID_R210, - CODEC_ID_ANM, - CODEC_ID_BINKVIDEO, - CODEC_ID_IFF_ILBM, - CODEC_ID_IFF_BYTERUN1, - CODEC_ID_KGV1, - CODEC_ID_YOP, - CODEC_ID_VP8, - CODEC_ID_PICTOR, - CODEC_ID_ANSI, - CODEC_ID_A64_MULTI, - CODEC_ID_A64_MULTI5, - CODEC_ID_R10K, - CODEC_ID_MXPEG, - CODEC_ID_LAGARITH, - CODEC_ID_PRORES, - CODEC_ID_JV, - CODEC_ID_DFA, - CODEC_ID_WMV3IMAGE, - CODEC_ID_VC1IMAGE, - CODEC_ID_UTVIDEO, - CODEC_ID_BMV_VIDEO, - CODEC_ID_VBLE, - CODEC_ID_DXTORY, - CODEC_ID_V410, - CODEC_ID_XWD, - CODEC_ID_CDXL, - CODEC_ID_XBM, - CODEC_ID_ZEROCODEC, - CODEC_ID_MSS1, - CODEC_ID_MSA1, - CODEC_ID_TSCC2, - CODEC_ID_MTS2, - CODEC_ID_CLLC, - CODEC_ID_Y41P = MKBETAG('Y','4','1','P'), - CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'), - CODEC_ID_EXR = MKBETAG('0','E','X','R'), - CODEC_ID_AVRP = MKBETAG('A','V','R','P'), +/* video codecs */ +CODEC_ID_MPEG1VIDEO, +CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding +CODEC_ID_MPEG2VIDEO_XVMC, +CODEC_ID_H261, +CODEC_ID_H263, +CODEC_ID_RV10, +CODEC_ID_RV20, +CODEC_ID_MJPEG, +CODEC_ID_MJPEGB, +CODEC_ID_LJPEG, +CODEC_ID_SP5X, +CODEC_ID_JPEGLS, +CODEC_ID_MPEG4, +CODEC_ID_RAWVIDEO, +CODEC_ID_MSMPEG4V1, +CODEC_ID_MSMPEG4V2, +CODEC_ID_MSMPEG4V3, +CODEC_ID_WMV1, +CODEC_ID_WMV2, +CODEC_ID_H263P, +CODEC_ID_H263I, +CODEC_ID_FLV1, +CODEC_ID_SVQ1, +CODEC_ID_SVQ3, +CODEC_ID_DVVIDEO, +CODEC_ID_HUFFYUV, +CODEC_ID_CYUV, +CODEC_ID_H264, +CODEC_ID_INDEO3, +CODEC_ID_VP3, +CODEC_ID_THEORA, +CODEC_ID_ASV1, +CODEC_ID_ASV2, +CODEC_ID_FFV1, +CODEC_ID_4XM, +CODEC_ID_VCR1, +CODEC_ID_CLJR, +CODEC_ID_MDEC, +CODEC_ID_ROQ, +CODEC_ID_INTERPLAY_VIDEO, +CODEC_ID_XAN_WC3, +CODEC_ID_XAN_WC4, +CODEC_ID_RPZA, +CODEC_ID_CINEPAK, +CODEC_ID_WS_VQA, +CODEC_ID_MSRLE, +CODEC_ID_MSVIDEO1, +CODEC_ID_IDCIN, +CODEC_ID_8BPS, +CODEC_ID_SMC, +CODEC_ID_FLIC, +CODEC_ID_TRUEMOTION1, +CODEC_ID_VMDVIDEO, +CODEC_ID_MSZH, +CODEC_ID_ZLIB, +CODEC_ID_QTRLE, +CODEC_ID_SNOW, +CODEC_ID_TSCC, +CODEC_ID_ULTI, +CODEC_ID_QDRAW, +CODEC_ID_VIXL, +CODEC_ID_QPEG, +CODEC_ID_PNG, +CODEC_ID_PPM, +CODEC_ID_PBM, +CODEC_ID_PGM, +CODEC_ID_PGMYUV, +CODEC_ID_PAM, +CODEC_ID_FFVHUFF, +CODEC_ID_RV30, +CODEC_ID_RV40, +CODEC_ID_VC1, +CODEC_ID_WMV3, +CODEC_ID_LOCO, +CODEC_ID_WNV1, +CODEC_ID_AASC, +CODEC_ID_INDEO2, +CODEC_ID_FRAPS, +CODEC_ID_TRUEMOTION2, +CODEC_ID_BMP, +CODEC_ID_CSCD, +CODEC_ID_MMVIDEO, +CODEC_ID_ZMBV, +CODEC_ID_AVS, +CODEC_ID_SMACKVIDEO, +CODEC_ID_NUV, +CODEC_ID_KMVC, +CODEC_ID_FLASHSV, +CODEC_ID_CAVS, +CODEC_ID_JPEG2000, +CODEC_ID_VMNC, +CODEC_ID_VP5, +CODEC_ID_VP6, +CODEC_ID_VP6F, +CODEC_ID_TARGA, +CODEC_ID_DSICINVIDEO, +CODEC_ID_TIERTEXSEQVIDEO, +CODEC_ID_TIFF, +CODEC_ID_GIF, +CODEC_ID_DXA, +CODEC_ID_DNXHD, +CODEC_ID_THP, +CODEC_ID_SGI, +CODEC_ID_C93, +CODEC_ID_BETHSOFTVID, +CODEC_ID_PTX, +CODEC_ID_TXD, +CODEC_ID_VP6A, +CODEC_ID_AMV, +CODEC_ID_VB, +CODEC_ID_PCX, +CODEC_ID_SUNRAST, +CODEC_ID_INDEO4, +CODEC_ID_INDEO5, +CODEC_ID_MIMIC, +CODEC_ID_RL2, +CODEC_ID_ESCAPE124, +CODEC_ID_DIRAC, +CODEC_ID_BFI, +CODEC_ID_CMV, +CODEC_ID_MOTIONPIXELS, +CODEC_ID_TGV, +CODEC_ID_TGQ, +CODEC_ID_TQI, +CODEC_ID_AURA, +CODEC_ID_AURA2, +CODEC_ID_V210X, +CODEC_ID_TMV, +CODEC_ID_V210, +CODEC_ID_DPX, +CODEC_ID_MAD, +CODEC_ID_FRWU, +CODEC_ID_FLASHSV2, +CODEC_ID_CDGRAPHICS, +CODEC_ID_R210, +CODEC_ID_ANM, +CODEC_ID_BINKVIDEO, +CODEC_ID_IFF_ILBM, +CODEC_ID_IFF_BYTERUN1, +CODEC_ID_KGV1, +CODEC_ID_YOP, +CODEC_ID_VP8, +CODEC_ID_PICTOR, +CODEC_ID_ANSI, +CODEC_ID_A64_MULTI, +CODEC_ID_A64_MULTI5, +CODEC_ID_R10K, +CODEC_ID_MXPEG, +CODEC_ID_LAGARITH, +CODEC_ID_PRORES, +CODEC_ID_JV, +CODEC_ID_DFA, +CODEC_ID_WMV3IMAGE, +CODEC_ID_VC1IMAGE, +CODEC_ID_UTVIDEO, +CODEC_ID_BMV_VIDEO, +CODEC_ID_VBLE, +CODEC_ID_DXTORY, +CODEC_ID_V410, +CODEC_ID_XWD, +CODEC_ID_CDXL, +CODEC_ID_XBM, +CODEC_ID_ZEROCODEC, +CODEC_ID_MSS1, +CODEC_ID_MSA1, +CODEC_ID_TSCC2, +CODEC_ID_MTS2, +CODEC_ID_CLLC, +CODEC_ID_Y41P = MKBETAG('Y','4','1','P'), +CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'), +CODEC_ID_EXR = MKBETAG('0','E','X','R'), +CODEC_ID_AVRP = MKBETAG('A','V','R','P'), - CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'), - CODEC_ID_AVUI = MKBETAG('A','V','U','I'), - CODEC_ID_AYUV = MKBETAG('A','Y','U','V'), - CODEC_ID_V308 = MKBETAG('V','3','0','8'), - CODEC_ID_V408 = MKBETAG('V','4','0','8'), - CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'), - CODEC_ID_SANM = MKBETAG('S','A','N','M'), - CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'), +CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'), +CODEC_ID_AVUI = MKBETAG('A','V','U','I'), +CODEC_ID_AYUV = MKBETAG('A','Y','U','V'), +CODEC_ID_V308 = MKBETAG('V','3','0','8'), +CODEC_ID_V408 = MKBETAG('V','4','0','8'), +CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'), +CODEC_ID_SANM = MKBETAG('S','A','N','M'), +CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'), - /* various PCM "codecs" */ - CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs - CODEC_ID_PCM_S16LE = 0x10000, - CODEC_ID_PCM_S16BE, - CODEC_ID_PCM_U16LE, - CODEC_ID_PCM_U16BE, - CODEC_ID_PCM_S8, - CODEC_ID_PCM_U8, - CODEC_ID_PCM_MULAW, - CODEC_ID_PCM_ALAW, - CODEC_ID_PCM_S32LE, - CODEC_ID_PCM_S32BE, - CODEC_ID_PCM_U32LE, - CODEC_ID_PCM_U32BE, - CODEC_ID_PCM_S24LE, - CODEC_ID_PCM_S24BE, - CODEC_ID_PCM_U24LE, - CODEC_ID_PCM_U24BE, - CODEC_ID_PCM_S24DAUD, - CODEC_ID_PCM_ZORK, - CODEC_ID_PCM_S16LE_PLANAR, - CODEC_ID_PCM_DVD, - CODEC_ID_PCM_F32BE, - CODEC_ID_PCM_F32LE, - CODEC_ID_PCM_F64BE, - CODEC_ID_PCM_F64LE, - CODEC_ID_PCM_BLURAY, - CODEC_ID_PCM_LXF, - CODEC_ID_S302M, - CODEC_ID_PCM_S8_PLANAR, +/* various PCM "codecs" */ +CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs +CODEC_ID_PCM_S16LE = 0x10000, +CODEC_ID_PCM_S16BE, +CODEC_ID_PCM_U16LE, +CODEC_ID_PCM_U16BE, +CODEC_ID_PCM_S8, +CODEC_ID_PCM_U8, +CODEC_ID_PCM_MULAW, +CODEC_ID_PCM_ALAW, +CODEC_ID_PCM_S32LE, +CODEC_ID_PCM_S32BE, +CODEC_ID_PCM_U32LE, +CODEC_ID_PCM_U32BE, +CODEC_ID_PCM_S24LE, +CODEC_ID_PCM_S24BE, +CODEC_ID_PCM_U24LE, +CODEC_ID_PCM_U24BE, +CODEC_ID_PCM_S24DAUD, +CODEC_ID_PCM_ZORK, +CODEC_ID_PCM_S16LE_PLANAR, +CODEC_ID_PCM_DVD, +CODEC_ID_PCM_F32BE, +CODEC_ID_PCM_F32LE, +CODEC_ID_PCM_F64BE, +CODEC_ID_PCM_F64LE, +CODEC_ID_PCM_BLURAY, +CODEC_ID_PCM_LXF, +CODEC_ID_S302M, +CODEC_ID_PCM_S8_PLANAR, - /* various ADPCM codecs */ - CODEC_ID_ADPCM_IMA_QT = 0x11000, - CODEC_ID_ADPCM_IMA_WAV, - CODEC_ID_ADPCM_IMA_DK3, - CODEC_ID_ADPCM_IMA_DK4, - CODEC_ID_ADPCM_IMA_WS, - CODEC_ID_ADPCM_IMA_SMJPEG, - CODEC_ID_ADPCM_MS, - CODEC_ID_ADPCM_4XM, - CODEC_ID_ADPCM_XA, - CODEC_ID_ADPCM_ADX, - CODEC_ID_ADPCM_EA, - CODEC_ID_ADPCM_G726, - CODEC_ID_ADPCM_CT, - CODEC_ID_ADPCM_SWF, - CODEC_ID_ADPCM_YAMAHA, - CODEC_ID_ADPCM_SBPRO_4, - CODEC_ID_ADPCM_SBPRO_3, - CODEC_ID_ADPCM_SBPRO_2, - CODEC_ID_ADPCM_THP, - CODEC_ID_ADPCM_IMA_AMV, - CODEC_ID_ADPCM_EA_R1, - CODEC_ID_ADPCM_EA_R3, - CODEC_ID_ADPCM_EA_R2, - CODEC_ID_ADPCM_IMA_EA_SEAD, - CODEC_ID_ADPCM_IMA_EA_EACS, - CODEC_ID_ADPCM_EA_XAS, - CODEC_ID_ADPCM_EA_MAXIS_XA, - CODEC_ID_ADPCM_IMA_ISS, - CODEC_ID_ADPCM_G722, - CODEC_ID_ADPCM_IMA_APC, - CODEC_ID_VIMA = MKBETAG('V','I','M','A'), +/* various ADPCM codecs */ +CODEC_ID_ADPCM_IMA_QT = 0x11000, +CODEC_ID_ADPCM_IMA_WAV, +CODEC_ID_ADPCM_IMA_DK3, +CODEC_ID_ADPCM_IMA_DK4, +CODEC_ID_ADPCM_IMA_WS, +CODEC_ID_ADPCM_IMA_SMJPEG, +CODEC_ID_ADPCM_MS, +CODEC_ID_ADPCM_4XM, +CODEC_ID_ADPCM_XA, +CODEC_ID_ADPCM_ADX, +CODEC_ID_ADPCM_EA, +CODEC_ID_ADPCM_G726, +CODEC_ID_ADPCM_CT, +CODEC_ID_ADPCM_SWF, +CODEC_ID_ADPCM_YAMAHA, +CODEC_ID_ADPCM_SBPRO_4, +CODEC_ID_ADPCM_SBPRO_3, +CODEC_ID_ADPCM_SBPRO_2, +CODEC_ID_ADPCM_THP, +CODEC_ID_ADPCM_IMA_AMV, +CODEC_ID_ADPCM_EA_R1, +CODEC_ID_ADPCM_EA_R3, +CODEC_ID_ADPCM_EA_R2, +CODEC_ID_ADPCM_IMA_EA_SEAD, +CODEC_ID_ADPCM_IMA_EA_EACS, +CODEC_ID_ADPCM_EA_XAS, +CODEC_ID_ADPCM_EA_MAXIS_XA, +CODEC_ID_ADPCM_IMA_ISS, +CODEC_ID_ADPCM_G722, +CODEC_ID_ADPCM_IMA_APC, +CODEC_ID_VIMA = MKBETAG('V','I','M','A'), - /* AMR */ - CODEC_ID_AMR_NB = 0x12000, - CODEC_ID_AMR_WB, +/* AMR */ +CODEC_ID_AMR_NB = 0x12000, +CODEC_ID_AMR_WB, - /* RealAudio codecs*/ - CODEC_ID_RA_144 = 0x13000, - CODEC_ID_RA_288, +/* RealAudio codecs*/ +CODEC_ID_RA_144 = 0x13000, +CODEC_ID_RA_288, - /* various DPCM codecs */ - CODEC_ID_ROQ_DPCM = 0x14000, - CODEC_ID_INTERPLAY_DPCM, - CODEC_ID_XAN_DPCM, - CODEC_ID_SOL_DPCM, +/* various DPCM codecs */ +CODEC_ID_ROQ_DPCM = 0x14000, +CODEC_ID_INTERPLAY_DPCM, +CODEC_ID_XAN_DPCM, +CODEC_ID_SOL_DPCM, - /* audio codecs */ - CODEC_ID_MP2 = 0x15000, - CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 - CODEC_ID_AAC, - CODEC_ID_AC3, - CODEC_ID_DTS, - CODEC_ID_VORBIS, - CODEC_ID_DVAUDIO, - CODEC_ID_WMAV1, - CODEC_ID_WMAV2, - CODEC_ID_MACE3, - CODEC_ID_MACE6, - CODEC_ID_VMDAUDIO, - CODEC_ID_FLAC, - CODEC_ID_MP3ADU, - CODEC_ID_MP3ON4, - CODEC_ID_SHORTEN, - CODEC_ID_ALAC, - CODEC_ID_WESTWOOD_SND1, - CODEC_ID_GSM, ///< as in Berlin toast format - CODEC_ID_QDM2, - CODEC_ID_COOK, - CODEC_ID_TRUESPEECH, - CODEC_ID_TTA, - CODEC_ID_SMACKAUDIO, - CODEC_ID_QCELP, - CODEC_ID_WAVPACK, - CODEC_ID_DSICINAUDIO, - CODEC_ID_IMC, - CODEC_ID_MUSEPACK7, - CODEC_ID_MLP, - CODEC_ID_GSM_MS, /* as found in WAV */ - CODEC_ID_ATRAC3, - CODEC_ID_VOXWARE, - CODEC_ID_APE, - CODEC_ID_NELLYMOSER, - CODEC_ID_MUSEPACK8, - CODEC_ID_SPEEX, - CODEC_ID_WMAVOICE, - CODEC_ID_WMAPRO, - CODEC_ID_WMALOSSLESS, - CODEC_ID_ATRAC3P, - CODEC_ID_EAC3, - CODEC_ID_SIPR, - CODEC_ID_MP1, - CODEC_ID_TWINVQ, - CODEC_ID_TRUEHD, - CODEC_ID_MP4ALS, - CODEC_ID_ATRAC1, - CODEC_ID_BINKAUDIO_RDFT, - CODEC_ID_BINKAUDIO_DCT, - CODEC_ID_AAC_LATM, - CODEC_ID_QDMC, - CODEC_ID_CELT, - CODEC_ID_G723_1, - CODEC_ID_G729, - CODEC_ID_8SVX_EXP, - CODEC_ID_8SVX_FIB, - CODEC_ID_BMV_AUDIO, - CODEC_ID_RALF, - CODEC_ID_IAC, - CODEC_ID_ILBC, - CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'), - CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'), - CODEC_ID_SONIC = MKBETAG('S','O','N','C'), - CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'), - CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'), - CODEC_ID_OPUS = MKBETAG('O','P','U','S'), +/* audio codecs */ +CODEC_ID_MP2 = 0x15000, +CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 +CODEC_ID_AAC, +CODEC_ID_AC3, +CODEC_ID_DTS, +CODEC_ID_VORBIS, +CODEC_ID_DVAUDIO, +CODEC_ID_WMAV1, +CODEC_ID_WMAV2, +CODEC_ID_MACE3, +CODEC_ID_MACE6, +CODEC_ID_VMDAUDIO, +CODEC_ID_FLAC, +CODEC_ID_MP3ADU, +CODEC_ID_MP3ON4, +CODEC_ID_SHORTEN, +CODEC_ID_ALAC, +CODEC_ID_WESTWOOD_SND1, +CODEC_ID_GSM, ///< as in Berlin toast format +CODEC_ID_QDM2, +CODEC_ID_COOK, +CODEC_ID_TRUESPEECH, +CODEC_ID_TTA, +CODEC_ID_SMACKAUDIO, +CODEC_ID_QCELP, +CODEC_ID_WAVPACK, +CODEC_ID_DSICINAUDIO, +CODEC_ID_IMC, +CODEC_ID_MUSEPACK7, +CODEC_ID_MLP, +CODEC_ID_GSM_MS, /* as found in WAV */ +CODEC_ID_ATRAC3, +CODEC_ID_VOXWARE, +CODEC_ID_APE, +CODEC_ID_NELLYMOSER, +CODEC_ID_MUSEPACK8, +CODEC_ID_SPEEX, +CODEC_ID_WMAVOICE, +CODEC_ID_WMAPRO, +CODEC_ID_WMALOSSLESS, +CODEC_ID_ATRAC3P, +CODEC_ID_EAC3, +CODEC_ID_SIPR, +CODEC_ID_MP1, +CODEC_ID_TWINVQ, +CODEC_ID_TRUEHD, +CODEC_ID_MP4ALS, +CODEC_ID_ATRAC1, +CODEC_ID_BINKAUDIO_RDFT, +CODEC_ID_BINKAUDIO_DCT, +CODEC_ID_AAC_LATM, +CODEC_ID_QDMC, +CODEC_ID_CELT, +CODEC_ID_G723_1, +CODEC_ID_G729, +CODEC_ID_8SVX_EXP, +CODEC_ID_8SVX_FIB, +CODEC_ID_BMV_AUDIO, +CODEC_ID_RALF, +CODEC_ID_IAC, +CODEC_ID_ILBC, +CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'), +CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'), +CODEC_ID_SONIC = MKBETAG('S','O','N','C'), +CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'), +CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'), +CODEC_ID_OPUS = MKBETAG('O','P','U','S'), - /* subtitle codecs */ - CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. - CODEC_ID_DVD_SUBTITLE = 0x17000, - CODEC_ID_DVB_SUBTITLE, - CODEC_ID_TEXT, ///< raw UTF-8 text - CODEC_ID_XSUB, - CODEC_ID_SSA, - CODEC_ID_MOV_TEXT, - CODEC_ID_HDMV_PGS_SUBTITLE, - CODEC_ID_DVB_TELETEXT, - CODEC_ID_SRT, - CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'), - CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'), - CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'), - CODEC_ID_SAMI = MKBETAG('S','A','M','I'), - CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'), - CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'), +/* subtitle codecs */ +CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. +CODEC_ID_DVD_SUBTITLE = 0x17000, +CODEC_ID_DVB_SUBTITLE, +CODEC_ID_TEXT, ///< raw UTF-8 text +CODEC_ID_XSUB, +CODEC_ID_SSA, +CODEC_ID_MOV_TEXT, +CODEC_ID_HDMV_PGS_SUBTITLE, +CODEC_ID_DVB_TELETEXT, +CODEC_ID_SRT, +CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'), +CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'), +CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'), +CODEC_ID_SAMI = MKBETAG('S','A','M','I'), +CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'), +CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'), - /* other specific kind of codecs (generally used for attachments) */ - CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs. - CODEC_ID_TTF = 0x18000, - CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'), - CODEC_ID_XBIN = MKBETAG('X','B','I','N'), - CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'), - CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'), +/* other specific kind of codecs (generally used for attachments) */ +CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs. +CODEC_ID_TTF = 0x18000, +CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'), +CODEC_ID_XBIN = MKBETAG('X','B','I','N'), +CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'), +CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'), - CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it +CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it - CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS +CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS * stream (only used by libavformat) */ - CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems + CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems * stream (only used by libavformat) */ - CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information. + CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information. #endif /* AVCODEC_OLD_CODEC_IDS_H */ diff --git a/thirdparties/mac/include/libavcodec/vdpau.h b/thirdparties/mac/include/libavcodec/vdpau.h index df2aace..fe1d3b7 100755 --- a/thirdparties/mac/include/libavcodec/vdpau.h +++ b/thirdparties/mac/include/libavcodec/vdpau.h @@ -104,12 +104,12 @@ typedef struct AVVDPAUContext { */ int bitstream_buffers_used; - /** - * Table of bitstream buffers. - * The user is responsible for freeing this buffer using av_freep(). - * - * Set by libavcodec. - */ + /** + * Table of bitstream buffers. + * The user is responsible for freeing this buffer using av_freep(). + * + * Set by libavcodec. + */ VdpBitstreamBuffer *bitstream_buffers; } AVVDPAUContext; diff --git a/thirdparties/mac/include/libavcodec/xvmc.h b/thirdparties/mac/include/libavcodec/xvmc.h index b2bf518..373d9aa 100755 --- a/thirdparties/mac/include/libavcodec/xvmc.h +++ b/thirdparties/mac/include/libavcodec/xvmc.h @@ -101,8 +101,8 @@ struct xvmc_pix_fmt { */ XvMCSurface* p_surface; -/** Set by the decoder before calling ff_draw_horiz_band(), - needed by the XvMCRenderSurface function. */ + /** Set by the decoder before calling ff_draw_horiz_band(), + needed by the XvMCRenderSurface function. */ //@{ /** Pointer to the surface used as past reference - application - unchanged diff --git a/thirdparties/mac/include/libavfilter/avcodec.h b/thirdparties/mac/include/libavfilter/avcodec.h index 5f4209a..8dee966 100755 --- a/thirdparties/mac/include/libavfilter/avcodec.h +++ b/thirdparties/mac/include/libavfilter/avcodec.h @@ -63,7 +63,7 @@ AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame * @param perms permissions to assign to the new buffer reference */ AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame, - int perms); + int perms); /** * Create and return a buffer reference from the data and properties @@ -72,8 +72,8 @@ AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame * @param perms permissions to assign to the new buffer reference */ AVFilterBufferRef *avfilter_get_buffer_ref_from_frame(enum AVMediaType type, - const AVFrame *frame, - int perms); + const AVFrame *frame, + int perms); #ifdef FF_API_FILL_FRAME /** @@ -87,7 +87,7 @@ AVFilterBufferRef *avfilter_get_buffer_ref_from_frame(enum AVMediaType type, */ attribute_deprecated int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame, - const AVFilterBufferRef *samplesref); + const AVFilterBufferRef *samplesref); /** * Fill an AVFrame with the information stored in picref. @@ -100,7 +100,7 @@ int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame, */ attribute_deprecated int avfilter_fill_frame_from_video_buffer_ref(AVFrame *frame, - const AVFilterBufferRef *picref); + const AVFilterBufferRef *picref); /** * Fill an AVFrame with information stored in ref. diff --git a/thirdparties/mac/include/libavfilter/avfilter.h b/thirdparties/mac/include/libavfilter/avfilter.h index 1c80167..69c028e 100755 --- a/thirdparties/mac/include/libavfilter/avfilter.h +++ b/thirdparties/mac/include/libavfilter/avfilter.h @@ -714,7 +714,7 @@ 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 AVPixelFormat format); + int w, int h, enum AVPixelFormat format); /** * Create an audio buffer reference wrapped around an already @@ -731,11 +731,11 @@ avfilter_get_video_buffer_ref_from_arrays(uint8_t * const data[4], const int lin * @param channel_layout the channel layout of the buffer */ AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_arrays(uint8_t **data, - int linesize, - int perms, - int nb_samples, - enum AVSampleFormat sample_fmt, - uint64_t channel_layout); + int linesize, + int perms, + int nb_samples, + enum AVSampleFormat sample_fmt, + uint64_t channel_layout); /** * Create an audio buffer reference wrapped around an already * allocated samples buffer. @@ -750,12 +750,12 @@ AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_arrays(uint8_t **data, * 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); + int linesize, + int perms, + int nb_samples, + enum AVSampleFormat sample_fmt, + int channels, + uint64_t channel_layout); diff --git a/thirdparties/mac/include/libavformat/avformat.h b/thirdparties/mac/include/libavformat/avformat.h index d23d0e8..575b088 100755 --- a/thirdparties/mac/include/libavformat/avformat.h +++ b/thirdparties/mac/include/libavformat/avformat.h @@ -367,9 +367,9 @@ typedef struct AVProbeData { #else #define AVFMT_TS_NONSTRICT 0x20000 #endif - /**< Format does not require strictly - increasing timestamps, but they must - still be monotonic */ +/**< Format does not require strictly + increasing timestamps, but they must + still be monotonic */ #define AVFMT_SEEK_TO_PTS 0x4000000 /**< Seeking is based on PTS */ @@ -1378,7 +1378,7 @@ AVProgram *av_new_program(AVFormatContext *s, int id); #if FF_API_PKT_DUMP attribute_deprecated void av_pkt_dump(FILE *f, AVPacket *pkt, int dump_payload); attribute_deprecated void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt, - int dump_payload); + int dump_payload); #endif #if FF_API_ALLOC_OUTPUT_CONTEXT @@ -1387,8 +1387,8 @@ attribute_deprecated void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt, */ attribute_deprecated AVFormatContext *avformat_alloc_output_context(const char *format, - AVOutputFormat *oformat, - const char *filename); + AVOutputFormat *oformat, + const char *filename); #endif /** @@ -1835,8 +1835,8 @@ AVOutputFormat *av_guess_format(const char *short_name, * Guess the codec ID based upon muxer and filename. */ enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name, - const char *filename, const char *mime_type, - enum AVMediaType type); + const char *filename, const char *mime_type, + enum AVMediaType type); /** * Get timing information for the data currently output. diff --git a/thirdparties/mac/include/libavformat/avio.h b/thirdparties/mac/include/libavformat/avio.h index 17b341d..4623814 100755 --- a/thirdparties/mac/include/libavformat/avio.h +++ b/thirdparties/mac/include/libavformat/avio.h @@ -120,26 +120,26 @@ typedef struct AVIOContext { * max filesize, used to limit allocations * This field is internal to libavformat and access from outside is not allowed. */ - int64_t maxsize; + int64_t maxsize; - /** - * avio_read and avio_write should if possible be satisfied directly - * instead of going through a buffer, and avio_seek will always - * call the underlying seek function directly. - */ - int direct; + /** + * avio_read and avio_write should if possible be satisfied directly + * instead of going through a buffer, and avio_seek will always + * call the underlying seek function directly. + */ + int direct; /** * Bytes read statistic * This field is internal to libavformat and access from outside is not allowed. */ - int64_t bytes_read; + int64_t bytes_read; /** * seek statistic * This field is internal to libavformat and access from outside is not allowed. */ - int seek_count; + int seek_count; } AVIOContext; /* unbuffered I/O */ @@ -177,13 +177,13 @@ int avio_check(const char *url, int flags); * @return Allocated AVIOContext or NULL on failure. */ AVIOContext *avio_alloc_context( - unsigned char *buffer, - int buffer_size, - int write_flag, - void *opaque, - int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), - int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), - int64_t (*seek)(void *opaque, int64_t offset, int whence)); + unsigned char *buffer, + int buffer_size, + int write_flag, + void *opaque, + int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), + int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), + int64_t (*seek)(void *opaque, int64_t offset, int whence)); void avio_w8(AVIOContext *s, int b); void avio_write(AVIOContext *s, const unsigned char *buf, int size); diff --git a/thirdparties/mac/include/libavutil/avstring.h b/thirdparties/mac/include/libavutil/avstring.h index 5b078f1..00ecca7 100755 --- a/thirdparties/mac/include/libavutil/avstring.h +++ b/thirdparties/mac/include/libavutil/avstring.h @@ -214,8 +214,9 @@ static inline int av_isspace(int c) */ static inline int av_toupper(int c) { - if (c >= 'a' && c <= 'z') + if (c >= 'a' && c <= 'z') { c ^= 0x20; + } return c; } @@ -224,8 +225,9 @@ static inline int av_toupper(int c) */ static inline int av_tolower(int c) { - if (c >= 'A' && c <= 'Z') + if (c >= 'A' && c <= 'Z') { c ^= 0x20; + } return c; } diff --git a/thirdparties/mac/include/libavutil/base64.h b/thirdparties/mac/include/libavutil/base64.h index 514498e..0f2be64 100755 --- a/thirdparties/mac/include/libavutil/base64.h +++ b/thirdparties/mac/include/libavutil/base64.h @@ -60,8 +60,8 @@ char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size); */ #define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1) - /** - * @} - */ +/** + * @} + */ #endif /* AVUTIL_BASE64_H */ diff --git a/thirdparties/mac/include/libavutil/bprint.h b/thirdparties/mac/include/libavutil/bprint.h index df78916..6dafdc7 100755 --- a/thirdparties/mac/include/libavutil/bprint.h +++ b/thirdparties/mac/include/libavutil/bprint.h @@ -74,12 +74,12 @@ */ typedef struct AVBPrint { FF_PAD_STRUCTURE(1024, - char *str; /** string so far */ - unsigned len; /** length so far */ - unsigned size; /** allocated memory */ - unsigned size_max; /** maximum allocated memory */ - char reserved_internal_buffer[1]; - ) + char *str; /** string so far */ + unsigned len; /** length so far */ + unsigned size; /** allocated memory */ + unsigned size_max; /** maximum allocated memory */ + char reserved_internal_buffer[1]; + ) } AVBPrint; /** diff --git a/thirdparties/mac/include/libavutil/common.h b/thirdparties/mac/include/libavutil/common.h index beaf9f7..ede062e 100755 --- a/thirdparties/mac/include/libavutil/common.h +++ b/thirdparties/mac/include/libavutil/common.h @@ -97,11 +97,19 @@ av_const int av_log2_16bit(unsigned 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(); + if (amin > amax) { + abort(); + } #endif - if (a < amin) return amin; - else if (a > amax) return amax; - else return a; + if (a < amin) { + return amin; + } + else if (a > amax) { + return amax; + } + else { + return a; + } } /** @@ -114,11 +122,19 @@ static av_always_inline av_const int av_clip_c(int a, int amin, int amax) 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(); + if (amin > amax) { + abort(); + } #endif - if (a < amin) return amin; - else if (a > amax) return amax; - else return a; + if (a < amin) { + return amin; + } + else if (a > amax) { + return amax; + } + else { + return a; + } } /** @@ -128,8 +144,12 @@ static av_always_inline av_const int64_t av_clip64_c(int64_t a, int64_t amin, in */ static av_always_inline av_const uint8_t av_clip_uint8_c(int a) { - if (a&(~0xFF)) return (-a)>>31; - else return a; + if (a&(~0xFF)) { + return (-a)>>31; + } + else { + return a; + } } /** @@ -139,8 +159,12 @@ static av_always_inline av_const uint8_t av_clip_uint8_c(int a) */ static av_always_inline av_const int8_t av_clip_int8_c(int a) { - if ((a+0x80) & ~0xFF) return (a>>31) ^ 0x7F; - else return a; + if ((a+0x80) & ~0xFF) { + return (a>>31) ^ 0x7F; + } + else { + return a; + } } /** @@ -150,8 +174,12 @@ static av_always_inline av_const int8_t av_clip_int8_c(int a) */ static av_always_inline av_const uint16_t av_clip_uint16_c(int a) { - if (a&(~0xFFFF)) return (-a)>>31; - else return a; + if (a&(~0xFFFF)) { + return (-a)>>31; + } + else { + return a; + } } /** @@ -161,8 +189,12 @@ static av_always_inline av_const uint16_t av_clip_uint16_c(int a) */ static av_always_inline av_const int16_t av_clip_int16_c(int a) { - if ((a+0x8000) & ~0xFFFF) return (a>>31) ^ 0x7FFF; - else return a; + if ((a+0x8000) & ~0xFFFF) { + return (a>>31) ^ 0x7FFF; + } + else { + return a; + } } /** @@ -172,8 +204,12 @@ static av_always_inline av_const int16_t av_clip_int16_c(int a) */ static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a) { - if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (a>>63) ^ 0x7FFFFFFF; - else return (int32_t)a; + if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) { + return (a>>63) ^ 0x7FFFFFFF; + } + else { + return (int32_t)a; + } } /** @@ -184,8 +220,12 @@ static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a) */ static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p) { - if (a & ~((1<<p) - 1)) return -a >> 31 & ((1<<p) - 1); - else return a; + if (a & ~((1<<p) - 1)) { + return -a >> 31 & ((1<<p) - 1); + } + else { + return a; + } } /** @@ -222,11 +262,19 @@ 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(); + if (amin > amax) { + abort(); + } #endif - if (a < amin) return amin; - else if (a > amax) return amax; - else return a; + if (a < amin) { + return amin; + } + else if (a > amax) { + return amax; + } + else { + return a; + } } /** Compute ceil(log2(x)). @@ -312,7 +360,7 @@ static av_always_inline av_const int av_popcount64_c(uint64_t x) val += (hi<<10) + 0x10000;\ }\ }\ - + /** * @def PUT_UTF8(val, tmp, PUT_BYTE) * Convert a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long). @@ -376,7 +424,7 @@ static av_always_inline av_const int av_popcount64_c(uint64_t x) PUT_16BIT\ }\ }\ - + #include "mem.h" diff --git a/thirdparties/mac/include/libavutil/cpu.h b/thirdparties/mac/include/libavutil/cpu.h index c8f34e0..7cb1a50 100755 --- a/thirdparties/mac/include/libavutil/cpu.h +++ b/thirdparties/mac/include/libavutil/cpu.h @@ -25,7 +25,7 @@ #define AV_CPU_FLAG_FORCE 0x80000000 /* force usage of selected flags (OR) */ - /* lower 16 bits - CPU features */ +/* lower 16 bits - CPU features */ #define AV_CPU_FLAG_MMX 0x0001 ///< standard MMX #define AV_CPU_FLAG_MMXEXT 0x0002 ///< SSE integer functions or AMD MMX ext #define AV_CPU_FLAG_MMX2 0x0002 ///< SSE integer functions or AMD MMX ext diff --git a/thirdparties/mac/include/libavutil/crc.h b/thirdparties/mac/include/libavutil/crc.h index 2bdfca8..63e7605 100755 --- a/thirdparties/mac/include/libavutil/crc.h +++ b/thirdparties/mac/include/libavutil/crc.h @@ -34,7 +34,7 @@ typedef enum { AV_CRC_32_IEEE, AV_CRC_32_IEEE_LE, /*< reversed bitorder version of AV_CRC_32_IEEE */ AV_CRC_MAX, /*< Not part of public API! Do not use outside libavutil. */ -}AVCRCId; +} AVCRCId; /** * Initialize a CRC table. diff --git a/thirdparties/mac/include/libavutil/fifo.h b/thirdparties/mac/include/libavutil/fifo.h index 849b9a6..f56149b 100755 --- a/thirdparties/mac/include/libavutil/fifo.h +++ b/thirdparties/mac/include/libavutil/fifo.h @@ -134,10 +134,12 @@ void av_fifo_drain(AVFifoBuffer *f, int size); static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs) { uint8_t *ptr = f->rptr + offs; - if (ptr >= f->end) + if (ptr >= f->end) { ptr = f->buffer + (ptr - f->end); - else if (ptr < f->buffer) + } + else if (ptr < f->buffer) { ptr = f->end - (f->buffer - ptr); + } return ptr; } diff --git a/thirdparties/mac/include/libavutil/intreadwrite.h b/thirdparties/mac/include/libavutil/intreadwrite.h index 7ee6977..1d6db92 100755 --- a/thirdparties/mac/include/libavutil/intreadwrite.h +++ b/thirdparties/mac/include/libavutil/intreadwrite.h @@ -209,9 +209,15 @@ typedef union { #if defined(__GNUC__) && !defined(__TI_COMPILER_VERSION__) -union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias; -union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias; -union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias; +union unaligned_64 { + uint64_t l; +} __attribute__((packed)) av_alias; +union unaligned_32 { + uint32_t l; +} __attribute__((packed)) av_alias; +union unaligned_16 { + uint16_t l; +} __attribute__((packed)) av_alias; # define AV_RN(s, p) (((const union unaligned_##s *) (p))->l) # define AV_WN(s, p, v) ((((union unaligned_##s *) (p))->l) = (v)) diff --git a/thirdparties/mac/include/libavutil/lfg.h b/thirdparties/mac/include/libavutil/lfg.h index ec90562..301d6da 100755 --- a/thirdparties/mac/include/libavutil/lfg.h +++ b/thirdparties/mac/include/libavutil/lfg.h @@ -35,7 +35,8 @@ void av_lfg_init(AVLFG *c, unsigned int seed); * Please also consider a simple LCG like state= state*1664525+1013904223, * it may be good enough and faster for your specific use case. */ -static inline unsigned int av_lfg_get(AVLFG *c){ +static inline unsigned int av_lfg_get(AVLFG *c) +{ c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63]; return c->state[c->index++ & 63]; } @@ -45,7 +46,8 @@ static inline unsigned int av_lfg_get(AVLFG *c){ * * Please also consider av_lfg_get() above, it is faster. */ -static inline unsigned int av_mlfg_get(AVLFG *c){ +static inline unsigned int av_mlfg_get(AVLFG *c) +{ unsigned int a= c->state[(c->index-55) & 63]; unsigned int b= c->state[(c->index-24) & 63]; return c->state[c->index++ & 63] = 2*a*b+a+b; diff --git a/thirdparties/mac/include/libavutil/log.h b/thirdparties/mac/include/libavutil/log.h index 7ea95fa..5dc45c1 100755 --- a/thirdparties/mac/include/libavutil/log.h +++ b/thirdparties/mac/include/libavutil/log.h @@ -38,7 +38,7 @@ typedef enum { AV_CLASS_CATEGORY_SWSCALER, AV_CLASS_CATEGORY_SWRESAMPLER, AV_CLASS_CATEGORY_NB, ///< not part of ABI/API -}AVClassCategory; +} AVClassCategory; struct AVOptionRanges; diff --git a/thirdparties/mac/include/libavutil/mem.h b/thirdparties/mac/include/libavutil/mem.h index ced9453..a7b3d9f 100755 --- a/thirdparties/mac/include/libavutil/mem.h +++ b/thirdparties/mac/include/libavutil/mem.h @@ -40,36 +40,36 @@ #if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1110 || defined(__SUNPRO_C) - #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v - #define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v +#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v +#define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v #elif defined(__TI_COMPILER_VERSION__) - #define DECLARE_ALIGNED(n,t,v) \ +#define DECLARE_ALIGNED(n,t,v) \ AV_PRAGMA(DATA_ALIGN(v,n)) \ t __attribute__((aligned(n))) v - #define DECLARE_ASM_CONST(n,t,v) \ +#define DECLARE_ASM_CONST(n,t,v) \ AV_PRAGMA(DATA_ALIGN(v,n)) \ static const t __attribute__((aligned(n))) v #elif defined(__GNUC__) - #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v - #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v +#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v +#define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v #elif defined(_MSC_VER) - #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v - #define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v +#define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v +#define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v #else - #define DECLARE_ALIGNED(n,t,v) t v - #define DECLARE_ASM_CONST(n,t,v) static const t v +#define DECLARE_ALIGNED(n,t,v) t v +#define DECLARE_ASM_CONST(n,t,v) static const t v #endif #if AV_GCC_VERSION_AT_LEAST(3,1) - #define av_malloc_attrib __attribute__((__malloc__)) +#define av_malloc_attrib __attribute__((__malloc__)) #else - #define av_malloc_attrib +#define av_malloc_attrib #endif #if AV_GCC_VERSION_AT_LEAST(4,3) - #define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__))) +#define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__))) #else - #define av_alloc_size(...) +#define av_alloc_size(...) #endif /** @@ -93,8 +93,9 @@ void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1); */ av_alloc_size(1, 2) static inline void *av_malloc_array(size_t nmemb, size_t size) { - if (size <= 0 || nmemb >= INT_MAX / size) + if (size <= 0 || nmemb >= INT_MAX / size) { return NULL; + } return av_malloc(nmemb * size); } @@ -166,8 +167,9 @@ void *av_calloc(size_t nmemb, size_t size) av_malloc_attrib; */ av_alloc_size(1, 2) static inline void *av_mallocz_array(size_t nmemb, size_t size) { - if (size <= 0 || nmemb >= INT_MAX / size) + if (size <= 0 || nmemb >= INT_MAX / size) { return NULL; + } return av_mallocz(nmemb * size); } @@ -206,8 +208,9 @@ static inline int av_size_mult(size_t a, size_t b, size_t *r) size_t t = a * b; /* Hack inspired from glibc: only try the division if nelem and elsize * are both greater than sqrt(SIZE_MAX). */ - if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) + if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b) { return AVERROR(EINVAL); + } *r = t; return 0; } diff --git a/thirdparties/mac/include/libavutil/old_pix_fmts.h b/thirdparties/mac/include/libavutil/old_pix_fmts.h index 57b6992..a804f03 100755 --- a/thirdparties/mac/include/libavutil/old_pix_fmts.h +++ b/thirdparties/mac/include/libavutil/old_pix_fmts.h @@ -28,144 +28,144 @@ * * 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_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_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_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_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_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_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_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 +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 +//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 +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 +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 +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_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_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 +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 */ diff --git a/thirdparties/mac/include/libavutil/opt.h b/thirdparties/mac/include/libavutil/opt.h index baf1b82..05f6f4b 100755 --- a/thirdparties/mac/include/libavutil/opt.h +++ b/thirdparties/mac/include/libavutil/opt.h @@ -217,7 +217,7 @@ * before the file is actually opened. */ -enum AVOptionType{ +enum AVOptionType { AV_OPT_TYPE_FLAGS, AV_OPT_TYPE_INT, AV_OPT_TYPE_INT64, diff --git a/thirdparties/mac/include/libavutil/pixdesc.h b/thirdparties/mac/include/libavutil/pixdesc.h index ca0722e..4caa15b 100755 --- a/thirdparties/mac/include/libavutil/pixdesc.h +++ b/thirdparties/mac/include/libavutil/pixdesc.h @@ -25,7 +25,7 @@ #include <inttypes.h> #include "pixfmt.h" -typedef struct AVComponentDescriptor{ +typedef struct AVComponentDescriptor { uint16_t plane :2; ///< which of the 4 planes contains the component /** @@ -41,7 +41,7 @@ typedef struct AVComponentDescriptor{ uint16_t offset_plus1 :3; uint16_t shift :3; ///< number of least significant bits that must be shifted away to get the value uint16_t depth_minus1 :4; ///< number of bits in the component minus 1 -}AVComponentDescriptor; +} AVComponentDescriptor; /** * Descriptor that unambiguously describes how the bits of a pixel are @@ -52,7 +52,7 @@ typedef struct AVComponentDescriptor{ * and all the YUV variants) AVPixFmtDescriptor just stores how values * are stored not what these values represent. */ -typedef struct AVPixFmtDescriptor{ +typedef struct AVPixFmtDescriptor { const char *name; uint8_t nb_components; ///< The number of components each pixel has, (1-4) @@ -84,7 +84,7 @@ typedef struct AVPixFmtDescriptor{ * otherwise 0 is luma, 1 is chroma-U and 2 is chroma-V. */ AVComponentDescriptor comp[4]; -}AVPixFmtDescriptor; +} AVPixFmtDescriptor; #define PIX_FMT_BE 1 ///< Pixel format is big-endian. #define PIX_FMT_PAL 2 ///< Pixel format has a palette in data[1], values are indexes in this palette. diff --git a/thirdparties/mac/include/libavutil/rational.h b/thirdparties/mac/include/libavutil/rational.h index 417e29e..84ce7a0 100755 --- a/thirdparties/mac/include/libavutil/rational.h +++ b/thirdparties/mac/include/libavutil/rational.h @@ -40,7 +40,7 @@ /** * rational number numerator/denominator */ -typedef struct AVRational{ +typedef struct AVRational { int num; ///< numerator int den; ///< denominator } AVRational; @@ -52,13 +52,22 @@ typedef struct AVRational{ * @return 0 if a==b, 1 if a>b, -1 if a<b, and INT_MIN if one of the * values is of the form 0/0 */ -static inline int av_cmp_q(AVRational a, AVRational b){ +static inline int av_cmp_q(AVRational a, AVRational b) +{ const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den; - if(tmp) return ((tmp ^ a.den ^ b.den)>>63)|1; - else if(b.den && a.den) return 0; - else if(a.num && b.num) return (a.num>>31) - (b.num>>31); - else return INT_MIN; + if(tmp) { + return ((tmp ^ a.den ^ b.den)>>63)|1; + } + else if(b.den && a.den) { + return 0; + } + else if(a.num && b.num) { + return (a.num>>31) - (b.num>>31); + } + else { + return INT_MIN; + } } /** @@ -66,7 +75,8 @@ static inline int av_cmp_q(AVRational a, AVRational b){ * @param a rational to convert * @return (double) a */ -static inline double av_q2d(AVRational a){ +static inline double av_q2d(AVRational a) +{ return a.num / (double) a.den; } diff --git a/thirdparties/mac/include/libavutil/timestamp.h b/thirdparties/mac/include/libavutil/timestamp.h index c7348d8..6b46998 100755 --- a/thirdparties/mac/include/libavutil/timestamp.h +++ b/thirdparties/mac/include/libavutil/timestamp.h @@ -38,8 +38,12 @@ */ static inline char *av_ts_make_string(char *buf, int64_t ts) { - if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS"); - else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%"PRId64"", ts); + if (ts == AV_NOPTS_VALUE) { + snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS"); + } + else { + snprintf(buf, AV_TS_MAX_STRING_SIZE, "%"PRId64"", ts); + } return buf; } @@ -60,8 +64,12 @@ static inline char *av_ts_make_string(char *buf, int64_t ts) */ static inline char *av_ts_make_time_string(char *buf, int64_t ts, AVRational *tb) { - if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS"); - else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%.6g", av_q2d(*tb) * ts); + if (ts == AV_NOPTS_VALUE) { + snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS"); + } + else { + snprintf(buf, AV_TS_MAX_STRING_SIZE, "%.6g", av_q2d(*tb) * ts); + } return buf; } diff --git a/thirdparties/mac/include/libswresample/swresample.h b/thirdparties/mac/include/libswresample/swresample.h index 95e8a5a..d7e3027 100755 --- a/thirdparties/mac/include/libswresample/swresample.h +++ b/thirdparties/mac/include/libswresample/swresample.h @@ -214,7 +214,7 @@ void swr_free(struct SwrContext **s); * @return number of samples output per channel, negative value on error */ int swr_convert(struct SwrContext *s, uint8_t **out, int out_count, - const uint8_t **in , int in_count); + const uint8_t **in , int in_count); /** * Convert the next timestamp from input to output diff --git a/thirdparties/mac/include/opus/opus.h b/thirdparties/mac/include/opus/opus.h index 93a53a2..3bc4526 100755 --- a/thirdparties/mac/include/opus/opus.h +++ b/thirdparties/mac/include/opus/opus.h @@ -525,12 +525,12 @@ OPUS_EXPORT void opus_decoder_destroy(OpusDecoder *st); * @returns number of frames */ OPUS_EXPORT int opus_packet_parse( - const unsigned char *data, - opus_int32 len, - unsigned char *out_toc, - const unsigned char *frames[48], - opus_int16 size[48], - int *payload_offset + const unsigned char *data, + opus_int32 len, + unsigned char *out_toc, + const unsigned char *frames[48], + opus_int16 size[48], + int *payload_offset ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4); /** Gets the bandwidth of an Opus packet. diff --git a/thirdparties/mac/include/opus/opus_multistream.h b/thirdparties/mac/include/opus/opus_multistream.h index ae59979..e0fe282 100755 --- a/thirdparties/mac/include/opus/opus_multistream.h +++ b/thirdparties/mac/include/opus/opus_multistream.h @@ -201,13 +201,13 @@ typedef struct OpusMSDecoder OpusMSDecoder; * (see @ref opus_errorcodes) on error. */ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_encoder_get_size( - int streams, - int coupled_streams + int streams, + int coupled_streams ); OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_surround_encoder_get_size( - int channels, - int mapping_family + int channels, + int mapping_family ); @@ -255,24 +255,24 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_surround_encoder * failure. */ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_encoder_create( - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - const unsigned char *mapping, - int application, - int *error + opus_int32 Fs, + int channels, + int streams, + int coupled_streams, + const unsigned char *mapping, + int application, + int *error ) OPUS_ARG_NONNULL(5); OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_surround_encoder_create( - opus_int32 Fs, - int channels, - int mapping_family, - int *streams, - int *coupled_streams, - unsigned char *mapping, - int application, - int *error + opus_int32 Fs, + int channels, + int mapping_family, + int *streams, + int *coupled_streams, + unsigned char *mapping, + int application, + int *error ) OPUS_ARG_NONNULL(5); /** Initialize a previously allocated multistream encoder state. @@ -324,24 +324,24 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_surround_enc * on failure. */ OPUS_EXPORT int opus_multistream_encoder_init( - OpusMSEncoder *st, - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - const unsigned char *mapping, - int application + OpusMSEncoder *st, + opus_int32 Fs, + int channels, + int streams, + int coupled_streams, + const unsigned char *mapping, + int application ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); OPUS_EXPORT int opus_multistream_surround_encoder_init( - OpusMSEncoder *st, - opus_int32 Fs, - int channels, - int mapping_family, - int *streams, - int *coupled_streams, - unsigned char *mapping, - int application + OpusMSEncoder *st, + opus_int32 Fs, + int channels, + int mapping_family, + int *streams, + int *coupled_streams, + unsigned char *mapping, + int application ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); /** Encodes a multistream Opus frame. @@ -420,11 +420,11 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode( * negative error code (see @ref opus_errorcodes) on failure. */ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode_float( - OpusMSEncoder *st, - const float *pcm, - int frame_size, - unsigned char *data, - opus_int32 max_data_bytes + OpusMSEncoder *st, + const float *pcm, + int frame_size, + unsigned char *data, + opus_int32 max_data_bytes ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4); /** Frees an <code>OpusMSEncoder</code> allocated by @@ -468,8 +468,8 @@ OPUS_EXPORT int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ... * (see @ref opus_errorcodes) on error. */ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_decoder_get_size( - int streams, - int coupled_streams + int streams, + int coupled_streams ); /** Allocates and initializes a multistream decoder state. @@ -502,12 +502,12 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_decoder_get_size * failure. */ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSDecoder *opus_multistream_decoder_create( - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - const unsigned char *mapping, - int *error + opus_int32 Fs, + int channels, + int streams, + int coupled_streams, + const unsigned char *mapping, + int *error ) OPUS_ARG_NONNULL(5); /** Intialize a previously allocated decoder state object. @@ -545,12 +545,12 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSDecoder *opus_multistream_decoder_crea * on failure. */ OPUS_EXPORT int opus_multistream_decoder_init( - OpusMSDecoder *st, - opus_int32 Fs, - int channels, - int streams, - int coupled_streams, - const unsigned char *mapping + OpusMSDecoder *st, + opus_int32 Fs, + int channels, + int streams, + int coupled_streams, + const unsigned char *mapping ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); /** Decode a multistream Opus packet. diff --git a/thirdparties/mac/include/opus/opus_types.h b/thirdparties/mac/include/opus/opus_types.h index b28e03a..85a2ed8 100755 --- a/thirdparties/mac/include/opus/opus_types.h +++ b/thirdparties/mac/include/opus/opus_types.h @@ -37,114 +37,114 @@ #if (defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) || defined (HAVE_STDINT_H)) #include <stdint.h> - typedef int16_t opus_int16; - typedef uint16_t opus_uint16; - typedef int32_t opus_int32; - typedef uint32_t opus_uint32; +typedef int16_t opus_int16; +typedef uint16_t opus_uint16; +typedef int32_t opus_int32; +typedef uint32_t opus_uint32; #elif defined(_WIN32) # if defined(__CYGWIN__) # include <_G_config.h> - typedef _G_int32_t opus_int32; - typedef _G_uint32_t opus_uint32; - typedef _G_int16 opus_int16; - typedef _G_uint16 opus_uint16; +typedef _G_int32_t opus_int32; +typedef _G_uint32_t opus_uint32; +typedef _G_int16 opus_int16; +typedef _G_uint16 opus_uint16; # elif defined(__MINGW32__) - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; +typedef short opus_int16; +typedef unsigned short opus_uint16; +typedef int opus_int32; +typedef unsigned int opus_uint32; # elif defined(__MWERKS__) - typedef int opus_int32; - typedef unsigned int opus_uint32; - typedef short opus_int16; - typedef unsigned short opus_uint16; +typedef int opus_int32; +typedef unsigned int opus_uint32; +typedef short opus_int16; +typedef unsigned short opus_uint16; # else - /* MSVC/Borland */ - typedef __int32 opus_int32; - typedef unsigned __int32 opus_uint32; - typedef __int16 opus_int16; - typedef unsigned __int16 opus_uint16; +/* MSVC/Borland */ +typedef __int32 opus_int32; +typedef unsigned __int32 opus_uint32; +typedef __int16 opus_int16; +typedef unsigned __int16 opus_uint16; # endif #elif defined(__MACOS__) # include <sys/types.h> - typedef SInt16 opus_int16; - typedef UInt16 opus_uint16; - typedef SInt32 opus_int32; - typedef UInt32 opus_uint32; +typedef SInt16 opus_int16; +typedef UInt16 opus_uint16; +typedef SInt32 opus_int32; +typedef UInt32 opus_uint32; #elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */ # include <sys/types.h> - typedef int16_t opus_int16; - typedef u_int16_t opus_uint16; - typedef int32_t opus_int32; - typedef u_int32_t opus_uint32; +typedef int16_t opus_int16; +typedef u_int16_t opus_uint16; +typedef int32_t opus_int32; +typedef u_int32_t opus_uint32; #elif defined(__BEOS__) - /* Be */ +/* Be */ # include <inttypes.h> - typedef int16 opus_int16; - typedef u_int16 opus_uint16; - typedef int32_t opus_int32; - typedef u_int32_t opus_uint32; +typedef int16 opus_int16; +typedef u_int16 opus_uint16; +typedef int32_t opus_int32; +typedef u_int32_t opus_uint32; #elif defined (__EMX__) - /* OS/2 GCC */ - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; +/* OS/2 GCC */ +typedef short opus_int16; +typedef unsigned short opus_uint16; +typedef int opus_int32; +typedef unsigned int opus_uint32; #elif defined (DJGPP) - /* DJGPP */ - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; +/* DJGPP */ +typedef short opus_int16; +typedef unsigned short opus_uint16; +typedef int opus_int32; +typedef unsigned int opus_uint32; #elif defined(R5900) - /* PS2 EE */ - typedef int opus_int32; - typedef unsigned opus_uint32; - typedef short opus_int16; - typedef unsigned short opus_uint16; +/* PS2 EE */ +typedef int opus_int32; +typedef unsigned opus_uint32; +typedef short opus_int16; +typedef unsigned short opus_uint16; #elif defined(__SYMBIAN32__) - /* Symbian GCC */ - typedef signed short opus_int16; - typedef unsigned short opus_uint16; - typedef signed int opus_int32; - typedef unsigned int opus_uint32; +/* Symbian GCC */ +typedef signed short opus_int16; +typedef unsigned short opus_uint16; +typedef signed int opus_int32; +typedef unsigned int opus_uint32; #elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X) - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef long opus_int32; - typedef unsigned long opus_uint32; +typedef short opus_int16; +typedef unsigned short opus_uint16; +typedef long opus_int32; +typedef unsigned long opus_uint32; #elif defined(CONFIG_TI_C6X) - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; +typedef short opus_int16; +typedef unsigned short opus_uint16; +typedef int opus_int32; +typedef unsigned int opus_uint32; #else - /* Give up, take a reasonable guess */ - typedef short opus_int16; - typedef unsigned short opus_uint16; - typedef int opus_int32; - typedef unsigned int opus_uint32; +/* Give up, take a reasonable guess */ +typedef short opus_int16; +typedef unsigned short opus_uint16; +typedef int opus_int32; +typedef unsigned int opus_uint32; #endif diff --git a/thirdparties/mac/include/speex/speex.h b/thirdparties/mac/include/speex/speex.h index 82ba016..0eb560e 100755 --- a/thirdparties/mac/include/speex/speex.h +++ b/thirdparties/mac/include/speex/speex.h @@ -7,18 +7,18 @@ 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 Xiph.org Foundation 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 @@ -245,70 +245,70 @@ typedef int (*decoder_ctl_func)(void *state, int request, void *ptr); /** Query function for a mode */ typedef int (*mode_query_func)(const void *mode, int request, void *ptr); -/** Struct defining a Speex mode */ +/** Struct defining a Speex mode */ typedef struct SpeexMode { - /** Pointer to the low-level mode data */ - const void *mode; + /** Pointer to the low-level mode data */ + const void *mode; + + /** Pointer to the mode query function */ + mode_query_func query; - /** Pointer to the mode query function */ - mode_query_func query; - - /** The name of the mode (you should not rely on this to identify the mode)*/ - const char *modeName; + /** The name of the mode (you should not rely on this to identify the mode)*/ + const char *modeName; - /**ID of the mode*/ - int modeID; + /**ID of the mode*/ + int modeID; - /**Version number of the bitstream (incremented every time we break - bitstream compatibility*/ - int bitstream_version; + /**Version number of the bitstream (incremented every time we break + bitstream compatibility*/ + int bitstream_version; - /** Pointer to encoder initialization function */ - encoder_init_func enc_init; + /** Pointer to encoder initialization function */ + encoder_init_func enc_init; - /** Pointer to encoder destruction function */ - encoder_destroy_func enc_destroy; + /** Pointer to encoder destruction function */ + encoder_destroy_func enc_destroy; - /** Pointer to frame encoding function */ - encode_func enc; + /** Pointer to frame encoding function */ + encode_func enc; - /** Pointer to decoder initialization function */ - decoder_init_func dec_init; + /** Pointer to decoder initialization function */ + decoder_init_func dec_init; - /** Pointer to decoder destruction function */ - decoder_destroy_func dec_destroy; + /** Pointer to decoder destruction function */ + decoder_destroy_func dec_destroy; - /** Pointer to frame decoding function */ - decode_func dec; + /** Pointer to frame decoding function */ + decode_func dec; - /** ioctl-like requests for encoder */ - encoder_ctl_func enc_ctl; + /** ioctl-like requests for encoder */ + encoder_ctl_func enc_ctl; - /** ioctl-like requests for decoder */ - decoder_ctl_func dec_ctl; + /** ioctl-like requests for decoder */ + decoder_ctl_func dec_ctl; } SpeexMode; /** - * Returns a handle to a newly created Speex encoder state structure. For now, - * the "mode" argument can be &nb_mode or &wb_mode . In the future, more modes - * may be added. Note that for now if you have more than one channels to + * Returns a handle to a newly created Speex encoder state structure. For now, + * the "mode" argument can be &nb_mode or &wb_mode . In the future, more modes + * may be added. Note that for now if you have more than one channels to * encode, you need one state per channel. * - * @param mode The mode to use (either speex_nb_mode or speex_wb.mode) + * @param mode The mode to use (either speex_nb_mode or speex_wb.mode) * @return A newly created encoder state or NULL if state allocation fails */ void *speex_encoder_init(const SpeexMode *mode); -/** Frees all resources associated to an existing Speex encoder state. +/** Frees all resources associated to an existing Speex encoder state. * @param state Encoder state to be destroyed */ void speex_encoder_destroy(void *state); /** Uses an existing encoder state to encode one frame of speech pointed to by "in". The encoded bit-stream is saved in "bits". @param state Encoder state - @param in Frame that will be encoded with a +-2^15 range. This data MAY be - overwritten by the encoder and should be considered uninitialised + @param in Frame that will be encoded with a +-2^15 range. This data MAY be + overwritten by the encoder and should be considered uninitialised after the call. @param bits Bit-stream where the data will be written @return 0 if frame needs not be transmitted (DTX only), 1 otherwise @@ -334,14 +334,14 @@ int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits); int speex_encoder_ctl(void *state, int request, void *ptr); -/** Returns a handle to a newly created decoder state structure. For now, +/** Returns a handle to a newly created decoder state structure. For now, * the mode argument can be &nb_mode or &wb_mode . In the future, more modes * may be added. Note that for now if you have more than one channels to * decode, you need one state per channel. * * @param mode Speex mode (one of speex_nb_mode or speex_wb_mode) * @return A newly created decoder state or NULL if state allocation fails - */ + */ void *speex_decoder_init(const SpeexMode *mode); /** Frees all resources associated to an existing decoder state. diff --git a/thirdparties/mac/include/speex/speex_bits.h b/thirdparties/mac/include/speex/speex_bits.h index a26fb4c..dd3b752 100755 --- a/thirdparties/mac/include/speex/speex_bits.h +++ b/thirdparties/mac/include/speex/speex_bits.h @@ -7,18 +7,18 @@ 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 Xiph.org Foundation 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 @@ -47,15 +47,15 @@ extern "C" { /** Bit-packing data structure representing (part of) a bit-stream. */ typedef struct SpeexBits { - char *chars; /**< "raw" data */ - int nbBits; /**< Total number of bits stored in the stream*/ - int charPtr; /**< Position of the byte "cursor" */ - int bitPtr; /**< Position of the bit "cursor" within the current char */ - int owner; /**< Does the struct "own" the "raw" buffer (member "chars") */ - int overflow;/**< Set to one if we try to read past the valid data */ - int buf_size;/**< Allocated size for buffer */ - int reserved1; /**< Reserved for future use */ - void *reserved2; /**< Reserved for future use */ + char *chars; /**< "raw" data */ + int nbBits; /**< Total number of bits stored in the stream*/ + int charPtr; /**< Position of the byte "cursor" */ + int bitPtr; /**< Position of the bit "cursor" within the current char */ + int owner; /**< Does the struct "own" the "raw" buffer (member "chars") */ + int overflow;/**< Set to one if we try to read past the valid data */ + int buf_size;/**< Allocated size for buffer */ + int reserved1; /**< Reserved for future use */ + void *reserved2; /**< Reserved for future use */ } SpeexBits; /** Initializes and allocates resources for a SpeexBits struct */ @@ -80,7 +80,7 @@ void speex_bits_rewind(SpeexBits *bits); void speex_bits_read_from(SpeexBits *bits, char *bytes, int len); /** Append bytes to the bit-stream - * + * * @param bits Bit-stream to operate on * @param bytes pointer to the bytes what will be appended * @param len Number of bytes of append @@ -88,7 +88,7 @@ void speex_bits_read_from(SpeexBits *bits, char *bytes, int len); void speex_bits_read_whole_bytes(SpeexBits *bits, char *bytes, int len); /** Write the content of a bit-stream to an area of memory - * + * * @param bits Bit-stream to operate on * @param bytes Memory location where to write the bits * @param max_len Maximum number of bytes to write (i.e. size of the "bytes" buffer) @@ -129,8 +129,8 @@ unsigned int speex_bits_unpack_unsigned(SpeexBits *bits, int nbBits); */ int speex_bits_nbytes(SpeexBits *bits); -/** Same as speex_bits_unpack_unsigned, but without modifying the cursor position - * +/** Same as speex_bits_unpack_unsigned, but without modifying the cursor position + * * @param bits Bit-stream to operate on * @param nbBits Number of bits to look for * @return Value of the bits peeked, interpreted as unsigned @@ -138,14 +138,14 @@ int speex_bits_nbytes(SpeexBits *bits); unsigned int speex_bits_peek_unsigned(SpeexBits *bits, int nbBits); /** Get the value of the next bit in the stream, without modifying the - * "cursor" position - * + * "cursor" position + * * @param bits Bit-stream to operate on * @return Value of the bit peeked (one bit only) */ int speex_bits_peek(SpeexBits *bits); -/** Advances the position of the "bit cursor" in the stream +/** Advances the position of the "bit cursor" in the stream * * @param bits Bit-stream to operate on * @param n Number of bits to advance @@ -159,8 +159,8 @@ void speex_bits_advance(SpeexBits *bits, int n); */ int speex_bits_remaining(SpeexBits *bits); -/** Insert a terminator so that the data can be sent as a packet while auto-detecting - * the number of frames in each packet +/** Insert a terminator so that the data can be sent as a packet while auto-detecting + * the number of frames in each packet * * @param bits Bit-stream to operate on */ diff --git a/thirdparties/mac/include/speex/speex_buffer.h b/thirdparties/mac/include/speex/speex_buffer.h index df56f5f..909bd6d 100755 --- a/thirdparties/mac/include/speex/speex_buffer.h +++ b/thirdparties/mac/include/speex/speex_buffer.h @@ -1,5 +1,5 @@ /* Copyright (C) 2007 Jean-Marc Valin - + File: speex_buffer.h This is a very simple ring buffer implementation. It is not thread-safe so you need to do your own locking. diff --git a/thirdparties/mac/include/speex/speex_callbacks.h b/thirdparties/mac/include/speex/speex_callbacks.h index 6f450b3..27b5649 100755 --- a/thirdparties/mac/include/speex/speex_callbacks.h +++ b/thirdparties/mac/include/speex/speex_callbacks.h @@ -7,18 +7,18 @@ 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 Xiph.org Foundation 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 @@ -89,11 +89,11 @@ typedef int (*speex_callback_func)(SpeexBits *bits, void *state, void *data); /** Callback information */ typedef struct SpeexCallback { - int callback_id; /**< ID associated to the callback */ - speex_callback_func func; /**< Callback handler function */ - void *data; /**< Data that will be sent to the handler */ - void *reserved1; /**< Reserved for future use */ - int reserved2; /**< Reserved for future use */ + int callback_id; /**< ID associated to the callback */ + speex_callback_func func; /**< Callback handler function */ + void *data; /**< Data that will be sent to the handler */ + void *reserved1; /**< Reserved for future use */ + int reserved2; /**< Reserved for future use */ } SpeexCallback; /** Handle in-band request */ diff --git a/thirdparties/mac/include/speex/speex_echo.h b/thirdparties/mac/include/speex/speex_echo.h index 53bcd28..582e1cc 100755 --- a/thirdparties/mac/include/speex/speex_echo.h +++ b/thirdparties/mac/include/speex/speex_echo.h @@ -63,7 +63,7 @@ extern "C" { struct SpeexEchoState_; /** @class SpeexEchoState - * This holds the state of the echo canceller. You need one per channel. + * This holds the state of the echo canceller. You need one per channel. */ /** Internal echo canceller state. Should never be accessed directly. */ @@ -85,7 +85,7 @@ SpeexEchoState *speex_echo_state_init(int frame_size, int filter_length); */ SpeexEchoState *speex_echo_state_init_mc(int frame_size, int filter_length, int nb_mic, int nb_speakers); -/** Destroys an echo canceller state +/** Destroys an echo canceller state * @param st Echo canceller state */ void speex_echo_state_destroy(SpeexEchoState *st); @@ -117,7 +117,7 @@ void speex_echo_capture(SpeexEchoState *st, const spx_int16_t *rec, spx_int16_t */ void speex_echo_playback(SpeexEchoState *st, const spx_int16_t *play); -/** Reset the echo canceller to its original state +/** Reset the echo canceller to its original state * @param st Echo canceller state */ void speex_echo_state_reset(SpeexEchoState *st); @@ -139,7 +139,7 @@ typedef struct SpeexDecorrState_ SpeexDecorrState; /** Create a state for the channel decorrelation algorithm - This is useful for multi-channel echo cancellation only + This is useful for multi-channel echo cancellation only * @param rate Sampling rate * @param channels Number of channels (it's a bit pointless if you don't have at least 2) * @param frame_size Size of the frame to process at ones (counting samples *per* channel) @@ -155,7 +155,7 @@ SpeexDecorrState *speex_decorrelate_new(int rate, int channels, int frame_size); */ void speex_decorrelate(SpeexDecorrState *st, const spx_int16_t *in, spx_int16_t *out, int strength); -/** Destroy a Decorrelation state +/** Destroy a Decorrelation state * @param st State to destroy */ void speex_decorrelate_destroy(SpeexDecorrState *st); diff --git a/thirdparties/mac/include/speex/speex_header.h b/thirdparties/mac/include/speex/speex_header.h index f85b249..4cc15df 100755 --- a/thirdparties/mac/include/speex/speex_header.h +++ b/thirdparties/mac/include/speex/speex_header.h @@ -7,18 +7,18 @@ 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 Xiph.org Foundation 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 @@ -57,21 +57,21 @@ struct SpeexMode; /** Speex header info for file-based formats */ typedef struct SpeexHeader { - char speex_string[SPEEX_HEADER_STRING_LENGTH]; /**< Identifies a Speex bit-stream, always set to "Speex " */ - char speex_version[SPEEX_HEADER_VERSION_LENGTH]; /**< Speex version */ - spx_int32_t speex_version_id; /**< Version for Speex (for checking compatibility) */ - spx_int32_t header_size; /**< Total size of the header ( sizeof(SpeexHeader) ) */ - spx_int32_t rate; /**< Sampling rate used */ - spx_int32_t mode; /**< Mode used (0 for narrowband, 1 for wideband) */ - spx_int32_t mode_bitstream_version; /**< Version ID of the bit-stream */ - spx_int32_t nb_channels; /**< Number of channels encoded */ - spx_int32_t bitrate; /**< Bit-rate used */ - spx_int32_t frame_size; /**< Size of frames */ - spx_int32_t vbr; /**< 1 for a VBR encoding, 0 otherwise */ - spx_int32_t frames_per_packet; /**< Number of frames stored per Ogg packet */ - spx_int32_t extra_headers; /**< Number of additional headers after the comments */ - spx_int32_t reserved1; /**< Reserved for future use, must be zero */ - spx_int32_t reserved2; /**< Reserved for future use, must be zero */ + char speex_string[SPEEX_HEADER_STRING_LENGTH]; /**< Identifies a Speex bit-stream, always set to "Speex " */ + char speex_version[SPEEX_HEADER_VERSION_LENGTH]; /**< Speex version */ + spx_int32_t speex_version_id; /**< Version for Speex (for checking compatibility) */ + spx_int32_t header_size; /**< Total size of the header ( sizeof(SpeexHeader) ) */ + spx_int32_t rate; /**< Sampling rate used */ + spx_int32_t mode; /**< Mode used (0 for narrowband, 1 for wideband) */ + spx_int32_t mode_bitstream_version; /**< Version ID of the bit-stream */ + spx_int32_t nb_channels; /**< Number of channels encoded */ + spx_int32_t bitrate; /**< Bit-rate used */ + spx_int32_t frame_size; /**< Size of frames */ + spx_int32_t vbr; /**< 1 for a VBR encoding, 0 otherwise */ + spx_int32_t frames_per_packet; /**< Number of frames stored per Ogg packet */ + spx_int32_t extra_headers; /**< Number of additional headers after the comments */ + spx_int32_t reserved1; /**< Reserved for future use, must be zero */ + spx_int32_t reserved2; /**< Reserved for future use, must be zero */ } SpeexHeader; /** Initializes a SpeexHeader using basic information */ diff --git a/thirdparties/mac/include/speex/speex_jitter.h b/thirdparties/mac/include/speex/speex_jitter.h index d68674b..e6f0321 100755 --- a/thirdparties/mac/include/speex/speex_jitter.h +++ b/thirdparties/mac/include/speex/speex_jitter.h @@ -7,18 +7,18 @@ 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 Xiph.org Foundation 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 @@ -58,12 +58,12 @@ typedef struct _JitterBufferPacket JitterBufferPacket; /** Definition of an incoming packet */ struct _JitterBufferPacket { - char *data; /**< Data bytes contained in the packet */ - spx_uint32_t len; /**< Length of the packet in bytes */ - spx_uint32_t timestamp; /**< Timestamp for the packet */ - spx_uint32_t span; /**< Time covered by the packet (same units as timestamp) */ - spx_uint16_t sequence; /**< RTP Sequence number if available (0 otherwise) */ - spx_uint32_t user_data; /**< Put whatever data you like here (it's ignored by the jitter buffer) */ + char *data; /**< Data bytes contained in the packet */ + spx_uint32_t len; /**< Length of the packet in bytes */ + spx_uint32_t timestamp; /**< Timestamp for the packet */ + spx_uint32_t span; /**< Time covered by the packet (same units as timestamp) */ + spx_uint16_t sequence; /**< RTP Sequence number if available (0 otherwise) */ + spx_uint32_t user_data; /**< Put whatever data you like here (it's ignored by the jitter buffer) */ }; /** Packet has been retrieved */ @@ -89,7 +89,7 @@ struct _JitterBufferPacket { /** Included because of an early misspelling (will remove in next release) */ #define JITTER_BUFFER_GET_AVALIABLE_COUNT 3 -/** Assign a function to destroy unused packet. When setting that, the jitter +/** Assign a function to destroy unused packet. When setting that, the jitter buffer no longer copies packet data. */ #define JITTER_BUFFER_SET_DESTROY_CALLBACK 4 /** */ @@ -104,7 +104,7 @@ struct _JitterBufferPacket { #define JITTER_BUFFER_SET_CONCEALMENT_SIZE 8 #define JITTER_BUFFER_GET_CONCEALMENT_SIZE 9 -/** Absolute max amount of loss that can be tolerated regardless of the delay. Typical loss +/** Absolute max amount of loss that can be tolerated regardless of the delay. Typical loss should be half of that or less. */ #define JITTER_BUFFER_SET_MAX_LATE_RATE 10 #define JITTER_BUFFER_GET_MAX_LATE_RATE 11 @@ -114,59 +114,59 @@ struct _JitterBufferPacket { #define JITTER_BUFFER_GET_LATE_COST 13 -/** Initialises jitter buffer - * - * @param step_size Starting value for the size of concleanment packets and delay +/** Initialises jitter buffer + * + * @param step_size Starting value for the size of concleanment packets and delay adjustment steps. Can be changed at any time using JITTER_BUFFER_SET_DELAY_STEP and JITTER_BUFFER_GET_CONCEALMENT_SIZE. * @return Newly created jitter buffer state */ JitterBuffer *jitter_buffer_init(int step_size); -/** Restores jitter buffer to its original state - * +/** Restores jitter buffer to its original state + * * @param jitter Jitter buffer state */ void jitter_buffer_reset(JitterBuffer *jitter); -/** Destroys jitter buffer - * +/** Destroys jitter buffer + * * @param jitter Jitter buffer state */ void jitter_buffer_destroy(JitterBuffer *jitter); /** Put one packet into the jitter buffer - * + * * @param jitter Jitter buffer state * @param packet Incoming packet */ void jitter_buffer_put(JitterBuffer *jitter, const JitterBufferPacket *packet); /** Get one packet from the jitter buffer - * + * * @param jitter Jitter buffer state * @param packet Returned packet * @param desired_span Number of samples (or units) we wish to get from the buffer (no guarantee) - * @param current_timestamp Timestamp for the returned packet + * @param current_timestamp Timestamp for the returned packet */ int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, spx_int32_t desired_span, spx_int32_t *start_offset); /** Used right after jitter_buffer_get() to obtain another packet that would have the same timestamp. * This is mainly useful for media where a single "frame" can be split into several packets. - * + * * @param jitter Jitter buffer state * @param packet Returned packet */ int jitter_buffer_get_another(JitterBuffer *jitter, JitterBufferPacket *packet); /** Get pointer timestamp of jitter buffer - * + * * @param jitter Jitter buffer state */ int jitter_buffer_get_pointer_timestamp(JitterBuffer *jitter); /** Advance by one tick - * + * * @param jitter Jitter buffer state */ void jitter_buffer_tick(JitterBuffer *jitter); @@ -178,7 +178,7 @@ void jitter_buffer_tick(JitterBuffer *jitter); void jitter_buffer_remaining_span(JitterBuffer *jitter, spx_uint32_t rem); /** Used like the ioctl function to control the jitter buffer parameters - * + * * @param jitter Jitter buffer state * @param request ioctl-type request (one of the JITTER_BUFFER_* macros) * @param ptr Data exchanged to-from function diff --git a/thirdparties/mac/include/speex/speex_preprocess.h b/thirdparties/mac/include/speex/speex_preprocess.h index f8eef2c..5cd3710 100755 --- a/thirdparties/mac/include/speex/speex_preprocess.h +++ b/thirdparties/mac/include/speex/speex_preprocess.h @@ -2,7 +2,7 @@ Written by Jean-Marc Valin */ /** * @file speex_preprocess.h - * @brief Speex preprocessor. The preprocess can do noise suppression, + * @brief Speex preprocessor. The preprocess can do noise suppression, * residual echo suppression (after using the echo canceller), automatic * gain control (AGC) and voice activity detection (VAD). */ @@ -37,7 +37,7 @@ #ifndef SPEEX_PREPROCESS_H #define SPEEX_PREPROCESS_H /** @defgroup SpeexPreprocessState SpeexPreprocessState: The Speex preprocessor - * This is the Speex preprocessor. The preprocess can do noise suppression, + * This is the Speex preprocessor. The preprocess can do noise suppression, * residual echo suppression (after using the echo canceller), automatic * gain control (AGC) and voice activity detection (VAD). * @{ @@ -48,7 +48,7 @@ #ifdef __cplusplus extern "C" { #endif - + /** State of the preprocessor (one per channel). Should never be accessed directly. */ struct SpeexPreprocessState_; @@ -64,12 +64,12 @@ typedef struct SpeexPreprocessState_ SpeexPreprocessState; */ SpeexPreprocessState *speex_preprocess_state_init(int frame_size, int sampling_rate); -/** Destroys a preprocessor state +/** Destroys a preprocessor state * @param st Preprocessor state to destroy */ void speex_preprocess_state_destroy(SpeexPreprocessState *st); -/** Preprocess a frame +/** Preprocess a frame * @param st Preprocessor state * @param x Audio sample vector (in and out). Must be same size as specified in speex_preprocess_state_init(). * @return Bool value for voice activity (1 for speech, 0 for noise/silence), ONLY if VAD turned on. @@ -85,7 +85,7 @@ int speex_preprocess(SpeexPreprocessState *st, spx_int16_t *x, spx_int32_t *echo */ void speex_preprocess_estimate_update(SpeexPreprocessState *st, spx_int16_t *x); -/** Used like the ioctl function to control the preprocessor parameters +/** Used like the ioctl function to control the preprocessor parameters * @param st Preprocessor state * @param request ioctl-type request (one of the SPEEX_PREPROCESS_* macros) * @param ptr Data exchanged to-from function diff --git a/thirdparties/mac/include/speex/speex_resampler.h b/thirdparties/mac/include/speex/speex_resampler.h index 54eef8d..4aefa61 100755 --- a/thirdparties/mac/include/speex/speex_resampler.h +++ b/thirdparties/mac/include/speex/speex_resampler.h @@ -1,8 +1,8 @@ /* Copyright (C) 2007 Jean-Marc Valin - + File: speex_resampler.h Resampling code - + The design goals of this code are: - Very fast algorithm - Low memory requirement @@ -43,7 +43,7 @@ /********* WARNING: MENTAL SANITY ENDS HERE *************/ -/* If the resampler is defined outside of Speex, we change the symbol names so that +/* If the resampler is defined outside of Speex, we change the symbol names so that there won't be any clash if linking with Speex later on. */ /* #define RANDOM_PREFIX your software name here */ @@ -53,7 +53,7 @@ #define CAT_PREFIX2(a,b) a ## b #define CAT_PREFIX(a,b) CAT_PREFIX2(a, b) - + #define speex_resampler_init CAT_PREFIX(RANDOM_PREFIX,_resampler_init) #define speex_resampler_init_frac CAT_PREFIX(RANDOM_PREFIX,_resampler_init_frac) #define speex_resampler_destroy CAT_PREFIX(RANDOM_PREFIX,_resampler_destroy) @@ -81,7 +81,7 @@ #define spx_int32_t int #define spx_uint16_t unsigned short #define spx_uint32_t unsigned int - + #else /* OUTSIDE_SPEEX */ #include "speex/speex_types.h" @@ -99,13 +99,13 @@ extern "C" { #define SPEEX_RESAMPLER_QUALITY_DESKTOP 5 enum { - RESAMPLER_ERR_SUCCESS = 0, - RESAMPLER_ERR_ALLOC_FAILED = 1, - RESAMPLER_ERR_BAD_STATE = 2, - RESAMPLER_ERR_INVALID_ARG = 3, - RESAMPLER_ERR_PTR_OVERLAP = 4, - - RESAMPLER_ERR_MAX_ERROR + RESAMPLER_ERR_SUCCESS = 0, + RESAMPLER_ERR_ALLOC_FAILED = 1, + RESAMPLER_ERR_BAD_STATE = 2, + RESAMPLER_ERR_INVALID_ARG = 3, + RESAMPLER_ERR_PTR_OVERLAP = 4, + + RESAMPLER_ERR_MAX_ERROR }; struct SpeexResamplerState_; @@ -120,14 +120,14 @@ typedef struct SpeexResamplerState_ SpeexResamplerState; * @return Newly created resampler state * @retval NULL Error: not enough memory */ -SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels, - spx_uint32_t in_rate, - spx_uint32_t out_rate, - int quality, - int *err); - -/** Create a new resampler with fractional input/output rates. The sampling - * rate ratio is an arbitrary rational number with both the numerator and +SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels, + spx_uint32_t in_rate, + spx_uint32_t out_rate, + int quality, + int *err); + +/** Create a new resampler with fractional input/output rates. The sampling + * rate ratio is an arbitrary rational number with both the numerator and * denominator being 32-bit integers. * @param nb_channels Number of channels to be processed * @param ratio_num Numerator of the sampling rate ratio @@ -139,13 +139,13 @@ SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels, * @return Newly created resampler state * @retval NULL Error: not enough memory */ -SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels, - spx_uint32_t ratio_num, - spx_uint32_t ratio_den, - spx_uint32_t in_rate, - spx_uint32_t out_rate, - int quality, - int *err); +SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels, + spx_uint32_t ratio_num, + spx_uint32_t ratio_den, + spx_uint32_t in_rate, + spx_uint32_t out_rate, + int quality, + int *err); /** Destroy a resampler state. * @param st Resampler state @@ -154,24 +154,24 @@ void speex_resampler_destroy(SpeexResamplerState *st); /** Resample a float array. The input and output buffers must *not* overlap. * @param st Resampler state - * @param channel_index Index of the channel to process for the multi-channel + * @param channel_index Index of the channel to process for the multi-channel * base (0 otherwise) * @param in Input buffer - * @param in_len Number of input samples in the input buffer. Returns the + * @param in_len Number of input samples in the input buffer. Returns the * number of samples processed * @param out Output buffer * @param out_len Size of the output buffer. Returns the number of samples written */ -int speex_resampler_process_float(SpeexResamplerState *st, - spx_uint32_t channel_index, - const float *in, - spx_uint32_t *in_len, - float *out, - spx_uint32_t *out_len); +int speex_resampler_process_float(SpeexResamplerState *st, + spx_uint32_t channel_index, + const float *in, + spx_uint32_t *in_len, + float *out, + spx_uint32_t *out_len); /** Resample an int array. The input and output buffers must *not* overlap. * @param st Resampler state - * @param channel_index Index of the channel to process for the multi-channel + * @param channel_index Index of the channel to process for the multi-channel * base (0 otherwise) * @param in Input buffer * @param in_len Number of input samples in the input buffer. Returns the number @@ -179,12 +179,12 @@ int speex_resampler_process_float(SpeexResamplerState *st, * @param out Output buffer * @param out_len Size of the output buffer. Returns the number of samples written */ -int speex_resampler_process_int(SpeexResamplerState *st, - spx_uint32_t channel_index, - const spx_int16_t *in, - spx_uint32_t *in_len, - spx_int16_t *out, - spx_uint32_t *out_len); +int speex_resampler_process_int(SpeexResamplerState *st, + spx_uint32_t channel_index, + const spx_int16_t *in, + spx_uint32_t *in_len, + spx_int16_t *out, + spx_uint32_t *out_len); /** Resample an interleaved float array. The input and output buffers must *not* overlap. * @param st Resampler state @@ -195,11 +195,11 @@ int speex_resampler_process_int(SpeexResamplerState *st, * @param out_len Size of the output buffer. Returns the number of samples written. * This is all per-channel. */ -int speex_resampler_process_interleaved_float(SpeexResamplerState *st, - const float *in, - spx_uint32_t *in_len, - float *out, - spx_uint32_t *out_len); +int speex_resampler_process_interleaved_float(SpeexResamplerState *st, + const float *in, + spx_uint32_t *in_len, + float *out, + spx_uint32_t *out_len); /** Resample an interleaved int array. The input and output buffers must *not* overlap. * @param st Resampler state @@ -210,31 +210,31 @@ int speex_resampler_process_interleaved_float(SpeexResamplerState *st, * @param out_len Size of the output buffer. Returns the number of samples written. * This is all per-channel. */ -int speex_resampler_process_interleaved_int(SpeexResamplerState *st, - const spx_int16_t *in, - spx_uint32_t *in_len, - spx_int16_t *out, - spx_uint32_t *out_len); +int speex_resampler_process_interleaved_int(SpeexResamplerState *st, + const spx_int16_t *in, + spx_uint32_t *in_len, + spx_int16_t *out, + spx_uint32_t *out_len); /** Set (change) the input/output sampling rates (integer value). * @param st Resampler state * @param in_rate Input sampling rate (integer number of Hz). * @param out_rate Output sampling rate (integer number of Hz). */ -int speex_resampler_set_rate(SpeexResamplerState *st, - spx_uint32_t in_rate, - spx_uint32_t out_rate); +int speex_resampler_set_rate(SpeexResamplerState *st, + spx_uint32_t in_rate, + spx_uint32_t out_rate); /** Get the current input/output sampling rates (integer value). * @param st Resampler state * @param in_rate Input sampling rate (integer number of Hz) copied. * @param out_rate Output sampling rate (integer number of Hz) copied. */ -void speex_resampler_get_rate(SpeexResamplerState *st, - spx_uint32_t *in_rate, +void speex_resampler_get_rate(SpeexResamplerState *st, + spx_uint32_t *in_rate, spx_uint32_t *out_rate); -/** Set (change) the input/output sampling rates and resampling ratio +/** Set (change) the input/output sampling rates and resampling ratio * (fractional values in Hz supported). * @param st Resampler state * @param ratio_num Numerator of the sampling rate ratio @@ -242,11 +242,11 @@ void speex_resampler_get_rate(SpeexResamplerState *st, * @param in_rate Input sampling rate rounded to the nearest integer (in Hz). * @param out_rate Output sampling rate rounded to the nearest integer (in Hz). */ -int speex_resampler_set_rate_frac(SpeexResamplerState *st, - spx_uint32_t ratio_num, - spx_uint32_t ratio_den, - spx_uint32_t in_rate, - spx_uint32_t out_rate); +int speex_resampler_set_rate_frac(SpeexResamplerState *st, + spx_uint32_t ratio_num, + spx_uint32_t ratio_den, + spx_uint32_t in_rate, + spx_uint32_t out_rate); /** Get the current resampling ratio. This will be reduced to the least * common denominator. @@ -254,53 +254,53 @@ int speex_resampler_set_rate_frac(SpeexResamplerState *st, * @param ratio_num Numerator of the sampling rate ratio copied * @param ratio_den Denominator of the sampling rate ratio copied */ -void speex_resampler_get_ratio(SpeexResamplerState *st, - spx_uint32_t *ratio_num, +void speex_resampler_get_ratio(SpeexResamplerState *st, + spx_uint32_t *ratio_num, spx_uint32_t *ratio_den); /** Set (change) the conversion quality. * @param st Resampler state - * @param quality Resampling quality between 0 and 10, where 0 has poor + * @param quality Resampling quality between 0 and 10, where 0 has poor * quality and 10 has very high quality. */ -int speex_resampler_set_quality(SpeexResamplerState *st, - int quality); +int speex_resampler_set_quality(SpeexResamplerState *st, + int quality); /** Get the conversion quality. * @param st Resampler state - * @param quality Resampling quality between 0 and 10, where 0 has poor + * @param quality Resampling quality between 0 and 10, where 0 has poor * quality and 10 has very high quality. */ -void speex_resampler_get_quality(SpeexResamplerState *st, +void speex_resampler_get_quality(SpeexResamplerState *st, int *quality); /** Set (change) the input stride. * @param st Resampler state * @param stride Input stride */ -void speex_resampler_set_input_stride(SpeexResamplerState *st, +void speex_resampler_set_input_stride(SpeexResamplerState *st, spx_uint32_t stride); /** Get the input stride. * @param st Resampler state * @param stride Input stride copied */ -void speex_resampler_get_input_stride(SpeexResamplerState *st, +void speex_resampler_get_input_stride(SpeexResamplerState *st, spx_uint32_t *stride); /** Set (change) the output stride. * @param st Resampler state * @param stride Output stride */ -void speex_resampler_set_output_stride(SpeexResamplerState *st, - spx_uint32_t stride); +void speex_resampler_set_output_stride(SpeexResamplerState *st, + spx_uint32_t stride); /** Get the output stride. * @param st Resampler state copied * @param stride Output stride */ -void speex_resampler_get_output_stride(SpeexResamplerState *st, - spx_uint32_t *stride); +void speex_resampler_get_output_stride(SpeexResamplerState *st, + spx_uint32_t *stride); /** Get the latency in input samples introduced by the resampler. * @param st Resampler state @@ -312,8 +312,8 @@ int speex_resampler_get_input_latency(SpeexResamplerState *st); */ int speex_resampler_get_output_latency(SpeexResamplerState *st); -/** Make sure that the first samples to go out of the resamplers don't have - * leading zeros. This is only useful before starting to use a newly created +/** Make sure that the first samples to go out of the resamplers don't have + * leading zeros. This is only useful before starting to use a newly created * resampler. It is recommended to use that when resampling an audio file, as * it will generate a file with the same length. For real-time processing, * it is probably easier not to use this call (so that the output duration diff --git a/thirdparties/mac/include/speex/speex_stereo.h b/thirdparties/mac/include/speex/speex_stereo.h index a259713..f33704d 100755 --- a/thirdparties/mac/include/speex/speex_stereo.h +++ b/thirdparties/mac/include/speex/speex_stereo.h @@ -7,18 +7,18 @@ 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 Xiph.org Foundation 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 @@ -48,12 +48,12 @@ extern "C" { /** If you access any of these fields directly, I'll personally come and bite you */ typedef struct SpeexStereoState { - float balance; /**< Left/right balance info */ - float e_ratio; /**< Ratio of energies: E(left+right)/[E(left)+E(right)] */ - float smooth_left; /**< Smoothed left channel gain */ - float smooth_right; /**< Smoothed right channel gain */ - float reserved1; /**< Reserved for future use */ - float reserved2; /**< Reserved for future use */ + float balance; /**< Left/right balance info */ + float e_ratio; /**< Ratio of energies: E(left+right)/[E(left)+E(right)] */ + float smooth_left; /**< Smoothed left channel gain */ + float smooth_right; /**< Smoothed right channel gain */ + float reserved1; /**< Reserved for future use */ + float reserved2; /**< Reserved for future use */ } SpeexStereoState; /** Deprecated. Use speex_stereo_state_init() instead. */ diff --git a/thirdparties/mac/include/speex/speex_types.h b/thirdparties/mac/include/speex/speex_types.h index 852fed8..fa8f806 100755 --- a/thirdparties/mac/include/speex/speex_types.h +++ b/thirdparties/mac/include/speex/speex_types.h @@ -22,100 +22,100 @@ #ifndef _SPEEX_TYPES_H #define _SPEEX_TYPES_H -#if defined(_WIN32) +#if defined(_WIN32) # if defined(__CYGWIN__) # include <_G_config.h> - typedef _G_int32_t spx_int32_t; - typedef _G_uint32_t spx_uint32_t; - typedef _G_int16_t spx_int16_t; - typedef _G_uint16_t spx_uint16_t; +typedef _G_int32_t spx_int32_t; +typedef _G_uint32_t spx_uint32_t; +typedef _G_int16_t spx_int16_t; +typedef _G_uint16_t spx_uint16_t; # elif defined(__MINGW32__) - typedef short spx_int16_t; - typedef unsigned short spx_uint16_t; - typedef int spx_int32_t; - typedef unsigned int spx_uint32_t; +typedef short spx_int16_t; +typedef unsigned short spx_uint16_t; +typedef int spx_int32_t; +typedef unsigned int spx_uint32_t; # elif defined(__MWERKS__) - typedef int spx_int32_t; - typedef unsigned int spx_uint32_t; - typedef short spx_int16_t; - typedef unsigned short spx_uint16_t; +typedef int spx_int32_t; +typedef unsigned int spx_uint32_t; +typedef short spx_int16_t; +typedef unsigned short spx_uint16_t; # else - /* MSVC/Borland */ - typedef __int32 spx_int32_t; - typedef unsigned __int32 spx_uint32_t; - typedef __int16 spx_int16_t; - typedef unsigned __int16 spx_uint16_t; +/* MSVC/Borland */ +typedef __int32 spx_int32_t; +typedef unsigned __int32 spx_uint32_t; +typedef __int16 spx_int16_t; +typedef unsigned __int16 spx_uint16_t; # endif #elif defined(__MACOS__) # include <sys/types.h> - typedef SInt16 spx_int16_t; - typedef UInt16 spx_uint16_t; - typedef SInt32 spx_int32_t; - typedef UInt32 spx_uint32_t; +typedef SInt16 spx_int16_t; +typedef UInt16 spx_uint16_t; +typedef SInt32 spx_int32_t; +typedef UInt32 spx_uint32_t; #elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */ # include <sys/types.h> - typedef int16_t spx_int16_t; - typedef u_int16_t spx_uint16_t; - typedef int32_t spx_int32_t; - typedef u_int32_t spx_uint32_t; +typedef int16_t spx_int16_t; +typedef u_int16_t spx_uint16_t; +typedef int32_t spx_int32_t; +typedef u_int32_t spx_uint32_t; #elif defined(__BEOS__) - /* Be */ +/* Be */ # include <inttypes.h> - typedef int16_t spx_int16_t; - typedef u_int16_t spx_uint16_t; - typedef int32_t spx_int32_t; - typedef u_int32_t spx_uint32_t; +typedef int16_t spx_int16_t; +typedef u_int16_t spx_uint16_t; +typedef int32_t spx_int32_t; +typedef u_int32_t spx_uint32_t; #elif defined (__EMX__) - /* OS/2 GCC */ - typedef short spx_int16_t; - typedef unsigned short spx_uint16_t; - typedef int spx_int32_t; - typedef unsigned int spx_uint32_t; +/* OS/2 GCC */ +typedef short spx_int16_t; +typedef unsigned short spx_uint16_t; +typedef int spx_int32_t; +typedef unsigned int spx_uint32_t; #elif defined (DJGPP) - /* DJGPP */ - typedef short spx_int16_t; - typedef int spx_int32_t; - typedef unsigned int spx_uint32_t; +/* DJGPP */ +typedef short spx_int16_t; +typedef int spx_int32_t; +typedef unsigned int spx_uint32_t; #elif defined(R5900) - /* PS2 EE */ - typedef int spx_int32_t; - typedef unsigned spx_uint32_t; - typedef short spx_int16_t; +/* PS2 EE */ +typedef int spx_int32_t; +typedef unsigned spx_uint32_t; +typedef short spx_int16_t; #elif defined(__SYMBIAN32__) - /* Symbian GCC */ - typedef signed short spx_int16_t; - typedef unsigned short spx_uint16_t; - typedef signed int spx_int32_t; - typedef unsigned int spx_uint32_t; +/* Symbian GCC */ +typedef signed short spx_int16_t; +typedef unsigned short spx_uint16_t; +typedef signed int spx_int32_t; +typedef unsigned int spx_uint32_t; #elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X) - typedef short spx_int16_t; - typedef unsigned short spx_uint16_t; - typedef long spx_int32_t; - typedef unsigned long spx_uint32_t; +typedef short spx_int16_t; +typedef unsigned short spx_uint16_t; +typedef long spx_int32_t; +typedef unsigned long spx_uint32_t; #elif defined(CONFIG_TI_C6X) - typedef short spx_int16_t; - typedef unsigned short spx_uint16_t; - typedef int spx_int32_t; - typedef unsigned int spx_uint32_t; +typedef short spx_int16_t; +typedef unsigned short spx_uint16_t; +typedef int spx_int32_t; +typedef unsigned int spx_uint32_t; #else diff --git a/thirdparties/mac/include/srtp/aes.h b/thirdparties/mac/include/srtp/aes.h index d88ce40..0d5e01c 100755 --- a/thirdparties/mac/include/srtp/aes.h +++ b/thirdparties/mac/include/srtp/aes.h @@ -8,26 +8,26 @@ */ /* - * + * * Copyright (c) 2001-2006, 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 @@ -53,19 +53,19 @@ /* aes internals */ typedef struct { - v128_t round[15]; - int num_rounds; + v128_t round[15]; + int num_rounds; } aes_expanded_key_t; err_status_t aes_expand_encryption_key(const uint8_t *key, - int key_len, - aes_expanded_key_t *expanded_key); + int key_len, + aes_expanded_key_t *expanded_key); err_status_t aes_expand_decryption_key(const uint8_t *key, - int key_len, - aes_expanded_key_t *expanded_key); + int key_len, + aes_expanded_key_t *expanded_key); void aes_encrypt(v128_t *plaintext, const aes_expanded_key_t *exp_key); @@ -75,7 +75,7 @@ aes_decrypt(v128_t *plaintext, const aes_expanded_key_t *exp_key); #if 0 /* - * internal functions + * internal functions */ void @@ -83,6 +83,6 @@ aes_init_sbox(void); void aes_compute_tables(void); -#endif +#endif #endif /* _AES_H */ diff --git a/thirdparties/mac/include/srtp/aes_cbc.h b/thirdparties/mac/include/srtp/aes_cbc.h index 4fda390..14fb658 100755 --- a/thirdparties/mac/include/srtp/aes_cbc.h +++ b/thirdparties/mac/include/srtp/aes_cbc.h @@ -9,26 +9,26 @@ */ /* - * + * * Copyright (c) 2001-2006, 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 @@ -51,38 +51,38 @@ #include "cipher.h" 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 */ + 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; err_status_t aes_cbc_set_key(aes_cbc_ctx_t *c, - const unsigned char *key); + const unsigned char *key); err_status_t -aes_cbc_encrypt(aes_cbc_ctx_t *c, - unsigned char *buf, - unsigned int *bytes_in_data); +aes_cbc_encrypt(aes_cbc_ctx_t *c, + unsigned char *buf, + unsigned int *bytes_in_data); err_status_t -aes_cbc_context_init(aes_cbc_ctx_t *c, const uint8_t *key, - int key_len); +aes_cbc_context_init(aes_cbc_ctx_t *c, const uint8_t *key, + int key_len); err_status_t 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, - unsigned char *data, - unsigned int *bytes_in_data); + unsigned char *data, + unsigned int *bytes_in_data); err_status_t aes_cbc_nist_decrypt(aes_cbc_ctx_t *c, - unsigned char *data, - unsigned int *bytes_in_data); + unsigned char *data, + unsigned int *bytes_in_data); #endif /* AES_CBC_H */ diff --git a/thirdparties/mac/include/srtp/aes_gcm_ossl.h b/thirdparties/mac/include/srtp/aes_gcm_ossl.h index 8e7711d..827ecd3 100755 --- a/thirdparties/mac/include/srtp/aes_gcm_ossl.h +++ b/thirdparties/mac/include/srtp/aes_gcm_ossl.h @@ -8,26 +8,26 @@ * */ /* - * + * * 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 @@ -52,11 +52,11 @@ #include <openssl/aes.h> typedef struct { - v256_t key; - int key_size; - int tag_len; - EVP_CIPHER_CTX ctx; - cipher_direction_t dir; + 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 */ diff --git a/thirdparties/mac/include/srtp/aes_icm.h b/thirdparties/mac/include/srtp/aes_icm.h index 1a2fd82..f4505ec 100755 --- a/thirdparties/mac/include/srtp/aes_icm.h +++ b/thirdparties/mac/include/srtp/aes_icm.h @@ -9,26 +9,26 @@ */ /* - * + * * Copyright (c) 2001-2006, 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 @@ -51,43 +51,43 @@ #include "cipher.h" typedef struct { - v128_t counter; /* holds the counter value */ - v128_t offset; /* initial offset value */ - v128_t keystream_buffer; /* buffers bytes of keystream */ - aes_expanded_key_t expanded_key; /* the cipher key */ - int bytes_in_buffer; /* number of unused bytes in buffer */ + v128_t counter; /* holds the counter value */ + v128_t offset; /* initial offset value */ + v128_t keystream_buffer; /* buffers bytes of keystream */ + aes_expanded_key_t expanded_key; /* the cipher key */ + int bytes_in_buffer; /* number of unused bytes in buffer */ } aes_icm_ctx_t; err_status_t aes_icm_context_init(aes_icm_ctx_t *c, - const unsigned char *key, - int key_len); + const unsigned char *key, + int key_len); err_status_t aes_icm_set_iv(aes_icm_ctx_t *c, void *iv, int direction); err_status_t aes_icm_encrypt(aes_icm_ctx_t *c, - unsigned char *buf, unsigned int *bytes_to_encr); + unsigned char *buf, unsigned int *bytes_to_encr); err_status_t aes_icm_output(aes_icm_ctx_t *c, - unsigned char *buf, unsigned int bytes_to_output); + unsigned char *buf, unsigned int bytes_to_output); -err_status_t +err_status_t aes_icm_dealloc(cipher_t *c); - -err_status_t -aes_icm_encrypt_ismacryp(aes_icm_ctx_t *c, - unsigned char *buf, - unsigned int *enc_len, - int forIsmacryp); - -err_status_t -aes_icm_alloc_ismacryp(cipher_t **c, - int key_len, - int forIsmacryp); + +err_status_t +aes_icm_encrypt_ismacryp(aes_icm_ctx_t *c, + unsigned char *buf, + unsigned int *enc_len, + int forIsmacryp); + +err_status_t +aes_icm_alloc_ismacryp(cipher_t **c, + int key_len, + int forIsmacryp); uint16_t aes_icm_bytes_encrypted(aes_icm_ctx_t *c); diff --git a/thirdparties/mac/include/srtp/alloc.h b/thirdparties/mac/include/srtp/alloc.h index 5980eed..306e5f4 100755 --- a/thirdparties/mac/include/srtp/alloc.h +++ b/thirdparties/mac/include/srtp/alloc.h @@ -1,32 +1,32 @@ /* * alloc.h * - * interface to memory allocation and deallocation, with optional debugging + * interface to memory allocation and deallocation, with optional debugging * * David A. McGrew * Cisco Systems, Inc. */ /* - * + * * Copyright (c) 2001-2006 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 diff --git a/thirdparties/mac/include/srtp/auth.h b/thirdparties/mac/include/srtp/auth.h index 5b5e4b2..4d03d08 100755 --- a/thirdparties/mac/include/srtp/auth.h +++ b/thirdparties/mac/include/srtp/auth.h @@ -8,26 +8,26 @@ */ /* - * + * * Copyright (c) 2001-2006, 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 @@ -46,7 +46,7 @@ #ifndef AUTH_H #define AUTH_H -#include "datatypes.h" +#include "datatypes.h" #include "err.h" /* error codes */ #include "crypto.h" /* for auth_type_id_t */ #include "crypto_types.h" /* for values of auth_type_id_t */ @@ -55,22 +55,22 @@ typedef struct auth_type_t *auth_type_pointer; typedef struct auth_t *auth_pointer_t; typedef err_status_t (*auth_alloc_func) - (auth_pointer_t *ap, int key_len, int out_len); +(auth_pointer_t *ap, int key_len, int out_len); typedef err_status_t (*auth_init_func) - (void *state, const uint8_t *key, int key_len); +(void *state, const uint8_t *key, int key_len); typedef err_status_t (*auth_dealloc_func)(auth_pointer_t ap); typedef err_status_t (*auth_compute_func) - (void *state, uint8_t *buffer, int octets_to_auth, - int tag_len, uint8_t *tag); +(void *state, uint8_t *buffer, int octets_to_auth, + int tag_len, uint8_t *tag); typedef err_status_t (*auth_update_func) - (void *state, uint8_t *buffer, int octets_to_auth); +(void *state, uint8_t *buffer, int octets_to_auth); typedef err_status_t (*auth_start_func)(void *state); - + /* some syntactic sugar on these function types */ #define auth_type_alloc(at, a, klen, outlen) \ @@ -109,40 +109,40 @@ auth_get_prefix_length(const struct auth_t *a); */ typedef struct auth_test_case_t { - int key_length_octets; /* octets in key */ - uint8_t *key; /* key */ - int data_length_octets; /* octets in data */ - uint8_t *data; /* data */ - int tag_length_octets; /* octets in tag */ - uint8_t *tag; /* tag */ - struct auth_test_case_t *next_test_case; /* pointer to next testcase */ + int key_length_octets; /* octets in key */ + uint8_t *key; /* key */ + int data_length_octets; /* octets in data */ + uint8_t *data; /* data */ + int tag_length_octets; /* octets in tag */ + uint8_t *tag; /* tag */ + struct auth_test_case_t *next_test_case; /* pointer to next testcase */ } auth_test_case_t; /* auth_type_t */ typedef struct auth_type_t { - auth_alloc_func alloc; - auth_dealloc_func dealloc; - auth_init_func init; - auth_compute_func compute; - auth_update_func update; - auth_start_func start; - char *description; - int ref_count; - auth_test_case_t *test_data; - debug_module_t *debug; - auth_type_id_t id; + auth_alloc_func alloc; + auth_dealloc_func dealloc; + auth_init_func init; + auth_compute_func compute; + auth_update_func update; + auth_start_func start; + char *description; + int ref_count; + auth_test_case_t *test_data; + debug_module_t *debug; + auth_type_id_t id; } auth_type_t; typedef struct auth_t { - auth_type_t *type; - void *state; - int out_len; /* length of output tag in octets */ - int key_len; /* length of key in octets */ - int prefix_len; /* length of keystream prefix */ + auth_type_t *type; + void *state; + int out_len; /* length of output tag in octets */ + int key_len; /* length of key in octets */ + int prefix_len; /* length of keystream prefix */ } auth_t; -/* +/* * auth_type_self_test() tests an auth_type against test cases * provided in an array of values of key/message/tag that is known to * be good @@ -151,7 +151,7 @@ typedef struct auth_t { err_status_t auth_type_self_test(const auth_type_t *at); -/* +/* * auth_type_test() tests an auth_type against external test cases * provided in an array of values of key/message/tag that is known to * be good diff --git a/thirdparties/mac/include/srtp/cipher.h b/thirdparties/mac/include/srtp/cipher.h index d0d6b57..20bd360 100755 --- a/thirdparties/mac/include/srtp/cipher.h +++ b/thirdparties/mac/include/srtp/cipher.h @@ -7,26 +7,26 @@ * Cisco Systems, Inc. */ /* - * + * * Copyright (c) 2001-2006,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 @@ -46,7 +46,7 @@ #ifndef CIPHER_H #define CIPHER_H -#include "datatypes.h" +#include "datatypes.h" #include "rdbx.h" /* for xtd_seq_num_t */ #include "err.h" /* for error codes */ #include "crypto.h" /* for cipher_type_id_t */ @@ -54,17 +54,17 @@ /** - * @brief cipher_direction_t defines a particular cipher operation. + * @brief cipher_direction_t defines a particular cipher operation. * * A cipher_direction_t is an enum that describes a particular cipher * operation, i.e. encryption or decryption. For some ciphers, this * distinction does not matter, but for others, it is essential. */ -typedef enum { - direction_encrypt, /**< encryption (convert plaintext to ciphertext) */ - direction_decrypt, /**< decryption (convert ciphertext to plaintext) */ - direction_any /**< encryption or decryption */ +typedef enum { + direction_encrypt, /**< encryption (convert plaintext to ciphertext) */ + direction_decrypt, /**< decryption (convert ciphertext to plaintext) */ + direction_any /**< encryption or decryption */ } cipher_direction_t; /* @@ -76,13 +76,13 @@ typedef struct cipher_type_t *cipher_type_pointer_t; typedef struct cipher_t *cipher_pointer_t; /* - * a cipher_alloc_func_t allocates (but does not initialize) a cipher_t + * a cipher_alloc_func_t allocates (but does not initialize) a cipher_t */ typedef err_status_t (*cipher_alloc_func_t) - (cipher_pointer_t *cp, int key_len, int tag_len); +(cipher_pointer_t *cp, int key_len, int tag_len); -/* +/* * a cipher_init_func_t [re-]initializes a cipher_t with a given key */ @@ -96,38 +96,38 @@ typedef err_status_t (*cipher_dealloc_func_t)(cipher_pointer_t cp); /* a cipher_set_segment_func_t sets the segment index of a cipher_t */ typedef err_status_t (*cipher_set_segment_func_t) - (void *state, xtd_seq_num_t idx); +(void *state, xtd_seq_num_t idx); -/* - * a cipher_set_aad_func_t processes the AAD data for AEAD ciphers +/* + * a cipher_set_aad_func_t processes the AAD data for AEAD ciphers */ typedef err_status_t (*cipher_set_aad_func_t) - (void *state, uint8_t *aad, unsigned int aad_len); +(void *state, uint8_t *aad, unsigned int aad_len); /* a cipher_encrypt_func_t encrypts data in-place */ typedef err_status_t (*cipher_encrypt_func_t) - (void *state, uint8_t *buffer, unsigned int *octets_to_encrypt); +(void *state, uint8_t *buffer, unsigned int *octets_to_encrypt); /* a cipher_decrypt_func_t decrypts data in-place */ typedef err_status_t (*cipher_decrypt_func_t) - (void *state, uint8_t *buffer, unsigned int *octets_to_decrypt); +(void *state, uint8_t *buffer, unsigned int *octets_to_decrypt); -/* +/* * a cipher_set_iv_func_t function sets the current initialization vector */ typedef err_status_t (*cipher_set_iv_func_t) - (cipher_pointer_t cp, void *iv, cipher_direction_t direction); +(cipher_pointer_t cp, void *iv, cipher_direction_t direction); /* * a cipher_get_tag_funct_t function is used to get the authentication * tag that was calculated by an AEAD cipher. */ typedef err_status_t (*cipher_get_tag_func_t) - (void *state, void *tag, int *len); +(void *state, void *tag, int *len); /* @@ -139,35 +139,35 @@ typedef err_status_t (*cipher_get_tag_func_t) */ typedef struct cipher_test_case_t { - int key_length_octets; /* octets in key */ - uint8_t *key; /* key */ - uint8_t *idx; /* packet index */ - int plaintext_length_octets; /* octets in plaintext */ - uint8_t *plaintext; /* plaintext */ - int ciphertext_length_octets; /* octets in plaintext */ - uint8_t *ciphertext; /* ciphertext */ - int aad_length_octets; /* octets in AAD */ - uint8_t *aad; /* AAD */ - int tag_length_octets; /* Length of AEAD tag */ - struct cipher_test_case_t *next_test_case; /* pointer to next testcase */ + int key_length_octets; /* octets in key */ + uint8_t *key; /* key */ + uint8_t *idx; /* packet index */ + int plaintext_length_octets; /* octets in plaintext */ + uint8_t *plaintext; /* plaintext */ + int ciphertext_length_octets; /* octets in plaintext */ + uint8_t *ciphertext; /* ciphertext */ + int aad_length_octets; /* octets in AAD */ + uint8_t *aad; /* AAD */ + int tag_length_octets; /* Length of AEAD tag */ + struct cipher_test_case_t *next_test_case; /* pointer to next testcase */ } cipher_test_case_t; /* cipher_type_t defines the 'metadata' for a particular cipher type */ typedef struct cipher_type_t { - cipher_alloc_func_t alloc; - cipher_dealloc_func_t dealloc; - cipher_init_func_t init; - cipher_set_aad_func_t set_aad; - cipher_encrypt_func_t encrypt; - cipher_encrypt_func_t decrypt; - cipher_set_iv_func_t set_iv; - cipher_get_tag_func_t get_tag; - char *description; - int ref_count; - cipher_test_case_t *test_data; - debug_module_t *debug; - cipher_type_id_t id; + cipher_alloc_func_t alloc; + cipher_dealloc_func_t dealloc; + cipher_init_func_t init; + cipher_set_aad_func_t set_aad; + cipher_encrypt_func_t encrypt; + cipher_encrypt_func_t decrypt; + cipher_set_iv_func_t set_iv; + cipher_get_tag_func_t get_tag; + char *description; + int ref_count; + cipher_test_case_t *test_data; + debug_module_t *debug; + cipher_type_id_t id; } cipher_type_t; /* @@ -176,10 +176,10 @@ typedef struct cipher_type_t { */ typedef struct cipher_t { - cipher_type_t *type; - void *state; - int key_len; - int algorithm; + cipher_type_t *type; + void *state; + int key_len; + int algorithm; } cipher_t; /* some syntactic sugar on these function types */ @@ -201,11 +201,11 @@ typedef struct cipher_t { #define cipher_set_iv(c, n, dir) \ ((c) ? (((c)->type)->set_iv(((cipher_pointer_t)(c)->state), (n), (dir))) : \ - err_status_no_such_op) + err_status_no_such_op) #define cipher_set_aad(c, a, l) \ (((c) && (((c)->type)->set_aad)) ? \ (((c)->type)->set_aad(((c)->state), (a), (l))) : \ - err_status_no_such_op) + err_status_no_such_op) err_status_t cipher_output(cipher_t *c, uint8_t *buffer, int num_octets_to_output); @@ -217,9 +217,9 @@ int cipher_get_key_length(const cipher_t *c); -/* - * cipher_type_self_test() tests a cipher against test cases provided in - * an array of values of key/xtd_seq_num_t/plaintext/ciphertext +/* + * cipher_type_self_test() tests a cipher against test cases provided in + * an array of values of key/xtd_seq_num_t/plaintext/ciphertext * that is known to be good */ @@ -227,9 +227,9 @@ err_status_t cipher_type_self_test(const cipher_type_t *ct); -/* - * cipher_type_test() tests a cipher against external test cases provided in - * an array of values of key/xtd_seq_num_t/plaintext/ciphertext +/* + * cipher_type_test() tests a cipher against external test cases provided in + * an array of values of key/xtd_seq_num_t/plaintext/ciphertext * that is known to be good */ @@ -240,7 +240,7 @@ cipher_type_test(const cipher_type_t *ct, const cipher_test_case_t *test_data); /* * cipher_bits_per_second(c, l, t) computes (and estimate of) the * number of bits that a cipher implementation can encrypt in a second - * + * * c is a cipher (which MUST be allocated and initialized already), l * is the length in octets of the test data to be encrypted, and t is * the number of trials diff --git a/thirdparties/mac/include/srtp/crypto.h b/thirdparties/mac/include/srtp/crypto.h index ab6f6be..5d60934 100755 --- a/thirdparties/mac/include/srtp/crypto.h +++ b/thirdparties/mac/include/srtp/crypto.h @@ -2,32 +2,32 @@ * crypto.h * * API for libcrypto - * + * * David A. McGrew * Cisco Systems, Inc. */ /* - * + * * Copyright (c) 2001-2006, 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 @@ -46,7 +46,7 @@ #ifndef CRYPTO_H #define CRYPTO_H -/** +/** * @brief A cipher_type_id_t is an identifier for a particular cipher * type. * @@ -55,10 +55,10 @@ * NULL_CIPHER is avaliable; this cipher leaves the data unchanged, * and can be selected to indicate that no encryption is to take * place. - * + * * @ingroup Ciphers */ -typedef uint32_t cipher_type_id_t; +typedef uint32_t cipher_type_id_t; /** * @brief An auth_type_id_t is an identifier for a particular authentication @@ -69,7 +69,7 @@ typedef uint32_t cipher_type_id_t; * avaliable; this authentication function performs no computation, * and can be selected to indicate that no authentication is to take * place. - * + * * @ingroup Authentication */ typedef uint32_t auth_type_id_t; diff --git a/thirdparties/mac/include/srtp/crypto_kernel.h b/thirdparties/mac/include/srtp/crypto_kernel.h index caccfa0..9e2c5f7 100755 --- a/thirdparties/mac/include/srtp/crypto_kernel.h +++ b/thirdparties/mac/include/srtp/crypto_kernel.h @@ -7,26 +7,26 @@ * Cisco Systems, Inc. */ /* - * + * * Copyright(c) 2001-2006 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 @@ -46,9 +46,9 @@ #ifndef CRYPTO_KERNEL #define CRYPTO_KERNEL -#include "rand_source.h" +#include "rand_source.h" #include "prng.h" -#include "cipher.h" +#include "cipher.h" #include "auth.h" #include "cryptoalg.h" #include "stat.h" @@ -65,37 +65,37 @@ */ typedef enum { - crypto_kernel_state_insecure, - crypto_kernel_state_secure + crypto_kernel_state_insecure, + crypto_kernel_state_secure } crypto_kernel_state_t; -/* - * linked list of cipher types +/* + * linked list of cipher types */ typedef struct kernel_cipher_type { - cipher_type_id_t id; - cipher_type_t *cipher_type; - struct kernel_cipher_type *next; + cipher_type_id_t id; + cipher_type_t *cipher_type; + struct kernel_cipher_type *next; } kernel_cipher_type_t; -/* - * linked list of auth types +/* + * linked list of auth types */ typedef struct kernel_auth_type { - auth_type_id_t id; - auth_type_t *auth_type; - struct kernel_auth_type *next; + auth_type_id_t id; + auth_type_t *auth_type; + struct kernel_auth_type *next; } kernel_auth_type_t; /* - * linked list of debug modules + * linked list of debug modules */ typedef struct kernel_debug_module { - debug_module_t *mod; - struct kernel_debug_module *next; + debug_module_t *mod; + struct kernel_debug_module *next; } kernel_debug_module_t; @@ -107,10 +107,10 @@ typedef struct kernel_debug_module { */ typedef struct { - crypto_kernel_state_t state; /* current state of kernel */ - kernel_cipher_type_t *cipher_type_list; /* list of all cipher types */ - kernel_auth_type_t *auth_type_list; /* list of all auth func types */ - kernel_debug_module_t *debug_module_list; /* list of all debug modules */ + crypto_kernel_state_t state; /* current state of kernel */ + kernel_cipher_type_t *cipher_type_list; /* list of all cipher types */ + kernel_auth_type_t *auth_type_list; /* list of all auth func types */ + kernel_debug_module_t *debug_module_list; /* list of all debug modules */ } crypto_kernel_t; @@ -125,10 +125,10 @@ typedef struct { * crypto algorithms. Possible return values are: * * err_status_ok initialization successful - * <other> init failure + * <other> init failure * * If any value other than err_status_ok is returned, the - * crypto_kernel MUST NOT be used. + * crypto_kernel MUST NOT be used. */ err_status_t @@ -142,7 +142,7 @@ crypto_kernel_init(void); * values are: * * err_status_ok shutdown successful - * <other> shutdown failure + * <other> shutdown failure * */ @@ -155,7 +155,7 @@ crypto_kernel_shutdown(void); * status report. Possible return values are: * * err_status_ok all tests were passed - * <other> a test failed + * <other> a test failed * */ @@ -184,7 +184,7 @@ crypto_kernel_load_auth_type(auth_type_t *ct, auth_type_id_t id); /* * crypto_kernel_replace_cipher_type(ct, id) - * + * * replaces the crypto kernel's existing cipher for the cipher_type id * with a new one passed in externally. The new cipher must pass all the * existing cipher_type's self tests as well as its own. @@ -195,7 +195,7 @@ crypto_kernel_replace_cipher_type(cipher_type_t *ct, cipher_type_id_t id); /* * crypto_kernel_replace_auth_type(ct, id) - * + * * replaces the crypto kernel's existing cipher for the auth_type id * with a new one passed in externally. The new auth type must pass all the * existing auth_type's self tests as well as its own. @@ -208,44 +208,44 @@ err_status_t crypto_kernel_load_debug_module(debug_module_t *new_dm); /* - * crypto_kernel_alloc_cipher(id, cp, key_len); + * crypto_kernel_alloc_cipher(id, cp, key_len); * * allocates a cipher of type id at location *cp, with key length * key_len octets. Return values are: - * + * * err_status_ok no problems * err_status_alloc_fail an allocation failure occured * err_status_fail couldn't find cipher with identifier 'id' */ err_status_t -crypto_kernel_alloc_cipher(cipher_type_id_t id, - cipher_pointer_t *cp, - int key_len, - int tag_len); +crypto_kernel_alloc_cipher(cipher_type_id_t id, + cipher_pointer_t *cp, + int key_len, + int tag_len); /* - * crypto_kernel_alloc_auth(id, ap, key_len, tag_len); + * crypto_kernel_alloc_auth(id, ap, key_len, tag_len); * * allocates an auth function of type id at location *ap, with key * length key_len octets and output tag length of tag_len. Return * values are: - * + * * err_status_ok no problems * err_status_alloc_fail an allocation failure occured * err_status_fail couldn't find auth with identifier 'id' */ err_status_t -crypto_kernel_alloc_auth(auth_type_id_t id, - auth_pointer_t *ap, - int key_len, - int tag_len); +crypto_kernel_alloc_auth(auth_type_id_t id, + auth_pointer_t *ap, + int key_len, + int tag_len); /* * crypto_kernel_set_debug_module(mod_name, v) - * + * * sets dynamic debugging to the value v (0 for off, 1 for on) for the * debug module with the name mod_name * @@ -262,7 +262,7 @@ crypto_kernel_set_debug_module(char *mod_name, int v); * random data to the location to which dest points, and returns an * error code. This error code @b must be checked, and if a failure is * reported, the data in the buffer @b must @b not be used. - * + * * @warning If the return code is not checked, then non-random * data may be in the buffer. This function will fail * unless it is called after crypto_kernel_init(). @@ -277,5 +277,5 @@ crypto_kernel_set_debug_module(char *mod_name, int v); */ err_status_t crypto_get_random(unsigned char *buffer, unsigned int length); - + #endif /* CRYPTO_KERNEL */ diff --git a/thirdparties/mac/include/srtp/crypto_math.h b/thirdparties/mac/include/srtp/crypto_math.h index 52f0837..4de3912 100755 --- a/thirdparties/mac/include/srtp/crypto_math.h +++ b/thirdparties/mac/include/srtp/crypto_math.h @@ -7,26 +7,26 @@ * Cisco Systems, Inc. */ /* - * + * * Copyright (c) 2001-2006 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 @@ -95,7 +95,7 @@ hex_string_to_v64(char *s); /* the matrix A[] is stored in column format, i.e., A[i] is the ith column of the matrix */ -uint8_t +uint8_t A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b); void @@ -118,11 +118,11 @@ octet_string_set_to_zero(uint8_t *s, int len); -/* +/* * the matrix A[] is stored in column format, i.e., A[i] is the ith * column of the matrix */ -uint8_t +uint8_t A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b); @@ -165,8 +165,8 @@ A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b); + htonl(tmp >> 32); \ z->v32[0] = ntohl((uint32_t) tmp); \ } - -#endif /* WORDS_BIGENDIAN */ + +#endif /* WORDS_BIGENDIAN */ #endif #ifdef DATATYPES_USE_MACROS /* little functions are really macros */ @@ -176,7 +176,7 @@ A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b); #define v128_xor(z, x, y) _v128_xor(z, x, y) #define v128_and(z, x, y) _v128_and(z, x, y) #define v128_or(z, x, y) _v128_or(z, x, y) -#define v128_complement(x) _v128_complement(x) +#define v128_complement(x) _v128_complement(x) #define v128_is_eq(x, y) _v128_is_eq(x, y) #define v128_xor_eq(x, y) _v128_xor_eq(x, y) #define v128_get_bit(x, i) _v128_get_bit(x, i) @@ -202,7 +202,7 @@ void v128_and(v128_t *z, v128_t *x, v128_t *y); void -v128_or(v128_t *z, v128_t *x, v128_t *y); +v128_or(v128_t *z, v128_t *x, v128_t *y); void v128_complement(v128_t *x); @@ -211,10 +211,10 @@ int v128_get_bit(const v128_t *x, int i); void -v128_set_bit(v128_t *x, int i) ; +v128_set_bit(v128_t *x, int i) ; void -v128_clear_bit(v128_t *x, int i); +v128_clear_bit(v128_t *x, int i); void v128_set_bit_to(v128_t *x, int i, int y); diff --git a/thirdparties/mac/include/srtp/crypto_types.h b/thirdparties/mac/include/srtp/crypto_types.h index dbb50c3..0699862 100755 --- a/thirdparties/mac/include/srtp/crypto_types.h +++ b/thirdparties/mac/include/srtp/crypto_types.h @@ -7,26 +7,26 @@ * Cisco Systems, Inc. */ /* - * + * * Copyright(c) 2001-2006,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 @@ -57,14 +57,14 @@ * (UST) must be used in conjunction with a cipher other than the null * cipher. These functions require a per-message pseudorandom input * that is generated by the cipher. - * + * * The identifiers STRONGHOLD_AUTH and STRONGHOLD_CIPHER identify the * strongest available authentication function and cipher, * respectively. They are resolved at compile time to the strongest * available algorithm. The stronghold algorithms can serve as did * the keep of a medieval fortification; they provide the strongest * defense (or the last refuge). - * + * * @{ */ @@ -72,7 +72,7 @@ * @defgroup Ciphers Cipher Types * * @brief Each cipher type is identified by an unsigned integer. The - * cipher types available in this edition of libSRTP are given + * cipher types available in this edition of libSRTP are given * by the #defines below. * * A cipher_type_id_t is an identifier for a cipher_type; only values @@ -90,84 +90,84 @@ /** * @brief The null cipher performs no encryption. * - * The NULL_CIPHER leaves its inputs unaltered, during both the + * The NULL_CIPHER leaves its inputs unaltered, during both the * encryption and decryption operations. This cipher can be chosen * to indicate that no encryption is to be performed. */ -#define NULL_CIPHER 0 +#define NULL_CIPHER 0 -/** - * @brief AES Integer Counter Mode (AES ICM) +/** + * @brief AES Integer Counter Mode (AES ICM) * - * AES ICM is the variant of counter mode that is used by Secure RTP. + * AES ICM is the variant of counter mode that is used by Secure RTP. * This cipher uses a 16-, 24-, or 32-octet key concatenated with a * 14-octet offset (or salt) value. */ -#define AES_ICM 1 +#define AES_ICM 1 -/** - * @brief AES-128 Integer Counter Mode (AES ICM) +/** + * @brief AES-128 Integer Counter Mode (AES ICM) * AES-128 ICM is a deprecated alternate name for AES ICM. */ #define AES_128_ICM AES_ICM /** - * @brief SEAL 3.0 - * + * @brief SEAL 3.0 + * * SEAL is the Software-Optimized Encryption Algorithm of Coppersmith * and Rogaway. Nota bene: this cipher is IBM proprietary. */ -#define SEAL 2 +#define SEAL 2 -/** - * @brief AES Cipher Block Chaining mode (AES CBC) +/** + * @brief AES Cipher Block Chaining mode (AES CBC) * * AES CBC is the AES Cipher Block Chaining mode. * This cipher uses a 16-, 24-, or 32-octet key. */ -#define AES_CBC 3 +#define AES_CBC 3 -/** - * @brief AES-128 Cipher Block Chaining mode (AES CBC) +/** + * @brief AES-128 Cipher Block Chaining mode (AES CBC) * * AES-128 CBC is a deprecated alternate name for AES CBC. */ -#define AES_128_CBC AES_CBC +#define AES_128_CBC AES_CBC /** * @brief Strongest available cipher. * * This identifier resolves to the strongest cipher type available. */ -#define STRONGHOLD_CIPHER AES_ICM +#define STRONGHOLD_CIPHER AES_ICM -/** - * @brief AES-192 Integer Counter Mode (AES ICM) +/** + * @brief AES-192 Integer Counter Mode (AES ICM) * AES-192 ICM is a deprecated alternate name for AES ICM. */ -#define AES_192_ICM 4 +#define AES_192_ICM 4 -/** - * @brief AES-256 Integer Counter Mode (AES ICM) +/** + * @brief AES-256 Integer Counter Mode (AES ICM) * AES-256 ICM is a deprecated alternate name for AES ICM. */ -#define AES_256_ICM 5 +#define AES_256_ICM 5 -/** - * @brief AES-128_GCM Galois Counter Mode (AES GCM) +/** + * @brief AES-128_GCM Galois Counter Mode (AES GCM) * - * AES-128 GCM is the variant of galois counter mode that is used by + * AES-128 GCM is the variant of galois counter mode that is used by * Secure RTP. This cipher uses a 16-octet key. */ -#define AES_128_GCM 6 +#define AES_128_GCM 6 -/** - * @brief AES-256_GCM Galois Counter Mode (AES GCM) +/** + * @brief AES-256_GCM Galois Counter Mode (AES GCM) * - * AES-256 GCM is the variant of galois counter mode that is used by + * AES-256 GCM is the variant of galois counter mode that is used by * Secure RTP. This cipher uses a 32-octet key. */ -#define AES_256_GCM 7 +#define AES_256_GCM 7 /** * @} @@ -177,14 +177,14 @@ /** * @defgroup Authentication Authentication Function Types - * + * * @brief Each authentication function type is identified by an * unsigned integer. The authentication function types available in * this edition of libSRTP are given by the #defines below. * * An auth_type_id_t is an identifier for an authentication function type; - * only values given by the #defines above (or those present in the - * file crypto_types.h) should be used. + * only values given by the #defines above (or those present in the + * file crypto_types.h) should be used. * * The identifier STRONGHOLD_AUTH indicates the strongest available * authentication function, allowing an application to choose the @@ -201,8 +201,8 @@ * * The NULL_AUTH function does nothing, and can be selected to indicate * that authentication should not be performed. - */ -#define NULL_AUTH 0 + */ +#define NULL_AUTH 0 /** * @brief UST with TMMH Version 2 @@ -212,15 +212,15 @@ * than the null cipher. * with a cipher. */ -#define UST_TMMHv2 1 +#define UST_TMMHv2 1 /** - * @brief (UST) AES-128 XORMAC + * @brief (UST) AES-128 XORMAC * * UST_AES_128_XMAC implements AES-128 XORMAC, using UST. Nota bene: * the XORMAC algorithm is IBM proprietary. */ -#define UST_AES_128_XMAC 2 +#define UST_AES_128_XMAC 2 /** * @brief HMAC-SHA1 @@ -228,7 +228,7 @@ * HMAC_SHA1 implements the Hash-based MAC using the NIST Secure * Hash Algorithm version 1 (SHA1). */ -#define HMAC_SHA1 3 +#define HMAC_SHA1 3 /** * @brief Strongest available authentication function. @@ -236,7 +236,7 @@ * This identifier resolves to the strongest available authentication * function. */ -#define STRONGHOLD_AUTH HMAC_SHA1 +#define STRONGHOLD_AUTH HMAC_SHA1 /** * @} diff --git a/thirdparties/mac/include/srtp/cryptoalg.h b/thirdparties/mac/include/srtp/cryptoalg.h index d9f0441..ad29fa0 100755 --- a/thirdparties/mac/include/srtp/cryptoalg.h +++ b/thirdparties/mac/include/srtp/cryptoalg.h @@ -2,31 +2,31 @@ * cryptoalg.h * * API for authenticated encryption crypto algorithms - * + * * David A. McGrew * Cisco Systems, Inc. */ /* - * + * * Copyright (c) 2001-2006 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 @@ -61,10 +61,10 @@ * The function pointer cryptoalg_func_t points to a function that * implements a crypto transform, and provides a uniform API for * accessing crypto mechanisms. - * - * @param key location of secret key * - * @param clear data to be authenticated but not encrypted + * @param key location of secret key + * + * @param clear data to be authenticated but not encrypted * * @param clear_len length of data to be authenticated but not encrypted * @@ -79,34 +79,34 @@ * length of the ciphertext (after the call) * */ - -typedef err_status_t (*cryptoalg_func_t) - (void *key, - const void *clear, - unsigned clear_len, - void *iv, - void *protect, - unsigned *protected_len); - -typedef + +typedef err_status_t (*cryptoalg_func_t) +(void *key, + const void *clear, + unsigned clear_len, + void *iv, + void *protect, + unsigned *protected_len); + +typedef err_status_t (*cryptoalg_inv_t) - (void *key, /* location of secret key */ - const void *clear, /* data to be authenticated only */ - unsigned clear_len, /* length of data to be authenticated only */ - void *iv, /* location of iv */ - void *opaque, /* data to be decrypted and authenticated */ - unsigned *opaque_len /* location of the length of data to be - * decrypted and authd (before and after) +(void *key, /* location of secret key */ + const void *clear, /* data to be authenticated only */ + unsigned clear_len, /* length of data to be authenticated only */ + void *iv, /* location of iv */ + void *opaque, /* data to be decrypted and authenticated */ + unsigned *opaque_len /* location of the length of data to be + * decrypted and authd (before and after) */ - ); +); typedef struct cryptoalg_ctx_t { - cryptoalg_func_t enc; - cryptoalg_inv_t dec; - unsigned key_len; - unsigned iv_len; - unsigned auth_tag_len; - unsigned max_expansion; + cryptoalg_func_t enc; + cryptoalg_inv_t dec; + unsigned key_len; + unsigned iv_len; + unsigned auth_tag_len; + unsigned max_expansion; } cryptoalg_ctx_t; typedef cryptoalg_ctx_t *cryptoalg_t; @@ -120,7 +120,7 @@ typedef cryptoalg_ctx_t *cryptoalg_t; int cryptoalg_get_id(cryptoalg_t c); -cryptoalg_t +cryptoalg_t cryptoalg_find_by_id(int id); diff --git a/thirdparties/mac/include/srtp/datatypes.h b/thirdparties/mac/include/srtp/datatypes.h index b18435f..b29a0f0 100755 --- a/thirdparties/mac/include/srtp/datatypes.h +++ b/thirdparties/mac/include/srtp/datatypes.h @@ -1,6 +1,6 @@ /* * datatypes.h - * + * * data types for bit vectors and finite fields * * David A. McGrew @@ -8,26 +8,26 @@ */ /* - * + * * Copyright (c) 2001-2006, 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 @@ -65,31 +65,31 @@ /* if DATATYPES_USE_MACROS is defined, then little functions are macros */ -#define DATATYPES_USE_MACROS +#define DATATYPES_USE_MACROS typedef union { - uint8_t v8[2]; - uint16_t value; + uint8_t v8[2]; + uint16_t value; } v16_t; typedef union { - uint8_t v8[4]; - uint16_t v16[2]; - uint32_t value; + uint8_t v8[4]; + uint16_t v16[2]; + uint32_t value; } v32_t; typedef union { - uint8_t v8[8]; - uint16_t v16[4]; - uint32_t v32[2]; - uint64_t value; + uint8_t v8[8]; + uint16_t v16[4]; + uint32_t v32[2]; + uint64_t value; } v64_t; typedef union { - uint8_t v8[16]; - uint16_t v16[8]; - uint32_t v32[4]; - uint64_t v64[2]; + uint8_t v8[16]; + uint16_t v16[8]; + uint32_t v32[4]; + uint64_t v64[2]; } v128_t; typedef union { @@ -168,7 +168,7 @@ v128_right_shift(v128_t *x, int shift_index); /* * the following macros define the data manipulation functions - * + * * If DATATYPES_USE_MACROS is defined, then these macros are used * directly (and function call overhead is avoided). Otherwise, * the macros are used through the functions defined in datatypes.c @@ -315,18 +315,18 @@ v128_right_shift(v128_t *x, int shift_index); + htonl(tmp >> 32); \ z->v32[0] = ntohl((uint32_t) tmp); \ } -#endif /* WORDS_BIGENDIAN */ +#endif /* WORDS_BIGENDIAN */ #endif /* 0 */ #ifdef DATATYPES_USE_MACROS /* little functions are really macros */ - + #define v128_set_to_zero(z) _v128_set_to_zero(z) #define v128_copy(z, x) _v128_copy(z, x) #define v128_xor(z, x, y) _v128_xor(z, x, y) #define v128_and(z, x, y) _v128_and(z, x, y) #define v128_or(z, x, y) _v128_or(z, x, y) -#define v128_complement(x) _v128_complement(x) +#define v128_complement(x) _v128_complement(x) #define v128_is_eq(x, y) _v128_is_eq(x, y) #define v128_xor_eq(x, y) _v128_xor_eq(x, y) #define v128_get_bit(x, i) _v128_get_bit(x, i) @@ -352,7 +352,7 @@ void v128_and(v128_t *z, v128_t *x, v128_t *y); void -v128_or(v128_t *z, v128_t *x, v128_t *y); +v128_or(v128_t *z, v128_t *x, v128_t *y); void v128_complement(v128_t *x); @@ -361,10 +361,10 @@ int v128_get_bit(const v128_t *x, int i); void -v128_set_bit(v128_t *x, int i) ; +v128_set_bit(v128_t *x, int i) ; void -v128_clear_bit(v128_t *x, int i); +v128_clear_bit(v128_t *x, int i); void v128_set_bit_to(v128_t *x, int i, int y); @@ -383,9 +383,9 @@ void octet_string_set_to_zero(uint8_t *s, int len); -#if !defined(SRTP_KERNEL_LINUX) && defined(HAVE_CONFIG_H) +#if !defined(SRTP_KERNEL_LINUX) && defined(HAVE_CONFIG_H) -/* +/* * Convert big endian integers to CPU byte order. */ #ifdef WORDS_BIGENDIAN @@ -401,10 +401,11 @@ octet_string_set_to_zero(uint8_t *s, int len); #if defined(__GNUC__) && defined(HAVE_X86) /* Fall back. */ -static inline uint32_t be32_to_cpu(uint32_t v) { - /* optimized for x86. */ - asm("bswap %0" : "=r" (v) : "0" (v)); - return v; +static inline uint32_t be32_to_cpu(uint32_t v) +{ + /* optimized for x86. */ + asm("bswap %0" : "=r" (v) : "0" (v)); + return v; } # else /* HAVE_X86 */ # ifdef HAVE_NETINET_IN_H @@ -415,15 +416,16 @@ static inline uint32_t be32_to_cpu(uint32_t v) { # define be32_to_cpu(x) ntohl((x)) # endif /* HAVE_X86 */ -static inline uint64_t be64_to_cpu(uint64_t v) { +static inline uint64_t be64_to_cpu(uint64_t v) +{ # ifdef NO_64BIT_MATH - /* use the make64 functions to do 64-bit math */ - v = make64(htonl(low32(v)),htonl(high32(v))); + /* use the make64 functions to do 64-bit math */ + v = make64(htonl(low32(v)),htonl(high32(v))); # else - /* use the native 64-bit math */ - v= (uint64_t)((be32_to_cpu((uint32_t)(v >> 32))) | (((uint64_t)be32_to_cpu((uint32_t)v)) << 32)); + /* use the native 64-bit math */ + v= (uint64_t)((be32_to_cpu((uint32_t)(v >> 32))) | (((uint64_t)be32_to_cpu((uint32_t)v)) << 32)); # endif - return v; + return v; } #endif /* ! SRTP_KERNEL_LINUX */ @@ -431,22 +433,22 @@ static inline uint64_t be64_to_cpu(uint64_t v) { #endif /* WORDS_BIGENDIAN */ /* - * functions manipulating bitvector_t + * functions manipulating bitvector_t * * A bitvector_t consists of an array of words and an integer * representing the number of significant bits stored in the array. * The bits are packed as follows: the least significant bit is that * of word[0], while the most significant bit is the nth most * significant bit of word[m], where length = bits_per_word * m + n. - * + * */ #define bits_per_word 32 #define bytes_per_word 4 typedef struct { - uint32_t length; - uint32_t *word; + uint32_t length; + uint32_t *word; } bitvector_t; diff --git a/thirdparties/mac/include/srtp/ekt.h b/thirdparties/mac/include/srtp/ekt.h index b0d888b..d7f9854 100755 --- a/thirdparties/mac/include/srtp/ekt.h +++ b/thirdparties/mac/include/srtp/ekt.h @@ -7,26 +7,26 @@ * Cisco Systems, Inc. */ /* - * + * * Copyright (c) 2001-2005 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 @@ -45,12 +45,12 @@ /* - * EKT implementation strategy - * + * EKT implementation strategy + * * use stream_template approach * * in srtp_unprotect, when a new stream appears, check if template has - * EKT defined, and if it does, then apply EKT processing + * EKT defined, and if it does, then apply EKT processing * * question: will we want to allow key-sharing templates in addition * to EKT templates? could define a new ssrc_type_t that's associated @@ -88,10 +88,10 @@ ekt_octets_after_base_tag(ekt_stream_t ekt); */ typedef struct ekt_policy_ctx_t { - ekt_spi_t spi; /* security parameter index */ - uint8_t ekt_cipher_type; - uint8_t *ekt_key; - struct ekt_policy_ctx_t *next_ekt_policy; + ekt_spi_t spi; /* security parameter index */ + uint8_t ekt_cipher_type; + uint8_t *ekt_key; + struct ekt_policy_ctx_t *next_ekt_policy; } ekt_policy_ctx_t; @@ -101,11 +101,11 @@ typedef struct ekt_policy_ctx_t { */ typedef struct ekt_data_t { - ekt_spi_t spi; - uint8_t ekt_cipher_type; - aes_expanded_key_t ekt_enc_key; - aes_expanded_key_t ekt_dec_key; - struct ekt_data_t *next_ekt_data; + ekt_spi_t spi; + uint8_t ekt_cipher_type; + aes_expanded_key_t ekt_enc_key; + aes_expanded_key_t ekt_dec_key; + struct ekt_data_t *next_ekt_data; } ekt_data_t; /* @@ -116,39 +116,39 @@ typedef struct ekt_data_t { */ typedef struct ekt_stream_ctx_t { - ekt_data_t *data; - uint16_t isn; /* initial sequence number */ - uint8_t encrypted_master_key[SRTP_MAX_KEY_LEN]; + ekt_data_t *data; + uint16_t isn; /* initial sequence number */ + uint8_t encrypted_master_key[SRTP_MAX_KEY_LEN]; } ekt_stream_ctx_t; -err_status_t +err_status_t ekt_alloc(ekt_stream_t *stream_data, ekt_policy_t policy); err_status_t -ekt_stream_init(ekt_stream_t e, - ekt_spi_t spi, - void *ekt_key, - unsigned ekt_cipher_type); +ekt_stream_init(ekt_stream_t e, + ekt_spi_t spi, + void *ekt_key, + unsigned ekt_cipher_type); err_status_t ekt_stream_init_from_policy(ekt_stream_t e, ekt_policy_t p); - + err_status_t -srtp_stream_init_from_ekt(srtp_stream_t stream, - const void *srtcp_hdr, - unsigned pkt_octet_len); - +srtp_stream_init_from_ekt(srtp_stream_t stream, + const void *srtcp_hdr, + unsigned pkt_octet_len); + void ekt_write_data(ekt_stream_t ekt, - uint8_t *base_tag, - unsigned base_tag_len, - int *packet_len, - xtd_seq_num_t pkt_index); + uint8_t *base_tag, + unsigned base_tag_len, + int *packet_len, + xtd_seq_num_t pkt_index); /* * We handle EKT by performing some additional steps before @@ -160,14 +160,14 @@ ekt_write_data(ekt_stream_t ekt, */ err_status_t -ekt_tag_verification_preproces(uint8_t *pkt_tag, - uint8_t *pkt_tag_copy, - unsigned tag_len); +ekt_tag_verification_preproces(uint8_t *pkt_tag, + uint8_t *pkt_tag_copy, + unsigned tag_len); err_status_t ekt_tag_verification_postproces(uint8_t *pkt_tag, - uint8_t *pkt_tag_copy, - unsigned tag_len); + uint8_t *pkt_tag_copy, + unsigned tag_len); /* @@ -178,15 +178,15 @@ ekt_tag_verification_postproces(uint8_t *pkt_tag, * Master Key, the SRTP ROC, the Initial Sequence Number, and SPI * fields. The Base Authentication Tag field is set to the all-zero * value - * + * * When EKT is not used, this function is a no-op. - * + * */ err_status_t srtp_stream_srtcp_auth_tag_generation_preprocess(const srtp_stream_t *s, - uint8_t *pkt_tag, - unsigned pkt_octet_len); + uint8_t *pkt_tag, + unsigned pkt_octet_len); /* it's not clear that a tag_generation_postprocess function is needed */ diff --git a/thirdparties/mac/include/srtp/err.h b/thirdparties/mac/include/srtp/err.h index 4f401a6..bf8f87a 100755 --- a/thirdparties/mac/include/srtp/err.h +++ b/thirdparties/mac/include/srtp/err.h @@ -1,32 +1,32 @@ /* * err.h - * + * * error status codes * * David A. McGrew * Cisco Systems, Inc. */ /* - * + * * Copyright (c) 2001-2006, 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 @@ -51,9 +51,9 @@ /** * @defgroup Error Error Codes - * + * * Error status codes are represented by the enumeration err_status_t. - * + * * @{ */ @@ -67,31 +67,31 @@ * */ typedef enum { - err_status_ok = 0, /**< nothing to report */ - err_status_fail = 1, /**< unspecified failure */ - err_status_bad_param = 2, /**< unsupported parameter */ - err_status_alloc_fail = 3, /**< couldn't allocate memory */ - err_status_dealloc_fail = 4, /**< couldn't deallocate properly */ - err_status_init_fail = 5, /**< couldn't initialize */ - err_status_terminus = 6, /**< can't process as much data as requested */ - err_status_auth_fail = 7, /**< authentication failure */ - err_status_cipher_fail = 8, /**< cipher failure */ - err_status_replay_fail = 9, /**< replay check failed (bad index) */ - err_status_replay_old = 10, /**< replay check failed (index too old) */ - err_status_algo_fail = 11, /**< algorithm failed test routine */ - err_status_no_such_op = 12, /**< unsupported operation */ - err_status_no_ctx = 13, /**< no appropriate context found */ - err_status_cant_check = 14, /**< unable to perform desired validation */ - err_status_key_expired = 15, /**< can't use key any more */ - err_status_socket_err = 16, /**< error in use of socket */ - err_status_signal_err = 17, /**< error in use POSIX signals */ - err_status_nonce_bad = 18, /**< nonce check failed */ - err_status_read_fail = 19, /**< couldn't read data */ - err_status_write_fail = 20, /**< couldn't write data */ - err_status_parse_err = 21, /**< error parsing data */ - err_status_encode_err = 22, /**< error encoding data */ - err_status_semaphore_err = 23,/**< error while using semaphores */ - err_status_pfkey_err = 24 /**< error while using pfkey */ + err_status_ok = 0, /**< nothing to report */ + err_status_fail = 1, /**< unspecified failure */ + err_status_bad_param = 2, /**< unsupported parameter */ + err_status_alloc_fail = 3, /**< couldn't allocate memory */ + err_status_dealloc_fail = 4, /**< couldn't deallocate properly */ + err_status_init_fail = 5, /**< couldn't initialize */ + err_status_terminus = 6, /**< can't process as much data as requested */ + err_status_auth_fail = 7, /**< authentication failure */ + err_status_cipher_fail = 8, /**< cipher failure */ + err_status_replay_fail = 9, /**< replay check failed (bad index) */ + err_status_replay_old = 10, /**< replay check failed (index too old) */ + err_status_algo_fail = 11, /**< algorithm failed test routine */ + err_status_no_such_op = 12, /**< unsupported operation */ + err_status_no_ctx = 13, /**< no appropriate context found */ + err_status_cant_check = 14, /**< unable to perform desired validation */ + err_status_key_expired = 15, /**< can't use key any more */ + err_status_socket_err = 16, /**< error in use of socket */ + err_status_signal_err = 17, /**< error in use POSIX signals */ + err_status_nonce_bad = 18, /**< nonce check failed */ + err_status_read_fail = 19, /**< couldn't read data */ + err_status_write_fail = 20, /**< couldn't write data */ + err_status_parse_err = 21, /**< error parsing data */ + err_status_encode_err = 22, /**< error encoding data */ + err_status_semaphore_err = 23,/**< error while using semaphores */ + err_status_pfkey_err = 24 /**< error while using pfkey */ } err_status_t; /** @@ -99,15 +99,15 @@ typedef enum { */ typedef enum { - err_level_emergency = 0, - err_level_alert, - err_level_critical, - err_level_error, - err_level_warning, - err_level_notice, - err_level_info, - err_level_debug, - err_level_none + err_level_emergency = 0, + err_level_alert, + err_level_critical, + err_level_error, + err_level_warning, + err_level_notice, + err_level_info, + err_level_debug, + err_level_none } err_reporting_level_t; /* @@ -145,8 +145,8 @@ err_report(int priority, const char *format, ...); */ typedef struct { - int on; /* 1 if debugging is on, 0 if it is off */ - const char *name; /* printable name for debug module */ + int on; /* 1 if debugging is on, 0 if it is off */ + const char *name; /* printable name for debug module */ } debug_module_t; #ifdef ENABLE_DEBUGGING diff --git a/thirdparties/mac/include/srtp/getopt_s.h b/thirdparties/mac/include/srtp/getopt_s.h index 2a6ece3..d3dc33d 100755 --- a/thirdparties/mac/include/srtp/getopt_s.h +++ b/thirdparties/mac/include/srtp/getopt_s.h @@ -7,26 +7,26 @@ * */ /* - * + * * Copyright (c) 2001-2006 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 @@ -45,11 +45,11 @@ #ifndef GETOPT_S_H #define GETOPT_S_H -/* +/* * getopt_s(), optarg_s, and optind_s are small, locally defined * versions of the POSIX standard getopt() interface. */ - + int getopt_s(int argc, char * const argv[], const char *optstring); diff --git a/thirdparties/mac/include/srtp/gf2_8.h b/thirdparties/mac/include/srtp/gf2_8.h index 098d37c..bbbabdf 100755 --- a/thirdparties/mac/include/srtp/gf2_8.h +++ b/thirdparties/mac/include/srtp/gf2_8.h @@ -8,26 +8,26 @@ */ /* - * + * * Copyright (c) 2001-2006, 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 @@ -54,13 +54,13 @@ typedef uint8_t gf2_8; #define gf2_8_field_polynomial 0x1B /* - * gf2_8_shift(x) returns + * gf2_8_shift(x) returns */ /* - * gf2_8_shift(z) returns the result of the GF(2^8) 'multiply by x' - * operation, using the field representation from AES; that is, the - * next gf2_8 value in the cyclic representation of that field. The + * gf2_8_shift(z) returns the result of the GF(2^8) 'multiply by x' + * operation, using the field representation from AES; that is, the + * next gf2_8 value in the cyclic representation of that field. The * value z should be an uint8_t. */ diff --git a/thirdparties/mac/include/srtp/hmac.h b/thirdparties/mac/include/srtp/hmac.h index 875f45c..a1639bf 100755 --- a/thirdparties/mac/include/srtp/hmac.h +++ b/thirdparties/mac/include/srtp/hmac.h @@ -8,26 +8,26 @@ * */ /* - * + * * Copyright (c) 2001-2006,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 @@ -50,12 +50,12 @@ #include "sha1.h" typedef struct { - uint8_t opad[64]; - sha1_ctx_t ctx; - sha1_ctx_t init_ctx; + uint8_t opad[64]; + sha1_ctx_t ctx; + sha1_ctx_t init_ctx; #ifdef OPENSSL - int ctx_initialized; - int init_ctx_initialized; + int ctx_initialized; + int init_ctx_initialized; #endif } hmac_ctx_t; @@ -76,7 +76,7 @@ hmac_update(hmac_ctx_t *state, const uint8_t *message, int msg_octets); err_status_t hmac_compute(hmac_ctx_t *state, const void *message, - int msg_octets, int tag_len, uint8_t *result); + int msg_octets, int tag_len, uint8_t *result); #endif /* HMAC_H */ diff --git a/thirdparties/mac/include/srtp/integers.h b/thirdparties/mac/include/srtp/integers.h index ed77210..90cfac6 100755 --- a/thirdparties/mac/include/srtp/integers.h +++ b/thirdparties/mac/include/srtp/integers.h @@ -8,26 +8,26 @@ */ /* - * + * * Copyright (c) 2001-2006, 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 @@ -124,7 +124,7 @@ extern uint32_t low32(uint64_t value); #define GET_32(addr) ((((unsigned char *) (addr))[0] << 24) | \ (((unsigned char *) (addr))[1] << 16) | \ (((unsigned char *) (addr))[2] << 8) | \ - (((unsigned char *) (addr))[3])) + (((unsigned char *) (addr))[3])) #else #define PUT_32(addr,value) \ { \ @@ -136,7 +136,7 @@ extern uint32_t low32(uint64_t value); #define GET_32(addr) ((((unsigned char *) (addr))[3] << 24) | \ (((unsigned char *) (addr))[2] << 16) | \ (((unsigned char *) (addr))[1] << 8) | \ - (((unsigned char *) (addr))[0])) + (((unsigned char *) (addr))[0])) #endif // WORDS_BIGENDIAN #else #define PUT_32(addr,value) *(((uint32_t *) (addr)) = (value) diff --git a/thirdparties/mac/include/srtp/kernel_compat.h b/thirdparties/mac/include/srtp/kernel_compat.h index 59d1898..36559f7 100755 --- a/thirdparties/mac/include/srtp/kernel_compat.h +++ b/thirdparties/mac/include/srtp/kernel_compat.h @@ -1,6 +1,6 @@ /* * kernel_compat.h - * + * * Compatibility stuff for building in kernel context where standard * C headers and library are not available. * @@ -8,26 +8,26 @@ * Ingate Systems AB */ /* - * + * * Copyright(c) 2005 Ingate Systems AB * 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 author(s) 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 @@ -70,9 +70,9 @@ static inline int rand(void) { - uint32_t temp; - get_random_bytes(&temp, sizeof(temp)); - return temp % (RAND_MAX+1); + uint32_t temp; + get_random_bytes(&temp, sizeof(temp)); + return temp % (RAND_MAX+1); } /* stdio/stdlib implementation. */ diff --git a/thirdparties/mac/include/srtp/key.h b/thirdparties/mac/include/srtp/key.h index e7e0744..340547f 100755 --- a/thirdparties/mac/include/srtp/key.h +++ b/thirdparties/mac/include/srtp/key.h @@ -2,31 +2,31 @@ * key.h * * key usage limits enforcement - * + * * David A. Mcgrew * Cisco Systems, Inc. */ /* - * + * * Copyright (c) 2001-2006 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 @@ -51,9 +51,9 @@ typedef struct key_limit_ctx_t *key_limit_t; typedef enum { - key_event_normal, - key_event_soft_limit, - key_event_hard_limit + key_event_normal, + key_event_soft_limit, + key_event_hard_limit } key_event_t; err_status_t @@ -68,15 +68,15 @@ key_limit_check(const key_limit_t key); key_event_t key_limit_update(key_limit_t key); -typedef enum { - key_state_normal, - key_state_past_soft_limit, - key_state_expired +typedef enum { + key_state_normal, + key_state_past_soft_limit, + key_state_expired } key_state_t; typedef struct key_limit_ctx_t { - xtd_seq_num_t num_left; - key_state_t state; + xtd_seq_num_t num_left; + key_state_t state; } key_limit_ctx_t; #endif /* KEY_H */ diff --git a/thirdparties/mac/include/srtp/null_auth.h b/thirdparties/mac/include/srtp/null_auth.h index 44f9a4a..54c0296 100755 --- a/thirdparties/mac/include/srtp/null_auth.h +++ b/thirdparties/mac/include/srtp/null_auth.h @@ -7,26 +7,26 @@ */ /* - * + * * Copyright (c) 2001-2006, 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 @@ -48,7 +48,7 @@ #include "auth.h" typedef struct { - char foo; + char foo; } null_auth_ctx_t; err_status_t @@ -62,7 +62,7 @@ null_auth_init(null_auth_ctx_t *state, const uint8_t *key, int key_len); err_status_t null_auth_compute (null_auth_ctx_t *state, uint8_t *message, - int msg_octets, int tag_len, uint8_t *result); + int msg_octets, int tag_len, uint8_t *result); #endif /* NULL_AUTH_H */ diff --git a/thirdparties/mac/include/srtp/null_cipher.h b/thirdparties/mac/include/srtp/null_cipher.h index 39da59a..63d272d 100755 --- a/thirdparties/mac/include/srtp/null_cipher.h +++ b/thirdparties/mac/include/srtp/null_cipher.h @@ -9,26 +9,26 @@ */ /* - * + * * Copyright (c) 2001-2006, 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 @@ -52,7 +52,7 @@ #include "cipher.h" typedef struct { - char foo ;/* empty, for now */ + char foo ;/* empty, for now */ } null_cipher_ctx_t; @@ -66,15 +66,15 @@ null_cipher_init(null_cipher_ctx_t *c, const uint8_t *key, int key_len); err_status_t null_cipher_set_segment(null_cipher_ctx_t *c, - unsigned long segment_index); + unsigned long segment_index); err_status_t null_cipher_encrypt(null_cipher_ctx_t *c, - unsigned char *buf, unsigned int *bytes_to_encr); + unsigned char *buf, unsigned int *bytes_to_encr); err_status_t null_cipher_encrypt_aligned(null_cipher_ctx_t *c, - unsigned char *buf, int bytes_to_encr); + unsigned char *buf, int bytes_to_encr); #endif /* NULL_CIPHER_H */ diff --git a/thirdparties/mac/include/srtp/prng.h b/thirdparties/mac/include/srtp/prng.h index c5ec230..dc19994 100755 --- a/thirdparties/mac/include/srtp/prng.h +++ b/thirdparties/mac/include/srtp/prng.h @@ -8,26 +8,26 @@ */ /* - * + * * Copyright (c) 2001-2006, 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 @@ -62,10 +62,10 @@ */ typedef struct { - v128_t state; /* state data */ - aes_expanded_key_t key; /* secret key */ - uint32_t octet_count; /* number of octets output since last init */ - rand_source_func_t rand; /* random source for re-initialization */ + v128_t state; /* state data */ + aes_expanded_key_t key; /* secret key */ + uint32_t octet_count; /* number of octets output since last init */ + rand_source_func_t rand; /* random source for re-initialization */ } x917_prng_t; err_status_t @@ -80,9 +80,9 @@ x917_prng_get_octet_string(uint8_t *dest, uint32_t len); */ typedef struct { - uint32_t octet_count; /* number of octets output since last init */ - aes_icm_ctx_t state; /* state data */ - rand_source_func_t rand; /* random source for re-initialization */ + uint32_t octet_count; /* number of octets output since last init */ + aes_icm_ctx_t state; /* state data */ + rand_source_func_t rand; /* random source for re-initialization */ } ctr_prng_t; err_status_t diff --git a/thirdparties/mac/include/srtp/rand_source.h b/thirdparties/mac/include/srtp/rand_source.h index b4c2110..d2e52ce 100755 --- a/thirdparties/mac/include/srtp/rand_source.h +++ b/thirdparties/mac/include/srtp/rand_source.h @@ -7,26 +7,26 @@ * Cisco Systems, Inc. */ /* - * + * * Copyright(c) 2001-2006 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 @@ -60,7 +60,7 @@ rand_source_init(void); * and returns an error code. This error code should be checked, * and if a failure is reported, the data in the buffer MUST NOT * be used. - * + * * warning: If the return code is not checked, then non-random * data may inadvertently be used. * @@ -77,7 +77,7 @@ rand_source_get_octet_string(void *dest, uint32_t length); err_status_t rand_source_deinit(void); -/* +/* * function prototype for a random source function * * A rand_source_func_t writes num_octets at the location indicated by @@ -86,6 +86,6 @@ rand_source_deinit(void); */ typedef err_status_t (*rand_source_func_t) - (void *dest, uint32_t num_octets); +(void *dest, uint32_t num_octets); #endif /* RAND_SOURCE */ diff --git a/thirdparties/mac/include/srtp/rdb.h b/thirdparties/mac/include/srtp/rdb.h index 300c569..ecbfa76 100755 --- a/thirdparties/mac/include/srtp/rdb.h +++ b/thirdparties/mac/include/srtp/rdb.h @@ -9,26 +9,26 @@ /* - * + * * Copyright (c) 2001-2006, 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 @@ -57,11 +57,11 @@ */ typedef struct { - uint32_t window_start; /* packet index of the first bit in bitmask */ - v128_t bitmask; + uint32_t window_start; /* packet index of the first bit in bitmask */ + v128_t bitmask; } rdb_t; -#define rdb_bits_in_bitmask (8*sizeof(v128_t)) +#define rdb_bits_in_bitmask (8*sizeof(v128_t)) /* * rdb init @@ -85,7 +85,7 @@ rdb_init(rdb_t *rdb); */ err_status_t -rdb_check(const rdb_t *rdb, uint32_t rdb_index); +rdb_check(const rdb_t *rdb, uint32_t rdb_index); /* * rdb_add_index @@ -100,18 +100,18 @@ err_status_t rdb_add_index(rdb_t *rdb, uint32_t rdb_index); /* - * the functions rdb_increment() and rdb_get_value() are for use by + * the functions rdb_increment() and rdb_get_value() are for use by * senders, not receivers - DO NOT use these functions on the same * rdb_t upon which rdb_add_index is used! */ /* - * rdb_increment(db) increments the sequence number in db, if it is + * rdb_increment(db) increments the sequence number in db, if it is * not too high * * return values: - * + * * err_status_ok no problem * err_status_key_expired sequence number too high * @@ -127,4 +127,4 @@ uint32_t rdb_get_value(const rdb_t *rdb); -#endif /* REPLAY_DB_H */ +#endif /* REPLAY_DB_H */ diff --git a/thirdparties/mac/include/srtp/rdbx.h b/thirdparties/mac/include/srtp/rdbx.h index 4b8dd22..9d612c7 100755 --- a/thirdparties/mac/include/srtp/rdbx.h +++ b/thirdparties/mac/include/srtp/rdbx.h @@ -9,26 +9,26 @@ */ /* - * + * * Copyright (c) 2001-2006, 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 @@ -50,7 +50,7 @@ #include "datatypes.h" #include "err.h" -/* #define ROC_TEST */ +/* #define ROC_TEST */ #ifndef ROC_TEST @@ -69,7 +69,7 @@ typedef uint16_t rollover_counter_t; /* 16 bit rollover counter */ /* * An xtd_seq_num_t is a 64-bit unsigned integer used as an 'extended' - * sequence number. + * sequence number. */ typedef uint64_t xtd_seq_num_t; @@ -81,8 +81,8 @@ typedef uint64_t xtd_seq_num_t; */ typedef struct { - xtd_seq_num_t index; - bitvector_t bitmask; + xtd_seq_num_t index; + bitvector_t bitmask; } rdbx_t; @@ -109,7 +109,7 @@ rdbx_dealloc(rdbx_t *rdbx); /* * rdbx_estimate_index(rdbx, guess, s) - * + * * given an rdbx and a sequence number s (from a newly arrived packet), * sets the contents of *guess to contain the best guess of the packet * index to which s corresponds, and returns the difference between @@ -118,8 +118,8 @@ rdbx_dealloc(rdbx_t *rdbx); int rdbx_estimate_index(const rdbx_t *rdbx, - xtd_seq_num_t *guess, - sequence_number_t s); + xtd_seq_num_t *guess, + sequence_number_t s); /* * rdbx_check(rdbx, delta); @@ -134,7 +134,7 @@ rdbx_check(const rdbx_t *rdbx, int difference); /* * replay_add_index(rdbx, delta) - * + * * adds the xtd_seq_num_t at rdbx->window_start + delta to replay_db * (and does *not* check if that xtd_seq_num_t appears in db) * @@ -152,7 +152,7 @@ rdbx_add_index(rdbx_t *rdbx, int delta); * to have the rollover counter value roc. If that value is less than * the current rollover counter value, then the function returns * err_status_replay_old; otherwise, err_status_ok is returned. - * + * */ err_status_t @@ -161,7 +161,7 @@ rdbx_set_roc(rdbx_t *rdbx, uint32_t roc); /* * rdbx_get_roc(rdbx) returns the value of the rollover counter for * the rdbx_t pointed to by rdbx - * + * */ xtd_seq_num_t @@ -196,7 +196,7 @@ index_advance(xtd_seq_num_t *pi, sequence_number_t s); /* * index_guess(local, guess, s) - * + * * given a xtd_seq_num_t local (which represents the highest * known-to-be-good index) and a sequence number s (from a newly * arrived packet), sets the contents of *guess to contain the best @@ -206,8 +206,8 @@ index_advance(xtd_seq_num_t *pi, sequence_number_t s); int index_guess(const xtd_seq_num_t *local, - xtd_seq_num_t *guess, - sequence_number_t s); + xtd_seq_num_t *guess, + sequence_number_t s); #endif /* RDBX_H */ diff --git a/thirdparties/mac/include/srtp/rtp.h b/thirdparties/mac/include/srtp/rtp.h index 0e0119c..9b97ab6 100755 --- a/thirdparties/mac/include/srtp/rtp.h +++ b/thirdparties/mac/include/srtp/rtp.h @@ -1,6 +1,6 @@ /* * rtp.h - * + * * rtp interface for srtp reference implementation * * David A. McGrew @@ -15,26 +15,26 @@ */ /* - * + * * Copyright (c) 2001-2006, 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 @@ -73,12 +73,12 @@ int rtp_recvfrom(rtp_receiver_t receiver, void *msg, int *len); int -rtp_receiver_init(rtp_receiver_t rcvr, int sock, - struct sockaddr_in addr, unsigned int ssrc); +rtp_receiver_init(rtp_receiver_t rcvr, int sock, + struct sockaddr_in addr, unsigned int ssrc); int -rtp_sender_init(rtp_sender_t sender, int sock, - struct sockaddr_in addr, unsigned int ssrc); +rtp_sender_init(rtp_sender_t sender, int sock, + struct sockaddr_in addr, unsigned int ssrc); /* * srtp_sender_init(...) initializes an rtp_sender_t @@ -86,17 +86,17 @@ rtp_sender_init(rtp_sender_t sender, int sock, int srtp_sender_init(rtp_sender_t rtp_ctx, /* structure to be init'ed */ - struct sockaddr_in name, /* socket name */ - sec_serv_t security_services, /* sec. servs. to be used */ - unsigned char *input_key /* master key/salt in hex */ - ); + struct sockaddr_in name, /* socket name */ + sec_serv_t security_services, /* sec. servs. to be used */ + unsigned char *input_key /* master key/salt in hex */ + ); int srtp_receiver_init(rtp_receiver_t rtp_ctx, /* structure to be init'ed */ - struct sockaddr_in name, /* socket name */ - sec_serv_t security_services, /* sec. servs. to be used */ - unsigned char *input_key /* master key/salt in hex */ - ); + struct sockaddr_in name, /* socket name */ + sec_serv_t security_services, /* sec. servs. to be used */ + unsigned char *input_key /* master key/salt in hex */ + ); int @@ -112,13 +112,13 @@ int rtp_receiver_deinit_srtp(rtp_receiver_t sender); -rtp_sender_t +rtp_sender_t rtp_sender_alloc(void); void rtp_sender_dealloc(rtp_sender_t rtp_ctx); -rtp_receiver_t +rtp_receiver_t rtp_receiver_alloc(void); void @@ -130,7 +130,7 @@ rtp_receiver_dealloc(rtp_receiver_t rtp_ctx); */ #define RTP_HEADER_LEN 12 -/* +/* * RTP_MAX_BUF_LEN defines the largest RTP packet in the rtp.c implementation */ #define RTP_MAX_BUF_LEN 16384 diff --git a/thirdparties/mac/include/srtp/rtp_priv.h b/thirdparties/mac/include/srtp/rtp_priv.h index 1421386..088cdbe 100755 --- a/thirdparties/mac/include/srtp/rtp_priv.h +++ b/thirdparties/mac/include/srtp/rtp_priv.h @@ -7,26 +7,26 @@ * Cisco Systems, Inc. */ /* - * + * * Copyright (c) 2001-2006 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 @@ -52,22 +52,22 @@ typedef srtp_hdr_t rtp_hdr_t; typedef struct { - srtp_hdr_t header; - char body[RTP_MAX_BUF_LEN]; + srtp_hdr_t header; + char body[RTP_MAX_BUF_LEN]; } rtp_msg_t; typedef struct rtp_sender_ctx_t { - rtp_msg_t message; - int socket; - srtp_ctx_t *srtp_ctx; - struct sockaddr_in addr; /* reciever's address */ + rtp_msg_t message; + int socket; + srtp_ctx_t *srtp_ctx; + struct sockaddr_in addr; /* reciever's address */ } rtp_sender_ctx_t; typedef struct rtp_receiver_ctx_t { - rtp_msg_t message; - int socket; - srtp_ctx_t *srtp_ctx; - struct sockaddr_in addr; /* receiver's address */ + rtp_msg_t message; + int socket; + srtp_ctx_t *srtp_ctx; + struct sockaddr_in addr; /* receiver's address */ } rtp_receiver_ctx_t; diff --git a/thirdparties/mac/include/srtp/sha1.h b/thirdparties/mac/include/srtp/sha1.h index f1744ce..64637b5 100755 --- a/thirdparties/mac/include/srtp/sha1.h +++ b/thirdparties/mac/include/srtp/sha1.h @@ -9,26 +9,26 @@ */ /* - * + * * Copyright (c) 2001-2006, 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 @@ -48,7 +48,7 @@ #define SHA1_H #ifdef HAVE_CONFIG_H - #include <config.h> +#include <config.h> #endif #include "err.h" @@ -93,17 +93,17 @@ static inline void sha1_final (sha1_ctx_t *ctx, uint32_t *output) #include "datatypes.h" typedef struct { - uint32_t H[5]; /* state vector */ - uint32_t M[16]; /* message buffer */ - int octets_in_buffer; /* octets of message in buffer */ - uint32_t num_bits_in_msg; /* total number of bits in message */ + uint32_t H[5]; /* state vector */ + uint32_t M[16]; /* message buffer */ + int octets_in_buffer; /* octets of message in buffer */ + uint32_t num_bits_in_msg; /* total number of bits in message */ } sha1_ctx_t; /* * sha1(&ctx, msg, len, output) hashes the len octets starting at msg * into the SHA1 context, then writes the result to the 20 octets at * output - * + * */ void @@ -111,10 +111,10 @@ sha1(const uint8_t *message, int octets_in_msg, uint32_t output[5]); /* * sha1_init(&ctx) initializes the SHA1 context ctx - * + * * sha1_update(&ctx, msg, len) hashes the len octets starting at msg * into the SHA1 context - * + * * sha1_final(&ctx, output) performs the final processing of the SHA1 * context and writes the result to the 20 octets at output * @@ -132,7 +132,7 @@ sha1_final(sha1_ctx_t *ctx, uint32_t output[5]); /* * The sha1_core function is INTERNAL to SHA-1, but it is declared * here because it is also used by the cipher SEAL 3.0 in its key - * setup algorithm. + * setup algorithm. */ /* @@ -148,5 +148,5 @@ void sha1_core(const uint32_t M[16], uint32_t hash_value[5]); #endif /* else OPENSSL */ - + #endif /* SHA1_H */ diff --git a/thirdparties/mac/include/srtp/srtp.h b/thirdparties/mac/include/srtp/srtp.h index 81af519..1ab10b8 100755 --- a/thirdparties/mac/include/srtp/srtp.h +++ b/thirdparties/mac/include/srtp/srtp.h @@ -7,26 +7,26 @@ * Cisco Systems, Inc. */ /* - * + * * Copyright (c) 2001-2006, 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 @@ -51,7 +51,7 @@ extern "C" { #endif #include <stdint.h> -#include "crypto.h" +#include "crypto.h" #include "crypto_types.h" #include "err.h" @@ -79,7 +79,7 @@ extern "C" { * SRTP_MAX_TAG_LEN is the maximum tag length supported by libSRTP */ -#define SRTP_MAX_TAG_LEN 16 +#define SRTP_MAX_TAG_LEN 16 /** * SRTP_MAX_TRAILER_LEN is the maximum length of the SRTP trailer @@ -89,10 +89,10 @@ extern "C" { * * @brief the maximum number of octets added by srtp_protect(). */ -#define SRTP_MAX_TRAILER_LEN SRTP_MAX_TAG_LEN +#define SRTP_MAX_TRAILER_LEN SRTP_MAX_TAG_LEN /* - * SRTP_AEAD_SALT_LEN is the length of the SALT values used with + * SRTP_AEAD_SALT_LEN is the length of the SALT values used with * GCM mode. GCM mode requires an IV. The SALT value is used * as part of the IV formation logic applied to each RTP packet. */ @@ -103,83 +103,84 @@ extern "C" { -/* +/* * nota bene: since libSRTP doesn't support the use of the MKI, the * SRTP_MAX_TRAILER_LEN value is just the maximum tag length */ /** - * @brief sec_serv_t describes a set of security services. + * @brief sec_serv_t describes a set of security services. * * A sec_serv_t enumeration is used to describe the particular * security services that will be applied by a particular crypto - * policy (or other mechanism). + * policy (or other mechanism). */ typedef enum { - sec_serv_none = 0, /**< no services */ - sec_serv_conf = 1, /**< confidentiality */ - sec_serv_auth = 2, /**< authentication */ - sec_serv_conf_and_auth = 3 /**< confidentiality and authentication */ -} sec_serv_t; + sec_serv_none = 0, /**< no services */ + sec_serv_conf = 1, /**< confidentiality */ + sec_serv_auth = 2, /**< authentication */ + sec_serv_conf_and_auth = 3 /**< confidentiality and authentication */ +} +sec_serv_t; -/** +/** * @brief crypto_policy_t describes a particular crypto policy that * can be applied to an SRTP stream. * * A crypto_policy_t describes a particular cryptographic policy that * can be applied to an SRTP or SRTCP stream. An SRTP session policy - * consists of a list of these policies, one for each SRTP stream + * consists of a list of these policies, one for each SRTP stream * in the session. */ typedef struct crypto_policy_t { - cipher_type_id_t cipher_type; /**< An integer representing + cipher_type_id_t cipher_type; /**< An integer representing * the type of cipher. */ - int cipher_key_len; /**< The length of the cipher key + int cipher_key_len; /**< The length of the cipher key * in octets. */ - auth_type_id_t auth_type; /**< An integer representing the + auth_type_id_t auth_type; /**< An integer representing the * authentication function. */ - int auth_key_len; /**< The length of the authentication + int auth_key_len; /**< The length of the authentication * function key in octets. */ - int auth_tag_len; /**< The length of the authentication + int auth_tag_len; /**< The length of the authentication * tag in octets. */ - sec_serv_t sec_serv; /**< The flag indicating the security + sec_serv_t sec_serv; /**< The flag indicating the security * services to be applied. */ } crypto_policy_t; -/** +/** * @brief ssrc_type_t describes the type of an SSRC. - * + * * An ssrc_type_t enumeration is used to indicate a type of SSRC. See * @ref srtp_policy_t for more informataion. */ -typedef enum { - ssrc_undefined = 0, /**< Indicates an undefined SSRC type. */ - ssrc_specific = 1, /**< Indicates a specific SSRC value */ - ssrc_any_inbound = 2, /**< Indicates any inbound SSRC value +typedef enum { + ssrc_undefined = 0, /**< Indicates an undefined SSRC type. */ + ssrc_specific = 1, /**< Indicates a specific SSRC value */ + ssrc_any_inbound = 2, /**< Indicates any inbound SSRC value (i.e. a value that is used in the function srtp_unprotect()) */ - ssrc_any_outbound = 3 /**< Indicates any outbound SSRC value - (i.e. a value that is used in the + ssrc_any_outbound = 3 /**< Indicates any outbound SSRC value + (i.e. a value that is used in the function srtp_protect()) */ } ssrc_type_t; /** * @brief An ssrc_t represents a particular SSRC value, or a `wildcard' SSRC. - * + * * An ssrc_t represents a particular SSRC value (if its type is * ssrc_specific), or a wildcard SSRC value that will match all * outbound SSRCs (if its type is ssrc_any_outbound) or all inbound - * SSRCs (if its type is ssrc_any_inbound). + * SSRCs (if its type is ssrc_any_inbound). * */ -typedef struct { - ssrc_type_t type; /**< The type of this particular SSRC */ - unsigned int value; /**< The value of this SSRC, if it is not a wildcard */ +typedef struct { + ssrc_type_t type; /**< The type of this particular SSRC */ + unsigned int value; /**< The value of this SSRC, if it is not a wildcard */ } ssrc_t; @@ -195,8 +196,8 @@ typedef struct ekt_policy_ctx_t *ekt_policy_t; typedef struct ekt_stream_ctx_t *ekt_stream_t; -/** - * @brief represents the policy for an SRTP session. +/** + * @brief represents the policy for an SRTP session. * * A single srtp_policy_t struct represents the policy for a single * SRTP stream, and a linked list of these elements represents the @@ -205,7 +206,7 @@ typedef struct ekt_stream_ctx_t *ekt_stream_t; * master key for that stream, the SSRC describing that stream, or a * flag indicating a `wildcard' SSRC value, and a `next' field that * holds a pointer to the next element in the list of policy elements, - * or NULL if it is the last element. + * or NULL if it is the last element. * * The wildcard value SSRC_ANY_INBOUND matches any SSRC from an * inbound stream that for which there is no explicit SSRC entry in @@ -216,33 +217,33 @@ typedef struct ekt_stream_ctx_t *ekt_stream_t; * is intentional, and it allows libSRTP to ensure that no security * lapses result from accidental re-use of SSRC values during key * sharing. - * - * + * + * * @warning The final element of the list @b must have its `next' pointer * set to NULL. */ typedef struct srtp_policy_t { - ssrc_t ssrc; /**< The SSRC value of stream, or the - * flags SSRC_ANY_INBOUND or + ssrc_t ssrc; /**< The SSRC value of stream, or the + * flags SSRC_ANY_INBOUND or * SSRC_ANY_OUTBOUND if key sharing * is used for this policy element. */ - crypto_policy_t rtp; /**< SRTP crypto policy. */ - crypto_policy_t rtcp; /**< SRTCP crypto policy. */ - unsigned char *key; /**< Pointer to the SRTP master key for + crypto_policy_t rtp; /**< SRTP crypto policy. */ + crypto_policy_t rtcp; /**< SRTCP crypto policy. */ + unsigned char *key; /**< Pointer to the SRTP master key for * this stream. */ - ekt_policy_t ekt; /**< Pointer to the EKT policy structure - * for this stream (if any) */ - unsigned long window_size; /**< The window size to use for replay + ekt_policy_t ekt; /**< Pointer to the EKT policy structure + * for this stream (if any) */ + unsigned long window_size; /**< The window size to use for replay * protection. */ - int allow_repeat_tx; /**< Whether retransmissions of + int allow_repeat_tx; /**< Whether retransmissions of * packets with the same sequence number * are allowed. (Note that such repeated * transmissions must have the same RTP * payload, or a severe security weakness * is introduced!) */ - struct srtp_policy_t *next; /**< Pointer to next stream policy. */ + struct srtp_policy_t *next; /**< Pointer to next stream policy. */ } srtp_policy_t; @@ -252,7 +253,7 @@ typedef struct srtp_policy_t { * @brief An srtp_t points to an SRTP session structure. * * The typedef srtp_t is a pointer to a structure that represents - * an SRTP session. This datatype is intentially opaque in + * an SRTP session. This datatype is intentially opaque in * order to separate the interface from the implementation. * * An SRTP session consists of all of the traffic sent to the RTP and @@ -269,11 +270,11 @@ typedef struct srtp_ctx_t *srtp_t; * * The typedef srtp_stream_t is a pointer to a structure that * represents an SRTP stream. This datatype is intentionally - * opaque in order to separate the interface from the implementation. - * + * opaque in order to separate the interface from the implementation. + * * An SRTP stream consists of all of the traffic sent to an SRTP * session by a single participant. A session can be viewed as - * a set of streams. + * a set of streams. * */ typedef struct srtp_stream_ctx_t *srtp_stream_t; @@ -281,7 +282,7 @@ typedef struct srtp_stream_ctx_t *srtp_stream_t; /** - * @brief srtp_init() initializes the srtp library. + * @brief srtp_init() initializes the srtp library. * * @warning This function @b must be called before any other srtp * functions. @@ -302,14 +303,14 @@ srtp_shutdown(void); /** * @brief srtp_protect() is the Secure RTP sender-side packet processing * function. - * + * * The function call srtp_protect(ctx, rtp_hdr, len_ptr) applies SRTP * protection to the RTP packet rtp_hdr (which has length *len_ptr) using * the SRTP context ctx. If err_status_ok is returned, then rtp_hdr * points to the resulting SRTP packet and *len_ptr is the number of * octets in that packet; otherwise, no assumptions should be made * about the value of either data elements. - * + * * The sequence numbers of the RTP packets presented to this function * need not be consecutive, but they @b must be out of order by less * than 2^15 = 32,768 packets. @@ -319,11 +320,11 @@ srtp_shutdown(void); * packet, and assumes that the RTP packet is aligned on a 32-bit * boundary. * - * @warning This function assumes that it can write SRTP_MAX_TRAILER_LEN - * into the location in memory immediately following the RTP packet. - * Callers MUST ensure that this much writable memory is available in + * @warning This function assumes that it can write SRTP_MAX_TRAILER_LEN + * into the location in memory immediately following the RTP packet. + * Callers MUST ensure that this much writable memory is available in * the buffer that holds the RTP packet. - * + * * @param ctx is the SRTP context to use in processing the packet. * * @param rtp_hdr is a pointer to the RTP packet (before the call); after @@ -334,7 +335,7 @@ srtp_shutdown(void); * complete SRTP packet after the call, if err_status_ok was returned. * Otherwise, the value of the data to which it points is undefined. * - * @return + * @return * - err_status_ok no problems * - err_status_replay_fail rtp sequence number was non-increasing * - @e other failure in cryptographic mechanisms @@ -342,7 +343,7 @@ srtp_shutdown(void); err_status_t srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr); - + /** * @brief srtp_unprotect() is the Secure RTP receiver-side packet * processing function. @@ -353,12 +354,12 @@ srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr); * err_status_ok is returned, then srtp_hdr points to the resulting * RTP packet and *len_ptr is the number of octets in that packet; * otherwise, no assumptions should be made about the value of either - * data elements. - * + * data elements. + * * The sequence numbers of the RTP packets presented to this function * need not be consecutive, but they @b must be out of order by less * than 2^15 = 32,768 packets. - * + * * @warning This function assumes that the SRTP packet is aligned on a * 32-bit boundary. * @@ -374,9 +375,9 @@ srtp_protect(srtp_t ctx, void *rtp_hdr, int *len_ptr); * complete rtp packet after the call, if err_status_ok was returned. * Otherwise, the value of the data to which it points is undefined. * - * @return + * @return * - err_status_ok if the RTP packet is valid. - * - err_status_auth_fail if the SRTP packet failed the message + * - err_status_auth_fail if the SRTP packet failed the message * authentication check. * - err_status_replay_fail if the SRTP packet is a replay (e.g. packet has * already been processed and accepted). @@ -397,14 +398,14 @@ srtp_unprotect(srtp_t ctx, void *srtp_hdr, int *len_ptr); * * @param session is a pointer to the SRTP session to which the policy is * to be added. - * + * * @param policy is the srtp_policy_t struct that describes the policy * for the session. The struct may be a single element, or it may be * the head of a list, in which case each element of the list is * processed. It may also be NULL, in which case streams should be added * later using srtp_add_stream(). The final element of the list @b must * have its `next' field set to NULL. - * + * * @return * - err_status_ok if creation succeded. * - err_status_alloc_fail if allocation failed. @@ -418,7 +419,7 @@ srtp_create(srtp_t *session, const srtp_policy_t *policy); /** * @brief srtp_add_stream() allocates and initializes an SRTP stream * within a given SRTP session. - * + * * The function call srtp_add_stream(session, policy) allocates and * initializes a new SRTP stream within a given, previously created * session, applying the policy given as the other argument to that @@ -431,13 +432,13 @@ srtp_create(srtp_t *session, const srtp_policy_t *policy); */ err_status_t -srtp_add_stream(srtp_t session, - const srtp_policy_t *policy); +srtp_add_stream(srtp_t session, + const srtp_policy_t *policy); /** * @brief srtp_remove_stream() deallocates an SRTP stream. - * + * * The function call srtp_remove_stream(session, ssrc) removes * the SRTP stream with the SSRC value ssrc from the SRTP session * context given by the argument session. @@ -449,7 +450,7 @@ srtp_add_stream(srtp_t session, * * @warning Wildcard SSRC values cannot be removed from a * session. - * + * * @return * - err_status_ok if the stream deallocation succeded. * - [other] otherwise. @@ -463,8 +464,8 @@ srtp_remove_stream(srtp_t session, unsigned int ssrc); * @brief crypto_policy_set_rtp_default() sets a crypto policy * structure to the SRTP default policy for RTP protection. * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function call crypto_policy_set_rtp_default(&p) sets the * crypto_policy_t at location p to the SRTP default policy for RTP * protection, as defined in the specification. This function is a @@ -473,9 +474,9 @@ srtp_remove_stream(srtp_t session, unsigned int ssrc); * with this function call. Doing so may allow your code to be * forward compatible with later versions of libSRTP that include more * elements in the crypto_policy_t datatype. - * + * * @return void. - * + * */ void @@ -485,8 +486,8 @@ crypto_policy_set_rtp_default(crypto_policy_t *p); * @brief crypto_policy_set_rtcp_default() sets a crypto policy * structure to the SRTP default policy for RTCP protection. * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function call crypto_policy_set_rtcp_default(&p) sets the * crypto_policy_t at location p to the SRTP default policy for RTCP * protection, as defined in the specification. This function is a @@ -495,9 +496,9 @@ crypto_policy_set_rtp_default(crypto_policy_t *p); * with this function call. Doing so may allow your code to be * forward compatible with later versions of libSRTP that include more * elements in the crypto_policy_t datatype. - * + * * @return void. - * + * */ void @@ -507,15 +508,15 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p); * @brief crypto_policy_set_aes_cm_128_hmac_sha1_80() sets a crypto * policy structure to the SRTP default policy for RTP protection. * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function crypto_policy_set_aes_cm_128_hmac_sha1_80() is a * synonym for crypto_policy_set_rtp_default(). It conforms to the * naming convention used in RFC 4568 (SDP Security Descriptions for * Media Streams). - * + * * @return void. - * + * */ #define crypto_policy_set_aes_cm_128_hmac_sha1_80(p) crypto_policy_set_rtp_default(p) @@ -525,8 +526,8 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p); * @brief crypto_policy_set_aes_cm_128_hmac_sha1_32() sets a crypto * policy structure to a short-authentication tag policy * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function call crypto_policy_set_aes_cm_128_hmac_sha1_32(&p) * sets the crypto_policy_t at location p to use policy * AES_CM_128_HMAC_SHA1_32 as defined in RFC 4568. @@ -536,7 +537,7 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p); * considered adequate only for protecting audio and video media that * use a stateless playback function. See Section 7.5 of RFC 3711 * (http://www.ietf.org/rfc/rfc3711.txt). - * + * * This function is a convenience that helps to avoid dealing directly * with the policy data structure. You are encouraged to initialize * policy elements with this function call. Doing so may allow your @@ -549,7 +550,7 @@ crypto_policy_set_rtcp_default(crypto_policy_t *p); * (http://www.ietf.org/rfc/rfc3711.txt). * * @return void. - * + * */ void @@ -561,14 +562,14 @@ crypto_policy_set_aes_cm_128_hmac_sha1_32(crypto_policy_t *p); * @brief crypto_policy_set_aes_cm_128_null_auth() sets a crypto * policy structure to an encryption-only policy * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function call crypto_policy_set_aes_cm_128_null_auth(&p) sets * the crypto_policy_t at location p to use the SRTP default cipher * (AES-128 Counter Mode), but to use no authentication method. This * policy is NOT RECOMMENDED unless it is unavoidable; see Section 7.5 * of RFC 3711 (http://www.ietf.org/rfc/rfc3711.txt). - * + * * This function is a convenience that helps to avoid dealing directly * with the policy data structure. You are encouraged to initialize * policy elements with this function call. Doing so may allow your @@ -580,7 +581,7 @@ crypto_policy_set_aes_cm_128_hmac_sha1_32(crypto_policy_t *p); * Section 7.5 of RFC 3711 (http://www.ietf.org/rfc/rfc3711.txt). * * @return void. - * + * */ void @@ -591,14 +592,14 @@ crypto_policy_set_aes_cm_128_null_auth(crypto_policy_t *p); * @brief crypto_policy_set_null_cipher_hmac_sha1_80() sets a crypto * policy structure to an authentication-only policy * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function call crypto_policy_set_null_cipher_hmac_sha1_80(&p) * sets the crypto_policy_t at location p to use HMAC-SHA1 with an 80 * bit authentication tag to provide message authentication, but to * use no encryption. This policy is NOT RECOMMENDED for SRTP unless - * there is a requirement to forego encryption. - * + * there is a requirement to forego encryption. + * * This function is a convenience that helps to avoid dealing directly * with the policy data structure. You are encouraged to initialize * policy elements with this function call. Doing so may allow your @@ -606,10 +607,10 @@ crypto_policy_set_aes_cm_128_null_auth(crypto_policy_t *p); * include more elements in the crypto_policy_t datatype. * * @warning This policy is NOT RECOMMENDED for SRTP unless there is a - * requirement to forego encryption. + * requirement to forego encryption. * * @return void. - * + * */ void @@ -618,18 +619,18 @@ crypto_policy_set_null_cipher_hmac_sha1_80(crypto_policy_t *p); /** * @brief crypto_policy_set_aes_cm_256_hmac_sha1_80() sets a crypto - * policy structure to a encryption and authentication policy using AES-256 + * policy structure to a encryption and authentication policy using AES-256 * for RTP protection. * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function call crypto_policy_set_aes_cm_256_hmac_sha1_80(&p) * sets the crypto_policy_t at location p to use policy * AES_CM_256_HMAC_SHA1_80 as defined in * draft-ietf-avt-srtp-big-aes-03.txt. This policy uses AES-256 * Counter Mode encryption and HMAC-SHA1 authentication, with an 80 bit * authentication tag. - * + * * This function is a convenience that helps to avoid dealing directly * with the policy data structure. You are encouraged to initialize * policy elements with this function call. Doing so may allow your @@ -637,7 +638,7 @@ crypto_policy_set_null_cipher_hmac_sha1_80(crypto_policy_t *p); * include more elements in the crypto_policy_t datatype. * * @return void. - * + * */ void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p); @@ -648,8 +649,8 @@ void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p); * policy structure to a short-authentication tag policy using AES-256 * encryption. * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function call crypto_policy_set_aes_cm_256_hmac_sha1_32(&p) * sets the crypto_policy_t at location p to use policy * AES_CM_256_HMAC_SHA1_32 as defined in @@ -659,7 +660,7 @@ void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p); * considered adequate only for protecting audio and video media that * use a stateless playback function. See Section 7.5 of RFC 3711 * (http://www.ietf.org/rfc/rfc3711.txt). - * + * * This function is a convenience that helps to avoid dealing directly * with the policy data structure. You are encouraged to initialize * policy elements with this function call. Doing so may allow your @@ -672,7 +673,7 @@ void crypto_policy_set_aes_cm_256_hmac_sha1_80(crypto_policy_t *p); * (http://www.ietf.org/rfc/rfc3711.txt). * * @return void. - * + * */ void @@ -710,14 +711,14 @@ crypto_policy_set_aes_cm_256_null_auth(crypto_policy_t *p); * @brief crypto_policy_set_aes_gcm_128_8_auth() sets a crypto * policy structure to an AEAD encryption policy. * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function call crypto_policy_set_aes_gcm_128_8_auth(&p) sets * the crypto_policy_t at location p to use the SRTP default cipher * (AES-128 Galois Counter Mode) with 8 octet auth tag. This * policy applies confidentiality and authentication to both the * RTP and RTCP packets. - * + * * This function is a convenience that helps to avoid dealing directly * with the policy data structure. You are encouraged to initialize * policy elements with this function call. Doing so may allow your @@ -725,7 +726,7 @@ crypto_policy_set_aes_cm_256_null_auth(crypto_policy_t *p); * include more elements in the crypto_policy_t datatype. * * @return void. - * + * */ void crypto_policy_set_aes_gcm_128_8_auth(crypto_policy_t *p); @@ -734,14 +735,14 @@ crypto_policy_set_aes_gcm_128_8_auth(crypto_policy_t *p); * @brief crypto_policy_set_aes_gcm_256_8_auth() sets a crypto * policy structure to an AEAD encryption policy * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function call crypto_policy_set_aes_gcm_256_8_auth(&p) sets * the crypto_policy_t at location p to use the SRTP default cipher - * (AES-256 Galois Counter Mode) with 8 octet auth tag. This + * (AES-256 Galois Counter Mode) with 8 octet auth tag. This * policy applies confidentiality and authentication to both the * RTP and RTCP packets. - * + * * This function is a convenience that helps to avoid dealing directly * with the policy data structure. You are encouraged to initialize * policy elements with this function call. Doing so may allow your @@ -749,7 +750,7 @@ crypto_policy_set_aes_gcm_128_8_auth(crypto_policy_t *p); * include more elements in the crypto_policy_t datatype. * * @return void. - * + * */ void crypto_policy_set_aes_gcm_256_8_auth(crypto_policy_t *p); @@ -758,14 +759,14 @@ crypto_policy_set_aes_gcm_256_8_auth(crypto_policy_t *p); * @brief crypto_policy_set_aes_gcm_128_8_only_auth() sets a crypto * policy structure to an AEAD authentication-only policy * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function call crypto_policy_set_aes_gcm_128_8_only_auth(&p) sets * the crypto_policy_t at location p to use the SRTP default cipher - * (AES-128 Galois Counter Mode) with 8 octet auth tag. This policy - * applies confidentiality and authentication to the RTP packets, + * (AES-128 Galois Counter Mode) with 8 octet auth tag. This policy + * applies confidentiality and authentication to the RTP packets, * but only authentication to the RTCP packets. - * + * * This function is a convenience that helps to avoid dealing directly * with the policy data structure. You are encouraged to initialize * policy elements with this function call. Doing so may allow your @@ -773,7 +774,7 @@ crypto_policy_set_aes_gcm_256_8_auth(crypto_policy_t *p); * include more elements in the crypto_policy_t datatype. * * @return void. - * + * */ void crypto_policy_set_aes_gcm_128_8_only_auth(crypto_policy_t *p); @@ -782,14 +783,14 @@ crypto_policy_set_aes_gcm_128_8_only_auth(crypto_policy_t *p); * @brief crypto_policy_set_aes_gcm_256_8_only_auth() sets a crypto * policy structure to an AEAD authentication-only policy * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function call crypto_policy_set_aes_gcm_256_8_only_auth(&p) sets * the crypto_policy_t at location p to use the SRTP default cipher - * (AES-256 Galois Counter Mode) with 8 octet auth tag. This policy - * applies confidentiality and authentication to the RTP packets, + * (AES-256 Galois Counter Mode) with 8 octet auth tag. This policy + * applies confidentiality and authentication to the RTP packets, * but only authentication to the RTCP packets. - * + * * This function is a convenience that helps to avoid dealing directly * with the policy data structure. You are encouraged to initialize * policy elements with this function call. Doing so may allow your @@ -797,7 +798,7 @@ crypto_policy_set_aes_gcm_128_8_only_auth(crypto_policy_t *p); * include more elements in the crypto_policy_t datatype. * * @return void. - * + * */ void crypto_policy_set_aes_gcm_256_8_only_auth(crypto_policy_t *p); @@ -806,14 +807,14 @@ crypto_policy_set_aes_gcm_256_8_only_auth(crypto_policy_t *p); * @brief crypto_policy_set_aes_gcm_128_16_auth() sets a crypto * policy structure to an AEAD encryption policy. * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function call crypto_policy_set_aes_gcm_128_16_auth(&p) sets * the crypto_policy_t at location p to use the SRTP default cipher * (AES-128 Galois Counter Mode) with 16 octet auth tag. This * policy applies confidentiality and authentication to both the * RTP and RTCP packets. - * + * * This function is a convenience that helps to avoid dealing directly * with the policy data structure. You are encouraged to initialize * policy elements with this function call. Doing so may allow your @@ -821,7 +822,7 @@ crypto_policy_set_aes_gcm_256_8_only_auth(crypto_policy_t *p); * include more elements in the crypto_policy_t datatype. * * @return void. - * + * */ void crypto_policy_set_aes_gcm_128_16_auth(crypto_policy_t *p); @@ -830,14 +831,14 @@ crypto_policy_set_aes_gcm_128_16_auth(crypto_policy_t *p); * @brief crypto_policy_set_aes_gcm_256_16_auth() sets a crypto * policy structure to an AEAD encryption policy * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function call crypto_policy_set_aes_gcm_256_16_auth(&p) sets * the crypto_policy_t at location p to use the SRTP default cipher - * (AES-256 Galois Counter Mode) with 16 octet auth tag. This + * (AES-256 Galois Counter Mode) with 16 octet auth tag. This * policy applies confidentiality and authentication to both the * RTP and RTCP packets. - * + * * This function is a convenience that helps to avoid dealing directly * with the policy data structure. You are encouraged to initialize * policy elements with this function call. Doing so may allow your @@ -845,7 +846,7 @@ crypto_policy_set_aes_gcm_128_16_auth(crypto_policy_t *p); * include more elements in the crypto_policy_t datatype. * * @return void. - * + * */ void crypto_policy_set_aes_gcm_256_16_auth(crypto_policy_t *p); @@ -854,7 +855,7 @@ crypto_policy_set_aes_gcm_256_16_auth(crypto_policy_t *p); /** * @brief srtp_dealloc() deallocates storage for an SRTP session * context. - * + * * The function call srtp_dealloc(s) deallocates storage for the * SRTP session context s. This function should be called no more * than one time for each of the contexts allocated by the function @@ -872,7 +873,7 @@ srtp_dealloc(srtp_t s); /* - * @brief identifies a particular SRTP profile + * @brief identifies a particular SRTP profile * * An srtp_profile_t enumeration is used to identify a particular SRTP * profile (that is, a set of algorithms and parameters). These @@ -880,13 +881,13 @@ srtp_dealloc(srtp_t s); */ typedef enum { - srtp_profile_reserved = 0, - srtp_profile_aes128_cm_sha1_80 = 1, - srtp_profile_aes128_cm_sha1_32 = 2, - srtp_profile_aes256_cm_sha1_80 = 3, - srtp_profile_aes256_cm_sha1_32 = 4, - srtp_profile_null_sha1_80 = 5, - srtp_profile_null_sha1_32 = 6, + srtp_profile_reserved = 0, + srtp_profile_aes128_cm_sha1_80 = 1, + srtp_profile_aes128_cm_sha1_32 = 2, + srtp_profile_aes256_cm_sha1_80 = 3, + srtp_profile_aes256_cm_sha1_32 = 4, + srtp_profile_null_sha1_80 = 5, + srtp_profile_null_sha1_32 = 6, } srtp_profile_t; @@ -894,26 +895,26 @@ typedef enum { * @brief crypto_policy_set_from_profile_for_rtp() sets a crypto policy * structure to the appropriate value for RTP based on an srtp_profile_t * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function call crypto_policy_set_rtp_default(&policy, profile) * sets the crypto_policy_t at location policy to the policy for RTP * protection, as defined by the srtp_profile_t profile. - * + * * This function is a convenience that helps to avoid dealing directly * with the policy data structure. You are encouraged to initialize * policy elements with this function call. Doing so may allow your * code to be forward compatible with later versions of libSRTP that * include more elements in the crypto_policy_t datatype. - * + * * @return values * - err_status_ok no problems were encountered - * - err_status_bad_param the profile is not supported - * + * - err_status_bad_param the profile is not supported + * */ err_status_t -crypto_policy_set_from_profile_for_rtp(crypto_policy_t *policy, - srtp_profile_t profile); +crypto_policy_set_from_profile_for_rtp(crypto_policy_t *policy, + srtp_profile_t profile); @@ -922,26 +923,26 @@ crypto_policy_set_from_profile_for_rtp(crypto_policy_t *policy, * @brief crypto_policy_set_from_profile_for_rtcp() sets a crypto policy * structure to the appropriate value for RTCP based on an srtp_profile_t * - * @param p is a pointer to the policy structure to be set - * + * @param p is a pointer to the policy structure to be set + * * The function call crypto_policy_set_rtcp_default(&policy, profile) * sets the crypto_policy_t at location policy to the policy for RTCP * protection, as defined by the srtp_profile_t profile. - * + * * This function is a convenience that helps to avoid dealing directly * with the policy data structure. You are encouraged to initialize * policy elements with this function call. Doing so may allow your * code to be forward compatible with later versions of libSRTP that * include more elements in the crypto_policy_t datatype. - * + * * @return values * - err_status_ok no problems were encountered - * - err_status_bad_param the profile is not supported - * + * - err_status_bad_param the profile is not supported + * */ err_status_t -crypto_policy_set_from_profile_for_rtcp(crypto_policy_t *policy, - srtp_profile_t profile); +crypto_policy_set_from_profile_for_rtcp(crypto_policy_t *policy, + srtp_profile_t profile); /** * @brief returns the master key length for a given SRTP profile @@ -959,18 +960,18 @@ srtp_profile_get_master_salt_length(srtp_profile_t profile); /** * @brief appends the salt to the key * - * The function call append_salt_to_key(k, klen, s, slen) + * The function call append_salt_to_key(k, klen, s, slen) * copies the string s to the location at klen bytes following - * the location k. + * the location k. * * @warning There must be at least bytes_in_salt + bytes_in_key bytes * available at the location pointed to by key. - * + * */ void append_salt_to_key(unsigned char *key, unsigned int bytes_in_key, - unsigned char *salt, unsigned int bytes_in_salt); + unsigned char *salt, unsigned int bytes_in_salt); @@ -982,7 +983,7 @@ append_salt_to_key(unsigned char *key, unsigned int bytes_in_key, /** * @defgroup SRTCP Secure RTCP - * @ingroup SRTP + * @ingroup SRTP * * @brief Secure RTCP functions are used to protect RTCP traffic. * @@ -990,36 +991,36 @@ append_salt_to_key(unsigned char *key, unsigned int bytes_in_key, * traffic in much the same way as it does RTP traffic. The function * srtp_protect_rtcp() applies cryptographic protections to outbound * RTCP packets, and srtp_unprotect_rtcp() verifies the protections on - * inbound RTCP packets. + * inbound RTCP packets. * * A note on the naming convention: srtp_protect_rtcp() has an srtp_t * as its first argument, and thus has `srtp_' as its prefix. The - * trailing `_rtcp' indicates the protocol on which it acts. - * + * trailing `_rtcp' indicates the protocol on which it acts. + * * @{ */ /** * @brief srtp_protect_rtcp() is the Secure RTCP sender-side packet * processing function. - * + * * The function call srtp_protect_rtcp(ctx, rtp_hdr, len_ptr) applies * SRTCP protection to the RTCP packet rtcp_hdr (which has length * *len_ptr) using the SRTP session context ctx. If err_status_ok is * returned, then rtp_hdr points to the resulting SRTCP packet and * *len_ptr is the number of octets in that packet; otherwise, no * assumptions should be made about the value of either data elements. - * + * * @warning This function assumes that it can write the authentication * tag into the location in memory immediately following the RTCP * packet, and assumes that the RTCP packet is aligned on a 32-bit * boundary. * - * @warning This function assumes that it can write SRTP_MAX_TRAILER_LEN+4 - * into the location in memory immediately following the RTCP packet. - * Callers MUST ensure that this much writable memory is available in + * @warning This function assumes that it can write SRTP_MAX_TRAILER_LEN+4 + * into the location in memory immediately following the RTCP packet. + * Callers MUST ensure that this much writable memory is available in * the buffer that holds the RTCP packet. - * + * * @param ctx is the SRTP context to use in processing the packet. * * @param rtcp_hdr is a pointer to the RTCP packet (before the call); after @@ -1031,14 +1032,14 @@ append_salt_to_key(unsigned char *key, unsigned int bytes_in_key, * was returned. Otherwise, the value of the data to which it points * is undefined. * - * @return + * @return * - err_status_ok if there were no problems. - * - [other] if there was a failure in + * - [other] if there was a failure in * the cryptographic mechanisms. */ - -err_status_t + +err_status_t srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len); /** @@ -1052,7 +1053,7 @@ srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len); * to the resulting RTCP packet and *len_ptr is the number of octets * in that packet; otherwise, no assumptions should be made about the * value of either data elements. - * + * * @warning This function assumes that the SRTCP packet is aligned on a * 32-bit boundary. * @@ -1070,9 +1071,9 @@ srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len); * returned. Otherwise, the value of the data to which it points is * undefined. * - * @return + * @return * - err_status_ok if the RTCP packet is valid. - * - err_status_auth_fail if the SRTCP packet failed the message + * - err_status_auth_fail if the SRTCP packet failed the message * authentication check. * - err_status_replay_fail if the SRTCP packet is a replay (e.g. has * already been processed and accepted). @@ -1080,7 +1081,7 @@ srtp_protect_rtcp(srtp_t ctx, void *rtcp_hdr, int *pkt_octet_len); * */ -err_status_t +err_status_t srtp_unprotect_rtcp(srtp_t ctx, void *srtcp_hdr, int *pkt_octet_len); /** @@ -1142,10 +1143,10 @@ srtp_get_user_data(srtp_t ctx); * @defgroup SRTPevents SRTP events and callbacks * @ingroup SRTP * - * @brief libSRTP can use a user-provided callback function to + * @brief libSRTP can use a user-provided callback function to * handle events. * - * + * * libSRTP allows a user to provide a callback function to handle * events that need to be dealt with outside of the data plane (see * the enum srtp_event_t for a description of these events). Dealing @@ -1166,8 +1167,8 @@ srtp_get_user_data(srtp_t ctx); * @brief srtp_event_t defines events that need to be handled * * The enum srtp_event_t defines events that need to be handled - * outside the `data plane', such as SSRC collisions and - * key expirations. + * outside the `data plane', such as SSRC collisions and + * key expirations. * * When a key expires or the maximum number of packets has been * reached, an SRTP stream will enter an `expired' state in which no @@ -1180,33 +1181,33 @@ srtp_get_user_data(srtp_t ctx); * latter case, all of the streams in the session will expire. */ -typedef enum { - event_ssrc_collision, /**< - * An SSRC collision occured. +typedef enum { + event_ssrc_collision, /**< + * An SSRC collision occured. */ - event_key_soft_limit, /**< An SRTP stream reached the soft key - * usage limit and will expire soon. + event_key_soft_limit, /**< An SRTP stream reached the soft key + * usage limit and will expire soon. */ - event_key_hard_limit, /**< An SRTP stream reached the hard + event_key_hard_limit, /**< An SRTP stream reached the hard * key usage limit and has expired. */ - event_packet_index_limit /**< An SRTP stream reached the hard - * packet limit (2^48 packets). + event_packet_index_limit /**< An SRTP stream reached the hard + * packet limit (2^48 packets). */ } srtp_event_t; /** - * @brief srtp_event_data_t is the structure passed as a callback to + * @brief srtp_event_data_t is the structure passed as a callback to * the event handler function * * The struct srtp_event_data_t holds the data passed to the event - * handler function. + * handler function. */ typedef struct srtp_event_data_t { - srtp_t session; /**< The session in which the event happend. */ - srtp_stream_t stream; /**< The stream in which the event happend. */ - srtp_event_t event; /**< An enum indicating the type of event. */ + srtp_t session; /**< The session in which the event happend. */ + srtp_stream_t stream; /**< The stream in which the event happend. */ + srtp_event_t event; /**< An enum indicating the type of event. */ } srtp_event_data_t; /** @@ -1224,7 +1225,7 @@ typedef void (srtp_event_handler_func_t)(srtp_event_data_t *data); /** * @brief sets the event handler to the function supplied by the caller. - * + * * The function call srtp_install_event_handler(func) sets the event * handler function to the value func. The value NULL is acceptable * as an argument; in this case, events will be ignored rather than @@ -1239,14 +1240,14 @@ err_status_t srtp_install_event_handler(srtp_event_handler_func_t func); /** - * @brief Returns the version string of the library. - * + * @brief Returns the version string of the library. + * */ const char *srtp_get_version_string(void); /** - * @brief Returns the numeric representation of the library version. - * + * @brief Returns the numeric representation of the library version. + * */ unsigned int srtp_get_version(void); diff --git a/thirdparties/mac/include/srtp/srtp_priv.h b/thirdparties/mac/include/srtp/srtp_priv.h index 170df5b..f925c1f 100755 --- a/thirdparties/mac/include/srtp/srtp_priv.h +++ b/thirdparties/mac/include/srtp/srtp_priv.h @@ -7,26 +7,26 @@ * Cisco Systems, Inc. */ /* - * + * * Copyright (c) 2001-2006 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 @@ -64,56 +64,56 @@ * an srtp_hdr_t represents the srtp header * * in this implementation, an srtp_hdr_t is assumed to be 32-bit aligned - * + * * (note that this definition follows that of RFC 1889 Appendix A, but * is not identical) */ - + #ifndef WORDS_BIGENDIAN /* * srtp_hdr_t represents an RTP or SRTP header. The bit-fields in - * this structure should be declared "unsigned int" instead of + * this structure should be declared "unsigned int" instead of * "unsigned char", but doing so causes the MS compiler to not * fully pack the bit fields. */ typedef struct { - unsigned char cc:4; /* CSRC count */ - unsigned char x:1; /* header extension flag */ - unsigned char p:1; /* padding flag */ - unsigned char version:2; /* protocol version */ - unsigned char pt:7; /* payload type */ - unsigned char m:1; /* marker bit */ - uint16_t seq; /* sequence number */ - uint32_t ts; /* timestamp */ - uint32_t ssrc; /* synchronization source */ + unsigned char cc:4; /* CSRC count */ + unsigned char x:1; /* header extension flag */ + unsigned char p:1; /* padding flag */ + unsigned char version:2; /* protocol version */ + unsigned char pt:7; /* payload type */ + unsigned char m:1; /* marker bit */ + uint16_t seq; /* sequence number */ + uint32_t ts; /* timestamp */ + uint32_t ssrc; /* synchronization source */ } srtp_hdr_t; #else /* BIG_ENDIAN */ typedef struct { - unsigned char version:2; /* protocol version */ - unsigned char p:1; /* padding flag */ - unsigned char x:1; /* header extension flag */ - unsigned char cc:4; /* CSRC count */ - unsigned char m:1; /* marker bit */ - unsigned char pt:7; /* payload type */ - uint16_t seq; /* sequence number */ - uint32_t ts; /* timestamp */ - uint32_t ssrc; /* synchronization source */ + unsigned char version:2; /* protocol version */ + unsigned char p:1; /* padding flag */ + unsigned char x:1; /* header extension flag */ + unsigned char cc:4; /* CSRC count */ + unsigned char m:1; /* marker bit */ + unsigned char pt:7; /* payload type */ + uint16_t seq; /* sequence number */ + uint32_t ts; /* timestamp */ + uint32_t ssrc; /* synchronization source */ } srtp_hdr_t; #endif typedef struct { - uint16_t profile_specific; /* profile-specific info */ - uint16_t length; /* number of 32-bit words in extension */ + uint16_t profile_specific; /* profile-specific info */ + uint16_t length; /* number of 32-bit words in extension */ } srtp_hdr_xtnd_t; /* - * srtcp_hdr_t represents a secure rtcp header + * srtcp_hdr_t represents a secure rtcp header * * in this implementation, an srtcp header is assumed to be 32-bit * alinged @@ -122,53 +122,53 @@ typedef struct { #ifndef WORDS_BIGENDIAN typedef struct { - unsigned char rc:5; /* reception report count */ - unsigned char p:1; /* padding flag */ - unsigned char version:2; /* protocol version */ - unsigned char pt:8; /* payload type */ - uint16_t len; /* length */ - uint32_t ssrc; /* synchronization source */ + unsigned char rc:5; /* reception report count */ + unsigned char p:1; /* padding flag */ + unsigned char version:2; /* protocol version */ + unsigned char pt:8; /* payload type */ + uint16_t len; /* length */ + uint32_t ssrc; /* synchronization source */ } srtcp_hdr_t; typedef struct { - unsigned int index:31; /* srtcp packet index in network order! */ - unsigned int e:1; /* encrypted? 1=yes */ - /* optional mikey/etc go here */ - /* and then the variable-length auth tag */ + unsigned int index:31; /* srtcp packet index in network order! */ + unsigned int e:1; /* encrypted? 1=yes */ + /* optional mikey/etc go here */ + /* and then the variable-length auth tag */ } srtcp_trailer_t; #else /* BIG_ENDIAN */ typedef struct { - unsigned char version:2; /* protocol version */ - unsigned char p:1; /* padding flag */ - unsigned char rc:5; /* reception report count */ - unsigned char pt:8; /* payload type */ - uint16_t len; /* length */ - uint32_t ssrc; /* synchronization source */ + unsigned char version:2; /* protocol version */ + unsigned char p:1; /* padding flag */ + unsigned char rc:5; /* reception report count */ + unsigned char pt:8; /* payload type */ + uint16_t len; /* length */ + uint32_t ssrc; /* synchronization source */ } srtcp_hdr_t; typedef struct { - unsigned int version:2; /* protocol version */ - unsigned int p:1; /* padding flag */ - unsigned int count:5; /* varies by packet type */ - unsigned int pt:8; /* payload type */ - uint16_t length; /* len of uint32s of packet less header */ + unsigned int version:2; /* protocol version */ + unsigned int p:1; /* padding flag */ + unsigned int count:5; /* varies by packet type */ + unsigned int pt:8; /* payload type */ + uint16_t length; /* len of uint32s of packet less header */ } rtcp_common_t; typedef struct { - unsigned int e:1; /* encrypted? 1=yes */ - unsigned int index:31; /* srtcp packet index */ - /* optional mikey/etc go here */ - /* and then the variable-length auth tag */ + unsigned int e:1; /* encrypted? 1=yes */ + unsigned int index:31; /* srtcp packet index */ + /* optional mikey/etc go here */ + /* and then the variable-length auth tag */ } srtcp_trailer_t; #endif /* - * the following declarations are libSRTP internal functions + * the following declarations are libSRTP internal functions */ /* @@ -176,7 +176,7 @@ typedef struct { * to ssrc, or NULL if no stream exists for that ssrc */ -srtp_stream_t +srtp_stream_t srtp_get_stream(srtp_t srtp, uint32_t ssrc); @@ -190,49 +190,49 @@ err_status_t srtp_stream_init_keys(srtp_stream_t srtp, const void *key); /* - * srtp_stream_init(s, p) initializes the srtp_stream_t s to + * srtp_stream_init(s, p) initializes the srtp_stream_t s to * use the policy at the location p */ err_status_t -srtp_stream_init(srtp_stream_t srtp, - const srtp_policy_t *p); +srtp_stream_init(srtp_stream_t srtp, + const srtp_policy_t *p); /* - * libsrtp internal datatypes + * libsrtp internal datatypes */ -typedef enum direction_t { - dir_unknown = 0, - dir_srtp_sender = 1, - dir_srtp_receiver = 2 +typedef enum direction_t { + dir_unknown = 0, + dir_srtp_sender = 1, + dir_srtp_receiver = 2 } direction_t; -/* +/* * an srtp_stream_t has its own SSRC, encryption key, authentication * key, sequence number, and replay database - * + * * note that the keys might not actually be unique, in which case the * cipher_t and auth_t pointers will point to the same structures */ typedef struct srtp_stream_ctx_t { - uint32_t ssrc; - cipher_t *rtp_cipher; - auth_t *rtp_auth; - rdbx_t rtp_rdbx; - sec_serv_t rtp_services; - cipher_t *rtcp_cipher; - auth_t *rtcp_auth; - rdb_t rtcp_rdb; - sec_serv_t rtcp_services; - key_limit_ctx_t *limit; - direction_t direction; - int allow_repeat_tx; - ekt_stream_t ekt; - uint8_t salt[SRTP_AEAD_SALT_LEN]; /* used with GCM mode for SRTP */ - uint8_t c_salt[SRTP_AEAD_SALT_LEN]; /* used with GCM mode for SRTCP */ - struct srtp_stream_ctx_t *next; /* linked list of streams */ + uint32_t ssrc; + cipher_t *rtp_cipher; + auth_t *rtp_auth; + rdbx_t rtp_rdbx; + sec_serv_t rtp_services; + cipher_t *rtcp_cipher; + auth_t *rtcp_auth; + rdb_t rtcp_rdb; + sec_serv_t rtcp_services; + key_limit_ctx_t *limit; + direction_t direction; + int allow_repeat_tx; + ekt_stream_t ekt; + uint8_t salt[SRTP_AEAD_SALT_LEN]; /* used with GCM mode for SRTP */ + uint8_t c_salt[SRTP_AEAD_SALT_LEN]; /* used with GCM mode for SRTCP */ + struct srtp_stream_ctx_t *next; /* linked list of streams */ } srtp_stream_ctx_t; @@ -241,9 +241,9 @@ typedef struct srtp_stream_ctx_t { */ typedef struct srtp_ctx_t { - srtp_stream_ctx_t *stream_list; /* linked list of streams */ - srtp_stream_ctx_t *stream_template; /* act as template for other streams */ - void *user_data; /* user custom data */ + srtp_stream_ctx_t *stream_list; /* linked list of streams */ + srtp_stream_ctx_t *stream_template; /* act as template for other streams */ + void *user_data; /* user custom data */ } srtp_ctx_t; @@ -252,7 +252,7 @@ typedef struct srtp_ctx_t { * srtp_handle_event(srtp, srtm, evnt) calls the event handling * function, if there is one. * - * This macro is not included in the documentation as it is + * This macro is not included in the documentation as it is * an internal-only function. */ @@ -263,7 +263,7 @@ typedef struct srtp_ctx_t { data.stream = strm; \ data.event = evnt; \ srtp_event_handler(&data); \ -} +} #endif /* SRTP_PRIV_H */ diff --git a/thirdparties/mac/include/srtp/stat.h b/thirdparties/mac/include/srtp/stat.h index e28b131..a67a380 100755 --- a/thirdparties/mac/include/srtp/stat.h +++ b/thirdparties/mac/include/srtp/stat.h @@ -1,6 +1,6 @@ /* * stats.h - * + * * interface to statistical test functions * * David A. McGrew @@ -8,26 +8,26 @@ */ /* - * + * * Copyright(c) 2001-2006, 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 diff --git a/thirdparties/mac/include/srtp/ut_sim.h b/thirdparties/mac/include/srtp/ut_sim.h index c25feeb..bd7d015 100755 --- a/thirdparties/mac/include/srtp/ut_sim.h +++ b/thirdparties/mac/include/srtp/ut_sim.h @@ -9,26 +9,26 @@ */ /* - * + * * Copyright (c) 2001-2006, 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 @@ -54,12 +54,12 @@ #define UT_BUF 160 /* maximum amount of packet reorder */ typedef struct { - uint32_t index; - uint32_t buffer[UT_BUF]; + uint32_t index; + uint32_t buffer[UT_BUF]; } ut_connection; /* - * ut_init(&u) initializes the ut_connection + * ut_init(&u) initializes the ut_connection * * this function should always be the first one called on a new * ut_connection diff --git a/thirdparties/mac/include/srtp/xfm.h b/thirdparties/mac/include/srtp/xfm.h index 80774f9..f46a672 100755 --- a/thirdparties/mac/include/srtp/xfm.h +++ b/thirdparties/mac/include/srtp/xfm.h @@ -2,32 +2,32 @@ * xfm.h * * interface for abstract crypto transform - * + * * David A. McGrew * Cisco Systems, Inc. */ /* - * + * * Copyright (c) 2001-2006, 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 @@ -64,12 +64,12 @@ * The function pointer xfm_func_t points to a function that * implements a crypto transform, and provides a uniform API for * accessing crypto mechanisms. - * - * @param key location of secret key * - * @param clear data to be authenticated only + * @param key location of secret key + * + * @param clear data to be authenticated only * - * @param clear_len length of data to be authenticated only + * @param clear_len length of data to be authenticated only * * @param iv location to write the Initialization Vector (IV) * @@ -81,38 +81,38 @@ * encrypted and authenticated (before the function call), and the * length of the ciphertext (after the call) * - * @param auth_tag location to write auth tag + * @param auth_tag location to write auth tag */ -typedef err_status_t (*xfm_func_t) - (void *key, - void *clear, - unsigned clear_len, - void *iv, - void *protect, - unsigned *protected_len, - void *auth_tag - ); - -typedef +typedef err_status_t (*xfm_func_t) +(void *key, + void *clear, + unsigned clear_len, + void *iv, + void *protect, + unsigned *protected_len, + void *auth_tag +); + +typedef err_status_t (*xfm_inv_t) - (void *key, /* location of secret key */ - void *clear, /* data to be authenticated only */ - unsigned clear_len, /* length of data to be authenticated only */ - void *iv, /* location of iv */ - void *opaque, /* data to be decrypted and authenticated */ - unsigned *opaque_len, /* location of the length of data to be - * decrypted and authd (before and after) +(void *key, /* location of secret key */ + void *clear, /* data to be authenticated only */ + unsigned clear_len, /* length of data to be authenticated only */ + void *iv, /* location of iv */ + void *opaque, /* data to be decrypted and authenticated */ + unsigned *opaque_len, /* location of the length of data to be + * decrypted and authd (before and after) */ - void *auth_tag /* location of auth tag */ - ); + void *auth_tag /* location of auth tag */ +); typedef struct xfm_ctx_t { - xfm_func_t func; - xfm_inv_t inv; - unsigned key_len; - unsigned iv_len; - unsigned auth_tag_len; + xfm_func_t func; + xfm_inv_t inv; + unsigned key_len; + unsigned iv_len; + unsigned auth_tag_len; } xfm_ctx_t; typedef xfm_ctx_t *xfm_t; @@ -125,35 +125,35 @@ typedef xfm_ctx_t *xfm_t; /* cryptoalgo - 5/28 */ - -typedef err_status_t (*cryptoalg_func_t) - (void *key, - void *clear, - unsigned clear_len, - void *iv, - void *opaque, - unsigned *opaque_len - ); - -typedef + +typedef err_status_t (*cryptoalg_func_t) +(void *key, + void *clear, + unsigned clear_len, + void *iv, + void *opaque, + unsigned *opaque_len +); + +typedef err_status_t (*cryptoalg_inv_t) - (void *key, /* location of secret key */ - void *clear, /* data to be authenticated only */ - unsigned clear_len, /* length of data to be authenticated only */ - void *iv, /* location of iv */ - void *opaque, /* data to be decrypted and authenticated */ - unsigned *opaque_len /* location of the length of data to be - * decrypted and authd (before and after) +(void *key, /* location of secret key */ + void *clear, /* data to be authenticated only */ + unsigned clear_len, /* length of data to be authenticated only */ + void *iv, /* location of iv */ + void *opaque, /* data to be decrypted and authenticated */ + unsigned *opaque_len /* location of the length of data to be + * decrypted and authd (before and after) */ - ); +); typedef struct cryptoalg_ctx_t { - cryptoalg_func_t enc; - cryptoalg_inv_t dec; - unsigned key_len; - unsigned iv_len; - unsigned auth_tag_len; - unsigned max_expansion; + cryptoalg_func_t enc; + cryptoalg_inv_t dec; + unsigned key_len; + unsigned iv_len; + unsigned auth_tag_len; + unsigned max_expansion; } cryptoalg_ctx_t; typedef cryptoalg_ctx_t *cryptoalg_t; diff --git a/thirdparties/mac/include/vpx/vp8.h b/thirdparties/mac/include/vpx/vp8.h index 2952203..1a6c594 100755 --- a/thirdparties/mac/include/vpx/vp8.h +++ b/thirdparties/mac/include/vpx/vp8.h @@ -36,8 +36,7 @@ * * The set of macros define the control functions of VP8 interface */ -enum vp8_com_control_id -{ +enum vp8_com_control_id { VP8_SET_REFERENCE = 1, /**< pass in an external frame into decoder to be used as reference frame */ VP8_COPY_REFERENCE = 2, /**< get a copy of reference frame from the decoder */ VP8_SET_POSTPROC = 3, /**< set the decoder's post processing settings */ @@ -53,8 +52,7 @@ enum vp8_com_control_id * * The set of macros define VP8 decoder post processing flags */ -enum vp8_postproc_level -{ +enum vp8_postproc_level { VP8_NOFILTERING = 0, VP8_DEBLOCK = 1<<0, VP8_DEMACROBLOCK = 1<<1, @@ -73,8 +71,7 @@ enum vp8_postproc_level * to VP8_DEBLOCK and deblocking_level to 1. */ -typedef struct vp8_postproc_cfg -{ +typedef struct vp8_postproc_cfg { int post_proc_flag; /**< the types of post processing to be done, should be combination of "vp8_postproc_level" */ int deblocking_level; /**< the strength of deblocking, valid range [0, 16] */ int noise_level; /**< the strength of additive noise, valid range [0, 16] */ @@ -84,8 +81,7 @@ typedef struct vp8_postproc_cfg * * The set of macros define the type of VP8 reference frames */ -typedef enum vpx_ref_frame_type -{ +typedef enum vpx_ref_frame_type { VP8_LAST_FRAME = 1, VP8_GOLD_FRAME = 2, VP8_ALTR_FRAME = 4 @@ -96,8 +92,7 @@ typedef enum vpx_ref_frame_type * define the data struct to access vp8 reference frames */ -typedef struct vpx_ref_frame -{ +typedef struct vpx_ref_frame { vpx_ref_frame_type_t frame_type; /**< which reference frame */ vpx_image_t img; /**< reference frame data in image format */ } vpx_ref_frame_t; diff --git a/thirdparties/mac/include/vpx/vp8cx.h b/thirdparties/mac/include/vpx/vp8cx.h index 0af631c..0afdeab 100755 --- a/thirdparties/mac/include/vpx/vp8cx.h +++ b/thirdparties/mac/include/vpx/vp8cx.h @@ -121,8 +121,7 @@ extern vpx_codec_iface_t* vpx_codec_vp8_cx(void); * * \sa #vpx_codec_control */ -enum vp8e_enc_control_id -{ +enum vp8e_enc_control_id { VP8E_UPD_ENTROPY = 5, /**< control function to set mode of entropy update in encoder */ VP8E_UPD_REFERENCE, /**< control function to set reference update mode in encoder */ VP8E_USE_REFERENCE, /**< control function to set which reference frame encoder can use */ @@ -184,8 +183,7 @@ enum vp8e_enc_control_id * * This set of constants define 1-D vpx scaling modes */ -typedef enum vpx_scaling_mode_1d -{ +typedef enum vpx_scaling_mode_1d { VP8E_NORMAL = 0, VP8E_FOURFIVE = 1, VP8E_THREEFIVE = 2, @@ -199,8 +197,7 @@ typedef enum vpx_scaling_mode_1d * */ -typedef struct vpx_roi_map -{ +typedef struct vpx_roi_map { unsigned char *roi_map; /**< specify an id between 0 and 3 for each 16x16 region within a frame */ unsigned int rows; /**< number of rows */ unsigned int cols; /**< number of cols */ @@ -216,8 +213,7 @@ typedef struct vpx_roi_map */ -typedef struct vpx_active_map -{ +typedef struct vpx_active_map { unsigned char *active_map; /**< specify an on (1) or off (0) each 16x16 region within a frame */ unsigned int rows; /**< number of rows */ unsigned int cols; /**< number of cols */ @@ -228,8 +224,7 @@ typedef struct vpx_active_map * This defines the data structure for image scaling mode * */ -typedef struct vpx_scaling_mode -{ +typedef struct vpx_scaling_mode { VPX_SCALING_MODE h_scaling_mode; /**< horizontal scaling mode */ VPX_SCALING_MODE v_scaling_mode; /**< vertical scaling mode */ } vpx_scaling_mode_t; @@ -239,8 +234,7 @@ typedef struct vpx_scaling_mode * This defines VP8 encoding mode * */ -typedef enum -{ +typedef enum { VP8_BEST_QUALITY_ENCODING, VP8_GOOD_QUALITY_ENCODING, VP8_REAL_TIME_ENCODING @@ -253,8 +247,7 @@ typedef enum * */ -typedef enum -{ +typedef enum { VP8_ONE_TOKENPARTITION = 0, VP8_TWO_TOKENPARTITION = 1, VP8_FOUR_TOKENPARTITION = 2, @@ -267,8 +260,7 @@ typedef enum * Changes the encoder to tune for certain types of input material. * */ -typedef enum -{ +typedef enum { VP8_TUNE_PSNR, VP8_TUNE_SSIM } vp8e_tuning; diff --git a/thirdparties/mac/include/vpx/vp8dx.h b/thirdparties/mac/include/vpx/vp8dx.h index 8661035..d8a5534 100755 --- a/thirdparties/mac/include/vpx/vp8dx.h +++ b/thirdparties/mac/include/vpx/vp8dx.h @@ -45,8 +45,7 @@ extern vpx_codec_iface_t* vpx_codec_vp8_dx(void); * * \sa #vpx_codec_control */ -enum vp8_dec_control_id -{ +enum vp8_dec_control_id { /** control function to get info on which reference frames were updated * by the last decode */ diff --git a/thirdparties/mac/include/vpx/vp8e.h b/thirdparties/mac/include/vpx/vp8e.h index ca907c9..4ad8d22 100755 --- a/thirdparties/mac/include/vpx/vp8e.h +++ b/thirdparties/mac/include/vpx/vp8e.h @@ -24,8 +24,7 @@ DECLSPEC_DEPRECATED extern vpx_codec_iface_t vpx_enc_vp8_algo DEPRECATED; -enum -{ +enum { VP8E_SET_REFERENCE = VP8_SET_REFERENCE, VP8E_COPY_REFERENCE = VP8_COPY_REFERENCE, VP8E_SET_PREVIEWPP = VP8_SET_POSTPROC, diff --git a/thirdparties/mac/include/vpx/vpx_codec.h b/thirdparties/mac/include/vpx/vpx_codec.h index d92e165..cad4078 100755 --- a/thirdparties/mac/include/vpx/vpx_codec.h +++ b/thirdparties/mac/include/vpx/vpx_codec.h @@ -45,7 +45,7 @@ extern "C" { #include "vpx_integer.h" #include "vpx_image.h" - /*!\brief Decorator indicating a function is deprecated */ +/*!\brief Decorator indicating a function is deprecated */ #ifndef DEPRECATED #if defined(__GNUC__) && __GNUC__ #define DEPRECATED __attribute__ ((deprecated)) @@ -59,7 +59,7 @@ extern "C" { #endif #endif - /*!\brief Decorator indicating a function is potentially unused */ +/*!\brief Decorator indicating a function is potentially unused */ #ifdef UNUSED #elif __GNUC__ #define UNUSED __attribute__ ((unused)) @@ -67,312 +67,310 @@ extern "C" { #define UNUSED #endif - /*!\brief Current ABI version number +/*!\brief Current ABI version number + * + * \internal + * If this file is altered in any way that changes the ABI, this value + * must be bumped. Examples include, but are not limited to, changing + * types, removing or reassigning enums, adding/removing/rearranging + * fields to structures + */ +#define VPX_CODEC_ABI_VERSION (2 + VPX_IMAGE_ABI_VERSION) /**<\hideinitializer*/ + +/*!\brief Algorithm return codes */ +typedef enum { + /*!\brief Operation completed without error */ + VPX_CODEC_OK, + + /*!\brief Unspecified error */ + VPX_CODEC_ERROR, + + /*!\brief Memory operation failed */ + VPX_CODEC_MEM_ERROR, + + /*!\brief ABI version mismatch */ + VPX_CODEC_ABI_MISMATCH, + + /*!\brief Algorithm does not have required capability */ + VPX_CODEC_INCAPABLE, + + /*!\brief The given bitstream is not supported. + * + * The bitstream was unable to be parsed at the highest level. The decoder + * is unable to proceed. This error \ref SHOULD be treated as fatal to the + * stream. */ + VPX_CODEC_UNSUP_BITSTREAM, + + /*!\brief Encoded bitstream uses an unsupported feature * - * \internal - * If this file is altered in any way that changes the ABI, this value - * must be bumped. Examples include, but are not limited to, changing - * types, removing or reassigning enums, adding/removing/rearranging - * fields to structures + * The decoder does not implement a feature required by the encoder. This + * return code should only be used for features that prevent future + * pictures from being properly decoded. This error \ref MAY be treated as + * fatal to the stream or \ref MAY be treated as fatal to the current GOP. */ -#define VPX_CODEC_ABI_VERSION (2 + VPX_IMAGE_ABI_VERSION) /**<\hideinitializer*/ + VPX_CODEC_UNSUP_FEATURE, - /*!\brief Algorithm return codes */ - typedef enum { - /*!\brief Operation completed without error */ - VPX_CODEC_OK, - - /*!\brief Unspecified error */ - VPX_CODEC_ERROR, - - /*!\brief Memory operation failed */ - VPX_CODEC_MEM_ERROR, - - /*!\brief ABI version mismatch */ - VPX_CODEC_ABI_MISMATCH, - - /*!\brief Algorithm does not have required capability */ - VPX_CODEC_INCAPABLE, - - /*!\brief The given bitstream is not supported. - * - * The bitstream was unable to be parsed at the highest level. The decoder - * is unable to proceed. This error \ref SHOULD be treated as fatal to the - * stream. */ - VPX_CODEC_UNSUP_BITSTREAM, - - /*!\brief Encoded bitstream uses an unsupported feature - * - * The decoder does not implement a feature required by the encoder. This - * return code should only be used for features that prevent future - * pictures from being properly decoded. This error \ref MAY be treated as - * fatal to the stream or \ref MAY be treated as fatal to the current GOP. - */ - VPX_CODEC_UNSUP_FEATURE, - - /*!\brief The coded data for this stream is corrupt or incomplete - * - * There was a problem decoding the current frame. This return code - * should only be used for failures that prevent future pictures from - * being properly decoded. This error \ref MAY be treated as fatal to the - * stream or \ref MAY be treated as fatal to the current GOP. If decoding - * is continued for the current GOP, artifacts may be present. - */ - VPX_CODEC_CORRUPT_FRAME, - - /*!\brief An application-supplied parameter is not valid. - * - */ - VPX_CODEC_INVALID_PARAM, - - /*!\brief An iterator reached the end of list. - * - */ - VPX_CODEC_LIST_END - - } - vpx_codec_err_t; - - - /*! \brief Codec capabilities bitfield + /*!\brief The coded data for this stream is corrupt or incomplete * - * Each codec advertises the capabilities it supports as part of its - * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces - * or functionality, and are not required to be supported. + * There was a problem decoding the current frame. This return code + * should only be used for failures that prevent future pictures from + * being properly decoded. This error \ref MAY be treated as fatal to the + * stream or \ref MAY be treated as fatal to the current GOP. If decoding + * is continued for the current GOP, artifacts may be present. + */ + VPX_CODEC_CORRUPT_FRAME, + + /*!\brief An application-supplied parameter is not valid. + * + */ + VPX_CODEC_INVALID_PARAM, + + /*!\brief An iterator reached the end of list. * - * The available flags are specified by VPX_CODEC_CAP_* defines. */ - typedef long vpx_codec_caps_t; + VPX_CODEC_LIST_END + +} +vpx_codec_err_t; + + +/*! \brief Codec capabilities bitfield + * + * Each codec advertises the capabilities it supports as part of its + * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces + * or functionality, and are not required to be supported. + * + * The available flags are specified by VPX_CODEC_CAP_* defines. + */ +typedef long vpx_codec_caps_t; #define VPX_CODEC_CAP_DECODER 0x1 /**< Is a decoder */ #define VPX_CODEC_CAP_ENCODER 0x2 /**< Is an encoder */ #define VPX_CODEC_CAP_XMA 0x4 /**< Supports eXternal Memory Allocation */ - /*! \brief Initialization-time Feature Enabling - * - * Certain codec features must be known at initialization time, to allow for - * proper memory allocation. - * - * The available flags are specified by VPX_CODEC_USE_* defines. - */ - typedef long vpx_codec_flags_t; +/*! \brief Initialization-time Feature Enabling + * + * Certain codec features must be known at initialization time, to allow for + * proper memory allocation. + * + * The available flags are specified by VPX_CODEC_USE_* defines. + */ +typedef long vpx_codec_flags_t; #define VPX_CODEC_USE_XMA 0x00000001 /**< Use eXternal Memory Allocation mode */ - /*!\brief Codec interface structure. - * - * Contains function pointers and other data private to the codec - * implementation. This structure is opaque to the application. - */ - typedef const struct vpx_codec_iface vpx_codec_iface_t; +/*!\brief Codec interface structure. + * + * Contains function pointers and other data private to the codec + * implementation. This structure is opaque to the application. + */ +typedef const struct vpx_codec_iface vpx_codec_iface_t; - /*!\brief Codec private data structure. - * - * Contains data private to the codec implementation. This structure is opaque - * to the application. - */ - typedef struct vpx_codec_priv vpx_codec_priv_t; +/*!\brief Codec private data structure. + * + * Contains data private to the codec implementation. This structure is opaque + * to the application. + */ +typedef struct vpx_codec_priv vpx_codec_priv_t; - /*!\brief Iterator - * - * Opaque storage used for iterating over lists. - */ - typedef const void *vpx_codec_iter_t; +/*!\brief Iterator + * + * Opaque storage used for iterating over lists. + */ +typedef const void *vpx_codec_iter_t; - /*!\brief Codec context structure - * - * All codecs \ref MUST support this context structure fully. In general, - * this data should be considered private to the codec algorithm, and - * not be manipulated or examined by the calling application. Applications - * may reference the 'name' member to get a printable description of the - * algorithm. - */ - typedef struct vpx_codec_ctx - { - const char *name; /**< Printable interface name */ - vpx_codec_iface_t *iface; /**< Interface pointers */ - vpx_codec_err_t err; /**< Last returned error */ - const char *err_detail; /**< Detailed info, if available */ - vpx_codec_flags_t init_flags; /**< Flags passed at init time */ - union - { - struct vpx_codec_dec_cfg *dec; /**< Decoder Configuration Pointer */ - struct vpx_codec_enc_cfg *enc; /**< Encoder Configuration Pointer */ - void *raw; - } config; /**< Configuration pointer aliasing union */ - vpx_codec_priv_t *priv; /**< Algorithm private storage */ - } vpx_codec_ctx_t; +/*!\brief Codec context structure + * + * All codecs \ref MUST support this context structure fully. In general, + * this data should be considered private to the codec algorithm, and + * not be manipulated or examined by the calling application. Applications + * may reference the 'name' member to get a printable description of the + * algorithm. + */ +typedef struct vpx_codec_ctx { + const char *name; /**< Printable interface name */ + vpx_codec_iface_t *iface; /**< Interface pointers */ + vpx_codec_err_t err; /**< Last returned error */ + const char *err_detail; /**< Detailed info, if available */ + vpx_codec_flags_t init_flags; /**< Flags passed at init time */ + union { + struct vpx_codec_dec_cfg *dec; /**< Decoder Configuration Pointer */ + struct vpx_codec_enc_cfg *enc; /**< Encoder Configuration Pointer */ + void *raw; + } config; /**< Configuration pointer aliasing union */ + vpx_codec_priv_t *priv; /**< Algorithm private storage */ +} vpx_codec_ctx_t; - /* - * Library Version Number Interface - * - * For example, see the following sample return values: - * vpx_codec_version() (1<<16 | 2<<8 | 3) - * vpx_codec_version_str() "v1.2.3-rc1-16-gec6a1ba" - * vpx_codec_version_extra_str() "rc1-16-gec6a1ba" - */ +/* + * Library Version Number Interface + * + * For example, see the following sample return values: + * vpx_codec_version() (1<<16 | 2<<8 | 3) + * vpx_codec_version_str() "v1.2.3-rc1-16-gec6a1ba" + * vpx_codec_version_extra_str() "rc1-16-gec6a1ba" + */ - /*!\brief Return the version information (as an integer) - * - * Returns a packed encoding of the library version number. This will only include - * the major.minor.patch component of the version number. Note that this encoded - * value should be accessed through the macros provided, as the encoding may change - * in the future. - * - */ - int vpx_codec_version(void); +/*!\brief Return the version information (as an integer) + * + * Returns a packed encoding of the library version number. This will only include + * the major.minor.patch component of the version number. Note that this encoded + * value should be accessed through the macros provided, as the encoding may change + * in the future. + * + */ +int vpx_codec_version(void); #define VPX_VERSION_MAJOR(v) ((v>>16)&0xff) /**< extract major from packed version */ #define VPX_VERSION_MINOR(v) ((v>>8)&0xff) /**< extract minor from packed version */ #define VPX_VERSION_PATCH(v) ((v>>0)&0xff) /**< extract patch from packed version */ - /*!\brief Return the version major number */ +/*!\brief Return the version major number */ #define vpx_codec_version_major() ((vpx_codec_version()>>16)&0xff) - /*!\brief Return the version minor number */ +/*!\brief Return the version minor number */ #define vpx_codec_version_minor() ((vpx_codec_version()>>8)&0xff) - /*!\brief Return the version patch number */ +/*!\brief Return the version patch number */ #define vpx_codec_version_patch() ((vpx_codec_version()>>0)&0xff) - /*!\brief Return the version information (as a string) - * - * Returns a printable string containing the full library version number. This may - * contain additional text following the three digit version number, as to indicate - * release candidates, prerelease versions, etc. - * - */ - const char *vpx_codec_version_str(void); +/*!\brief Return the version information (as a string) + * + * Returns a printable string containing the full library version number. This may + * contain additional text following the three digit version number, as to indicate + * release candidates, prerelease versions, etc. + * + */ +const char *vpx_codec_version_str(void); - /*!\brief Return the version information (as a string) - * - * Returns a printable "extra string". This is the component of the string returned - * by vpx_codec_version_str() following the three digit version number. - * - */ - const char *vpx_codec_version_extra_str(void); +/*!\brief Return the version information (as a string) + * + * Returns a printable "extra string". This is the component of the string returned + * by vpx_codec_version_str() following the three digit version number. + * + */ +const char *vpx_codec_version_extra_str(void); - /*!\brief Return the build configuration - * - * Returns a printable string containing an encoded version of the build - * configuration. This may be useful to vpx support. - * - */ - const char *vpx_codec_build_config(void); +/*!\brief Return the build configuration + * + * Returns a printable string containing an encoded version of the build + * configuration. This may be useful to vpx support. + * + */ +const char *vpx_codec_build_config(void); - /*!\brief Return the name for a given interface - * - * Returns a human readable string for name of the given codec interface. - * - * \param[in] iface Interface pointer - * - */ - const char *vpx_codec_iface_name(vpx_codec_iface_t *iface); +/*!\brief Return the name for a given interface + * + * Returns a human readable string for name of the given codec interface. + * + * \param[in] iface Interface pointer + * + */ +const char *vpx_codec_iface_name(vpx_codec_iface_t *iface); - /*!\brief Convert error number to printable string - * - * Returns a human readable string for the last error returned by the - * algorithm. The returned error will be one line and will not contain - * any newline characters. - * - * - * \param[in] err Error number. - * - */ - const char *vpx_codec_err_to_string(vpx_codec_err_t err); +/*!\brief Convert error number to printable string + * + * Returns a human readable string for the last error returned by the + * algorithm. The returned error will be one line and will not contain + * any newline characters. + * + * + * \param[in] err Error number. + * + */ +const char *vpx_codec_err_to_string(vpx_codec_err_t err); - /*!\brief Retrieve error synopsis for codec context - * - * Returns a human readable string for the last error returned by the - * algorithm. The returned error will be one line and will not contain - * any newline characters. - * - * - * \param[in] ctx Pointer to this instance's context. - * - */ - const char *vpx_codec_error(vpx_codec_ctx_t *ctx); +/*!\brief Retrieve error synopsis for codec context + * + * Returns a human readable string for the last error returned by the + * algorithm. The returned error will be one line and will not contain + * any newline characters. + * + * + * \param[in] ctx Pointer to this instance's context. + * + */ +const char *vpx_codec_error(vpx_codec_ctx_t *ctx); - /*!\brief Retrieve detailed error information for codec context - * - * Returns a human readable string providing detailed information about - * the last error. - * - * \param[in] ctx Pointer to this instance's context. - * - * \retval NULL - * No detailed information is available. - */ - const char *vpx_codec_error_detail(vpx_codec_ctx_t *ctx); +/*!\brief Retrieve detailed error information for codec context + * + * Returns a human readable string providing detailed information about + * the last error. + * + * \param[in] ctx Pointer to this instance's context. + * + * \retval NULL + * No detailed information is available. + */ +const char *vpx_codec_error_detail(vpx_codec_ctx_t *ctx); - /* REQUIRED FUNCTIONS - * - * The following functions are required to be implemented for all codecs. - * They represent the base case functionality expected of all codecs. - */ +/* REQUIRED FUNCTIONS + * + * The following functions are required to be implemented for all codecs. + * They represent the base case functionality expected of all codecs. + */ - /*!\brief Destroy a codec instance - * - * Destroys a codec context, freeing any associated memory buffers. - * - * \param[in] ctx Pointer to this instance's context - * - * \retval #VPX_CODEC_OK - * The codec algorithm initialized. - * \retval #VPX_CODEC_MEM_ERROR - * Memory allocation failed. - */ - vpx_codec_err_t vpx_codec_destroy(vpx_codec_ctx_t *ctx); +/*!\brief Destroy a codec instance + * + * Destroys a codec context, freeing any associated memory buffers. + * + * \param[in] ctx Pointer to this instance's context + * + * \retval #VPX_CODEC_OK + * The codec algorithm initialized. + * \retval #VPX_CODEC_MEM_ERROR + * Memory allocation failed. + */ +vpx_codec_err_t vpx_codec_destroy(vpx_codec_ctx_t *ctx); - /*!\brief Get the capabilities of an algorithm. - * - * Retrieves the capabilities bitfield from the algorithm's interface. - * - * \param[in] iface Pointer to the algorithm interface - * - */ - vpx_codec_caps_t vpx_codec_get_caps(vpx_codec_iface_t *iface); +/*!\brief Get the capabilities of an algorithm. + * + * Retrieves the capabilities bitfield from the algorithm's interface. + * + * \param[in] iface Pointer to the algorithm interface + * + */ +vpx_codec_caps_t vpx_codec_get_caps(vpx_codec_iface_t *iface); - /*!\brief Control algorithm - * - * This function is used to exchange algorithm specific data with the codec - * instance. This can be used to implement features specific to a particular - * algorithm. - * - * This wrapper function dispatches the request to the helper function - * associated with the given ctrl_id. It tries to call this function - * transparently, but will return #VPX_CODEC_ERROR if the request could not - * be dispatched. - * - * Note that this function should not be used directly. Call the - * #vpx_codec_control wrapper macro instead. - * - * \param[in] ctx Pointer to this instance's context - * \param[in] ctrl_id Algorithm specific control identifier - * - * \retval #VPX_CODEC_OK - * The control request was processed. - * \retval #VPX_CODEC_ERROR - * The control request was not processed. - * \retval #VPX_CODEC_INVALID_PARAM - * The data was not valid. - */ - vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx, - int ctrl_id, - ...); +/*!\brief Control algorithm + * + * This function is used to exchange algorithm specific data with the codec + * instance. This can be used to implement features specific to a particular + * algorithm. + * + * This wrapper function dispatches the request to the helper function + * associated with the given ctrl_id. It tries to call this function + * transparently, but will return #VPX_CODEC_ERROR if the request could not + * be dispatched. + * + * Note that this function should not be used directly. Call the + * #vpx_codec_control wrapper macro instead. + * + * \param[in] ctx Pointer to this instance's context + * \param[in] ctrl_id Algorithm specific control identifier + * + * \retval #VPX_CODEC_OK + * The control request was processed. + * \retval #VPX_CODEC_ERROR + * The control request was not processed. + * \retval #VPX_CODEC_INVALID_PARAM + * The data was not valid. + */ +vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx, + int ctrl_id, + ...); #if defined(VPX_DISABLE_CTRL_TYPECHECKS) && VPX_DISABLE_CTRL_TYPECHECKS # define vpx_codec_control(ctx,id,data) vpx_codec_control_(ctx,id,data) # define VPX_CTRL_USE_TYPE(id, typ) @@ -380,30 +378,30 @@ extern "C" { # define VPX_CTRL_VOID(id, typ) #else - /*!\brief vpx_codec_control wrapper macro - * - * This macro allows for type safe conversions across the variadic parameter - * to vpx_codec_control_(). - * - * \internal - * It works by dispatching the call to the control function through a wrapper - * function named with the id parameter. - */ +/*!\brief vpx_codec_control wrapper macro + * + * This macro allows for type safe conversions across the variadic parameter + * to vpx_codec_control_(). + * + * \internal + * It works by dispatching the call to the control function through a wrapper + * function named with the id parameter. + */ # define vpx_codec_control(ctx,id,data) vpx_codec_control_##id(ctx,id,data)\ /**<\hideinitializer*/ - /*!\brief vpx_codec_control type definition macro - * - * This macro allows for type safe conversions across the variadic parameter - * to vpx_codec_control_(). It defines the type of the argument for a given - * control identifier. - * - * \internal - * It defines a static function with - * the correctly typed arguments as a wrapper to the type-unsafe internal - * function. - */ +/*!\brief vpx_codec_control type definition macro + * + * This macro allows for type safe conversions across the variadic parameter + * to vpx_codec_control_(). It defines the type of the argument for a given + * control identifier. + * + * \internal + * It defines a static function with + * the correctly typed arguments as a wrapper to the type-unsafe internal + * function. + */ # define VPX_CTRL_USE_TYPE(id, typ) \ static vpx_codec_err_t \ vpx_codec_control_##id(vpx_codec_ctx_t*, int, typ) UNUSED;\ @@ -414,16 +412,16 @@ extern "C" { } /**<\hideinitializer*/ - /*!\brief vpx_codec_control deprecated type definition macro - * - * Like #VPX_CTRL_USE_TYPE, but indicates that the specified control is - * deprecated and should not be used. Consult the documentation for your - * codec for more information. - * - * \internal - * It defines a static function with the correctly typed arguments as a - * wrapper to the type-unsafe internal function. - */ +/*!\brief vpx_codec_control deprecated type definition macro + * + * Like #VPX_CTRL_USE_TYPE, but indicates that the specified control is + * deprecated and should not be used. Consult the documentation for your + * codec for more information. + * + * \internal + * It defines a static function with the correctly typed arguments as a + * wrapper to the type-unsafe internal function. + */ # define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ) \ DECLSPEC_DEPRECATED static vpx_codec_err_t \ vpx_codec_control_##id(vpx_codec_ctx_t*, int, typ) DEPRECATED UNUSED;\ @@ -434,16 +432,16 @@ extern "C" { } /**<\hideinitializer*/ - /*!\brief vpx_codec_control void type definition macro - * - * This macro allows for type safe conversions across the variadic parameter - * to vpx_codec_control_(). It indicates that a given control identifier takes - * no argument. - * - * \internal - * It defines a static function without a data argument as a wrapper to the - * type-unsafe internal function. - */ +/*!\brief vpx_codec_control void type definition macro + * + * This macro allows for type safe conversions across the variadic parameter + * to vpx_codec_control_(). It indicates that a given control identifier takes + * no argument. + * + * \internal + * It defines a static function without a data argument as a wrapper to the + * type-unsafe internal function. + */ # define VPX_CTRL_VOID(id) \ static vpx_codec_err_t \ vpx_codec_control_##id(vpx_codec_ctx_t*, int) UNUSED;\ @@ -457,95 +455,94 @@ extern "C" { #endif - /*!\defgroup cap_xma External Memory Allocation Functions - * - * The following functions are required to be implemented for all codecs - * that advertise the VPX_CODEC_CAP_XMA capability. Calling these functions - * for codecs that don't advertise this capability will result in an error - * code being returned, usually VPX_CODEC_INCAPABLE - * @{ - */ +/*!\defgroup cap_xma External Memory Allocation Functions + * + * The following functions are required to be implemented for all codecs + * that advertise the VPX_CODEC_CAP_XMA capability. Calling these functions + * for codecs that don't advertise this capability will result in an error + * code being returned, usually VPX_CODEC_INCAPABLE + * @{ + */ - /*!\brief Memory Map Entry - * - * This structure is used to contain the properties of a memory segment. It - * is populated by the codec in the request phase, and by the calling - * application once the requested allocation has been performed. +/*!\brief Memory Map Entry + * + * This structure is used to contain the properties of a memory segment. It + * is populated by the codec in the request phase, and by the calling + * application once the requested allocation has been performed. + */ +typedef struct vpx_codec_mmap { + /* + * The following members are set by the codec when requesting a segment */ - typedef struct vpx_codec_mmap - { - /* - * The following members are set by the codec when requesting a segment - */ - unsigned int id; /**< identifier for the segment's contents */ - unsigned long sz; /**< size of the segment, in bytes */ - unsigned int align; /**< required alignment of the segment, in bytes */ - unsigned int flags; /**< bitfield containing segment properties */ + unsigned int id; /**< identifier for the segment's contents */ + unsigned long sz; /**< size of the segment, in bytes */ + unsigned int align; /**< required alignment of the segment, in bytes */ + unsigned int flags; /**< bitfield containing segment properties */ #define VPX_CODEC_MEM_ZERO 0x1 /**< Segment must be zeroed by allocation */ #define VPX_CODEC_MEM_WRONLY 0x2 /**< Segment need not be readable */ #define VPX_CODEC_MEM_FAST 0x4 /**< Place in fast memory, if available */ - /* The following members are to be filled in by the allocation function */ - void *base; /**< pointer to the allocated segment */ - void (*dtor)(struct vpx_codec_mmap *map); /**< destructor to call */ - void *priv; /**< allocator private storage */ - } vpx_codec_mmap_t; /**< alias for struct vpx_codec_mmap */ + /* The following members are to be filled in by the allocation function */ + void *base; /**< pointer to the allocated segment */ + void (*dtor)(struct vpx_codec_mmap *map); /**< destructor to call */ + void *priv; /**< allocator private storage */ +} vpx_codec_mmap_t; /**< alias for struct vpx_codec_mmap */ - /*!\brief Iterate over the list of segments to allocate. - * - * Iterates over a list of the segments to allocate. The iterator storage - * should be initialized to NULL to start the iteration. Iteration is complete - * when this function returns VPX_CODEC_LIST_END. The amount of memory needed to - * allocate is dependent upon the size of the encoded stream. In cases where the - * stream is not available at allocation time, a fixed size must be requested. - * The codec will not be able to operate on streams larger than the size used at - * allocation time. - * - * \param[in] ctx Pointer to this instance's context. - * \param[out] mmap Pointer to the memory map entry to populate. - * \param[in,out] iter Iterator storage, initialized to NULL - * - * \retval #VPX_CODEC_OK - * The memory map entry was populated. - * \retval #VPX_CODEC_ERROR - * Codec does not support XMA mode. - * \retval #VPX_CODEC_MEM_ERROR - * Unable to determine segment size from stream info. - */ - vpx_codec_err_t vpx_codec_get_mem_map(vpx_codec_ctx_t *ctx, - vpx_codec_mmap_t *mmap, - vpx_codec_iter_t *iter); +/*!\brief Iterate over the list of segments to allocate. + * + * Iterates over a list of the segments to allocate. The iterator storage + * should be initialized to NULL to start the iteration. Iteration is complete + * when this function returns VPX_CODEC_LIST_END. The amount of memory needed to + * allocate is dependent upon the size of the encoded stream. In cases where the + * stream is not available at allocation time, a fixed size must be requested. + * The codec will not be able to operate on streams larger than the size used at + * allocation time. + * + * \param[in] ctx Pointer to this instance's context. + * \param[out] mmap Pointer to the memory map entry to populate. + * \param[in,out] iter Iterator storage, initialized to NULL + * + * \retval #VPX_CODEC_OK + * The memory map entry was populated. + * \retval #VPX_CODEC_ERROR + * Codec does not support XMA mode. + * \retval #VPX_CODEC_MEM_ERROR + * Unable to determine segment size from stream info. + */ +vpx_codec_err_t vpx_codec_get_mem_map(vpx_codec_ctx_t *ctx, + vpx_codec_mmap_t *mmap, + vpx_codec_iter_t *iter); - /*!\brief Identify allocated segments to codec instance - * - * Stores a list of allocated segments in the codec. Segments \ref MUST be - * passed in the order they are read from vpx_codec_get_mem_map(), but may be - * passed in groups of any size. Segments \ref MUST be set only once. The - * allocation function \ref MUST ensure that the vpx_codec_mmap_t::base member - * is non-NULL. If the segment requires cleanup handling (e.g., calling free() - * or close()) then the vpx_codec_mmap_t::dtor member \ref MUST be populated. - * - * \param[in] ctx Pointer to this instance's context. - * \param[in] mmaps Pointer to the first memory map entry in the list. - * \param[in] num_maps Number of entries being set at this time - * - * \retval #VPX_CODEC_OK - * The segment was stored in the codec context. - * \retval #VPX_CODEC_INCAPABLE - * Codec does not support XMA mode. - * \retval #VPX_CODEC_MEM_ERROR - * Segment base address was not set, or segment was already stored. +/*!\brief Identify allocated segments to codec instance + * + * Stores a list of allocated segments in the codec. Segments \ref MUST be + * passed in the order they are read from vpx_codec_get_mem_map(), but may be + * passed in groups of any size. Segments \ref MUST be set only once. The + * allocation function \ref MUST ensure that the vpx_codec_mmap_t::base member + * is non-NULL. If the segment requires cleanup handling (e.g., calling free() + * or close()) then the vpx_codec_mmap_t::dtor member \ref MUST be populated. + * + * \param[in] ctx Pointer to this instance's context. + * \param[in] mmaps Pointer to the first memory map entry in the list. + * \param[in] num_maps Number of entries being set at this time + * + * \retval #VPX_CODEC_OK + * The segment was stored in the codec context. + * \retval #VPX_CODEC_INCAPABLE + * Codec does not support XMA mode. + * \retval #VPX_CODEC_MEM_ERROR + * Segment base address was not set, or segment was already stored. - */ - vpx_codec_err_t vpx_codec_set_mem_map(vpx_codec_ctx_t *ctx, - vpx_codec_mmap_t *mmaps, - unsigned int num_maps); + */ +vpx_codec_err_t vpx_codec_set_mem_map(vpx_codec_ctx_t *ctx, + vpx_codec_mmap_t *mmaps, + unsigned int num_maps); - /*!@} - end defgroup cap_xma*/ - /*!@} - end defgroup codec*/ +/*!@} - end defgroup cap_xma*/ +/*!@} - end defgroup codec*/ #endif diff --git a/thirdparties/mac/include/vpx/vpx_decoder.h b/thirdparties/mac/include/vpx/vpx_decoder.h index 7992cc4..d47a21e 100755 --- a/thirdparties/mac/include/vpx/vpx_decoder.h +++ b/thirdparties/mac/include/vpx/vpx_decoder.h @@ -32,24 +32,24 @@ extern "C" { #define VPX_DECODER_H #include "vpx_codec.h" - /*!\brief Current ABI version number - * - * \internal - * If this file is altered in any way that changes the ABI, this value - * must be bumped. Examples include, but are not limited to, changing - * types, removing or reassigning enums, adding/removing/rearranging - * fields to structures - */ +/*!\brief Current ABI version number + * + * \internal + * If this file is altered in any way that changes the ABI, this value + * must be bumped. Examples include, but are not limited to, changing + * types, removing or reassigning enums, adding/removing/rearranging + * fields to structures + */ #define VPX_DECODER_ABI_VERSION (2 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer*/ - /*! \brief Decoder capabilities bitfield - * - * Each decoder advertises the capabilities it supports as part of its - * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces - * or functionality, and are not required to be supported by a decoder. - * - * The available flags are specified by VPX_CODEC_CAP_* defines. - */ +/*! \brief Decoder capabilities bitfield + * + * Each decoder advertises the capabilities it supports as part of its + * ::vpx_codec_iface_t interface structure. Capabilities are extra interfaces + * or functionality, and are not required to be supported by a decoder. + * + * The available flags are specified by VPX_CODEC_CAP_* defines. + */ #define VPX_CODEC_CAP_PUT_SLICE 0x10000 /**< Will issue put_slice callbacks */ #define VPX_CODEC_CAP_PUT_FRAME 0x20000 /**< Will issue put_frame callbacks */ #define VPX_CODEC_CAP_POSTPROC 0x40000 /**< Can postprocess decoded frame */ @@ -58,13 +58,13 @@ extern "C" { #define VPX_CODEC_CAP_INPUT_FRAGMENTS 0x100000 /**< Can receive encoded frames one fragment at a time */ - /*! \brief Initialization-time Feature Enabling - * - * Certain codec features must be known at initialization time, to allow for - * proper memory allocation. - * - * The available flags are specified by VPX_CODEC_USE_* defines. - */ +/*! \brief Initialization-time Feature Enabling + * + * Certain codec features must be known at initialization time, to allow for + * proper memory allocation. + * + * The available flags are specified by VPX_CODEC_USE_* defines. + */ #define VPX_CODEC_USE_POSTPROC 0x10000 /**< Postprocess decoded frame */ #define VPX_CODEC_USE_ERROR_CONCEALMENT 0x20000 /**< Conceal errors in decoded frames */ @@ -72,255 +72,253 @@ extern "C" { passed to the decoder one fragment at a time */ - /*!\brief Stream properties - * - * This structure is used to query or set properties of the decoded - * stream. Algorithms may extend this structure with data specific - * to their bitstream by setting the sz member appropriately. - */ - typedef struct vpx_codec_stream_info - { - unsigned int sz; /**< Size of this structure */ - unsigned int w; /**< Width (or 0 for unknown/default) */ - unsigned int h; /**< Height (or 0 for unknown/default) */ - unsigned int is_kf; /**< Current frame is a keyframe */ - } vpx_codec_stream_info_t; - - /* REQUIRED FUNCTIONS - * - * The following functions are required to be implemented for all decoders. - * They represent the base case functionality expected of all decoders. - */ - - - /*!\brief Initialization Configurations - * - * This structure is used to pass init time configuration options to the - * decoder. - */ - typedef struct vpx_codec_dec_cfg - { - unsigned int threads; /**< Maximum number of threads to use, default 1 */ - unsigned int w; /**< Width */ - unsigned int h; /**< Height */ - } vpx_codec_dec_cfg_t; /**< alias for struct vpx_codec_dec_cfg */ - - - /*!\brief Initialize a decoder instance - * - * Initializes a decoder context using the given interface. Applications - * should call the vpx_codec_dec_init convenience macro instead of this - * function directly, to ensure that the ABI version number parameter - * is properly initialized. - * - * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags - * parameter), the storage pointed to by the cfg parameter must be - * kept readable and stable until all memory maps have been set. - * - * \param[in] ctx Pointer to this instance's context. - * \param[in] iface Pointer to the algorithm interface to use. - * \param[in] cfg Configuration to use, if known. May be NULL. - * \param[in] flags Bitfield of VPX_CODEC_USE_* flags - * \param[in] ver ABI version number. Must be set to - * VPX_DECODER_ABI_VERSION - * \retval #VPX_CODEC_OK - * The decoder algorithm initialized. - * \retval #VPX_CODEC_MEM_ERROR - * Memory allocation failed. - */ - vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx, - vpx_codec_iface_t *iface, - vpx_codec_dec_cfg_t *cfg, - vpx_codec_flags_t flags, - int ver); - - /*!\brief Convenience macro for vpx_codec_dec_init_ver() - * - * Ensures the ABI version parameter is properly set. - */ +/*!\brief Stream properties + * + * This structure is used to query or set properties of the decoded + * stream. Algorithms may extend this structure with data specific + * to their bitstream by setting the sz member appropriately. + */ +typedef struct vpx_codec_stream_info { + unsigned int sz; /**< Size of this structure */ + unsigned int w; /**< Width (or 0 for unknown/default) */ + unsigned int h; /**< Height (or 0 for unknown/default) */ + unsigned int is_kf; /**< Current frame is a keyframe */ +} vpx_codec_stream_info_t; + +/* REQUIRED FUNCTIONS + * + * The following functions are required to be implemented for all decoders. + * They represent the base case functionality expected of all decoders. + */ + + +/*!\brief Initialization Configurations + * + * This structure is used to pass init time configuration options to the + * decoder. + */ +typedef struct vpx_codec_dec_cfg { + unsigned int threads; /**< Maximum number of threads to use, default 1 */ + unsigned int w; /**< Width */ + unsigned int h; /**< Height */ +} vpx_codec_dec_cfg_t; /**< alias for struct vpx_codec_dec_cfg */ + + +/*!\brief Initialize a decoder instance + * + * Initializes a decoder context using the given interface. Applications + * should call the vpx_codec_dec_init convenience macro instead of this + * function directly, to ensure that the ABI version number parameter + * is properly initialized. + * + * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags + * parameter), the storage pointed to by the cfg parameter must be + * kept readable and stable until all memory maps have been set. + * + * \param[in] ctx Pointer to this instance's context. + * \param[in] iface Pointer to the algorithm interface to use. + * \param[in] cfg Configuration to use, if known. May be NULL. + * \param[in] flags Bitfield of VPX_CODEC_USE_* flags + * \param[in] ver ABI version number. Must be set to + * VPX_DECODER_ABI_VERSION + * \retval #VPX_CODEC_OK + * The decoder algorithm initialized. + * \retval #VPX_CODEC_MEM_ERROR + * Memory allocation failed. + */ +vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx, + vpx_codec_iface_t *iface, + vpx_codec_dec_cfg_t *cfg, + vpx_codec_flags_t flags, + int ver); + +/*!\brief Convenience macro for vpx_codec_dec_init_ver() + * + * Ensures the ABI version parameter is properly set. + */ #define vpx_codec_dec_init(ctx, iface, cfg, flags) \ vpx_codec_dec_init_ver(ctx, iface, cfg, flags, VPX_DECODER_ABI_VERSION) - /*!\brief Parse stream info from a buffer - * - * Performs high level parsing of the bitstream. Construction of a decoder - * context is not necessary. Can be used to determine if the bitstream is - * of the proper format, and to extract information from the stream. - * - * \param[in] iface Pointer to the algorithm interface - * \param[in] data Pointer to a block of data to parse - * \param[in] data_sz Size of the data buffer - * \param[in,out] si Pointer to stream info to update. The size member - * \ref MUST be properly initialized, but \ref MAY be - * clobbered by the algorithm. This parameter \ref MAY - * be NULL. - * - * \retval #VPX_CODEC_OK - * Bitstream is parsable and stream information updated - */ - vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface, - const uint8_t *data, - unsigned int data_sz, - vpx_codec_stream_info_t *si); - - - /*!\brief Return information about the current stream. - * - * Returns information about the stream that has been parsed during decoding. - * - * \param[in] ctx Pointer to this instance's context - * \param[in,out] si Pointer to stream info to update. The size member - * \ref MUST be properly initialized, but \ref MAY be - * clobbered by the algorithm. This parameter \ref MAY - * be NULL. - * - * \retval #VPX_CODEC_OK - * Bitstream is parsable and stream information updated - */ - vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx, - vpx_codec_stream_info_t *si); - - - /*!\brief Decode data - * - * Processes a buffer of coded data. If the processing results in a new - * decoded frame becoming available, PUT_SLICE and PUT_FRAME events may be - * generated, as appropriate. Encoded data \ref MUST be passed in DTS (decode - * time stamp) order. Frames produced will always be in PTS (presentation - * time stamp) order. - * If the decoder is configured with VPX_CODEC_USE_INPUT_FRAGMENTS enabled, - * data and data_sz can contain a fragment of the encoded frame. Fragment - * \#n must contain at least partition \#n, but can also contain subsequent - * partitions (\#n+1 - \#n+i), and if so, fragments \#n+1, .., \#n+i must - * be empty. When no more data is available, this function should be called - * with NULL as data and 0 as data_sz. The memory passed to this function - * must be available until the frame has been decoded. - * - * \param[in] ctx Pointer to this instance's context - * \param[in] data Pointer to this block of new coded data. If - * NULL, a VPX_CODEC_CB_PUT_FRAME event is posted - * for the previously decoded frame. - * \param[in] data_sz Size of the coded data, in bytes. - * \param[in] user_priv Application specific data to associate with - * this frame. - * \param[in] deadline Soft deadline the decoder should attempt to meet, - * in us. Set to zero for unlimited. - * - * \return Returns #VPX_CODEC_OK if the coded data was processed completely - * and future pictures can be decoded without error. Otherwise, - * see the descriptions of the other error codes in ::vpx_codec_err_t - * for recoverability capabilities. - */ - vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx, - const uint8_t *data, - unsigned int data_sz, - void *user_priv, - long deadline); - - - /*!\brief Decoded frames iterator - * - * Iterates over a list of the frames available for display. The iterator - * storage should be initialized to NULL to start the iteration. Iteration is - * complete when this function returns NULL. - * - * The list of available frames becomes valid upon completion of the - * vpx_codec_decode call, and remains valid until the next call to vpx_codec_decode. - * - * \param[in] ctx Pointer to this instance's context - * \param[in,out] iter Iterator storage, initialized to NULL - * - * \return Returns a pointer to an image, if one is ready for display. Frames - * produced will always be in PTS (presentation time stamp) order. - */ - vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx, - vpx_codec_iter_t *iter); - - - /*!\defgroup cap_put_frame Frame-Based Decoding Functions - * - * The following functions are required to be implemented for all decoders - * that advertise the VPX_CODEC_CAP_PUT_FRAME capability. Calling these functions - * for codecs that don't advertise this capability will result in an error - * code being returned, usually VPX_CODEC_ERROR - * @{ - */ - - /*!\brief put frame callback prototype - * - * This callback is invoked by the decoder to notify the application of - * the availability of decoded image data. - */ - typedef void (*vpx_codec_put_frame_cb_fn_t)(void *user_priv, - const vpx_image_t *img); - - - /*!\brief Register for notification of frame completion. - * - * Registers a given function to be called when a decoded frame is - * available. - * - * \param[in] ctx Pointer to this instance's context - * \param[in] cb Pointer to the callback function - * \param[in] user_priv User's private data - * - * \retval #VPX_CODEC_OK - * Callback successfully registered. - * \retval #VPX_CODEC_ERROR - * Decoder context not initialized, or algorithm not capable of - * posting slice completion. - */ - vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx, - vpx_codec_put_frame_cb_fn_t cb, - void *user_priv); - - - /*!@} - end defgroup cap_put_frame */ - - /*!\defgroup cap_put_slice Slice-Based Decoding Functions - * - * The following functions are required to be implemented for all decoders - * that advertise the VPX_CODEC_CAP_PUT_SLICE capability. Calling these functions - * for codecs that don't advertise this capability will result in an error - * code being returned, usually VPX_CODEC_ERROR - * @{ - */ - - /*!\brief put slice callback prototype - * - * This callback is invoked by the decoder to notify the application of - * the availability of partially decoded image data. The - */ - typedef void (*vpx_codec_put_slice_cb_fn_t)(void *user_priv, - const vpx_image_t *img, - const vpx_image_rect_t *valid, - const vpx_image_rect_t *update); - - - /*!\brief Register for notification of slice completion. - * - * Registers a given function to be called when a decoded slice is - * available. - * - * \param[in] ctx Pointer to this instance's context - * \param[in] cb Pointer to the callback function - * \param[in] user_priv User's private data - * - * \retval #VPX_CODEC_OK - * Callback successfully registered. - * \retval #VPX_CODEC_ERROR - * Decoder context not initialized, or algorithm not capable of - * posting slice completion. - */ - vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *ctx, - vpx_codec_put_slice_cb_fn_t cb, - void *user_priv); - - - /*!@} - end defgroup cap_put_slice*/ - - /*!@} - end defgroup decoder*/ +/*!\brief Parse stream info from a buffer + * + * Performs high level parsing of the bitstream. Construction of a decoder + * context is not necessary. Can be used to determine if the bitstream is + * of the proper format, and to extract information from the stream. + * + * \param[in] iface Pointer to the algorithm interface + * \param[in] data Pointer to a block of data to parse + * \param[in] data_sz Size of the data buffer + * \param[in,out] si Pointer to stream info to update. The size member + * \ref MUST be properly initialized, but \ref MAY be + * clobbered by the algorithm. This parameter \ref MAY + * be NULL. + * + * \retval #VPX_CODEC_OK + * Bitstream is parsable and stream information updated + */ +vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface, + const uint8_t *data, + unsigned int data_sz, + vpx_codec_stream_info_t *si); + + +/*!\brief Return information about the current stream. + * + * Returns information about the stream that has been parsed during decoding. + * + * \param[in] ctx Pointer to this instance's context + * \param[in,out] si Pointer to stream info to update. The size member + * \ref MUST be properly initialized, but \ref MAY be + * clobbered by the algorithm. This parameter \ref MAY + * be NULL. + * + * \retval #VPX_CODEC_OK + * Bitstream is parsable and stream information updated + */ +vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx, + vpx_codec_stream_info_t *si); + + +/*!\brief Decode data + * + * Processes a buffer of coded data. If the processing results in a new + * decoded frame becoming available, PUT_SLICE and PUT_FRAME events may be + * generated, as appropriate. Encoded data \ref MUST be passed in DTS (decode + * time stamp) order. Frames produced will always be in PTS (presentation + * time stamp) order. + * If the decoder is configured with VPX_CODEC_USE_INPUT_FRAGMENTS enabled, + * data and data_sz can contain a fragment of the encoded frame. Fragment + * \#n must contain at least partition \#n, but can also contain subsequent + * partitions (\#n+1 - \#n+i), and if so, fragments \#n+1, .., \#n+i must + * be empty. When no more data is available, this function should be called + * with NULL as data and 0 as data_sz. The memory passed to this function + * must be available until the frame has been decoded. + * + * \param[in] ctx Pointer to this instance's context + * \param[in] data Pointer to this block of new coded data. If + * NULL, a VPX_CODEC_CB_PUT_FRAME event is posted + * for the previously decoded frame. + * \param[in] data_sz Size of the coded data, in bytes. + * \param[in] user_priv Application specific data to associate with + * this frame. + * \param[in] deadline Soft deadline the decoder should attempt to meet, + * in us. Set to zero for unlimited. + * + * \return Returns #VPX_CODEC_OK if the coded data was processed completely + * and future pictures can be decoded without error. Otherwise, + * see the descriptions of the other error codes in ::vpx_codec_err_t + * for recoverability capabilities. + */ +vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx, + const uint8_t *data, + unsigned int data_sz, + void *user_priv, + long deadline); + + +/*!\brief Decoded frames iterator + * + * Iterates over a list of the frames available for display. The iterator + * storage should be initialized to NULL to start the iteration. Iteration is + * complete when this function returns NULL. + * + * The list of available frames becomes valid upon completion of the + * vpx_codec_decode call, and remains valid until the next call to vpx_codec_decode. + * + * \param[in] ctx Pointer to this instance's context + * \param[in,out] iter Iterator storage, initialized to NULL + * + * \return Returns a pointer to an image, if one is ready for display. Frames + * produced will always be in PTS (presentation time stamp) order. + */ +vpx_image_t *vpx_codec_get_frame(vpx_codec_ctx_t *ctx, + vpx_codec_iter_t *iter); + + +/*!\defgroup cap_put_frame Frame-Based Decoding Functions + * + * The following functions are required to be implemented for all decoders + * that advertise the VPX_CODEC_CAP_PUT_FRAME capability. Calling these functions + * for codecs that don't advertise this capability will result in an error + * code being returned, usually VPX_CODEC_ERROR + * @{ + */ + +/*!\brief put frame callback prototype + * + * This callback is invoked by the decoder to notify the application of + * the availability of decoded image data. + */ +typedef void (*vpx_codec_put_frame_cb_fn_t)(void *user_priv, + const vpx_image_t *img); + + +/*!\brief Register for notification of frame completion. + * + * Registers a given function to be called when a decoded frame is + * available. + * + * \param[in] ctx Pointer to this instance's context + * \param[in] cb Pointer to the callback function + * \param[in] user_priv User's private data + * + * \retval #VPX_CODEC_OK + * Callback successfully registered. + * \retval #VPX_CODEC_ERROR + * Decoder context not initialized, or algorithm not capable of + * posting slice completion. + */ +vpx_codec_err_t vpx_codec_register_put_frame_cb(vpx_codec_ctx_t *ctx, + vpx_codec_put_frame_cb_fn_t cb, + void *user_priv); + + +/*!@} - end defgroup cap_put_frame */ + +/*!\defgroup cap_put_slice Slice-Based Decoding Functions + * + * The following functions are required to be implemented for all decoders + * that advertise the VPX_CODEC_CAP_PUT_SLICE capability. Calling these functions + * for codecs that don't advertise this capability will result in an error + * code being returned, usually VPX_CODEC_ERROR + * @{ + */ + +/*!\brief put slice callback prototype + * + * This callback is invoked by the decoder to notify the application of + * the availability of partially decoded image data. The + */ +typedef void (*vpx_codec_put_slice_cb_fn_t)(void *user_priv, + const vpx_image_t *img, + const vpx_image_rect_t *valid, + const vpx_image_rect_t *update); + + +/*!\brief Register for notification of slice completion. + * + * Registers a given function to be called when a decoded slice is + * available. + * + * \param[in] ctx Pointer to this instance's context + * \param[in] cb Pointer to the callback function + * \param[in] user_priv User's private data + * + * \retval #VPX_CODEC_OK + * Callback successfully registered. + * \retval #VPX_CODEC_ERROR + * Decoder context not initialized, or algorithm not capable of + * posting slice completion. + */ +vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *ctx, + vpx_codec_put_slice_cb_fn_t cb, + void *user_priv); + + +/*!@} - end defgroup cap_put_slice*/ + +/*!@} - end defgroup decoder*/ #endif diff --git a/thirdparties/mac/include/vpx/vpx_decoder_compat.h b/thirdparties/mac/include/vpx/vpx_decoder_compat.h index 8adc1b9..13046e1 100755 --- a/thirdparties/mac/include/vpx/vpx_decoder_compat.h +++ b/thirdparties/mac/include/vpx/vpx_decoder_compat.h @@ -30,555 +30,552 @@ extern "C" { #ifndef VPX_DECODER_COMPAT_H #define VPX_DECODER_COMPAT_H - /*!\brief Decoder algorithm return codes */ - typedef enum { - /*!\brief Operation completed without error */ - VPX_DEC_OK = VPX_CODEC_OK, - - /*!\brief Unspecified error */ - VPX_DEC_ERROR = VPX_CODEC_ERROR, - - /*!\brief Memory operation failed */ - VPX_DEC_MEM_ERROR = VPX_CODEC_MEM_ERROR, - - /*!\brief ABI version mismatch */ - VPX_DEC_ABI_MISMATCH = VPX_CODEC_ABI_MISMATCH, - - /*!\brief The given bitstream is not supported. - * - * The bitstream was unable to be parsed at the highest level. The decoder - * is unable to proceed. This error \ref SHOULD be treated as fatal to the - * stream. */ - VPX_DEC_UNSUP_BITSTREAM = VPX_CODEC_UNSUP_BITSTREAM, - - /*!\brief Encoded bitstream uses an unsupported feature - * - * The decoder does not implement a feature required by the encoder. This - * return code should only be used for features that prevent future - * pictures from being properly decoded. This error \ref MAY be treated as - * fatal to the stream or \ref MAY be treated as fatal to the current GOP. - */ - VPX_DEC_UNSUP_FEATURE = VPX_CODEC_UNSUP_FEATURE, - - /*!\brief The coded data for this stream is corrupt or incomplete - * - * There was a problem decoding the current frame. This return code - * should only be used for failures that prevent future pictures from - * being properly decoded. This error \ref MAY be treated as fatal to the - * stream or \ref MAY be treated as fatal to the current GOP. If decoding - * is continued for the current GOP, artifacts may be present. - */ - VPX_DEC_CORRUPT_FRAME = VPX_CODEC_CORRUPT_FRAME, - - /*!\brief An application-supplied parameter is not valid. - * - */ - VPX_DEC_INVALID_PARAM = VPX_CODEC_INVALID_PARAM, - - /*!\brief An iterator reached the end of list. - * - */ - VPX_DEC_LIST_END = VPX_CODEC_LIST_END - - } - vpx_dec_err_t; - - /*! \brief Decoder capabilities bitfield +/*!\brief Decoder algorithm return codes */ +typedef enum { + /*!\brief Operation completed without error */ + VPX_DEC_OK = VPX_CODEC_OK, + + /*!\brief Unspecified error */ + VPX_DEC_ERROR = VPX_CODEC_ERROR, + + /*!\brief Memory operation failed */ + VPX_DEC_MEM_ERROR = VPX_CODEC_MEM_ERROR, + + /*!\brief ABI version mismatch */ + VPX_DEC_ABI_MISMATCH = VPX_CODEC_ABI_MISMATCH, + + /*!\brief The given bitstream is not supported. + * + * The bitstream was unable to be parsed at the highest level. The decoder + * is unable to proceed. This error \ref SHOULD be treated as fatal to the + * stream. */ + VPX_DEC_UNSUP_BITSTREAM = VPX_CODEC_UNSUP_BITSTREAM, + + /*!\brief Encoded bitstream uses an unsupported feature + * + * The decoder does not implement a feature required by the encoder. This + * return code should only be used for features that prevent future + * pictures from being properly decoded. This error \ref MAY be treated as + * fatal to the stream or \ref MAY be treated as fatal to the current GOP. + */ + VPX_DEC_UNSUP_FEATURE = VPX_CODEC_UNSUP_FEATURE, + + /*!\brief The coded data for this stream is corrupt or incomplete * - * Each decoder advertises the capabilities it supports as part of its - * ::vpx_dec_iface_t interface structure. Capabilities are extra interfaces - * or functionality, and are not required to be supported by a decoder. + * There was a problem decoding the current frame. This return code + * should only be used for failures that prevent future pictures from + * being properly decoded. This error \ref MAY be treated as fatal to the + * stream or \ref MAY be treated as fatal to the current GOP. If decoding + * is continued for the current GOP, artifacts may be present. + */ + VPX_DEC_CORRUPT_FRAME = VPX_CODEC_CORRUPT_FRAME, + + /*!\brief An application-supplied parameter is not valid. + * + */ + VPX_DEC_INVALID_PARAM = VPX_CODEC_INVALID_PARAM, + + /*!\brief An iterator reached the end of list. * - * The available flags are specified by VPX_DEC_CAP_* defines. */ - typedef int vpx_dec_caps_t; + VPX_DEC_LIST_END = VPX_CODEC_LIST_END + +} +vpx_dec_err_t; + +/*! \brief Decoder capabilities bitfield + * + * Each decoder advertises the capabilities it supports as part of its + * ::vpx_dec_iface_t interface structure. Capabilities are extra interfaces + * or functionality, and are not required to be supported by a decoder. + * + * The available flags are specified by VPX_DEC_CAP_* defines. + */ +typedef int vpx_dec_caps_t; #define VPX_DEC_CAP_PUT_SLICE 0x0001 /**< Will issue put_slice callbacks */ #define VPX_DEC_CAP_PUT_FRAME 0x0002 /**< Will issue put_frame callbacks */ #define VPX_DEC_CAP_XMA 0x0004 /**< Supports eXternal Memory Allocation */ - /*!\brief Stream properties - * - * This structure is used to query or set properties of the decoded - * stream. Algorithms may extend this structure with data specific - * to their bitstream by setting the sz member appropriately. - */ +/*!\brief Stream properties + * + * This structure is used to query or set properties of the decoded + * stream. Algorithms may extend this structure with data specific + * to their bitstream by setting the sz member appropriately. + */ #if 1 - typedef vpx_codec_stream_info_t vpx_dec_stream_info_t; +typedef vpx_codec_stream_info_t vpx_dec_stream_info_t; #else - typedef struct - { - unsigned int sz; /**< Size of this structure */ - unsigned int w; /**< Width (or 0 for unknown/default) */ - unsigned int h; /**< Height (or 0 for unknown/default) */ - unsigned int is_kf; /**< Current frame is a keyframe */ - } vpx_dec_stream_info_t; +typedef struct { + unsigned int sz; /**< Size of this structure */ + unsigned int w; /**< Width (or 0 for unknown/default) */ + unsigned int h; /**< Height (or 0 for unknown/default) */ + unsigned int is_kf; /**< Current frame is a keyframe */ +} vpx_dec_stream_info_t; #endif - /*!\brief Decoder interface structure. - * - * Contains function pointers and other data private to the decoder - * implementation. This structure is opaque to the application. - */ - typedef const struct vpx_codec_iface vpx_dec_iface_t; - typedef struct vpx_codec_priv vpx_dec_priv_t; +/*!\brief Decoder interface structure. + * + * Contains function pointers and other data private to the decoder + * implementation. This structure is opaque to the application. + */ +typedef const struct vpx_codec_iface vpx_dec_iface_t; +typedef struct vpx_codec_priv vpx_dec_priv_t; - /*!\brief Iterator - * - * Opaque storage used for iterating over lists. - */ - typedef vpx_codec_iter_t vpx_dec_iter_t; +/*!\brief Iterator + * + * Opaque storage used for iterating over lists. + */ +typedef vpx_codec_iter_t vpx_dec_iter_t; - /*!\brief Decoder context structure - * - * All decoders \ref MUST support this context structure fully. In general, - * this data should be considered private to the decoder algorithm, and - * not be manipulated or examined by the calling application. Applications - * may reference the 'name' member to get a printable description of the - * algorithm. - */ +/*!\brief Decoder context structure + * + * All decoders \ref MUST support this context structure fully. In general, + * this data should be considered private to the decoder algorithm, and + * not be manipulated or examined by the calling application. Applications + * may reference the 'name' member to get a printable description of the + * algorithm. + */ #if 1 - typedef vpx_codec_ctx_t vpx_dec_ctx_t; +typedef vpx_codec_ctx_t vpx_dec_ctx_t; #else - typedef struct - { - const char *name; /**< Printable interface name */ - vpx_dec_iface_t *iface; /**< Interface pointers */ - vpx_dec_err_t err; /**< Last returned error */ - vpx_dec_priv_t *priv; /**< Algorithm private storage */ - } vpx_dec_ctx_t; +typedef struct { + const char *name; /**< Printable interface name */ + vpx_dec_iface_t *iface; /**< Interface pointers */ + vpx_dec_err_t err; /**< Last returned error */ + vpx_dec_priv_t *priv; /**< Algorithm private storage */ +} vpx_dec_ctx_t; #endif - /*!\brief Return the build configuration - * - * Returns a printable string containing an encoded version of the build - * configuration. This may be useful to vpx support. - * - */ - const char *vpx_dec_build_config(void) DEPRECATED; +/*!\brief Return the build configuration + * + * Returns a printable string containing an encoded version of the build + * configuration. This may be useful to vpx support. + * + */ +const char *vpx_dec_build_config(void) DEPRECATED; - /*!\brief Return the name for a given interface - * - * Returns a human readable string for name of the given decoder interface. - * - * \param[in] iface Interface pointer - * - */ - const char *vpx_dec_iface_name(vpx_dec_iface_t *iface) DEPRECATED; +/*!\brief Return the name for a given interface + * + * Returns a human readable string for name of the given decoder interface. + * + * \param[in] iface Interface pointer + * + */ +const char *vpx_dec_iface_name(vpx_dec_iface_t *iface) DEPRECATED; - /*!\brief Convert error number to printable string - * - * Returns a human readable string for the last error returned by the - * algorithm. The returned error will be one line and will not contain - * any newline characters. - * - * - * \param[in] err Error number. - * - */ - const char *vpx_dec_err_to_string(vpx_dec_err_t err) DEPRECATED; +/*!\brief Convert error number to printable string + * + * Returns a human readable string for the last error returned by the + * algorithm. The returned error will be one line and will not contain + * any newline characters. + * + * + * \param[in] err Error number. + * + */ +const char *vpx_dec_err_to_string(vpx_dec_err_t err) DEPRECATED; - /*!\brief Retrieve error synopsis for decoder context - * - * Returns a human readable string for the last error returned by the - * algorithm. The returned error will be one line and will not contain - * any newline characters. - * - * - * \param[in] ctx Pointer to this instance's context. - * - */ - const char *vpx_dec_error(vpx_dec_ctx_t *ctx) DEPRECATED; +/*!\brief Retrieve error synopsis for decoder context + * + * Returns a human readable string for the last error returned by the + * algorithm. The returned error will be one line and will not contain + * any newline characters. + * + * + * \param[in] ctx Pointer to this instance's context. + * + */ +const char *vpx_dec_error(vpx_dec_ctx_t *ctx) DEPRECATED; - /*!\brief Retrieve detailed error information for decoder context - * - * Returns a human readable string providing detailed information about - * the last error. - * - * \param[in] ctx Pointer to this instance's context. - * - * \retval NULL - * No detailed information is available. - */ - const char *vpx_dec_error_detail(vpx_dec_ctx_t *ctx) DEPRECATED; +/*!\brief Retrieve detailed error information for decoder context + * + * Returns a human readable string providing detailed information about + * the last error. + * + * \param[in] ctx Pointer to this instance's context. + * + * \retval NULL + * No detailed information is available. + */ +const char *vpx_dec_error_detail(vpx_dec_ctx_t *ctx) DEPRECATED; - /* REQUIRED FUNCTIONS - * - * The following functions are required to be implemented for all decoders. - * They represent the base case functionality expected of all decoders. - */ +/* REQUIRED FUNCTIONS + * + * The following functions are required to be implemented for all decoders. + * They represent the base case functionality expected of all decoders. + */ - /*!\brief Initialize a decoder instance - * - * Initializes a decoder context using the given interface. Applications - * should call the vpx_dec_init convenience macro instead of this - * function directly, to ensure that the ABI version number parameter - * is properly initialized. - * - * \param[in] ctx Pointer to this instance's context. - * \param[in] iface Pointer to the algorithm interface to use. - * \param[in] ver ABI version number. Must be set to - * VPX_DECODER_ABI_VERSION - * \retval #VPX_DEC_OK - * The decoder algorithm initialized. - * \retval #VPX_DEC_MEM_ERROR - * Memory allocation failed. - */ - vpx_dec_err_t vpx_dec_init_ver(vpx_dec_ctx_t *ctx, - vpx_dec_iface_t *iface, - int ver) DEPRECATED; +/*!\brief Initialize a decoder instance + * + * Initializes a decoder context using the given interface. Applications + * should call the vpx_dec_init convenience macro instead of this + * function directly, to ensure that the ABI version number parameter + * is properly initialized. + * + * \param[in] ctx Pointer to this instance's context. + * \param[in] iface Pointer to the algorithm interface to use. + * \param[in] ver ABI version number. Must be set to + * VPX_DECODER_ABI_VERSION + * \retval #VPX_DEC_OK + * The decoder algorithm initialized. + * \retval #VPX_DEC_MEM_ERROR + * Memory allocation failed. + */ +vpx_dec_err_t vpx_dec_init_ver(vpx_dec_ctx_t *ctx, + vpx_dec_iface_t *iface, + int ver) DEPRECATED; #define vpx_dec_init(ctx, iface) \ vpx_dec_init_ver(ctx, iface, VPX_DECODER_ABI_VERSION) - /*!\brief Destroy a decoder instance - * - * Destroys a decoder context, freeing any associated memory buffers. - * - * \param[in] ctx Pointer to this instance's context - * - * \retval #VPX_DEC_OK - * The decoder algorithm initialized. - * \retval #VPX_DEC_MEM_ERROR - * Memory allocation failed. - */ - vpx_dec_err_t vpx_dec_destroy(vpx_dec_ctx_t *ctx) DEPRECATED; +/*!\brief Destroy a decoder instance + * + * Destroys a decoder context, freeing any associated memory buffers. + * + * \param[in] ctx Pointer to this instance's context + * + * \retval #VPX_DEC_OK + * The decoder algorithm initialized. + * \retval #VPX_DEC_MEM_ERROR + * Memory allocation failed. + */ +vpx_dec_err_t vpx_dec_destroy(vpx_dec_ctx_t *ctx) DEPRECATED; - /*!\brief Get the capabilities of an algorithm. - * - * Retrieves the capabilities bitfield from the algorithm's interface. - * - * \param[in] iface Pointer to the algorithm interface - * - */ - vpx_dec_caps_t vpx_dec_get_caps(vpx_dec_iface_t *iface) DEPRECATED; +/*!\brief Get the capabilities of an algorithm. + * + * Retrieves the capabilities bitfield from the algorithm's interface. + * + * \param[in] iface Pointer to the algorithm interface + * + */ +vpx_dec_caps_t vpx_dec_get_caps(vpx_dec_iface_t *iface) DEPRECATED; - /*!\brief Parse stream info from a buffer - * - * Performs high level parsing of the bitstream. Construction of a decoder - * context is not necessary. Can be used to determine if the bitstream is - * of the proper format, and to extract information from the stream. - * - * \param[in] iface Pointer to the algorithm interface - * \param[in] data Pointer to a block of data to parse - * \param[in] data_sz Size of the data buffer - * \param[in,out] si Pointer to stream info to update. The size member - * \ref MUST be properly initialized, but \ref MAY be - * clobbered by the algorithm. This parameter \ref MAY - * be NULL. - * - * \retval #VPX_DEC_OK - * Bitstream is parsable and stream information updated - */ - vpx_dec_err_t vpx_dec_peek_stream_info(vpx_dec_iface_t *iface, - const uint8_t *data, - unsigned int data_sz, - vpx_dec_stream_info_t *si) DEPRECATED; +/*!\brief Parse stream info from a buffer + * + * Performs high level parsing of the bitstream. Construction of a decoder + * context is not necessary. Can be used to determine if the bitstream is + * of the proper format, and to extract information from the stream. + * + * \param[in] iface Pointer to the algorithm interface + * \param[in] data Pointer to a block of data to parse + * \param[in] data_sz Size of the data buffer + * \param[in,out] si Pointer to stream info to update. The size member + * \ref MUST be properly initialized, but \ref MAY be + * clobbered by the algorithm. This parameter \ref MAY + * be NULL. + * + * \retval #VPX_DEC_OK + * Bitstream is parsable and stream information updated + */ +vpx_dec_err_t vpx_dec_peek_stream_info(vpx_dec_iface_t *iface, + const uint8_t *data, + unsigned int data_sz, + vpx_dec_stream_info_t *si) DEPRECATED; - /*!\brief Return information about the current stream. - * - * Returns information about the stream that has been parsed during decoding. - * - * \param[in] ctx Pointer to this instance's context - * \param[in,out] si Pointer to stream info to update. The size member - * \ref MUST be properly initialized, but \ref MAY be - * clobbered by the algorithm. This parameter \ref MAY - * be NULL. - * - * \retval #VPX_DEC_OK - * Bitstream is parsable and stream information updated - */ - vpx_dec_err_t vpx_dec_get_stream_info(vpx_dec_ctx_t *ctx, - vpx_dec_stream_info_t *si) DEPRECATED; +/*!\brief Return information about the current stream. + * + * Returns information about the stream that has been parsed during decoding. + * + * \param[in] ctx Pointer to this instance's context + * \param[in,out] si Pointer to stream info to update. The size member + * \ref MUST be properly initialized, but \ref MAY be + * clobbered by the algorithm. This parameter \ref MAY + * be NULL. + * + * \retval #VPX_DEC_OK + * Bitstream is parsable and stream information updated + */ +vpx_dec_err_t vpx_dec_get_stream_info(vpx_dec_ctx_t *ctx, + vpx_dec_stream_info_t *si) DEPRECATED; - /*!\brief Control algorithm - * - * This function is used to exchange algorithm specific data with the decoder - * instance. This can be used to implement features specific to a particular - * algorithm. - * - * This wrapper function dispatches the request to the helper function - * associated with the given ctrl_id. It tries to call this function - * transparently, but will return #VPX_DEC_ERROR if the request could not - * be dispatched. - * - * \param[in] ctx Pointer to this instance's context - * \param[in] ctrl_id Algorithm specific control identifier - * \param[in,out] data Data to exchange with algorithm instance. - * - * \retval #VPX_DEC_OK - * The control request was processed. - * \retval #VPX_DEC_ERROR - * The control request was not processed. - * \retval #VPX_DEC_INVALID_PARAM - * The data was not valid. - */ - vpx_dec_err_t vpx_dec_control(vpx_dec_ctx_t *ctx, - int ctrl_id, - void *data) DEPRECATED; +/*!\brief Control algorithm + * + * This function is used to exchange algorithm specific data with the decoder + * instance. This can be used to implement features specific to a particular + * algorithm. + * + * This wrapper function dispatches the request to the helper function + * associated with the given ctrl_id. It tries to call this function + * transparently, but will return #VPX_DEC_ERROR if the request could not + * be dispatched. + * + * \param[in] ctx Pointer to this instance's context + * \param[in] ctrl_id Algorithm specific control identifier + * \param[in,out] data Data to exchange with algorithm instance. + * + * \retval #VPX_DEC_OK + * The control request was processed. + * \retval #VPX_DEC_ERROR + * The control request was not processed. + * \retval #VPX_DEC_INVALID_PARAM + * The data was not valid. + */ +vpx_dec_err_t vpx_dec_control(vpx_dec_ctx_t *ctx, + int ctrl_id, + void *data) DEPRECATED; - /*!\brief Decode data - * - * Processes a buffer of coded data. If the processing results in a new - * decoded frame becoming available, #VPX_DEC_CB_PUT_SLICE and - * #VPX_DEC_CB_PUT_FRAME events may be generated, as appropriate. Encoded data - * \ref MUST be passed in DTS (decode time stamp) order. Frames produced will - * always be in PTS (presentation time stamp) order. - * - * \param[in] ctx Pointer to this instance's context - * \param[in] data Pointer to this block of new coded data. If - * NULL, a VPX_DEC_CB_PUT_FRAME event is posted - * for the previously decoded frame. - * \param[in] data_sz Size of the coded data, in bytes. - * \param[in] user_priv Application specific data to associate with - * this frame. - * \param[in] rel_pts PTS relative to the previous frame, in us. If - * unknown or unavailable, set to zero. - * - * \return Returns #VPX_DEC_OK if the coded data was processed completely - * and future pictures can be decoded without error. Otherwise, - * see the descriptions of the other error codes in ::vpx_dec_err_t - * for recoverability capabilities. - */ - vpx_dec_err_t vpx_dec_decode(vpx_dec_ctx_t *ctx, - uint8_t *data, - unsigned int data_sz, - void *user_priv, - int rel_pts) DEPRECATED; +/*!\brief Decode data + * + * Processes a buffer of coded data. If the processing results in a new + * decoded frame becoming available, #VPX_DEC_CB_PUT_SLICE and + * #VPX_DEC_CB_PUT_FRAME events may be generated, as appropriate. Encoded data + * \ref MUST be passed in DTS (decode time stamp) order. Frames produced will + * always be in PTS (presentation time stamp) order. + * + * \param[in] ctx Pointer to this instance's context + * \param[in] data Pointer to this block of new coded data. If + * NULL, a VPX_DEC_CB_PUT_FRAME event is posted + * for the previously decoded frame. + * \param[in] data_sz Size of the coded data, in bytes. + * \param[in] user_priv Application specific data to associate with + * this frame. + * \param[in] rel_pts PTS relative to the previous frame, in us. If + * unknown or unavailable, set to zero. + * + * \return Returns #VPX_DEC_OK if the coded data was processed completely + * and future pictures can be decoded without error. Otherwise, + * see the descriptions of the other error codes in ::vpx_dec_err_t + * for recoverability capabilities. + */ +vpx_dec_err_t vpx_dec_decode(vpx_dec_ctx_t *ctx, + uint8_t *data, + unsigned int data_sz, + void *user_priv, + int rel_pts) DEPRECATED; - /*!\brief Decoded frames iterator - * - * Iterates over a list of the frames available for display. The iterator - * storage should be initialized to NULL to start the iteration. Iteration is - * complete when this function returns NULL. - * - * The list of available frames becomes valid upon completion of the - * vpx_dec_decode call, and remains valid until the next call to vpx_dec_decode. - * - * \param[in] ctx Pointer to this instance's context - * \param[in out] iter Iterator storage, initialized to NULL - * - * \return Returns a pointer to an image, if one is ready for display. Frames - * produced will always be in PTS (presentation time stamp) order. - */ - vpx_image_t *vpx_dec_get_frame(vpx_dec_ctx_t *ctx, - vpx_dec_iter_t *iter) DEPRECATED; +/*!\brief Decoded frames iterator + * + * Iterates over a list of the frames available for display. The iterator + * storage should be initialized to NULL to start the iteration. Iteration is + * complete when this function returns NULL. + * + * The list of available frames becomes valid upon completion of the + * vpx_dec_decode call, and remains valid until the next call to vpx_dec_decode. + * + * \param[in] ctx Pointer to this instance's context + * \param[in out] iter Iterator storage, initialized to NULL + * + * \return Returns a pointer to an image, if one is ready for display. Frames + * produced will always be in PTS (presentation time stamp) order. + */ +vpx_image_t *vpx_dec_get_frame(vpx_dec_ctx_t *ctx, + vpx_dec_iter_t *iter) DEPRECATED; - /*!\defgroup cap_put_frame Frame-Based Decoding Functions - * - * The following functions are required to be implemented for all decoders - * that advertise the VPX_DEC_CAP_PUT_FRAME capability. Calling these functions - * for codecs that don't advertise this capability will result in an error - * code being returned, usually VPX_DEC_ERROR - * @{ - */ +/*!\defgroup cap_put_frame Frame-Based Decoding Functions + * + * The following functions are required to be implemented for all decoders + * that advertise the VPX_DEC_CAP_PUT_FRAME capability. Calling these functions + * for codecs that don't advertise this capability will result in an error + * code being returned, usually VPX_DEC_ERROR + * @{ + */ - /*!\brief put frame callback prototype - * - * This callback is invoked by the decoder to notify the application of - * the availability of decoded image data. - */ - typedef void (*vpx_dec_put_frame_cb_fn_t)(void *user_priv, - const vpx_image_t *img); +/*!\brief put frame callback prototype + * + * This callback is invoked by the decoder to notify the application of + * the availability of decoded image data. + */ +typedef void (*vpx_dec_put_frame_cb_fn_t)(void *user_priv, + const vpx_image_t *img); - /*!\brief Register for notification of frame completion. - * - * Registers a given function to be called when a decoded frame is - * available. - * - * \param[in] ctx Pointer to this instance's context - * \param[in] cb Pointer to the callback function - * \param[in] user_priv User's private data - * - * \retval #VPX_DEC_OK - * Callback successfully registered. - * \retval #VPX_DEC_ERROR - * Decoder context not initialized, or algorithm not capable of - * posting slice completion. - */ - vpx_dec_err_t vpx_dec_register_put_frame_cb(vpx_dec_ctx_t *ctx, - vpx_dec_put_frame_cb_fn_t cb, - void *user_priv) DEPRECATED; +/*!\brief Register for notification of frame completion. + * + * Registers a given function to be called when a decoded frame is + * available. + * + * \param[in] ctx Pointer to this instance's context + * \param[in] cb Pointer to the callback function + * \param[in] user_priv User's private data + * + * \retval #VPX_DEC_OK + * Callback successfully registered. + * \retval #VPX_DEC_ERROR + * Decoder context not initialized, or algorithm not capable of + * posting slice completion. + */ +vpx_dec_err_t vpx_dec_register_put_frame_cb(vpx_dec_ctx_t *ctx, + vpx_dec_put_frame_cb_fn_t cb, + void *user_priv) DEPRECATED; - /*!@} - end defgroup cap_put_frame */ +/*!@} - end defgroup cap_put_frame */ - /*!\defgroup cap_put_slice Slice-Based Decoding Functions - * - * The following functions are required to be implemented for all decoders - * that advertise the VPX_DEC_CAP_PUT_SLICE capability. Calling these functions - * for codecs that don't advertise this capability will result in an error - * code being returned, usually VPX_DEC_ERROR - * @{ - */ +/*!\defgroup cap_put_slice Slice-Based Decoding Functions + * + * The following functions are required to be implemented for all decoders + * that advertise the VPX_DEC_CAP_PUT_SLICE capability. Calling these functions + * for codecs that don't advertise this capability will result in an error + * code being returned, usually VPX_DEC_ERROR + * @{ + */ - /*!\brief put slice callback prototype - * - * This callback is invoked by the decoder to notify the application of - * the availability of partially decoded image data. The - */ - typedef void (*vpx_dec_put_slice_cb_fn_t)(void *user_priv, - const vpx_image_t *img, - const vpx_image_rect_t *valid, - const vpx_image_rect_t *update); +/*!\brief put slice callback prototype + * + * This callback is invoked by the decoder to notify the application of + * the availability of partially decoded image data. The + */ +typedef void (*vpx_dec_put_slice_cb_fn_t)(void *user_priv, + const vpx_image_t *img, + const vpx_image_rect_t *valid, + const vpx_image_rect_t *update); - /*!\brief Register for notification of slice completion. - * - * Registers a given function to be called when a decoded slice is - * available. - * - * \param[in] ctx Pointer to this instance's context - * \param[in] cb Pointer to the callback function - * \param[in] user_priv User's private data - * - * \retval #VPX_DEC_OK - * Callback successfully registered. - * \retval #VPX_DEC_ERROR - * Decoder context not initialized, or algorithm not capable of - * posting slice completion. - */ - vpx_dec_err_t vpx_dec_register_put_slice_cb(vpx_dec_ctx_t *ctx, - vpx_dec_put_slice_cb_fn_t cb, - void *user_priv) DEPRECATED; +/*!\brief Register for notification of slice completion. + * + * Registers a given function to be called when a decoded slice is + * available. + * + * \param[in] ctx Pointer to this instance's context + * \param[in] cb Pointer to the callback function + * \param[in] user_priv User's private data + * + * \retval #VPX_DEC_OK + * Callback successfully registered. + * \retval #VPX_DEC_ERROR + * Decoder context not initialized, or algorithm not capable of + * posting slice completion. + */ +vpx_dec_err_t vpx_dec_register_put_slice_cb(vpx_dec_ctx_t *ctx, + vpx_dec_put_slice_cb_fn_t cb, + void *user_priv) DEPRECATED; - /*!@} - end defgroup cap_put_slice*/ +/*!@} - end defgroup cap_put_slice*/ - /*!\defgroup cap_xma External Memory Allocation Functions - * - * The following functions are required to be implemented for all decoders - * that advertise the VPX_DEC_CAP_XMA capability. Calling these functions - * for codecs that don't advertise this capability will result in an error - * code being returned, usually VPX_DEC_ERROR - * @{ - */ +/*!\defgroup cap_xma External Memory Allocation Functions + * + * The following functions are required to be implemented for all decoders + * that advertise the VPX_DEC_CAP_XMA capability. Calling these functions + * for codecs that don't advertise this capability will result in an error + * code being returned, usually VPX_DEC_ERROR + * @{ + */ - /*!\brief Memory Map Entry - * - * This structure is used to contain the properties of a memory segment. It - * is populated by the decoder in the request phase, and by the calling - * application once the requested allocation has been performed. - */ +/*!\brief Memory Map Entry + * + * This structure is used to contain the properties of a memory segment. It + * is populated by the decoder in the request phase, and by the calling + * application once the requested allocation has been performed. + */ #if 1 #define VPX_DEC_MEM_ZERO 0x1 /**< Segment must be zeroed by allocation */ #define VPX_DEC_MEM_WRONLY 0x2 /**< Segment need not be readable */ #define VPX_DEC_MEM_FAST 0x4 /**< Place in fast memory, if available */ - typedef struct vpx_codec_mmap vpx_dec_mmap_t; +typedef struct vpx_codec_mmap vpx_dec_mmap_t; #else - typedef struct vpx_dec_mmap - { - /* - * The following members are set by the codec when requesting a segment - */ - unsigned int id; /**< identifier for the segment's contents */ - unsigned long sz; /**< size of the segment, in bytes */ - unsigned int align; /**< required alignment of the segment, in bytes */ - unsigned int flags; /**< bitfield containing segment properties */ +typedef struct vpx_dec_mmap { + /* + * The following members are set by the codec when requesting a segment + */ + unsigned int id; /**< identifier for the segment's contents */ + unsigned long sz; /**< size of the segment, in bytes */ + unsigned int align; /**< required alignment of the segment, in bytes */ + unsigned int flags; /**< bitfield containing segment properties */ #define VPX_DEC_MEM_ZERO 0x1 /**< Segment must be zeroed by allocation */ #define VPX_DEC_MEM_WRONLY 0x2 /**< Segment need not be readable */ #define VPX_DEC_MEM_FAST 0x4 /**< Place in fast memory, if available */ - /* The following members are to be filled in by the allocation function */ - void *base; /**< pointer to the allocated segment */ - void (*dtor)(struct vpx_dec_mmap *map); /**< destructor to call */ - void *priv; /**< allocator private storage */ - } vpx_dec_mmap_t; + /* The following members are to be filled in by the allocation function */ + void *base; /**< pointer to the allocated segment */ + void (*dtor)(struct vpx_dec_mmap *map); /**< destructor to call */ + void *priv; /**< allocator private storage */ +} vpx_dec_mmap_t; #endif - /*!\brief Initialize a decoder instance in external allocation mode - * - * Initializes a decoder context using the given interface. Applications - * should call the vpx_dec_xma_init convenience macro instead of this - * function directly, to ensure that the ABI version number parameter - * is properly initialized. - * - * \param[in] ctx Pointer to this instance's context. - * \param[in] iface Pointer to the algorithm interface to use. - * \param[in] ver ABI version number. Must be set to - * VPX_DECODER_ABI_VERSION - * \retval #VPX_DEC_OK - * The decoder algorithm initialized. - * \retval #VPX_DEC_ERROR - * Decoder does not support XMA mode. - */ - vpx_dec_err_t vpx_dec_xma_init_ver(vpx_dec_ctx_t *ctx, - vpx_dec_iface_t *iface, - int ver) DEPRECATED; +/*!\brief Initialize a decoder instance in external allocation mode + * + * Initializes a decoder context using the given interface. Applications + * should call the vpx_dec_xma_init convenience macro instead of this + * function directly, to ensure that the ABI version number parameter + * is properly initialized. + * + * \param[in] ctx Pointer to this instance's context. + * \param[in] iface Pointer to the algorithm interface to use. + * \param[in] ver ABI version number. Must be set to + * VPX_DECODER_ABI_VERSION + * \retval #VPX_DEC_OK + * The decoder algorithm initialized. + * \retval #VPX_DEC_ERROR + * Decoder does not support XMA mode. + */ +vpx_dec_err_t vpx_dec_xma_init_ver(vpx_dec_ctx_t *ctx, + vpx_dec_iface_t *iface, + int ver) DEPRECATED; #define vpx_dec_xma_init(ctx, iface) \ vpx_dec_xma_init_ver(ctx, iface, VPX_DECODER_ABI_VERSION) - /*!\brief Iterate over the list of segments to allocate. - * - * Iterates over a list of the segments to allocate. The iterator storage - * should be initialized to NULL to start the iteration. Iteration is complete - * when this function returns VPX_DEC_LIST_END. The amount of memory needed to - * allocate is dependent upon the size of the encoded stream. This means that - * the stream info structure must be known at allocation time. It can be - * populated with the vpx_dec_peek_stream_info() function. In cases where the - * stream to be decoded is not available at allocation time, a fixed size must - * be requested. The decoder will not be able to decode streams larger than - * the size used at allocation time. - * - * \param[in] ctx Pointer to this instance's context. - * \param[out] mmap Pointer to the memory map entry to populate. - * \param[in] si Pointer to the stream info. - * \param[in out] iter Iterator storage, initialized to NULL - * - * \retval #VPX_DEC_OK - * The memory map entry was populated. - * \retval #VPX_DEC_ERROR - * Decoder does not support XMA mode. - * \retval #VPX_DEC_MEM_ERROR - * Unable to determine segment size from stream info. - */ - vpx_dec_err_t vpx_dec_get_mem_map(vpx_dec_ctx_t *ctx, - vpx_dec_mmap_t *mmap, - const vpx_dec_stream_info_t *si, - vpx_dec_iter_t *iter) DEPRECATED; +/*!\brief Iterate over the list of segments to allocate. + * + * Iterates over a list of the segments to allocate. The iterator storage + * should be initialized to NULL to start the iteration. Iteration is complete + * when this function returns VPX_DEC_LIST_END. The amount of memory needed to + * allocate is dependent upon the size of the encoded stream. This means that + * the stream info structure must be known at allocation time. It can be + * populated with the vpx_dec_peek_stream_info() function. In cases where the + * stream to be decoded is not available at allocation time, a fixed size must + * be requested. The decoder will not be able to decode streams larger than + * the size used at allocation time. + * + * \param[in] ctx Pointer to this instance's context. + * \param[out] mmap Pointer to the memory map entry to populate. + * \param[in] si Pointer to the stream info. + * \param[in out] iter Iterator storage, initialized to NULL + * + * \retval #VPX_DEC_OK + * The memory map entry was populated. + * \retval #VPX_DEC_ERROR + * Decoder does not support XMA mode. + * \retval #VPX_DEC_MEM_ERROR + * Unable to determine segment size from stream info. + */ +vpx_dec_err_t vpx_dec_get_mem_map(vpx_dec_ctx_t *ctx, + vpx_dec_mmap_t *mmap, + const vpx_dec_stream_info_t *si, + vpx_dec_iter_t *iter) DEPRECATED; - /*!\brief Identify allocated segments to decoder instance - * - * Stores a list of allocated segments in the decoder. Segments \ref MUST be - * passed in the order they are read from vpx_dec_get_mem_map(), but may be - * passed in groups of any size. Segments \ref MUST be set only once. The - * allocation function \ref MUST ensure that the vpx_dec_mmap_t::base member - * is non-NULL. If the segment requires cleanup handling (e.g., calling free() - * or close()) then the vpx_dec_mmap_t::dtor member \ref MUST be populated. - * - * \param[in] ctx Pointer to this instance's context. - * \param[in] mmaps Pointer to the first memory map entry in the list. - * \param[in] num_maps Number of entries being set at this time - * - * \retval #VPX_DEC_OK - * The segment was stored in the decoder context. - * \retval #VPX_DEC_ERROR - * Decoder does not support XMA mode. - * \retval #VPX_DEC_MEM_ERROR - * Segment base address was not set, or segment was already stored. +/*!\brief Identify allocated segments to decoder instance + * + * Stores a list of allocated segments in the decoder. Segments \ref MUST be + * passed in the order they are read from vpx_dec_get_mem_map(), but may be + * passed in groups of any size. Segments \ref MUST be set only once. The + * allocation function \ref MUST ensure that the vpx_dec_mmap_t::base member + * is non-NULL. If the segment requires cleanup handling (e.g., calling free() + * or close()) then the vpx_dec_mmap_t::dtor member \ref MUST be populated. + * + * \param[in] ctx Pointer to this instance's context. + * \param[in] mmaps Pointer to the first memory map entry in the list. + * \param[in] num_maps Number of entries being set at this time + * + * \retval #VPX_DEC_OK + * The segment was stored in the decoder context. + * \retval #VPX_DEC_ERROR + * Decoder does not support XMA mode. + * \retval #VPX_DEC_MEM_ERROR + * Segment base address was not set, or segment was already stored. - */ - vpx_dec_err_t vpx_dec_set_mem_map(vpx_dec_ctx_t *ctx, - vpx_dec_mmap_t *mmaps, - unsigned int num_maps) DEPRECATED; + */ +vpx_dec_err_t vpx_dec_set_mem_map(vpx_dec_ctx_t *ctx, + vpx_dec_mmap_t *mmaps, + unsigned int num_maps) DEPRECATED; - /*!@} - end defgroup cap_xma*/ - /*!@} - end defgroup decoder*/ +/*!@} - end defgroup cap_xma*/ +/*!@} - end defgroup decoder*/ #endif diff --git a/thirdparties/mac/include/vpx/vpx_encoder.h b/thirdparties/mac/include/vpx/vpx_encoder.h index 239036e..749531e 100755 --- a/thirdparties/mac/include/vpx/vpx_encoder.h +++ b/thirdparties/mac/include/vpx/vpx_encoder.h @@ -46,75 +46,74 @@ extern "C" { /*!\deprecated Use #VPX_TS_MAX_LAYERS instead. */ #define MAX_LAYERS VPX_TS_MAX_LAYERS - /*!\brief Current ABI version number - * - * \internal - * If this file is altered in any way that changes the ABI, this value - * must be bumped. Examples include, but are not limited to, changing - * types, removing or reassigning enums, adding/removing/rearranging - * fields to structures - */ +/*!\brief Current ABI version number + * + * \internal + * If this file is altered in any way that changes the ABI, this value + * must be bumped. Examples include, but are not limited to, changing + * types, removing or reassigning enums, adding/removing/rearranging + * fields to structures + */ #define VPX_ENCODER_ABI_VERSION (3 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer*/ - /*! \brief Encoder capabilities bitfield - * - * Each encoder advertises the capabilities it supports as part of its - * ::vpx_codec_iface_t interface structure. Capabilities are extra - * interfaces or functionality, and are not required to be supported - * by an encoder. - * - * The available flags are specified by VPX_CODEC_CAP_* defines. - */ +/*! \brief Encoder capabilities bitfield + * + * Each encoder advertises the capabilities it supports as part of its + * ::vpx_codec_iface_t interface structure. Capabilities are extra + * interfaces or functionality, and are not required to be supported + * by an encoder. + * + * The available flags are specified by VPX_CODEC_CAP_* defines. + */ #define VPX_CODEC_CAP_PSNR 0x10000 /**< Can issue PSNR packets */ - /*! Can output one partition at a time. Each partition is returned in its - * own VPX_CODEC_CX_FRAME_PKT, with the FRAME_IS_FRAGMENT flag set for - * every partition but the last. In this mode all frames are always - * returned partition by partition. - */ +/*! Can output one partition at a time. Each partition is returned in its + * own VPX_CODEC_CX_FRAME_PKT, with the FRAME_IS_FRAGMENT flag set for + * every partition but the last. In this mode all frames are always + * returned partition by partition. + */ #define VPX_CODEC_CAP_OUTPUT_PARTITION 0x20000 - /*! \brief Initialization-time Feature Enabling - * - * Certain codec features must be known at initialization time, to allow - * for proper memory allocation. - * - * The available flags are specified by VPX_CODEC_USE_* defines. - */ +/*! \brief Initialization-time Feature Enabling + * + * Certain codec features must be known at initialization time, to allow + * for proper memory allocation. + * + * The available flags are specified by VPX_CODEC_USE_* defines. + */ #define VPX_CODEC_USE_PSNR 0x10000 /**< Calculate PSNR on each frame */ #define VPX_CODEC_USE_OUTPUT_PARTITION 0x20000 /**< Make the encoder output one partition at a time. */ - /*!\brief Generic fixed size buffer structure - * - * This structure is able to hold a reference to any fixed size buffer. - */ - typedef struct vpx_fixed_buf - { - void *buf; /**< Pointer to the data */ - size_t sz; /**< Length of the buffer, in chars */ - } vpx_fixed_buf_t; /**< alias for struct vpx_fixed_buf */ +/*!\brief Generic fixed size buffer structure + * + * This structure is able to hold a reference to any fixed size buffer. + */ +typedef struct vpx_fixed_buf { + void *buf; /**< Pointer to the data */ + size_t sz; /**< Length of the buffer, in chars */ +} vpx_fixed_buf_t; /**< alias for struct vpx_fixed_buf */ - /*!\brief Time Stamp Type - * - * An integer, which when multiplied by the stream's time base, provides - * the absolute time of a sample. - */ - typedef int64_t vpx_codec_pts_t; +/*!\brief Time Stamp Type + * + * An integer, which when multiplied by the stream's time base, provides + * the absolute time of a sample. + */ +typedef int64_t vpx_codec_pts_t; - /*!\brief Compressed Frame Flags - * - * This type represents a bitfield containing information about a compressed - * frame that may be useful to an application. The most significant 16 bits - * can be used by an algorithm to provide additional detail, for example to - * support frame types that are codec specific (MPEG-1 D-frames for example) - */ - typedef uint32_t vpx_codec_frame_flags_t; +/*!\brief Compressed Frame Flags + * + * This type represents a bitfield containing information about a compressed + * frame that may be useful to an application. The most significant 16 bits + * can be used by an algorithm to provide additional detail, for example to + * support frame types that are codec specific (MPEG-1 D-frames for example) + */ +typedef uint32_t vpx_codec_frame_flags_t; #define VPX_FRAME_IS_KEY 0x1 /**< frame is the start of a GOP */ #define VPX_FRAME_IS_DROPPABLE 0x2 /**< frame can be dropped without affecting the stream (no future frame depends on @@ -124,13 +123,13 @@ extern "C" { #define VPX_FRAME_IS_FRAGMENT 0x8 /**< this is a fragment of the encoded frame */ - /*!\brief Error Resilient flags - * - * These flags define which error resilient features to enable in the - * encoder. The flags are specified through the - * vpx_codec_enc_cfg::g_error_resilient variable. - */ - typedef uint32_t vpx_codec_er_flags_t; +/*!\brief Error Resilient flags + * + * These flags define which error resilient features to enable in the + * encoder. The flags are specified through the + * vpx_codec_enc_cfg::g_error_resilient variable. + */ +typedef uint32_t vpx_codec_er_flags_t; #define VPX_ERROR_RESILIENT_DEFAULT 0x1 /**< Improve resiliency against losses of whole frames */ #define VPX_ERROR_RESILIENT_PARTITIONS 0x2 /**< The frame partitions are @@ -142,645 +141,635 @@ extern "C" { predicition is still done over the partition boundary. */ - /*!\brief Encoder output packet variants - * - * This enumeration lists the different kinds of data packets that can be - * returned by calls to vpx_codec_get_cx_data(). Algorithms \ref MAY - * extend this list to provide additional functionality. - */ - enum vpx_codec_cx_pkt_kind - { - VPX_CODEC_CX_FRAME_PKT, /**< Compressed video frame */ - VPX_CODEC_STATS_PKT, /**< Two-pass statistics for this frame */ - VPX_CODEC_PSNR_PKT, /**< PSNR statistics for this frame */ - VPX_CODEC_CUSTOM_PKT = 256 /**< Algorithm extensions */ - }; +/*!\brief Encoder output packet variants + * + * This enumeration lists the different kinds of data packets that can be + * returned by calls to vpx_codec_get_cx_data(). Algorithms \ref MAY + * extend this list to provide additional functionality. + */ +enum vpx_codec_cx_pkt_kind { + VPX_CODEC_CX_FRAME_PKT, /**< Compressed video frame */ + VPX_CODEC_STATS_PKT, /**< Two-pass statistics for this frame */ + VPX_CODEC_PSNR_PKT, /**< PSNR statistics for this frame */ + VPX_CODEC_CUSTOM_PKT = 256 /**< Algorithm extensions */ +}; - /*!\brief Encoder output packet - * - * This structure contains the different kinds of output data the encoder - * may produce while compressing a frame. - */ - typedef struct vpx_codec_cx_pkt - { - enum vpx_codec_cx_pkt_kind kind; /**< packet variant */ - union - { - struct - { - void *buf; /**< compressed data buffer */ - size_t sz; /**< length of compressed data */ - vpx_codec_pts_t pts; /**< time stamp to show frame +/*!\brief Encoder output packet + * + * This structure contains the different kinds of output data the encoder + * may produce while compressing a frame. + */ +typedef struct vpx_codec_cx_pkt { + enum vpx_codec_cx_pkt_kind kind; /**< packet variant */ + union { + struct { + void *buf; /**< compressed data buffer */ + size_t sz; /**< length of compressed data */ + vpx_codec_pts_t pts; /**< time stamp to show frame (in timebase units) */ - unsigned long duration; /**< duration to show frame + unsigned long duration; /**< duration to show frame (in timebase units) */ - vpx_codec_frame_flags_t flags; /**< flags for this frame */ - int partition_id; /**< the partition id + vpx_codec_frame_flags_t flags; /**< flags for this frame */ + int partition_id; /**< the partition id defines the decoding order of the partitions. Only applicable when "output partition" mode is enabled. First partition has id 0.*/ - } frame; /**< data for compressed frame packet */ - struct vpx_fixed_buf twopass_stats; /**< data for two-pass packet */ - struct vpx_psnr_pkt - { - unsigned int samples[4]; /**< Number of samples, total/y/u/v */ - uint64_t sse[4]; /**< sum squared error, total/y/u/v */ - double psnr[4]; /**< PSNR, total/y/u/v */ - } psnr; /**< data for PSNR packet */ - struct vpx_fixed_buf raw; /**< data for arbitrary packets */ + } frame; /**< data for compressed frame packet */ + struct vpx_fixed_buf twopass_stats; /**< data for two-pass packet */ + struct vpx_psnr_pkt { + unsigned int samples[4]; /**< Number of samples, total/y/u/v */ + uint64_t sse[4]; /**< sum squared error, total/y/u/v */ + double psnr[4]; /**< PSNR, total/y/u/v */ + } psnr; /**< data for PSNR packet */ + struct vpx_fixed_buf raw; /**< data for arbitrary packets */ - /* This packet size is fixed to allow codecs to extend this - * interface without having to manage storage for raw packets, - * i.e., if it's smaller than 128 bytes, you can store in the - * packet list directly. - */ - char pad[128 - sizeof(enum vpx_codec_cx_pkt_kind)]; /**< fixed sz */ - } data; /**< packet data */ - } vpx_codec_cx_pkt_t; /**< alias for struct vpx_codec_cx_pkt */ + /* This packet size is fixed to allow codecs to extend this + * interface without having to manage storage for raw packets, + * i.e., if it's smaller than 128 bytes, you can store in the + * packet list directly. + */ + char pad[128 - sizeof(enum vpx_codec_cx_pkt_kind)]; /**< fixed sz */ + } data; /**< packet data */ +} vpx_codec_cx_pkt_t; /**< alias for struct vpx_codec_cx_pkt */ - /*!\brief Rational Number - * - * This structure holds a fractional value. - */ - typedef struct vpx_rational - { - int num; /**< fraction numerator */ - int den; /**< fraction denominator */ - } vpx_rational_t; /**< alias for struct vpx_rational */ +/*!\brief Rational Number + * + * This structure holds a fractional value. + */ +typedef struct vpx_rational { + int num; /**< fraction numerator */ + int den; /**< fraction denominator */ +} vpx_rational_t; /**< alias for struct vpx_rational */ - /*!\brief Multi-pass Encoding Pass */ - enum vpx_enc_pass - { - VPX_RC_ONE_PASS, /**< Single pass mode */ - VPX_RC_FIRST_PASS, /**< First pass of multi-pass mode */ - VPX_RC_LAST_PASS /**< Final pass of multi-pass mode */ - }; +/*!\brief Multi-pass Encoding Pass */ +enum vpx_enc_pass { + VPX_RC_ONE_PASS, /**< Single pass mode */ + VPX_RC_FIRST_PASS, /**< First pass of multi-pass mode */ + VPX_RC_LAST_PASS /**< Final pass of multi-pass mode */ +}; - /*!\brief Rate control mode */ - enum vpx_rc_mode - { - VPX_VBR, /**< Variable Bit Rate (VBR) mode */ - VPX_CBR, /**< Constant Bit Rate (CBR) mode */ - VPX_CQ /**< Constant Quality (CQ) mode */ - }; +/*!\brief Rate control mode */ +enum vpx_rc_mode { + VPX_VBR, /**< Variable Bit Rate (VBR) mode */ + VPX_CBR, /**< Constant Bit Rate (CBR) mode */ + VPX_CQ /**< Constant Quality (CQ) mode */ +}; - /*!\brief Keyframe placement mode. - * - * This enumeration determines whether keyframes are placed automatically by - * the encoder or whether this behavior is disabled. Older releases of this - * SDK were implemented such that VPX_KF_FIXED meant keyframes were disabled. - * This name is confusing for this behavior, so the new symbols to be used - * are VPX_KF_AUTO and VPX_KF_DISABLED. - */ - enum vpx_kf_mode - { - VPX_KF_FIXED, /**< deprecated, implies VPX_KF_DISABLED */ - VPX_KF_AUTO, /**< Encoder determines optimal placement automatically */ - VPX_KF_DISABLED = 0 /**< Encoder does not place keyframes. */ - }; +/*!\brief Keyframe placement mode. + * + * This enumeration determines whether keyframes are placed automatically by + * the encoder or whether this behavior is disabled. Older releases of this + * SDK were implemented such that VPX_KF_FIXED meant keyframes were disabled. + * This name is confusing for this behavior, so the new symbols to be used + * are VPX_KF_AUTO and VPX_KF_DISABLED. + */ +enum vpx_kf_mode { + VPX_KF_FIXED, /**< deprecated, implies VPX_KF_DISABLED */ + VPX_KF_AUTO, /**< Encoder determines optimal placement automatically */ + VPX_KF_DISABLED = 0 /**< Encoder does not place keyframes. */ +}; - /*!\brief Encoded Frame Flags - * - * This type indicates a bitfield to be passed to vpx_codec_encode(), defining - * per-frame boolean values. By convention, bits common to all codecs will be - * named VPX_EFLAG_*, and bits specific to an algorithm will be named - * /algo/_eflag_*. The lower order 16 bits are reserved for common use. - */ - typedef long vpx_enc_frame_flags_t; +/*!\brief Encoded Frame Flags + * + * This type indicates a bitfield to be passed to vpx_codec_encode(), defining + * per-frame boolean values. By convention, bits common to all codecs will be + * named VPX_EFLAG_*, and bits specific to an algorithm will be named + * /algo/_eflag_*. The lower order 16 bits are reserved for common use. + */ +typedef long vpx_enc_frame_flags_t; #define VPX_EFLAG_FORCE_KF (1<<0) /**< Force this frame to be a keyframe */ - /*!\brief Encoder configuration structure +/*!\brief Encoder configuration structure + * + * This structure contains the encoder settings that have common representations + * across all codecs. This doesn't imply that all codecs support all features, + * however. + */ +typedef struct vpx_codec_enc_cfg { + /* + * generic settings (g) + */ + + /*!\brief Algorithm specific "usage" value * - * This structure contains the encoder settings that have common representations - * across all codecs. This doesn't imply that all codecs support all features, - * however. + * Algorithms may define multiple values for usage, which may convey the + * intent of how the application intends to use the stream. If this value + * is non-zero, consult the documentation for the codec to determine its + * meaning. */ - typedef struct vpx_codec_enc_cfg - { - /* - * generic settings (g) - */ + unsigned int g_usage; - /*!\brief Algorithm specific "usage" value - * - * Algorithms may define multiple values for usage, which may convey the - * intent of how the application intends to use the stream. If this value - * is non-zero, consult the documentation for the codec to determine its - * meaning. - */ - unsigned int g_usage; + /*!\brief Maximum number of threads to use + * + * For multi-threaded implementations, use no more than this number of + * threads. The codec may use fewer threads than allowed. The value + * 0 is equivalent to the value 1. + */ + unsigned int g_threads; - /*!\brief Maximum number of threads to use - * - * For multi-threaded implementations, use no more than this number of - * threads. The codec may use fewer threads than allowed. The value - * 0 is equivalent to the value 1. - */ - unsigned int g_threads; + + /*!\brief Bitstream profile to use + * + * Some codecs support a notion of multiple bitstream profiles. Typically + * this maps to a set of features that are turned on or off. Often the + * profile to use is determined by the features of the intended decoder. + * Consult the documentation for the codec to determine the valid values + * for this parameter, or set to zero for a sane default. + */ + unsigned int g_profile; /**< profile of bitstream to use */ - /*!\brief Bitstream profile to use - * - * Some codecs support a notion of multiple bitstream profiles. Typically - * this maps to a set of features that are turned on or off. Often the - * profile to use is determined by the features of the intended decoder. - * Consult the documentation for the codec to determine the valid values - * for this parameter, or set to zero for a sane default. - */ - unsigned int g_profile; /**< profile of bitstream to use */ + /*!\brief Width of the frame + * + * This value identifies the presentation resolution of the frame, + * in pixels. Note that the frames passed as input to the encoder must + * have this resolution. Frames will be presented by the decoder in this + * resolution, independent of any spatial resampling the encoder may do. + */ + unsigned int g_w; - /*!\brief Width of the frame - * - * This value identifies the presentation resolution of the frame, - * in pixels. Note that the frames passed as input to the encoder must - * have this resolution. Frames will be presented by the decoder in this - * resolution, independent of any spatial resampling the encoder may do. - */ - unsigned int g_w; + /*!\brief Height of the frame + * + * This value identifies the presentation resolution of the frame, + * in pixels. Note that the frames passed as input to the encoder must + * have this resolution. Frames will be presented by the decoder in this + * resolution, independent of any spatial resampling the encoder may do. + */ + unsigned int g_h; - /*!\brief Height of the frame - * - * This value identifies the presentation resolution of the frame, - * in pixels. Note that the frames passed as input to the encoder must - * have this resolution. Frames will be presented by the decoder in this - * resolution, independent of any spatial resampling the encoder may do. - */ - unsigned int g_h; - - - /*!\brief Stream timebase units - * - * Indicates the smallest interval of time, in seconds, used by the stream. - * For fixed frame rate material, or variable frame rate material where - * frames are timed at a multiple of a given clock (ex: video capture), - * the \ref RECOMMENDED method is to set the timebase to the reciprocal - * of the frame rate (ex: 1001/30000 for 29.970 Hz NTSC). This allows the - * pts to correspond to the frame number, which can be handy. For - * re-encoding video from containers with absolute time timestamps, the - * \ref RECOMMENDED method is to set the timebase to that of the parent - * container or multimedia framework (ex: 1/1000 for ms, as in FLV). - */ - struct vpx_rational g_timebase; + /*!\brief Stream timebase units + * + * Indicates the smallest interval of time, in seconds, used by the stream. + * For fixed frame rate material, or variable frame rate material where + * frames are timed at a multiple of a given clock (ex: video capture), + * the \ref RECOMMENDED method is to set the timebase to the reciprocal + * of the frame rate (ex: 1001/30000 for 29.970 Hz NTSC). This allows the + * pts to correspond to the frame number, which can be handy. For + * re-encoding video from containers with absolute time timestamps, the + * \ref RECOMMENDED method is to set the timebase to that of the parent + * container or multimedia framework (ex: 1/1000 for ms, as in FLV). + */ + struct vpx_rational g_timebase; - /*!\brief Enable error resilient modes. - * - * The error resilient bitfield indicates to the encoder which features - * it should enable to take measures for streaming over lossy or noisy - * links. - */ - vpx_codec_er_flags_t g_error_resilient; + /*!\brief Enable error resilient modes. + * + * The error resilient bitfield indicates to the encoder which features + * it should enable to take measures for streaming over lossy or noisy + * links. + */ + vpx_codec_er_flags_t g_error_resilient; - /*!\brief Multi-pass Encoding Mode - * - * This value should be set to the current phase for multi-pass encoding. - * For single pass, set to #VPX_RC_ONE_PASS. - */ - enum vpx_enc_pass g_pass; - - - /*!\brief Allow lagged encoding - * - * If set, this value allows the encoder to consume a number of input - * frames before producing output frames. This allows the encoder to - * base decisions for the current frame on future frames. This does - * increase the latency of the encoding pipeline, so it is not appropriate - * in all situations (ex: realtime encoding). - * - * Note that this is a maximum value -- the encoder may produce frames - * sooner than the given limit. Set this value to 0 to disable this - * feature. - */ - unsigned int g_lag_in_frames; + /*!\brief Multi-pass Encoding Mode + * + * This value should be set to the current phase for multi-pass encoding. + * For single pass, set to #VPX_RC_ONE_PASS. + */ + enum vpx_enc_pass g_pass; - /* - * rate control settings (rc) - */ + /*!\brief Allow lagged encoding + * + * If set, this value allows the encoder to consume a number of input + * frames before producing output frames. This allows the encoder to + * base decisions for the current frame on future frames. This does + * increase the latency of the encoding pipeline, so it is not appropriate + * in all situations (ex: realtime encoding). + * + * Note that this is a maximum value -- the encoder may produce frames + * sooner than the given limit. Set this value to 0 to disable this + * feature. + */ + unsigned int g_lag_in_frames; - /*!\brief Temporal resampling configuration, if supported by the codec. - * - * Temporal resampling allows the codec to "drop" frames as a strategy to - * meet its target data rate. This can cause temporal discontinuities in - * the encoded video, which may appear as stuttering during playback. This - * trade-off is often acceptable, but for many applications is not. It can - * be disabled in these cases. - * - * Note that not all codecs support this feature. All vpx VPx codecs do. - * For other codecs, consult the documentation for that algorithm. - * - * This threshold is described as a percentage of the target data buffer. - * When the data buffer falls below this percentage of fullness, a - * dropped frame is indicated. Set the threshold to zero (0) to disable - * this feature. - */ - unsigned int rc_dropframe_thresh; + /* + * rate control settings (rc) + */ - /*!\brief Enable/disable spatial resampling, if supported by the codec. - * - * Spatial resampling allows the codec to compress a lower resolution - * version of the frame, which is then upscaled by the encoder to the - * correct presentation resolution. This increases visual quality at - * low data rates, at the expense of CPU time on the encoder/decoder. - */ - unsigned int rc_resize_allowed; + /*!\brief Temporal resampling configuration, if supported by the codec. + * + * Temporal resampling allows the codec to "drop" frames as a strategy to + * meet its target data rate. This can cause temporal discontinuities in + * the encoded video, which may appear as stuttering during playback. This + * trade-off is often acceptable, but for many applications is not. It can + * be disabled in these cases. + * + * Note that not all codecs support this feature. All vpx VPx codecs do. + * For other codecs, consult the documentation for that algorithm. + * + * This threshold is described as a percentage of the target data buffer. + * When the data buffer falls below this percentage of fullness, a + * dropped frame is indicated. Set the threshold to zero (0) to disable + * this feature. + */ + unsigned int rc_dropframe_thresh; - /*!\brief Spatial resampling up watermark. - * - * This threshold is described as a percentage of the target data buffer. - * When the data buffer rises above this percentage of fullness, the - * encoder will step up to a higher resolution version of the frame. - */ - unsigned int rc_resize_up_thresh; + /*!\brief Enable/disable spatial resampling, if supported by the codec. + * + * Spatial resampling allows the codec to compress a lower resolution + * version of the frame, which is then upscaled by the encoder to the + * correct presentation resolution. This increases visual quality at + * low data rates, at the expense of CPU time on the encoder/decoder. + */ + unsigned int rc_resize_allowed; - /*!\brief Spatial resampling down watermark. - * - * This threshold is described as a percentage of the target data buffer. - * When the data buffer falls below this percentage of fullness, the - * encoder will step down to a lower resolution version of the frame. - */ - unsigned int rc_resize_down_thresh; + /*!\brief Spatial resampling up watermark. + * + * This threshold is described as a percentage of the target data buffer. + * When the data buffer rises above this percentage of fullness, the + * encoder will step up to a higher resolution version of the frame. + */ + unsigned int rc_resize_up_thresh; - /*!\brief Rate control algorithm to use. - * - * Indicates whether the end usage of this stream is to be streamed over - * a bandwidth constrained link, indicating that Constant Bit Rate (CBR) - * mode should be used, or whether it will be played back on a high - * bandwidth link, as from a local disk, where higher variations in - * bitrate are acceptable. - */ - enum vpx_rc_mode rc_end_usage; + /*!\brief Spatial resampling down watermark. + * + * This threshold is described as a percentage of the target data buffer. + * When the data buffer falls below this percentage of fullness, the + * encoder will step down to a lower resolution version of the frame. + */ + unsigned int rc_resize_down_thresh; - /*!\brief Two-pass stats buffer. - * - * A buffer containing all of the stats packets produced in the first - * pass, concatenated. - */ - struct vpx_fixed_buf rc_twopass_stats_in; + /*!\brief Rate control algorithm to use. + * + * Indicates whether the end usage of this stream is to be streamed over + * a bandwidth constrained link, indicating that Constant Bit Rate (CBR) + * mode should be used, or whether it will be played back on a high + * bandwidth link, as from a local disk, where higher variations in + * bitrate are acceptable. + */ + enum vpx_rc_mode rc_end_usage; - /*!\brief Target data rate - * - * Target bandwidth to use for this stream, in kilobits per second. - */ - unsigned int rc_target_bitrate; + /*!\brief Two-pass stats buffer. + * + * A buffer containing all of the stats packets produced in the first + * pass, concatenated. + */ + struct vpx_fixed_buf rc_twopass_stats_in; - /* - * quantizer settings - */ + /*!\brief Target data rate + * + * Target bandwidth to use for this stream, in kilobits per second. + */ + unsigned int rc_target_bitrate; - /*!\brief Minimum (Best Quality) Quantizer - * - * The quantizer is the most direct control over the quality of the - * encoded image. The range of valid values for the quantizer is codec - * specific. Consult the documentation for the codec to determine the - * values to use. To determine the range programmatically, call - * vpx_codec_enc_config_default() with a usage value of 0. - */ - unsigned int rc_min_quantizer; + /* + * quantizer settings + */ - /*!\brief Maximum (Worst Quality) Quantizer - * - * The quantizer is the most direct control over the quality of the - * encoded image. The range of valid values for the quantizer is codec - * specific. Consult the documentation for the codec to determine the - * values to use. To determine the range programmatically, call - * vpx_codec_enc_config_default() with a usage value of 0. - */ - unsigned int rc_max_quantizer; + /*!\brief Minimum (Best Quality) Quantizer + * + * The quantizer is the most direct control over the quality of the + * encoded image. The range of valid values for the quantizer is codec + * specific. Consult the documentation for the codec to determine the + * values to use. To determine the range programmatically, call + * vpx_codec_enc_config_default() with a usage value of 0. + */ + unsigned int rc_min_quantizer; - /* - * bitrate tolerance - */ + /*!\brief Maximum (Worst Quality) Quantizer + * + * The quantizer is the most direct control over the quality of the + * encoded image. The range of valid values for the quantizer is codec + * specific. Consult the documentation for the codec to determine the + * values to use. To determine the range programmatically, call + * vpx_codec_enc_config_default() with a usage value of 0. + */ + unsigned int rc_max_quantizer; - /*!\brief Rate control adaptation undershoot control - * - * This value, expressed as a percentage of the target bitrate, - * controls the maximum allowed adaptation speed of the codec. - * This factor controls the maximum amount of bits that can - * be subtracted from the target bitrate in order to compensate - * for prior overshoot. - * - * Valid values in the range 0-1000. - */ - unsigned int rc_undershoot_pct; - - - /*!\brief Rate control adaptation overshoot control - * - * This value, expressed as a percentage of the target bitrate, - * controls the maximum allowed adaptation speed of the codec. - * This factor controls the maximum amount of bits that can - * be added to the target bitrate in order to compensate for - * prior undershoot. - * - * Valid values in the range 0-1000. - */ - unsigned int rc_overshoot_pct; + /* + * bitrate tolerance + */ - /* - * decoder buffer model parameters - */ + /*!\brief Rate control adaptation undershoot control + * + * This value, expressed as a percentage of the target bitrate, + * controls the maximum allowed adaptation speed of the codec. + * This factor controls the maximum amount of bits that can + * be subtracted from the target bitrate in order to compensate + * for prior overshoot. + * + * Valid values in the range 0-1000. + */ + unsigned int rc_undershoot_pct; - /*!\brief Decoder Buffer Size - * - * This value indicates the amount of data that may be buffered by the - * decoding application. Note that this value is expressed in units of - * time (milliseconds). For example, a value of 5000 indicates that the - * client will buffer (at least) 5000ms worth of encoded data. Use the - * target bitrate (#rc_target_bitrate) to convert to bits/bytes, if - * necessary. - */ - unsigned int rc_buf_sz; + /*!\brief Rate control adaptation overshoot control + * + * This value, expressed as a percentage of the target bitrate, + * controls the maximum allowed adaptation speed of the codec. + * This factor controls the maximum amount of bits that can + * be added to the target bitrate in order to compensate for + * prior undershoot. + * + * Valid values in the range 0-1000. + */ + unsigned int rc_overshoot_pct; - /*!\brief Decoder Buffer Initial Size - * - * This value indicates the amount of data that will be buffered by the - * decoding application prior to beginning playback. This value is - * expressed in units of time (milliseconds). Use the target bitrate - * (#rc_target_bitrate) to convert to bits/bytes, if necessary. - */ - unsigned int rc_buf_initial_sz; + /* + * decoder buffer model parameters + */ - /*!\brief Decoder Buffer Optimal Size - * - * This value indicates the amount of data that the encoder should try - * to maintain in the decoder's buffer. This value is expressed in units - * of time (milliseconds). Use the target bitrate (#rc_target_bitrate) - * to convert to bits/bytes, if necessary. - */ - unsigned int rc_buf_optimal_sz; + /*!\brief Decoder Buffer Size + * + * This value indicates the amount of data that may be buffered by the + * decoding application. Note that this value is expressed in units of + * time (milliseconds). For example, a value of 5000 indicates that the + * client will buffer (at least) 5000ms worth of encoded data. Use the + * target bitrate (#rc_target_bitrate) to convert to bits/bytes, if + * necessary. + */ + unsigned int rc_buf_sz; - /* - * 2 pass rate control parameters - */ + /*!\brief Decoder Buffer Initial Size + * + * This value indicates the amount of data that will be buffered by the + * decoding application prior to beginning playback. This value is + * expressed in units of time (milliseconds). Use the target bitrate + * (#rc_target_bitrate) to convert to bits/bytes, if necessary. + */ + unsigned int rc_buf_initial_sz; - /*!\brief Two-pass mode CBR/VBR bias - * - * Bias, expressed on a scale of 0 to 100, for determining target size - * for the current frame. The value 0 indicates the optimal CBR mode - * value should be used. The value 100 indicates the optimal VBR mode - * value should be used. Values in between indicate which way the - * encoder should "lean." - */ - unsigned int rc_2pass_vbr_bias_pct; /**< RC mode bias between CBR and VBR(0-100: 0->CBR, 100->VBR) */ + /*!\brief Decoder Buffer Optimal Size + * + * This value indicates the amount of data that the encoder should try + * to maintain in the decoder's buffer. This value is expressed in units + * of time (milliseconds). Use the target bitrate (#rc_target_bitrate) + * to convert to bits/bytes, if necessary. + */ + unsigned int rc_buf_optimal_sz; - /*!\brief Two-pass mode per-GOP minimum bitrate - * - * This value, expressed as a percentage of the target bitrate, indicates - * the minimum bitrate to be used for a single GOP (aka "section") - */ - unsigned int rc_2pass_vbr_minsection_pct; + /* + * 2 pass rate control parameters + */ - /*!\brief Two-pass mode per-GOP maximum bitrate - * - * This value, expressed as a percentage of the target bitrate, indicates - * the maximum bitrate to be used for a single GOP (aka "section") - */ - unsigned int rc_2pass_vbr_maxsection_pct; + /*!\brief Two-pass mode CBR/VBR bias + * + * Bias, expressed on a scale of 0 to 100, for determining target size + * for the current frame. The value 0 indicates the optimal CBR mode + * value should be used. The value 100 indicates the optimal VBR mode + * value should be used. Values in between indicate which way the + * encoder should "lean." + */ + unsigned int rc_2pass_vbr_bias_pct; /**< RC mode bias between CBR and VBR(0-100: 0->CBR, 100->VBR) */ - /* - * keyframing settings (kf) - */ + /*!\brief Two-pass mode per-GOP minimum bitrate + * + * This value, expressed as a percentage of the target bitrate, indicates + * the minimum bitrate to be used for a single GOP (aka "section") + */ + unsigned int rc_2pass_vbr_minsection_pct; - /*!\brief Keyframe placement mode - * - * This value indicates whether the encoder should place keyframes at a - * fixed interval, or determine the optimal placement automatically - * (as governed by the #kf_min_dist and #kf_max_dist parameters) - */ - enum vpx_kf_mode kf_mode; + /*!\brief Two-pass mode per-GOP maximum bitrate + * + * This value, expressed as a percentage of the target bitrate, indicates + * the maximum bitrate to be used for a single GOP (aka "section") + */ + unsigned int rc_2pass_vbr_maxsection_pct; - /*!\brief Keyframe minimum interval - * - * This value, expressed as a number of frames, prevents the encoder from - * placing a keyframe nearer than kf_min_dist to the previous keyframe. At - * least kf_min_dist frames non-keyframes will be coded before the next - * keyframe. Set kf_min_dist equal to kf_max_dist for a fixed interval. - */ - unsigned int kf_min_dist; + /* + * keyframing settings (kf) + */ - /*!\brief Keyframe maximum interval - * - * This value, expressed as a number of frames, forces the encoder to code - * a keyframe if one has not been coded in the last kf_max_dist frames. - * A value of 0 implies all frames will be keyframes. Set kf_min_dist - * equal to kf_max_dist for a fixed interval. - */ - unsigned int kf_max_dist; + /*!\brief Keyframe placement mode + * + * This value indicates whether the encoder should place keyframes at a + * fixed interval, or determine the optimal placement automatically + * (as governed by the #kf_min_dist and #kf_max_dist parameters) + */ + enum vpx_kf_mode kf_mode; - /* - * Temporal scalability settings (ts) - */ - /*!\brief Number of coding layers - * - * This value specifies the number of coding layers to be used. - */ - unsigned int ts_number_layers; + /*!\brief Keyframe minimum interval + * + * This value, expressed as a number of frames, prevents the encoder from + * placing a keyframe nearer than kf_min_dist to the previous keyframe. At + * least kf_min_dist frames non-keyframes will be coded before the next + * keyframe. Set kf_min_dist equal to kf_max_dist for a fixed interval. + */ + unsigned int kf_min_dist; - /*!\brief Target bitrate for each layer - * - * These values specify the target coding bitrate for each coding layer. - */ - unsigned int ts_target_bitrate[VPX_TS_MAX_LAYERS]; - /*!\brief Frame rate decimation factor for each layer - * - * These values specify the frame rate decimation factors to apply - * to each layer. - */ - unsigned int ts_rate_decimator[VPX_TS_MAX_LAYERS]; - - /*!\brief Length of the sequence defining frame layer membership - * - * This value specifies the length of the sequence that defines the - * membership of frames to layers. For example, if ts_periodicity=8 then - * frames are assigned to coding layers with a repeated sequence of - * length 8. - */ - unsigned int ts_periodicity; - - /*!\brief Template defining the membership of frames to coding layers - * - * This array defines the membership of frames to coding layers. For a - * 2-layer encoding that assigns even numbered frames to one layer (0) - * and odd numbered frames to a second layer (1) with ts_periodicity=8, - * then ts_layer_id = (0,1,0,1,0,1,0,1). - */ - unsigned int ts_layer_id[VPX_TS_MAX_PERIODICITY]; - } vpx_codec_enc_cfg_t; /**< alias for struct vpx_codec_enc_cfg */ + /*!\brief Keyframe maximum interval + * + * This value, expressed as a number of frames, forces the encoder to code + * a keyframe if one has not been coded in the last kf_max_dist frames. + * A value of 0 implies all frames will be keyframes. Set kf_min_dist + * equal to kf_max_dist for a fixed interval. + */ + unsigned int kf_max_dist; + /* + * Temporal scalability settings (ts) + */ - /*!\brief Initialize an encoder instance + /*!\brief Number of coding layers * - * Initializes a encoder context using the given interface. Applications - * should call the vpx_codec_enc_init convenience macro instead of this - * function directly, to ensure that the ABI version number parameter - * is properly initialized. + * This value specifies the number of coding layers to be used. + */ + unsigned int ts_number_layers; + + /*!\brief Target bitrate for each layer * - * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags - * parameter), the storage pointed to by the cfg parameter must be - * kept readable and stable until all memory maps have been set. + * These values specify the target coding bitrate for each coding layer. + */ + unsigned int ts_target_bitrate[VPX_TS_MAX_LAYERS]; + + /*!\brief Frame rate decimation factor for each layer * - * \param[in] ctx Pointer to this instance's context. - * \param[in] iface Pointer to the algorithm interface to use. - * \param[in] cfg Configuration to use, if known. May be NULL. - * \param[in] flags Bitfield of VPX_CODEC_USE_* flags - * \param[in] ver ABI version number. Must be set to - * VPX_ENCODER_ABI_VERSION - * \retval #VPX_CODEC_OK - * The decoder algorithm initialized. - * \retval #VPX_CODEC_MEM_ERROR - * Memory allocation failed. + * These values specify the frame rate decimation factors to apply + * to each layer. */ - vpx_codec_err_t vpx_codec_enc_init_ver(vpx_codec_ctx_t *ctx, - vpx_codec_iface_t *iface, - vpx_codec_enc_cfg_t *cfg, - vpx_codec_flags_t flags, - int ver); + unsigned int ts_rate_decimator[VPX_TS_MAX_LAYERS]; + /*!\brief Length of the sequence defining frame layer membership + * + * This value specifies the length of the sequence that defines the + * membership of frames to layers. For example, if ts_periodicity=8 then + * frames are assigned to coding layers with a repeated sequence of + * length 8. + */ + unsigned int ts_periodicity; - /*!\brief Convenience macro for vpx_codec_enc_init_ver() + /*!\brief Template defining the membership of frames to coding layers * - * Ensures the ABI version parameter is properly set. + * This array defines the membership of frames to coding layers. For a + * 2-layer encoding that assigns even numbered frames to one layer (0) + * and odd numbered frames to a second layer (1) with ts_periodicity=8, + * then ts_layer_id = (0,1,0,1,0,1,0,1). */ + unsigned int ts_layer_id[VPX_TS_MAX_PERIODICITY]; +} vpx_codec_enc_cfg_t; /**< alias for struct vpx_codec_enc_cfg */ + + +/*!\brief Initialize an encoder instance + * + * Initializes a encoder context using the given interface. Applications + * should call the vpx_codec_enc_init convenience macro instead of this + * function directly, to ensure that the ABI version number parameter + * is properly initialized. + * + * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags + * parameter), the storage pointed to by the cfg parameter must be + * kept readable and stable until all memory maps have been set. + * + * \param[in] ctx Pointer to this instance's context. + * \param[in] iface Pointer to the algorithm interface to use. + * \param[in] cfg Configuration to use, if known. May be NULL. + * \param[in] flags Bitfield of VPX_CODEC_USE_* flags + * \param[in] ver ABI version number. Must be set to + * VPX_ENCODER_ABI_VERSION + * \retval #VPX_CODEC_OK + * The decoder algorithm initialized. + * \retval #VPX_CODEC_MEM_ERROR + * Memory allocation failed. + */ +vpx_codec_err_t vpx_codec_enc_init_ver(vpx_codec_ctx_t *ctx, + vpx_codec_iface_t *iface, + vpx_codec_enc_cfg_t *cfg, + vpx_codec_flags_t flags, + int ver); + + +/*!\brief Convenience macro for vpx_codec_enc_init_ver() + * + * Ensures the ABI version parameter is properly set. + */ #define vpx_codec_enc_init(ctx, iface, cfg, flags) \ vpx_codec_enc_init_ver(ctx, iface, cfg, flags, VPX_ENCODER_ABI_VERSION) - /*!\brief Initialize multi-encoder instance - * - * Initializes multi-encoder context using the given interface. - * Applications should call the vpx_codec_enc_init_multi convenience macro - * instead of this function directly, to ensure that the ABI version number - * parameter is properly initialized. - * - * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags - * parameter), the storage pointed to by the cfg parameter must be - * kept readable and stable until all memory maps have been set. - * - * \param[in] ctx Pointer to this instance's context. - * \param[in] iface Pointer to the algorithm interface to use. - * \param[in] cfg Configuration to use, if known. May be NULL. - * \param[in] num_enc Total number of encoders. - * \param[in] flags Bitfield of VPX_CODEC_USE_* flags - * \param[in] dsf Pointer to down-sampling factors. - * \param[in] ver ABI version number. Must be set to - * VPX_ENCODER_ABI_VERSION - * \retval #VPX_CODEC_OK - * The decoder algorithm initialized. - * \retval #VPX_CODEC_MEM_ERROR - * Memory allocation failed. - */ - vpx_codec_err_t vpx_codec_enc_init_multi_ver(vpx_codec_ctx_t *ctx, - vpx_codec_iface_t *iface, - vpx_codec_enc_cfg_t *cfg, - int num_enc, - vpx_codec_flags_t flags, - vpx_rational_t *dsf, - int ver); +/*!\brief Initialize multi-encoder instance + * + * Initializes multi-encoder context using the given interface. + * Applications should call the vpx_codec_enc_init_multi convenience macro + * instead of this function directly, to ensure that the ABI version number + * parameter is properly initialized. + * + * In XMA mode (activated by setting VPX_CODEC_USE_XMA in the flags + * parameter), the storage pointed to by the cfg parameter must be + * kept readable and stable until all memory maps have been set. + * + * \param[in] ctx Pointer to this instance's context. + * \param[in] iface Pointer to the algorithm interface to use. + * \param[in] cfg Configuration to use, if known. May be NULL. + * \param[in] num_enc Total number of encoders. + * \param[in] flags Bitfield of VPX_CODEC_USE_* flags + * \param[in] dsf Pointer to down-sampling factors. + * \param[in] ver ABI version number. Must be set to + * VPX_ENCODER_ABI_VERSION + * \retval #VPX_CODEC_OK + * The decoder algorithm initialized. + * \retval #VPX_CODEC_MEM_ERROR + * Memory allocation failed. + */ +vpx_codec_err_t vpx_codec_enc_init_multi_ver(vpx_codec_ctx_t *ctx, + vpx_codec_iface_t *iface, + vpx_codec_enc_cfg_t *cfg, + int num_enc, + vpx_codec_flags_t flags, + vpx_rational_t *dsf, + int ver); - /*!\brief Convenience macro for vpx_codec_enc_init_multi_ver() - * - * Ensures the ABI version parameter is properly set. - */ +/*!\brief Convenience macro for vpx_codec_enc_init_multi_ver() + * + * Ensures the ABI version parameter is properly set. + */ #define vpx_codec_enc_init_multi(ctx, iface, cfg, num_enc, flags, dsf) \ vpx_codec_enc_init_multi_ver(ctx, iface, cfg, num_enc, flags, dsf, \ VPX_ENCODER_ABI_VERSION) - /*!\brief Get a default configuration - * - * Initializes a encoder configuration structure with default values. Supports - * the notion of "usages" so that an algorithm may offer different default - * settings depending on the user's intended goal. This function \ref SHOULD - * be called by all applications to initialize the configuration structure - * before specializing the configuration with application specific values. - * - * \param[in] iface Pointer to the algorithm interface to use. - * \param[out] cfg Configuration buffer to populate - * \param[in] usage End usage. Set to 0 or use codec specific values. - * - * \retval #VPX_CODEC_OK - * The configuration was populated. - * \retval #VPX_CODEC_INCAPABLE - * Interface is not an encoder interface. - * \retval #VPX_CODEC_INVALID_PARAM - * A parameter was NULL, or the usage value was not recognized. - */ - vpx_codec_err_t vpx_codec_enc_config_default(vpx_codec_iface_t *iface, - vpx_codec_enc_cfg_t *cfg, - unsigned int usage); +/*!\brief Get a default configuration + * + * Initializes a encoder configuration structure with default values. Supports + * the notion of "usages" so that an algorithm may offer different default + * settings depending on the user's intended goal. This function \ref SHOULD + * be called by all applications to initialize the configuration structure + * before specializing the configuration with application specific values. + * + * \param[in] iface Pointer to the algorithm interface to use. + * \param[out] cfg Configuration buffer to populate + * \param[in] usage End usage. Set to 0 or use codec specific values. + * + * \retval #VPX_CODEC_OK + * The configuration was populated. + * \retval #VPX_CODEC_INCAPABLE + * Interface is not an encoder interface. + * \retval #VPX_CODEC_INVALID_PARAM + * A parameter was NULL, or the usage value was not recognized. + */ +vpx_codec_err_t vpx_codec_enc_config_default(vpx_codec_iface_t *iface, + vpx_codec_enc_cfg_t *cfg, + unsigned int usage); - /*!\brief Set or change configuration - * - * Reconfigures an encoder instance according to the given configuration. - * - * \param[in] ctx Pointer to this instance's context - * \param[in] cfg Configuration buffer to use - * - * \retval #VPX_CODEC_OK - * The configuration was populated. - * \retval #VPX_CODEC_INCAPABLE - * Interface is not an encoder interface. - * \retval #VPX_CODEC_INVALID_PARAM - * A parameter was NULL, or the usage value was not recognized. - */ - vpx_codec_err_t vpx_codec_enc_config_set(vpx_codec_ctx_t *ctx, - const vpx_codec_enc_cfg_t *cfg); +/*!\brief Set or change configuration + * + * Reconfigures an encoder instance according to the given configuration. + * + * \param[in] ctx Pointer to this instance's context + * \param[in] cfg Configuration buffer to use + * + * \retval #VPX_CODEC_OK + * The configuration was populated. + * \retval #VPX_CODEC_INCAPABLE + * Interface is not an encoder interface. + * \retval #VPX_CODEC_INVALID_PARAM + * A parameter was NULL, or the usage value was not recognized. + */ +vpx_codec_err_t vpx_codec_enc_config_set(vpx_codec_ctx_t *ctx, + const vpx_codec_enc_cfg_t *cfg); - /*!\brief Get global stream headers - * - * Retrieves a stream level global header packet, if supported by the codec. - * - * \param[in] ctx Pointer to this instance's context - * - * \retval NULL - * Encoder does not support global header - * \retval Non-NULL - * Pointer to buffer containing global header packet - */ - vpx_fixed_buf_t *vpx_codec_get_global_headers(vpx_codec_ctx_t *ctx); +/*!\brief Get global stream headers + * + * Retrieves a stream level global header packet, if supported by the codec. + * + * \param[in] ctx Pointer to this instance's context + * + * \retval NULL + * Encoder does not support global header + * \retval Non-NULL + * Pointer to buffer containing global header packet + */ +vpx_fixed_buf_t *vpx_codec_get_global_headers(vpx_codec_ctx_t *ctx); #define VPX_DL_REALTIME (1) /**< deadline parameter analogous to @@ -789,141 +778,141 @@ extern "C" { * VPx GOOD QUALITY mode. */ #define VPX_DL_BEST_QUALITY (0) /**< deadline parameter analogous to * VPx BEST QUALITY mode. */ - /*!\brief Encode a frame - * - * Encodes a video frame at the given "presentation time." The presentation - * time stamp (PTS) \ref MUST be strictly increasing. - * - * The encoder supports the notion of a soft real-time deadline. Given a - * non-zero value to the deadline parameter, the encoder will make a "best - * effort" guarantee to return before the given time slice expires. It is - * implicit that limiting the available time to encode will degrade the - * output quality. The encoder can be given an unlimited time to produce the - * best possible frame by specifying a deadline of '0'. This deadline - * supercedes the VPx notion of "best quality, good quality, realtime". - * Applications that wish to map these former settings to the new deadline - * based system can use the symbols #VPX_DL_REALTIME, #VPX_DL_GOOD_QUALITY, - * and #VPX_DL_BEST_QUALITY. - * - * When the last frame has been passed to the encoder, this function should - * continue to be called, with the img parameter set to NULL. This will - * signal the end-of-stream condition to the encoder and allow it to encode - * any held buffers. Encoding is complete when vpx_codec_encode() is called - * and vpx_codec_get_cx_data() returns no data. - * - * \param[in] ctx Pointer to this instance's context - * \param[in] img Image data to encode, NULL to flush. - * \param[in] pts Presentation time stamp, in timebase units. - * \param[in] duration Duration to show frame, in timebase units. - * \param[in] flags Flags to use for encoding this frame. - * \param[in] deadline Time to spend encoding, in microseconds. (0=infinite) - * - * \retval #VPX_CODEC_OK - * The configuration was populated. - * \retval #VPX_CODEC_INCAPABLE - * Interface is not an encoder interface. - * \retval #VPX_CODEC_INVALID_PARAM - * A parameter was NULL, the image format is unsupported, etc. - */ - vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx, - const vpx_image_t *img, - vpx_codec_pts_t pts, - unsigned long duration, - vpx_enc_frame_flags_t flags, - unsigned long deadline); - - /*!\brief Set compressed data output buffer - * - * Sets the buffer that the codec should output the compressed data - * into. This call effectively sets the buffer pointer returned in the - * next VPX_CODEC_CX_FRAME_PKT packet. Subsequent packets will be - * appended into this buffer. The buffer is preserved across frames, - * so applications must periodically call this function after flushing - * the accumulated compressed data to disk or to the network to reset - * the pointer to the buffer's head. - * - * `pad_before` bytes will be skipped before writing the compressed - * data, and `pad_after` bytes will be appended to the packet. The size - * of the packet will be the sum of the size of the actual compressed - * data, pad_before, and pad_after. The padding bytes will be preserved - * (not overwritten). - * - * Note that calling this function does not guarantee that the returned - * compressed data will be placed into the specified buffer. In the - * event that the encoded data will not fit into the buffer provided, - * the returned packet \ref MAY point to an internal buffer, as it would - * if this call were never used. In this event, the output packet will - * NOT have any padding, and the application must free space and copy it - * to the proper place. This is of particular note in configurations - * that may output multiple packets for a single encoded frame (e.g., lagged - * encoding) or if the application does not reset the buffer periodically. - * - * Applications may restore the default behavior of the codec providing - * the compressed data buffer by calling this function with a NULL - * buffer. - * - * Applications \ref MUSTNOT call this function during iteration of - * vpx_codec_get_cx_data(). - * - * \param[in] ctx Pointer to this instance's context - * \param[in] buf Buffer to store compressed data into - * \param[in] pad_before Bytes to skip before writing compressed data - * \param[in] pad_after Bytes to skip after writing compressed data - * - * \retval #VPX_CODEC_OK - * The buffer was set successfully. - * \retval #VPX_CODEC_INVALID_PARAM - * A parameter was NULL, the image format is unsupported, etc. - */ - vpx_codec_err_t vpx_codec_set_cx_data_buf(vpx_codec_ctx_t *ctx, - const vpx_fixed_buf_t *buf, - unsigned int pad_before, - unsigned int pad_after); +/*!\brief Encode a frame + * + * Encodes a video frame at the given "presentation time." The presentation + * time stamp (PTS) \ref MUST be strictly increasing. + * + * The encoder supports the notion of a soft real-time deadline. Given a + * non-zero value to the deadline parameter, the encoder will make a "best + * effort" guarantee to return before the given time slice expires. It is + * implicit that limiting the available time to encode will degrade the + * output quality. The encoder can be given an unlimited time to produce the + * best possible frame by specifying a deadline of '0'. This deadline + * supercedes the VPx notion of "best quality, good quality, realtime". + * Applications that wish to map these former settings to the new deadline + * based system can use the symbols #VPX_DL_REALTIME, #VPX_DL_GOOD_QUALITY, + * and #VPX_DL_BEST_QUALITY. + * + * When the last frame has been passed to the encoder, this function should + * continue to be called, with the img parameter set to NULL. This will + * signal the end-of-stream condition to the encoder and allow it to encode + * any held buffers. Encoding is complete when vpx_codec_encode() is called + * and vpx_codec_get_cx_data() returns no data. + * + * \param[in] ctx Pointer to this instance's context + * \param[in] img Image data to encode, NULL to flush. + * \param[in] pts Presentation time stamp, in timebase units. + * \param[in] duration Duration to show frame, in timebase units. + * \param[in] flags Flags to use for encoding this frame. + * \param[in] deadline Time to spend encoding, in microseconds. (0=infinite) + * + * \retval #VPX_CODEC_OK + * The configuration was populated. + * \retval #VPX_CODEC_INCAPABLE + * Interface is not an encoder interface. + * \retval #VPX_CODEC_INVALID_PARAM + * A parameter was NULL, the image format is unsupported, etc. + */ +vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx, + const vpx_image_t *img, + vpx_codec_pts_t pts, + unsigned long duration, + vpx_enc_frame_flags_t flags, + unsigned long deadline); + +/*!\brief Set compressed data output buffer + * + * Sets the buffer that the codec should output the compressed data + * into. This call effectively sets the buffer pointer returned in the + * next VPX_CODEC_CX_FRAME_PKT packet. Subsequent packets will be + * appended into this buffer. The buffer is preserved across frames, + * so applications must periodically call this function after flushing + * the accumulated compressed data to disk or to the network to reset + * the pointer to the buffer's head. + * + * `pad_before` bytes will be skipped before writing the compressed + * data, and `pad_after` bytes will be appended to the packet. The size + * of the packet will be the sum of the size of the actual compressed + * data, pad_before, and pad_after. The padding bytes will be preserved + * (not overwritten). + * + * Note that calling this function does not guarantee that the returned + * compressed data will be placed into the specified buffer. In the + * event that the encoded data will not fit into the buffer provided, + * the returned packet \ref MAY point to an internal buffer, as it would + * if this call were never used. In this event, the output packet will + * NOT have any padding, and the application must free space and copy it + * to the proper place. This is of particular note in configurations + * that may output multiple packets for a single encoded frame (e.g., lagged + * encoding) or if the application does not reset the buffer periodically. + * + * Applications may restore the default behavior of the codec providing + * the compressed data buffer by calling this function with a NULL + * buffer. + * + * Applications \ref MUSTNOT call this function during iteration of + * vpx_codec_get_cx_data(). + * + * \param[in] ctx Pointer to this instance's context + * \param[in] buf Buffer to store compressed data into + * \param[in] pad_before Bytes to skip before writing compressed data + * \param[in] pad_after Bytes to skip after writing compressed data + * + * \retval #VPX_CODEC_OK + * The buffer was set successfully. + * \retval #VPX_CODEC_INVALID_PARAM + * A parameter was NULL, the image format is unsupported, etc. + */ +vpx_codec_err_t vpx_codec_set_cx_data_buf(vpx_codec_ctx_t *ctx, + const vpx_fixed_buf_t *buf, + unsigned int pad_before, + unsigned int pad_after); - /*!\brief Encoded data iterator - * - * Iterates over a list of data packets to be passed from the encoder to the - * application. The different kinds of packets available are enumerated in - * #vpx_codec_cx_pkt_kind. - * - * #VPX_CODEC_CX_FRAME_PKT packets should be passed to the application's - * muxer. Multiple compressed frames may be in the list. - * #VPX_CODEC_STATS_PKT packets should be appended to a global buffer. - * - * The application \ref MUST silently ignore any packet kinds that it does - * not recognize or support. - * - * The data buffers returned from this function are only guaranteed to be - * valid until the application makes another call to any vpx_codec_* function. - * - * \param[in] ctx Pointer to this instance's context - * \param[in,out] iter Iterator storage, initialized to NULL - * - * \return Returns a pointer to an output data packet (compressed frame data, - * two-pass statistics, etc.) or NULL to signal end-of-list. - * - */ - const vpx_codec_cx_pkt_t *vpx_codec_get_cx_data(vpx_codec_ctx_t *ctx, - vpx_codec_iter_t *iter); +/*!\brief Encoded data iterator + * + * Iterates over a list of data packets to be passed from the encoder to the + * application. The different kinds of packets available are enumerated in + * #vpx_codec_cx_pkt_kind. + * + * #VPX_CODEC_CX_FRAME_PKT packets should be passed to the application's + * muxer. Multiple compressed frames may be in the list. + * #VPX_CODEC_STATS_PKT packets should be appended to a global buffer. + * + * The application \ref MUST silently ignore any packet kinds that it does + * not recognize or support. + * + * The data buffers returned from this function are only guaranteed to be + * valid until the application makes another call to any vpx_codec_* function. + * + * \param[in] ctx Pointer to this instance's context + * \param[in,out] iter Iterator storage, initialized to NULL + * + * \return Returns a pointer to an output data packet (compressed frame data, + * two-pass statistics, etc.) or NULL to signal end-of-list. + * + */ +const vpx_codec_cx_pkt_t *vpx_codec_get_cx_data(vpx_codec_ctx_t *ctx, + vpx_codec_iter_t *iter); - /*!\brief Get Preview Frame - * - * Returns an image that can be used as a preview. Shows the image as it would - * exist at the decompressor. The application \ref MUST NOT write into this - * image buffer. - * - * \param[in] ctx Pointer to this instance's context - * - * \return Returns a pointer to a preview image, or NULL if no image is - * available. - * - */ - const vpx_image_t *vpx_codec_get_preview_frame(vpx_codec_ctx_t *ctx); +/*!\brief Get Preview Frame + * + * Returns an image that can be used as a preview. Shows the image as it would + * exist at the decompressor. The application \ref MUST NOT write into this + * image buffer. + * + * \param[in] ctx Pointer to this instance's context + * + * \return Returns a pointer to a preview image, or NULL if no image is + * available. + * + */ +const vpx_image_t *vpx_codec_get_preview_frame(vpx_codec_ctx_t *ctx); - /*!@} - end defgroup encoder*/ +/*!@} - end defgroup encoder*/ #endif #ifdef __cplusplus diff --git a/thirdparties/mac/include/vpx/vpx_image.h b/thirdparties/mac/include/vpx/vpx_image.h index 3e42447..b3e6ed7 100755 --- a/thirdparties/mac/include/vpx/vpx_image.h +++ b/thirdparties/mac/include/vpx/vpx_image.h @@ -20,14 +20,14 @@ extern "C" { #ifndef VPX_IMAGE_H #define VPX_IMAGE_H - /*!\brief Current ABI version number - * - * \internal - * If this file is altered in any way that changes the ABI, this value - * must be bumped. Examples include, but are not limited to, changing - * types, removing or reassigning enums, adding/removing/rearranging - * fields to structures - */ +/*!\brief Current ABI version number + * + * \internal + * If this file is altered in any way that changes the ABI, this value + * must be bumped. Examples include, but are not limited to, changing + * types, removing or reassigning enums, adding/removing/rearranging + * fields to structures + */ #define VPX_IMAGE_ABI_VERSION (1) /**<\hideinitializer*/ @@ -36,41 +36,41 @@ extern "C" { #define VPX_IMG_FMT_HAS_ALPHA 0x400 /**< Image has an alpha channel component */ - /*!\brief List of supported image formats */ - typedef enum vpx_img_fmt { - VPX_IMG_FMT_NONE, - VPX_IMG_FMT_RGB24, /**< 24 bit per pixel packed RGB */ - VPX_IMG_FMT_RGB32, /**< 32 bit per pixel packed 0RGB */ - VPX_IMG_FMT_RGB565, /**< 16 bit per pixel, 565 */ - VPX_IMG_FMT_RGB555, /**< 16 bit per pixel, 555 */ - VPX_IMG_FMT_UYVY, /**< UYVY packed YUV */ - VPX_IMG_FMT_YUY2, /**< YUYV packed YUV */ - VPX_IMG_FMT_YVYU, /**< YVYU packed YUV */ - VPX_IMG_FMT_BGR24, /**< 24 bit per pixel packed BGR */ - VPX_IMG_FMT_RGB32_LE, /**< 32 bit packed BGR0 */ - VPX_IMG_FMT_ARGB, /**< 32 bit packed ARGB, alpha=255 */ - VPX_IMG_FMT_ARGB_LE, /**< 32 bit packed BGRA, alpha=255 */ - VPX_IMG_FMT_RGB565_LE, /**< 16 bit per pixel, gggbbbbb rrrrrggg */ - VPX_IMG_FMT_RGB555_LE, /**< 16 bit per pixel, gggbbbbb 0rrrrrgg */ - VPX_IMG_FMT_YV12 = VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_UV_FLIP | 1, /**< planar YVU */ - VPX_IMG_FMT_I420 = VPX_IMG_FMT_PLANAR | 2, - VPX_IMG_FMT_VPXYV12 = VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_UV_FLIP | 3, /** < planar 4:2:0 format with vpx color space */ - VPX_IMG_FMT_VPXI420 = VPX_IMG_FMT_PLANAR | 4 /** < planar 4:2:0 format with vpx color space */ - } - vpx_img_fmt_t; /**< alias for enum vpx_img_fmt */ +/*!\brief List of supported image formats */ +typedef enum vpx_img_fmt { + VPX_IMG_FMT_NONE, + VPX_IMG_FMT_RGB24, /**< 24 bit per pixel packed RGB */ + VPX_IMG_FMT_RGB32, /**< 32 bit per pixel packed 0RGB */ + VPX_IMG_FMT_RGB565, /**< 16 bit per pixel, 565 */ + VPX_IMG_FMT_RGB555, /**< 16 bit per pixel, 555 */ + VPX_IMG_FMT_UYVY, /**< UYVY packed YUV */ + VPX_IMG_FMT_YUY2, /**< YUYV packed YUV */ + VPX_IMG_FMT_YVYU, /**< YVYU packed YUV */ + VPX_IMG_FMT_BGR24, /**< 24 bit per pixel packed BGR */ + VPX_IMG_FMT_RGB32_LE, /**< 32 bit packed BGR0 */ + VPX_IMG_FMT_ARGB, /**< 32 bit packed ARGB, alpha=255 */ + VPX_IMG_FMT_ARGB_LE, /**< 32 bit packed BGRA, alpha=255 */ + VPX_IMG_FMT_RGB565_LE, /**< 16 bit per pixel, gggbbbbb rrrrrggg */ + VPX_IMG_FMT_RGB555_LE, /**< 16 bit per pixel, gggbbbbb 0rrrrrgg */ + VPX_IMG_FMT_YV12 = VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_UV_FLIP | 1, /**< planar YVU */ + VPX_IMG_FMT_I420 = VPX_IMG_FMT_PLANAR | 2, + VPX_IMG_FMT_VPXYV12 = VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_UV_FLIP | 3, /** < planar 4:2:0 format with vpx color space */ + VPX_IMG_FMT_VPXI420 = VPX_IMG_FMT_PLANAR | 4 /** < planar 4:2:0 format with vpx color space */ +} +vpx_img_fmt_t; /**< alias for enum vpx_img_fmt */ #if !defined(VPX_CODEC_DISABLE_COMPAT) || !VPX_CODEC_DISABLE_COMPAT #define IMG_FMT_PLANAR VPX_IMG_FMT_PLANAR /**< \deprecated Use #VPX_IMG_FMT_PLANAR */ #define IMG_FMT_UV_FLIP VPX_IMG_FMT_UV_FLIP /**< \deprecated Use #VPX_IMG_FMT_UV_FLIP */ #define IMG_FMT_HAS_ALPHA VPX_IMG_FMT_HAS_ALPHA /**< \deprecated Use #VPX_IMG_FMT_HAS_ALPHA */ - /*!\brief Deprecated list of supported image formats - * \deprecated New code should use #vpx_img_fmt - */ +/*!\brief Deprecated list of supported image formats + * \deprecated New code should use #vpx_img_fmt + */ #define img_fmt vpx_img_fmt - /*!\brief alias for enum img_fmt. - * \deprecated New code should use #vpx_img_fmt_t - */ +/*!\brief alias for enum img_fmt. + * \deprecated New code should use #vpx_img_fmt_t + */ #define img_fmt_t vpx_img_fmt_t #define IMG_FMT_NONE VPX_IMG_FMT_NONE /**< \deprecated Use #VPX_IMG_FMT_NONE */ @@ -93,24 +93,23 @@ extern "C" { #define IMG_FMT_VPXI420 VPX_IMG_FMT_VPXI420 /**< \deprecated Use #VPX_IMG_FMT_VPXI420 */ #endif /* VPX_CODEC_DISABLE_COMPAT */ - /**\brief Image Descriptor */ - typedef struct vpx_image - { - vpx_img_fmt_t fmt; /**< Image Format */ +/**\brief Image Descriptor */ +typedef struct vpx_image { + vpx_img_fmt_t fmt; /**< Image Format */ - /* Image storage dimensions */ - unsigned int w; /**< Stored image width */ - unsigned int h; /**< Stored image height */ + /* Image storage dimensions */ + unsigned int w; /**< Stored image width */ + unsigned int h; /**< Stored image height */ - /* Image display dimensions */ - unsigned int d_w; /**< Displayed image width */ - unsigned int d_h; /**< Displayed image height */ + /* Image display dimensions */ + unsigned int d_w; /**< Displayed image width */ + unsigned int d_h; /**< Displayed image height */ - /* Chroma subsampling info */ - unsigned int x_chroma_shift; /**< subsampling order, X */ - unsigned int y_chroma_shift; /**< subsampling order, Y */ + /* Chroma subsampling info */ + unsigned int x_chroma_shift; /**< subsampling order, X */ + unsigned int y_chroma_shift; /**< subsampling order, Y */ - /* Image data pointers. */ + /* Image data pointers. */ #define VPX_PLANE_PACKED 0 /**< To be used for all packed formats */ #define VPX_PLANE_Y 0 /**< Y (Luminance) plane */ #define VPX_PLANE_U 1 /**< U (Chroma) plane */ @@ -123,119 +122,118 @@ extern "C" { #define PLANE_V VPX_PLANE_V #define PLANE_ALPHA VPX_PLANE_ALPHA #endif - unsigned char *planes[4]; /**< pointer to the top left pixel for each plane */ - int stride[4]; /**< stride between rows for each plane */ + unsigned char *planes[4]; /**< pointer to the top left pixel for each plane */ + int stride[4]; /**< stride between rows for each plane */ - int bps; /**< bits per sample (for packed formats) */ + int bps; /**< bits per sample (for packed formats) */ - /* The following member may be set by the application to associate data - * with this image. - */ - void *user_priv; /**< may be set by the application to associate data + /* The following member may be set by the application to associate data + * with this image. + */ + void *user_priv; /**< may be set by the application to associate data * with this image. */ - /* The following members should be treated as private. */ - unsigned char *img_data; /**< private */ - int img_data_owner; /**< private */ - int self_allocd; /**< private */ - } vpx_image_t; /**< alias for struct vpx_image */ - - /**\brief Representation of a rectangle on a surface */ - typedef struct vpx_image_rect - { - unsigned int x; /**< leftmost column */ - unsigned int y; /**< topmost row */ - unsigned int w; /**< width */ - unsigned int h; /**< height */ - } vpx_image_rect_t; /**< alias for struct vpx_image_rect */ - - /*!\brief Open a descriptor, allocating storage for the underlying image - * - * Returns a descriptor for storing an image of the given format. The - * storage for the descriptor is allocated on the heap. - * - * \param[in] img Pointer to storage for descriptor. If this parameter - * is NULL, the storage for the descriptor will be - * allocated on the heap. - * \param[in] fmt Format for the image - * \param[in] d_w Width of the image - * \param[in] d_h Height of the image - * \param[in] align Alignment, in bytes, of the image buffer and - * each row in the image(stride). - * - * \return Returns a pointer to the initialized image descriptor. If the img - * parameter is non-null, the value of the img parameter will be - * returned. - */ - vpx_image_t *vpx_img_alloc(vpx_image_t *img, - vpx_img_fmt_t fmt, - unsigned int d_w, - unsigned int d_h, - unsigned int align); - - /*!\brief Open a descriptor, using existing storage for the underlying image - * - * Returns a descriptor for storing an image of the given format. The - * storage for descriptor has been allocated elsewhere, and a descriptor is - * desired to "wrap" that storage. - * - * \param[in] img Pointer to storage for descriptor. If this parameter - * is NULL, the storage for the descriptor will be - * allocated on the heap. - * \param[in] fmt Format for the image - * \param[in] d_w Width of the image - * \param[in] d_h Height of the image - * \param[in] align Alignment, in bytes, of each row in the image. - * \param[in] img_data Storage to use for the image - * - * \return Returns a pointer to the initialized image descriptor. If the img - * parameter is non-null, the value of the img parameter will be - * returned. - */ - vpx_image_t *vpx_img_wrap(vpx_image_t *img, - vpx_img_fmt_t fmt, - unsigned int d_w, - unsigned int d_h, - unsigned int align, - unsigned char *img_data); - - - /*!\brief Set the rectangle identifying the displayed portion of the image - * - * Updates the displayed rectangle (aka viewport) on the image surface to - * match the specified coordinates and size. - * - * \param[in] img Image descriptor - * \param[in] x leftmost column - * \param[in] y topmost row - * \param[in] w width - * \param[in] h height - * - * \return 0 if the requested rectangle is valid, nonzero otherwise. - */ - int vpx_img_set_rect(vpx_image_t *img, - unsigned int x, - unsigned int y, - unsigned int w, - unsigned int h); - - - /*!\brief Flip the image vertically (top for bottom) - * - * Adjusts the image descriptor's pointers and strides to make the image - * be referenced upside-down. - * - * \param[in] img Image descriptor - */ - void vpx_img_flip(vpx_image_t *img); + /* The following members should be treated as private. */ + unsigned char *img_data; /**< private */ + int img_data_owner; /**< private */ + int self_allocd; /**< private */ +} vpx_image_t; /**< alias for struct vpx_image */ + +/**\brief Representation of a rectangle on a surface */ +typedef struct vpx_image_rect { + unsigned int x; /**< leftmost column */ + unsigned int y; /**< topmost row */ + unsigned int w; /**< width */ + unsigned int h; /**< height */ +} vpx_image_rect_t; /**< alias for struct vpx_image_rect */ + +/*!\brief Open a descriptor, allocating storage for the underlying image + * + * Returns a descriptor for storing an image of the given format. The + * storage for the descriptor is allocated on the heap. + * + * \param[in] img Pointer to storage for descriptor. If this parameter + * is NULL, the storage for the descriptor will be + * allocated on the heap. + * \param[in] fmt Format for the image + * \param[in] d_w Width of the image + * \param[in] d_h Height of the image + * \param[in] align Alignment, in bytes, of the image buffer and + * each row in the image(stride). + * + * \return Returns a pointer to the initialized image descriptor. If the img + * parameter is non-null, the value of the img parameter will be + * returned. + */ +vpx_image_t *vpx_img_alloc(vpx_image_t *img, + vpx_img_fmt_t fmt, + unsigned int d_w, + unsigned int d_h, + unsigned int align); - /*!\brief Close an image descriptor - * - * Frees all allocated storage associated with an image descriptor. - * - * \param[in] img Image descriptor - */ - void vpx_img_free(vpx_image_t *img); +/*!\brief Open a descriptor, using existing storage for the underlying image + * + * Returns a descriptor for storing an image of the given format. The + * storage for descriptor has been allocated elsewhere, and a descriptor is + * desired to "wrap" that storage. + * + * \param[in] img Pointer to storage for descriptor. If this parameter + * is NULL, the storage for the descriptor will be + * allocated on the heap. + * \param[in] fmt Format for the image + * \param[in] d_w Width of the image + * \param[in] d_h Height of the image + * \param[in] align Alignment, in bytes, of each row in the image. + * \param[in] img_data Storage to use for the image + * + * \return Returns a pointer to the initialized image descriptor. If the img + * parameter is non-null, the value of the img parameter will be + * returned. + */ +vpx_image_t *vpx_img_wrap(vpx_image_t *img, + vpx_img_fmt_t fmt, + unsigned int d_w, + unsigned int d_h, + unsigned int align, + unsigned char *img_data); + + +/*!\brief Set the rectangle identifying the displayed portion of the image + * + * Updates the displayed rectangle (aka viewport) on the image surface to + * match the specified coordinates and size. + * + * \param[in] img Image descriptor + * \param[in] x leftmost column + * \param[in] y topmost row + * \param[in] w width + * \param[in] h height + * + * \return 0 if the requested rectangle is valid, nonzero otherwise. + */ +int vpx_img_set_rect(vpx_image_t *img, + unsigned int x, + unsigned int y, + unsigned int w, + unsigned int h); + + +/*!\brief Flip the image vertically (top for bottom) + * + * Adjusts the image descriptor's pointers and strides to make the image + * be referenced upside-down. + * + * \param[in] img Image descriptor + */ +void vpx_img_flip(vpx_image_t *img); + +/*!\brief Close an image descriptor + * + * Frees all allocated storage associated with an image descriptor. + * + * \param[in] img Image descriptor + */ +void vpx_img_free(vpx_image_t *img); #endif #ifdef __cplusplus diff --git a/thirdparties/mac/include/webrtc/echo_cancellation.h b/thirdparties/mac/include/webrtc/echo_cancellation.h index dc64a34..7ca1f26 100755 --- a/thirdparties/mac/include/webrtc/echo_cancellation.h +++ b/thirdparties/mac/include/webrtc/echo_cancellation.h @@ -24,36 +24,36 @@ #define AEC_BAD_PARAMETER_WARNING 12050 enum { - kAecNlpConservative = 0, - kAecNlpModerate, - kAecNlpAggressive + kAecNlpConservative = 0, + kAecNlpModerate, + kAecNlpAggressive }; enum { - kAecFalse = 0, - kAecTrue + kAecFalse = 0, + kAecTrue }; typedef struct { - int16_t nlpMode; // default kAecNlpModerate - int16_t skewMode; // default kAecFalse - int16_t metricsMode; // default kAecFalse - int delay_logging; // default kAecFalse - // float realSkew; + int16_t nlpMode; // default kAecNlpModerate + int16_t skewMode; // default kAecFalse + int16_t metricsMode; // default kAecFalse + int delay_logging; // default kAecFalse + // float realSkew; } AecConfig; typedef struct { - int instant; - int average; - int max; - int min; + int instant; + int average; + int max; + int min; } AecLevel; typedef struct { - AecLevel rerl; - AecLevel erl; - AecLevel erle; - AecLevel aNlp; + AecLevel rerl; + AecLevel erl; + AecLevel erle; + AecLevel aNlp; } AecMetrics; struct AecCore; |