diff --git a/bin/windows/vpx/include/vpx/vp8.h b/bin/windows/vpx/include/vpx/vp8.h index 8a035f97707..f30dafed585 100644 --- a/bin/windows/vpx/include/vpx/vp8.h +++ b/bin/windows/vpx/include/vpx/vp8.h @@ -10,7 +10,7 @@ /*!\defgroup vp8 VP8 * \ingroup codecs - * VP8 is vpx's newest video compression algorithm that uses motion + * VP8 is a video compression algorithm that uses motion * compensated prediction, Discrete Cosine Transform (DCT) coding of the * prediction error signal and context dependent entropy coding techniques * based on arithmetic principles. It features: @@ -27,8 +27,8 @@ /*!\file * \brief Provides controls common to both the VP8 encoder and decoder. */ -#ifndef VPX_VP8_H_ -#define VPX_VP8_H_ +#ifndef VPX_VPX_VP8_H_ +#define VPX_VPX_VP8_H_ #include "./vpx_codec.h" #include "./vpx_image.h" @@ -42,21 +42,19 @@ extern "C" { * The set of macros define the control functions of VP8 interface */ 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 */ - VP8_SET_DBG_COLOR_REF_FRAME = 4, /**< set the reference frames to color for each macroblock */ - VP8_SET_DBG_COLOR_MB_MODES = 5, /**< set which macro block modes to color */ - VP8_SET_DBG_COLOR_B_MODES = 6, /**< set which blocks modes to color */ - VP8_SET_DBG_DISPLAY_MV = 7, /**< set which motion vector modes to draw */ + /*!\brief pass in an external frame into decoder to be used as reference frame + */ + VP8_SET_REFERENCE = 1, + VP8_COPY_REFERENCE = 2, /**< get a copy of reference frame from the decoder */ + VP8_SET_POSTPROC = 3, /**< set the decoder's post processing settings */ /* TODO(jkoleszar): The encoder incorrectly reuses some of these values (5+) * for its control ids. These should be migrated to something like the * VP8_DECODER_CTRL_ID_START range next time we're ready to break the ABI. */ - VP9_GET_REFERENCE = 128, /**< get a pointer to a reference frame */ + VP9_GET_REFERENCE = 128, /**< get a pointer to a reference frame */ VP8_COMMON_CTRL_ID_MAX, - VP8_DECODER_CTRL_ID_START = 256 + VP8_DECODER_CTRL_ID_START = 256 }; /*!\brief post process flags @@ -64,15 +62,11 @@ enum vp8_com_control_id { * The set of macros define VP8 decoder post processing flags */ enum vp8_postproc_level { - VP8_NOFILTERING = 0, - VP8_DEBLOCK = 1 << 0, - VP8_DEMACROBLOCK = 1 << 1, - VP8_ADDNOISE = 1 << 2, - VP8_DEBUG_TXT_FRAME_INFO = 1 << 3, /**< print frame information */ - VP8_DEBUG_TXT_MBLK_MODES = 1 << 4, /**< print macro block modes over each macro block */ - VP8_DEBUG_TXT_DC_DIFF = 1 << 5, /**< print dc diff for each macro block */ - VP8_DEBUG_TXT_RATE_INFO = 1 << 6, /**< print video rate info (encoder only) */ - VP8_MFQE = 1 << 10 + VP8_NOFILTERING = 0, + VP8_DEBLOCK = 1 << 0, + VP8_DEMACROBLOCK = 1 << 1, + VP8_ADDNOISE = 1 << 2, + VP8_MFQE = 1 << 3 }; /*!\brief post process flags @@ -83,9 +77,11 @@ enum vp8_postproc_level { */ 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] */ + /*!\brief the types of post processing to be done, should be combination of + * "vp8_postproc_level" */ + int post_proc_flag; + int deblocking_level; /**< the strength of deblocking, valid range [0, 16] */ + int noise_level; /**< the strength of additive noise, valid range [0, 16] */ } vp8_postproc_cfg_t; /*!\brief reference frame type @@ -103,8 +99,8 @@ typedef enum vpx_ref_frame_type { * Define the data struct to access vp8 reference frames. */ 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_type_t frame_type; /**< which reference frame */ + vpx_image_t img; /**< reference frame data in image format */ } vpx_ref_frame_t; /*!\brief VP9 specific reference frame data struct @@ -112,8 +108,8 @@ typedef struct vpx_ref_frame { * Define the data struct to access vp9 reference frames. */ typedef struct vp9_ref_frame { - int idx; /**< frame index to get (input) */ - vpx_image_t img; /**< img structure to populate (output) */ + int idx; /**< frame index to get (input) */ + vpx_image_t img; /**< img structure to populate (output) */ } vp9_ref_frame_t; /*!\cond */ @@ -121,21 +117,13 @@ typedef struct vp9_ref_frame { * * defines the data type for each of VP8 decoder control function requires */ -VPX_CTRL_USE_TYPE(VP8_SET_REFERENCE, vpx_ref_frame_t *) +VPX_CTRL_USE_TYPE(VP8_SET_REFERENCE, vpx_ref_frame_t *) #define VPX_CTRL_VP8_SET_REFERENCE -VPX_CTRL_USE_TYPE(VP8_COPY_REFERENCE, vpx_ref_frame_t *) +VPX_CTRL_USE_TYPE(VP8_COPY_REFERENCE, vpx_ref_frame_t *) #define VPX_CTRL_VP8_COPY_REFERENCE -VPX_CTRL_USE_TYPE(VP8_SET_POSTPROC, vp8_postproc_cfg_t *) +VPX_CTRL_USE_TYPE(VP8_SET_POSTPROC, vp8_postproc_cfg_t *) #define VPX_CTRL_VP8_SET_POSTPROC -VPX_CTRL_USE_TYPE(VP8_SET_DBG_COLOR_REF_FRAME, int) -#define VPX_CTRL_VP8_SET_DBG_COLOR_REF_FRAME -VPX_CTRL_USE_TYPE(VP8_SET_DBG_COLOR_MB_MODES, int) -#define VPX_CTRL_VP8_SET_DBG_COLOR_MB_MODES -VPX_CTRL_USE_TYPE(VP8_SET_DBG_COLOR_B_MODES, int) -#define VPX_CTRL_VP8_SET_DBG_COLOR_B_MODES -VPX_CTRL_USE_TYPE(VP8_SET_DBG_DISPLAY_MV, int) -#define VPX_CTRL_VP8_SET_DBG_DISPLAY_MV -VPX_CTRL_USE_TYPE(VP9_GET_REFERENCE, vp9_ref_frame_t *) +VPX_CTRL_USE_TYPE(VP9_GET_REFERENCE, vp9_ref_frame_t *) #define VPX_CTRL_VP9_GET_REFERENCE /*!\endcond */ @@ -145,4 +133,4 @@ VPX_CTRL_USE_TYPE(VP9_GET_REFERENCE, vp9_ref_frame_t *) } // extern "C" #endif -#endif // VPX_VP8_H_ +#endif // VPX_VPX_VP8_H_ diff --git a/bin/windows/vpx/include/vpx/vp8dx.h b/bin/windows/vpx/include/vpx/vp8dx.h index 67c97bb6c9a..af92f21ae30 100644 --- a/bin/windows/vpx/include/vpx/vp8dx.h +++ b/bin/windows/vpx/include/vpx/vp8dx.h @@ -8,7 +8,6 @@ * be found in the AUTHORS file in the root of the source tree. */ - /*!\defgroup vp8_decoder WebM VP8/VP9 Decoder * \ingroup vp8 * @@ -18,8 +17,8 @@ * \brief Provides definitions for using VP8 or VP9 within the vpx Decoder * interface. */ -#ifndef VPX_VP8DX_H_ -#define VPX_VP8DX_H_ +#ifndef VPX_VPX_VP8DX_H_ +#define VPX_VPX_VP8DX_H_ #ifdef __cplusplus extern "C" { @@ -33,7 +32,7 @@ extern "C" { * This interface provides the capability to decode VP8 streams. * @{ */ -extern vpx_codec_iface_t vpx_codec_vp8_dx_algo; +extern vpx_codec_iface_t vpx_codec_vp8_dx_algo; extern vpx_codec_iface_t *vpx_codec_vp8_dx(void); /*!@} - end algorithm interface member group*/ @@ -42,7 +41,7 @@ extern vpx_codec_iface_t *vpx_codec_vp8_dx(void); * This interface provides the capability to decode VP9 streams. * @{ */ -extern vpx_codec_iface_t vpx_codec_vp9_dx_algo; +extern vpx_codec_iface_t vpx_codec_vp9_dx_algo; extern vpx_codec_iface_t *vpx_codec_vp9_dx(void); /*!@} - end algorithm interface member group*/ @@ -112,6 +111,37 @@ enum vp8_dec_control_id { */ VP9_SET_SKIP_LOOP_FILTER, + /** control function to decode SVC stream up to the x spatial layers, + * where x is passed in through the control, and is 0 for base layer. + */ + VP9_DECODE_SVC_SPATIAL_LAYER, + + /*!\brief Codec control function to get last decoded frame quantizer. + * + * Return value uses internal quantizer scale defined by the codec. + * + * Supported in codecs: VP8, VP9 + */ + VPXD_GET_LAST_QUANTIZER, + + /*!\brief Codec control function to set row level multi-threading. + * + * 0 : off, 1 : on + * + * Supported in codecs: VP9 + */ + VP9D_SET_ROW_MT, + + /*!\brief Codec control function to set loopfilter optimization. + * + * 0 : off, Loop filter is done after all tiles have been decoded + * 1 : on, Loop filter is done immediately after decode without + * waiting for all threads to sync. + * + * Supported in codecs: VP9 + */ + VP9D_SET_LOOP_FILTER_OPT, + VP8_DECODER_CTRL_ID_MAX }; @@ -126,18 +156,13 @@ typedef void (*vpx_decrypt_cb)(void *decrypt_state, const unsigned char *input, * Defines a structure to hold the decryption state and access function. */ typedef struct vpx_decrypt_init { - /*! Decrypt callback. */ - vpx_decrypt_cb decrypt_cb; + /*! Decrypt callback. */ + vpx_decrypt_cb decrypt_cb; - /*! Decryption state. */ - void *decrypt_state; + /*! Decryption state. */ + void *decrypt_state; } vpx_decrypt_init; -/*!\brief A deprecated alias for vpx_decrypt_init. - */ -typedef vpx_decrypt_init vp8_decrypt_init; - - /*!\cond */ /*!\brief VP8 decoder control function parameter type * @@ -146,25 +171,34 @@ typedef vpx_decrypt_init vp8_decrypt_init; * */ - -VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_UPDATES, int *) +VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_UPDATES, int *) #define VPX_CTRL_VP8D_GET_LAST_REF_UPDATES -VPX_CTRL_USE_TYPE(VP8D_GET_FRAME_CORRUPTED, int *) +VPX_CTRL_USE_TYPE(VP8D_GET_FRAME_CORRUPTED, int *) #define VPX_CTRL_VP8D_GET_FRAME_CORRUPTED -VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_USED, int *) +VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_USED, int *) #define VPX_CTRL_VP8D_GET_LAST_REF_USED -VPX_CTRL_USE_TYPE(VPXD_SET_DECRYPTOR, vpx_decrypt_init *) +VPX_CTRL_USE_TYPE(VPXD_GET_LAST_QUANTIZER, int *) +#define VPX_CTRL_VPXD_GET_LAST_QUANTIZER +VPX_CTRL_USE_TYPE(VPXD_SET_DECRYPTOR, vpx_decrypt_init *) #define VPX_CTRL_VPXD_SET_DECRYPTOR -VPX_CTRL_USE_TYPE(VP8D_SET_DECRYPTOR, vpx_decrypt_init *) +VPX_CTRL_USE_TYPE(VP8D_SET_DECRYPTOR, vpx_decrypt_init *) #define VPX_CTRL_VP8D_SET_DECRYPTOR -VPX_CTRL_USE_TYPE(VP9D_GET_DISPLAY_SIZE, int *) +VPX_CTRL_USE_TYPE(VP9D_GET_DISPLAY_SIZE, int *) #define VPX_CTRL_VP9D_GET_DISPLAY_SIZE -VPX_CTRL_USE_TYPE(VP9D_GET_BIT_DEPTH, unsigned int *) +VPX_CTRL_USE_TYPE(VP9D_GET_BIT_DEPTH, unsigned int *) #define VPX_CTRL_VP9D_GET_BIT_DEPTH -VPX_CTRL_USE_TYPE(VP9D_GET_FRAME_SIZE, int *) +VPX_CTRL_USE_TYPE(VP9D_GET_FRAME_SIZE, int *) #define VPX_CTRL_VP9D_GET_FRAME_SIZE VPX_CTRL_USE_TYPE(VP9_INVERT_TILE_DECODE_ORDER, int) #define VPX_CTRL_VP9_INVERT_TILE_DECODE_ORDER +#define VPX_CTRL_VP9_DECODE_SVC_SPATIAL_LAYER +VPX_CTRL_USE_TYPE(VP9_DECODE_SVC_SPATIAL_LAYER, int) +#define VPX_CTRL_VP9_SET_SKIP_LOOP_FILTER +VPX_CTRL_USE_TYPE(VP9_SET_SKIP_LOOP_FILTER, int) +#define VPX_CTRL_VP9_DECODE_SET_ROW_MT +VPX_CTRL_USE_TYPE(VP9D_SET_ROW_MT, int) +#define VPX_CTRL_VP9_SET_LOOP_FILTER_OPT +VPX_CTRL_USE_TYPE(VP9D_SET_LOOP_FILTER_OPT, int) /*!\endcond */ /*! @} - end defgroup vp8_decoder */ @@ -173,4 +207,4 @@ VPX_CTRL_USE_TYPE(VP9_INVERT_TILE_DECODE_ORDER, int) } // extern "C" #endif -#endif // VPX_VP8DX_H_ +#endif // VPX_VPX_VP8DX_H_ diff --git a/bin/windows/vpx/include/vpx/vpx_codec.h b/bin/windows/vpx/include/vpx/vpx_codec.h index b6037bb4d7a..b0a931e0191 100644 --- a/bin/windows/vpx/include/vpx/vpx_codec.h +++ b/bin/windows/vpx/include/vpx/vpx_codec.h @@ -8,7 +8,6 @@ * be found in the AUTHORS file in the root of the source tree. */ - /*!\defgroup codec Common Algorithm Interface * This abstraction allows applications to easily support multiple video * formats with minimal code duplication. This section describes the interface @@ -23,457 +22,450 @@ * video codec algorithm. * * An application instantiates a specific codec instance by using - * vpx_codec_init() and a pointer to the algorithm's interface structure: + * vpx_codec_dec_init() or vpx_codec_enc_init() and a pointer to the + * algorithm's interface structure: *
  *     my_app.c:
  *       extern vpx_codec_iface_t my_codec;
  *       {
  *           vpx_codec_ctx_t algo;
- *           res = vpx_codec_init(&algo, &my_codec);
+ *           int threads = 4;
+ *           vpx_codec_dec_cfg_t cfg = { threads, 0, 0 };
+ *           res = vpx_codec_dec_init(&algo, &my_codec, &cfg, 0);
  *       }
  *     
* * Once initialized, the instance is manged using other functions from * the vpx_codec_* family. */ -#ifndef VPX_VPX_CODEC_H_ -#define VPX_VPX_CODEC_H_ +#ifndef VPX_VPX_VPX_CODEC_H_ +#define VPX_VPX_VPX_CODEC_H_ #ifdef __cplusplus extern "C" { #endif -#include "./vpx_integer.h" #include "./vpx_image.h" +#include "./vpx_integer.h" - /*!\brief Decorator indicating a function is deprecated */ -#ifndef DEPRECATED +/*!\brief Decorator indicating a function is deprecated */ +#ifndef VPX_DEPRECATED #if defined(__GNUC__) && __GNUC__ -#define DEPRECATED __attribute__ ((deprecated)) +#define VPX_DEPRECATED __attribute__((deprecated)) #elif defined(_MSC_VER) -#define DEPRECATED +#define VPX_DEPRECATED #else -#define DEPRECATED +#define VPX_DEPRECATED #endif -#endif /* DEPRECATED */ +#endif /* VPX_DEPRECATED */ -#ifndef DECLSPEC_DEPRECATED +#ifndef VPX_DECLSPEC_DEPRECATED #if defined(__GNUC__) && __GNUC__ -#define DECLSPEC_DEPRECATED /**< \copydoc #DEPRECATED */ +#define VPX_DECLSPEC_DEPRECATED /**< \copydoc #VPX_DEPRECATED */ #elif defined(_MSC_VER) -#define DECLSPEC_DEPRECATED __declspec(deprecated) /**< \copydoc #DEPRECATED */ +/*!\brief \copydoc #VPX_DEPRECATED */ +#define VPX_DECLSPEC_DEPRECATED __declspec(deprecated) #else -#define DECLSPEC_DEPRECATED /**< \copydoc #DEPRECATED */ +#define VPX_DECLSPEC_DEPRECATED /**< \copydoc #VPX_DEPRECATED */ #endif -#endif /* DECLSPEC_DEPRECATED */ +#endif /* VPX_DECLSPEC_DEPRECATED */ - /*!\brief Decorator indicating a function is potentially unused */ -#ifdef UNUSED -#elif defined(__GNUC__) || defined(__clang__) -#define UNUSED __attribute__ ((unused)) +/*!\brief Decorator indicating a function is potentially unused */ +#ifndef VPX_UNUSED +#if defined(__GNUC__) || defined(__clang__) +#define VPX_UNUSED __attribute__((unused)) #else -#define UNUSED +#define VPX_UNUSED #endif +#endif /* VPX_UNUSED */ - /*!\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 (3 + 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 - * - * 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 - * - * 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 */ +/*!\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 (4 + VPX_IMAGE_ABI_VERSION) /**<\hideinitializer*/ +/*!\brief Algorithm return codes */ +typedef enum { + /*!\brief Operation completed without error */ + VPX_CODEC_OK, - /*! \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 Unspecified error */ + VPX_CODEC_ERROR, + /*!\brief Memory operation failed */ + VPX_CODEC_MEM_ERROR, - /*!\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 ABI version mismatch */ + VPX_CODEC_ABI_MISMATCH, + /*!\brief Algorithm does not have required capability */ + VPX_CODEC_INCAPABLE, - /*!\brief Codec private data structure. + /*!\brief The given bitstream is not supported. * - * Contains data private to the codec implementation. This structure is opaque - * to the application. - */ - typedef struct vpx_codec_priv vpx_codec_priv_t; - + * 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 Iterator + /*!\brief Encoded bitstream uses an unsupported feature * - * Opaque storage used for iterating over lists. + * 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. */ - typedef const void *vpx_codec_iter_t; + VPX_CODEC_UNSUP_FEATURE, - - /*!\brief Codec context structure + /*!\brief The coded data for this stream is corrupt or incomplete * - * 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 { - /**< Decoder Configuration Pointer */ - const struct vpx_codec_dec_cfg *dec; - /**< Encoder Configuration Pointer */ - const struct vpx_codec_enc_cfg *enc; - const void *raw; - } config; /**< Configuration pointer aliasing union */ - vpx_codec_priv_t *priv; /**< Algorithm private storage */ - } vpx_codec_ctx_t; - - /*!\brief Bit depth for codec - * * - * This enumeration determines the bit depth of the codec. + * 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. */ - typedef enum vpx_bit_depth { - VPX_BITS_8 = 8, /**< 8 bits */ - VPX_BITS_10 = 10, /**< 10 bits */ - VPX_BITS_12 = 12, /**< 12 bits */ - } vpx_bit_depth_t; - - /* - * Library Version Number Interface + VPX_CODEC_CORRUPT_FRAME, + + /*!\brief An application-supplied parameter is not valid. * - * 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" */ + VPX_CODEC_INVALID_PARAM, - /*!\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. + /*!\brief An iterator reached the end of list. * */ - 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 */ + VPX_CODEC_LIST_END - /*!\brief Return the version major number */ -#define vpx_codec_version_major() ((vpx_codec_version()>>16)&0xff) +} vpx_codec_err_t; - /*!\brief Return the version minor number */ -#define vpx_codec_version_minor() ((vpx_codec_version()>>8)&0xff) +/*! \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 */ - /*!\brief Return the version patch number */ -#define vpx_codec_version_patch() ((vpx_codec_version()>>0)&0xff) +/*! Can support images at greater than 8 bitdepth. + */ +#define VPX_CODEC_CAP_HIGHBITDEPTH 0x4 +/*! \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 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 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 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 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 { + /**< Decoder Configuration Pointer */ + const struct vpx_codec_dec_cfg *dec; + /**< Encoder Configuration Pointer */ + const struct vpx_codec_enc_cfg *enc; + const void *raw; + } config; /**< Configuration pointer aliasing union */ + vpx_codec_priv_t *priv; /**< Algorithm private storage */ +} vpx_codec_ctx_t; + +/*!\brief Bit depth for codec + * * + * This enumeration determines the bit depth of the codec. + */ +typedef enum vpx_bit_depth { + VPX_BITS_8 = 8, /**< 8 bits */ + VPX_BITS_10 = 10, /**< 10 bits */ + VPX_BITS_12 = 12, /**< 12 bits */ +} vpx_bit_depth_t; - /*!\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); +/* + * 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); +#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 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 version major number */ +#define vpx_codec_version_major() ((vpx_codec_version() >> 16) & 0xff) +/*!\brief Return the version minor number */ +#define vpx_codec_version_minor() ((vpx_codec_version() >> 8) & 0xff) - /*!\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 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 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 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 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 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); - /* REQUIRED FUNCTIONS - * - * The following functions are required to be implemented for all codecs. - * They represent the base case functionality expected of all codecs. - */ +/*!\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 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 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. + */ - /*!\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 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 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) -# define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ) -# define VPX_CTRL_VOID(id, typ) +#define vpx_codec_control(ctx, id, data) vpx_codec_control_(ctx, id, data) +#define VPX_CTRL_USE_TYPE(id, typ) +#define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ) +#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. - */ -# define vpx_codec_control(ctx,id,data) vpx_codec_control_##id(ctx,id,data)\ - /**<\hideinitializer*/ - +/*!\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. - */ -# define VPX_CTRL_USE_TYPE(id, typ) \ - static vpx_codec_err_t \ - vpx_codec_control_##id(vpx_codec_ctx_t*, int, typ) UNUSED;\ - \ - static vpx_codec_err_t \ - vpx_codec_control_##id(vpx_codec_ctx_t *ctx, int ctrl_id, typ data) {\ - return vpx_codec_control_(ctx, ctrl_id, data);\ +/*!\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) \ + VPX_UNUSED; \ + \ + static vpx_codec_err_t vpx_codec_control_##id(vpx_codec_ctx_t *ctx, \ + int ctrl_id, typ data) { \ + return vpx_codec_control_(ctx, ctrl_id, data); \ } /**<\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. - */ -# 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;\ - \ - DECLSPEC_DEPRECATED static vpx_codec_err_t \ - vpx_codec_control_##id(vpx_codec_ctx_t *ctx, int ctrl_id, typ data) {\ - return vpx_codec_control_(ctx, ctrl_id, data);\ +/*!\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) \ + VPX_DECLSPEC_DEPRECATED static vpx_codec_err_t vpx_codec_control_##id( \ + vpx_codec_ctx_t *, int, typ) VPX_DEPRECATED VPX_UNUSED; \ + \ + VPX_DECLSPEC_DEPRECATED static vpx_codec_err_t vpx_codec_control_##id( \ + vpx_codec_ctx_t *ctx, int ctrl_id, typ data) { \ + return vpx_codec_control_(ctx, ctrl_id, data); \ } /**<\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. - */ -# define VPX_CTRL_VOID(id) \ - static vpx_codec_err_t \ - vpx_codec_control_##id(vpx_codec_ctx_t*, int) UNUSED;\ - \ - static vpx_codec_err_t \ - vpx_codec_control_##id(vpx_codec_ctx_t *ctx, int ctrl_id) {\ - return vpx_codec_control_(ctx, ctrl_id);\ +/*!\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) \ + VPX_UNUSED; \ + \ + static vpx_codec_err_t vpx_codec_control_##id(vpx_codec_ctx_t *ctx, \ + int ctrl_id) { \ + return vpx_codec_control_(ctx, ctrl_id); \ } /**<\hideinitializer*/ - #endif - /*!@} - end defgroup codec*/ +/*!@} - end defgroup codec*/ #ifdef __cplusplus } #endif -#endif // VPX_VPX_CODEC_H_ - +#endif // VPX_VPX_VPX_CODEC_H_ diff --git a/bin/windows/vpx/include/vpx/vpx_decoder.h b/bin/windows/vpx/include/vpx/vpx_decoder.h index 62fd9197564..39e5f585f6b 100644 --- a/bin/windows/vpx/include/vpx/vpx_decoder.h +++ b/bin/windows/vpx/include/vpx/vpx_decoder.h @@ -7,8 +7,8 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -#ifndef VPX_VPX_DECODER_H_ -#define VPX_VPX_DECODER_H_ +#ifndef VPX_VPX_VPX_DECODER_H_ +#define VPX_VPX_VPX_DECODER_H_ /*!\defgroup decoder Decoder Algorithm Interface * \ingroup codec @@ -32,347 +32,334 @@ extern "C" { #include "./vpx_codec.h" #include "./vpx_frame_buffer.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 - */ -#define VPX_DECODER_ABI_VERSION (3 + 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. - */ -#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 */ -#define VPX_CODEC_CAP_ERROR_CONCEALMENT 0x80000 /**< Can conceal errors due to - packet loss */ -#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. - */ -#define VPX_CODEC_CAP_FRAME_THREADING 0x200000 /**< Can support frame-based - multi-threading */ -#define VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER 0x400000 /**< Can support external - frame buffers */ - -#define VPX_CODEC_USE_POSTPROC 0x10000 /**< Postprocess decoded frame */ -#define VPX_CODEC_USE_ERROR_CONCEALMENT 0x20000 /**< Conceal errors in decoded - frames */ -#define VPX_CODEC_USE_INPUT_FRAGMENTS 0x40000 /**< The input frame should be - passed to the decoder one - fragment at a time */ -#define VPX_CODEC_USE_FRAME_THREADING 0x80000 /**< Enable frame-based - multi-threading */ - - /*!\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 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 \ + (3 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer*/ - /*!\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 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 */ +/*!\brief Can conceal errors due to packet loss */ +#define VPX_CODEC_CAP_ERROR_CONCEALMENT 0x80000 +/*!\brief Can receive encoded frames one fragment at a time */ +#define VPX_CODEC_CAP_INPUT_FRAGMENTS 0x100000 +/*!\brief Can support frame-based multi-threading */ +#define VPX_CODEC_CAP_FRAME_THREADING 0x200000 +/*!brief Can support external frame buffers */ +#define VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER 0x400000 + +/*! \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 */ +/*!\brief Conceal errors in decoded frames */ +#define VPX_CODEC_USE_ERROR_CONCEALMENT 0x20000 +/*!\brief The input frame should be passed to the decoder one fragment at a + * time */ +#define VPX_CODEC_USE_INPUT_FRAGMENTS 0x40000 +/*!\brief Enable frame-based multi-threading */ +#define VPX_CODEC_USE_FRAME_THREADING 0x80000 + +/*!\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. - * - * If the library was configured with --disable-multithread, this call - * is not thread safe and should be guarded with a lock if being used - * in a multithreaded context. - * - * \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, - const vpx_codec_dec_cfg_t *cfg, - vpx_codec_flags_t flags, - int ver); +/*!\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. + * + * If the library was configured with --disable-multithread, this call + * is not thread safe and should be guarded with a lock if being used + * in a multithreaded context. + * + * \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, + const 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 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 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 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 callbacks may be + * invoked, 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, the put_frame callback is invoked 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 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); +/*!\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 function is required to be implemented for all decoders + * that advertise the VPX_CODEC_CAP_PUT_FRAME capability. Calling this + * function for codecs that don't advertise this capability will result in + * an error code being returned, usually VPX_CODEC_INCAPABLE. + * @{ + */ - /*!@} - end defgroup cap_put_frame */ +/*!\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); - /*!\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 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. + * \retval #VPX_CODEC_INCAPABLE + * Algorithm not capable of posting frame 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); - /*!\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); +/*!@} - end defgroup cap_put_frame */ +/*!\defgroup cap_put_slice Slice-Based Decoding Functions + * + * The following function is required to be implemented for all decoders + * that advertise the VPX_CODEC_CAP_PUT_SLICE capability. Calling this + * function for codecs that don't advertise this capability will result in + * an error code being returned, usually VPX_CODEC_INCAPABLE. + * @{ + */ - /*!\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); +/*!\brief put slice callback prototype + * + * This callback is invoked by the decoder to notify the application of + * the availability of partially decoded image data. + */ +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. + * \retval #VPX_CODEC_INCAPABLE + * 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 cap_put_slice*/ - /*!\defgroup cap_external_frame_buffer External Frame Buffer Functions - * - * The following section is required to be implemented for all decoders - * that advertise the VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER capability. - * Calling this function for codecs that don't advertise this capability - * will result in an error code being returned, usually VPX_CODEC_ERROR. - * - * \note - * Currently this only works with VP9. - * @{ - */ +/*!\defgroup cap_external_frame_buffer External Frame Buffer Functions + * + * The following function is required to be implemented for all decoders + * that advertise the VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER capability. + * Calling this function for codecs that don't advertise this capability + * will result in an error code being returned, usually VPX_CODEC_INCAPABLE. + * + * \note + * Currently this only works with VP9. + * @{ + */ - /*!\brief Pass in external frame buffers for the decoder to use. - * - * Registers functions to be called when libvpx needs a frame buffer - * to decode the current frame and a function to be called when libvpx does - * not internally reference the frame buffer. This set function must - * be called before the first call to decode or libvpx will assume the - * default behavior of allocating frame buffers internally. - * - * \param[in] ctx Pointer to this instance's context - * \param[in] cb_get Pointer to the get callback function - * \param[in] cb_release Pointer to the release callback function - * \param[in] cb_priv Callback's private data - * - * \retval #VPX_CODEC_OK - * External frame buffers will be used by libvpx. - * \retval #VPX_CODEC_INVALID_PARAM - * One or more of the callbacks were NULL. - * \retval #VPX_CODEC_ERROR - * Decoder context not initialized, or algorithm not capable of - * using external frame buffers. - * - * \note - * When decoding VP9, the application may be required to pass in at least - * #VP9_MAXIMUM_REF_BUFFERS + #VPX_MAXIMUM_WORK_BUFFERS external frame - * buffers. - */ - vpx_codec_err_t vpx_codec_set_frame_buffer_functions( - vpx_codec_ctx_t *ctx, - vpx_get_frame_buffer_cb_fn_t cb_get, - vpx_release_frame_buffer_cb_fn_t cb_release, void *cb_priv); +/*!\brief Pass in external frame buffers for the decoder to use. + * + * Registers functions to be called when libvpx needs a frame buffer + * to decode the current frame and a function to be called when libvpx does + * not internally reference the frame buffer. This set function must + * be called before the first call to decode or libvpx will assume the + * default behavior of allocating frame buffers internally. + * + * \param[in] ctx Pointer to this instance's context + * \param[in] cb_get Pointer to the get callback function + * \param[in] cb_release Pointer to the release callback function + * \param[in] cb_priv Callback's private data + * + * \retval #VPX_CODEC_OK + * External frame buffers will be used by libvpx. + * \retval #VPX_CODEC_INVALID_PARAM + * One or more of the callbacks were NULL. + * \retval #VPX_CODEC_ERROR + * Decoder context not initialized. + * \retval #VPX_CODEC_INCAPABLE + * Algorithm not capable of using external frame buffers. + * + * \note + * When decoding VP9, the application may be required to pass in at least + * #VP9_MAXIMUM_REF_BUFFERS + #VPX_MAXIMUM_WORK_BUFFERS external frame + * buffers. + */ +vpx_codec_err_t vpx_codec_set_frame_buffer_functions( + vpx_codec_ctx_t *ctx, vpx_get_frame_buffer_cb_fn_t cb_get, + vpx_release_frame_buffer_cb_fn_t cb_release, void *cb_priv); - /*!@} - end defgroup cap_external_frame_buffer */ +/*!@} - end defgroup cap_external_frame_buffer */ - /*!@} - end defgroup decoder*/ +/*!@} - end defgroup decoder*/ #ifdef __cplusplus } #endif -#endif // VPX_VPX_DECODER_H_ - +#endif // VPX_VPX_VPX_DECODER_H_ diff --git a/bin/windows/vpx/include/vpx/vpx_frame_buffer.h b/bin/windows/vpx/include/vpx/vpx_frame_buffer.h index 9036459af0a..fc8320017be 100644 --- a/bin/windows/vpx/include/vpx/vpx_frame_buffer.h +++ b/bin/windows/vpx/include/vpx/vpx_frame_buffer.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef VPX_VPX_FRAME_BUFFER_H_ -#define VPX_VPX_FRAME_BUFFER_H_ +#ifndef VPX_VPX_VPX_FRAME_BUFFER_H_ +#define VPX_VPX_VPX_FRAME_BUFFER_H_ /*!\file * \brief Describes the decoder external frame buffer interface. @@ -37,9 +37,9 @@ extern "C" { * This structure holds allocated frame buffers used by the decoder. */ typedef struct vpx_codec_frame_buffer { - uint8_t *data; /**< Pointer to the data buffer */ - size_t size; /**< Size of data in bytes */ - void *priv; /**< Frame's private data */ + uint8_t *data; /**< Pointer to the data buffer */ + size_t size; /**< Size of data in bytes */ + void *priv; /**< Frame's private data */ } vpx_codec_frame_buffer_t; /*!\brief get frame buffer callback prototype @@ -52,16 +52,16 @@ typedef struct vpx_codec_frame_buffer { * data. The callback is triggered when the decoder needs a frame buffer to * decode a compressed image into. This function may be called more than once * for every call to vpx_codec_decode. The application may set fb->priv to - * some data which will be passed back in the ximage and the release function - * call. |fb| is guaranteed to not be NULL. On success the callback must - * return 0. Any failure the callback must return a value less than 0. + * some data which will be passed back in the vpx_image_t and the release + * function call. |fb| is guaranteed to not be NULL. On success the callback + * must return 0. Any failure the callback must return a value less than 0. * * \param[in] priv Callback's private data - * \param[in] new_size Size in bytes needed by the buffer + * \param[in] min_size Size in bytes needed by the buffer * \param[in,out] fb Pointer to vpx_codec_frame_buffer_t */ -typedef int (*vpx_get_frame_buffer_cb_fn_t)( - void *priv, size_t min_size, vpx_codec_frame_buffer_t *fb); +typedef int (*vpx_get_frame_buffer_cb_fn_t)(void *priv, size_t min_size, + vpx_codec_frame_buffer_t *fb); /*!\brief release frame buffer callback prototype * @@ -73,11 +73,11 @@ typedef int (*vpx_get_frame_buffer_cb_fn_t)( * \param[in] priv Callback's private data * \param[in] fb Pointer to vpx_codec_frame_buffer_t */ -typedef int (*vpx_release_frame_buffer_cb_fn_t)( - void *priv, vpx_codec_frame_buffer_t *fb); +typedef int (*vpx_release_frame_buffer_cb_fn_t)(void *priv, + vpx_codec_frame_buffer_t *fb); #ifdef __cplusplus } // extern "C" #endif -#endif // VPX_VPX_FRAME_BUFFER_H_ +#endif // VPX_VPX_VPX_FRAME_BUFFER_H_ diff --git a/bin/windows/vpx/include/vpx/vpx_image.h b/bin/windows/vpx/include/vpx/vpx_image.h index 7958c69806e..bc23be50c58 100644 --- a/bin/windows/vpx/include/vpx/vpx_image.h +++ b/bin/windows/vpx/include/vpx/vpx_image.h @@ -8,228 +8,201 @@ * be found in the AUTHORS file in the root of the source tree. */ - /*!\file * \brief Describes the vpx image descriptor and associated operations * */ -#ifndef VPX_VPX_IMAGE_H_ -#define VPX_VPX_IMAGE_H_ +#ifndef VPX_VPX_VPX_IMAGE_H_ +#define VPX_VPX_VPX_IMAGE_H_ #ifdef __cplusplus extern "C" { #endif - /*!\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 (4) /**<\hideinitializer*/ - - -#define VPX_IMG_FMT_PLANAR 0x100 /**< Image is a planar format. */ -#define VPX_IMG_FMT_UV_FLIP 0x200 /**< V plane precedes U in memory. */ -#define VPX_IMG_FMT_HAS_ALPHA 0x400 /**< Image has an alpha channel. */ -#define VPX_IMG_FMT_HIGHBITDEPTH 0x800 /**< Image uses 16bit framebuffer. */ - - /*!\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, - VPX_IMG_FMT_I422 = VPX_IMG_FMT_PLANAR | 5, - VPX_IMG_FMT_I444 = VPX_IMG_FMT_PLANAR | 6, - VPX_IMG_FMT_I440 = VPX_IMG_FMT_PLANAR | 7, - VPX_IMG_FMT_444A = VPX_IMG_FMT_PLANAR | VPX_IMG_FMT_HAS_ALPHA | 6, - VPX_IMG_FMT_I42016 = VPX_IMG_FMT_I420 | VPX_IMG_FMT_HIGHBITDEPTH, - VPX_IMG_FMT_I42216 = VPX_IMG_FMT_I422 | VPX_IMG_FMT_HIGHBITDEPTH, - VPX_IMG_FMT_I44416 = VPX_IMG_FMT_I444 | VPX_IMG_FMT_HIGHBITDEPTH, - VPX_IMG_FMT_I44016 = VPX_IMG_FMT_I440 | VPX_IMG_FMT_HIGHBITDEPTH - } vpx_img_fmt_t; /**< alias for enum vpx_img_fmt */ - - /*!\brief List of supported color spaces */ - typedef enum vpx_color_space { - VPX_CS_UNKNOWN = 0, /**< Unknown */ - VPX_CS_BT_601 = 1, /**< BT.601 */ - VPX_CS_BT_709 = 2, /**< BT.709 */ - VPX_CS_SMPTE_170 = 3, /**< SMPTE.170 */ - VPX_CS_SMPTE_240 = 4, /**< SMPTE.240 */ - VPX_CS_BT_2020 = 5, /**< BT.2020 */ - VPX_CS_RESERVED = 6, /**< Reserved */ - VPX_CS_SRGB = 7 /**< sRGB */ - } vpx_color_space_t; /**< alias for enum vpx_color_space */ - - /*!\brief List of supported color range */ - typedef enum vpx_color_range { - VPX_CR_STUDIO_RANGE = 0, /**< Y [16..235], UV [16..240] */ - VPX_CR_FULL_RANGE = 1 /**< YUV/RGB [0..255] */ - } vpx_color_range_t; /**< alias for enum vpx_color_range */ - - /**\brief Image Descriptor */ - typedef struct vpx_image { - vpx_img_fmt_t fmt; /**< Image Format */ - vpx_color_space_t cs; /**< Color Space */ - vpx_color_range_t range; /**< Color Range */ - - /* Image storage dimensions */ - unsigned int w; /**< Stored image width */ - unsigned int h; /**< Stored image height */ - unsigned int bit_depth; /**< Stored image bit-depth */ - - /* Image display dimensions */ - unsigned int d_w; /**< Displayed image width */ - unsigned int d_h; /**< Displayed image height */ - - /* Image intended rendering dimensions */ - unsigned int r_w; /**< Intended rendering image width */ - unsigned int r_h; /**< Intended rendering image height */ - - /* Chroma subsampling info */ - unsigned int x_chroma_shift; /**< subsampling order, X */ - unsigned int y_chroma_shift; /**< subsampling order, Y */ - - /* 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 */ -#define VPX_PLANE_V 2 /**< V (Chroma) plane */ -#define VPX_PLANE_ALPHA 3 /**< A (Transparency) 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) */ - - /* 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 */ - - void *fb_priv; /**< Frame buffer data associated with the image. */ - } 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 +/*!\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 (5) /**<\hideinitializer*/ + +#define VPX_IMG_FMT_PLANAR 0x100 /**< Image is a planar format. */ +#define VPX_IMG_FMT_UV_FLIP 0x200 /**< V plane precedes U in memory. */ +#define VPX_IMG_FMT_HAS_ALPHA 0x400 /**< Image has an alpha channel. */ +#define VPX_IMG_FMT_HIGHBITDEPTH 0x800 /**< Image uses 16bit framebuffer. */ + +/*!\brief List of supported image formats */ +typedef enum vpx_img_fmt { + VPX_IMG_FMT_NONE, + 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_I422 = VPX_IMG_FMT_PLANAR | 5, + VPX_IMG_FMT_I444 = VPX_IMG_FMT_PLANAR | 6, + VPX_IMG_FMT_I440 = VPX_IMG_FMT_PLANAR | 7, + VPX_IMG_FMT_NV12 = VPX_IMG_FMT_PLANAR | 9, + VPX_IMG_FMT_I42016 = VPX_IMG_FMT_I420 | VPX_IMG_FMT_HIGHBITDEPTH, + VPX_IMG_FMT_I42216 = VPX_IMG_FMT_I422 | VPX_IMG_FMT_HIGHBITDEPTH, + VPX_IMG_FMT_I44416 = VPX_IMG_FMT_I444 | VPX_IMG_FMT_HIGHBITDEPTH, + VPX_IMG_FMT_I44016 = VPX_IMG_FMT_I440 | VPX_IMG_FMT_HIGHBITDEPTH +} vpx_img_fmt_t; /**< alias for enum vpx_img_fmt */ + +/*!\brief List of supported color spaces */ +typedef enum vpx_color_space { + VPX_CS_UNKNOWN = 0, /**< Unknown */ + VPX_CS_BT_601 = 1, /**< BT.601 */ + VPX_CS_BT_709 = 2, /**< BT.709 */ + VPX_CS_SMPTE_170 = 3, /**< SMPTE.170 */ + VPX_CS_SMPTE_240 = 4, /**< SMPTE.240 */ + VPX_CS_BT_2020 = 5, /**< BT.2020 */ + VPX_CS_RESERVED = 6, /**< Reserved */ + VPX_CS_SRGB = 7 /**< sRGB */ +} vpx_color_space_t; /**< alias for enum vpx_color_space */ + +/*!\brief List of supported color range */ +typedef enum vpx_color_range { + VPX_CR_STUDIO_RANGE = 0, /**< Y [16..235], UV [16..240] */ + VPX_CR_FULL_RANGE = 1 /**< YUV/RGB [0..255] */ +} vpx_color_range_t; /**< alias for enum vpx_color_range */ + +/**\brief Image Descriptor */ +typedef struct vpx_image { + vpx_img_fmt_t fmt; /**< Image Format */ + vpx_color_space_t cs; /**< Color Space */ + vpx_color_range_t range; /**< Color Range */ + + /* Image storage dimensions */ + unsigned int w; /**< Stored image width */ + unsigned int h; /**< Stored image height */ + unsigned int bit_depth; /**< Stored image bit-depth */ + + /* Image display dimensions */ + unsigned int d_w; /**< Displayed image width */ + unsigned int d_h; /**< Displayed image height */ + + /* Image intended rendering dimensions */ + unsigned int r_w; /**< Intended rendering image width */ + unsigned int r_h; /**< Intended rendering image height */ + + /* Chroma subsampling info */ + unsigned int x_chroma_shift; /**< subsampling order, X */ + unsigned int y_chroma_shift; /**< subsampling order, Y */ + +/* 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 */ +#define VPX_PLANE_V 2 /**< V (Chroma) plane */ +#define VPX_PLANE_ALPHA 3 /**< A (Transparency) 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) */ + + /*!\brief The following member may be set by the application to associate + * data with this image. */ - void vpx_img_flip(vpx_image_t *img); + void *user_priv; - /*!\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); + /* The following members should be treated as private. */ + unsigned char *img_data; /**< private */ + int img_data_owner; /**< private */ + int self_allocd; /**< private */ + + void *fb_priv; /**< Frame buffer data associated with the image. */ +} 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] stride_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 stride_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); #ifdef __cplusplus } // extern "C" #endif -#endif // VPX_VPX_IMAGE_H_ +#endif // VPX_VPX_VPX_IMAGE_H_ diff --git a/bin/windows/vpx/include/vpx/vpx_integer.h b/bin/windows/vpx/include/vpx/vpx_integer.h index 829c9d132c8..4129d156f8a 100644 --- a/bin/windows/vpx/include/vpx/vpx_integer.h +++ b/bin/windows/vpx/include/vpx/vpx_integer.h @@ -8,9 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ - -#ifndef VPX_VPX_INTEGER_H_ -#define VPX_VPX_INTEGER_H_ +#ifndef VPX_VPX_VPX_INTEGER_H_ +#define VPX_VPX_VPX_INTEGER_H_ /* get ptrdiff_t, size_t, wchar_t, NULL */ #include @@ -19,56 +18,23 @@ #define VPX_FORCE_INLINE __forceinline #define VPX_INLINE __inline #else -#define VPX_FORCE_INLINE __inline__ __attribute__(always_inline) +#define VPX_FORCE_INLINE __inline__ __attribute__((always_inline)) // TODO(jbb): Allow a way to force inline off for older compilers. #define VPX_INLINE inline #endif -#if (defined(_MSC_VER) && (_MSC_VER < 1600)) || defined(VPX_EMULATE_INTTYPES) -typedef signed char int8_t; -typedef signed short int16_t; -typedef signed int int32_t; - -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; +/* Assume platforms have the C99 standard integer types. */ -#if (defined(_MSC_VER) && (_MSC_VER < 1600)) -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; -#define INT64_MAX _I64_MAX -#define INT32_MAX _I32_MAX -#define INT32_MIN _I32_MIN -#define INT16_MAX _I16_MAX -#define INT16_MIN _I16_MIN +#if defined(__cplusplus) +#if !defined(__STDC_FORMAT_MACROS) +#define __STDC_FORMAT_MACROS #endif - -#ifndef _UINTPTR_T_DEFINED -typedef size_t uintptr_t; +#if !defined(__STDC_LIMIT_MACROS) +#define __STDC_LIMIT_MACROS #endif - -#else - -/* Most platforms have the C99 standard integer types. */ - -#if defined(__cplusplus) -# if !defined(__STDC_FORMAT_MACROS) -# define __STDC_FORMAT_MACROS -# endif -# if !defined(__STDC_LIMIT_MACROS) -# define __STDC_LIMIT_MACROS -# endif #endif // __cplusplus -#include - -#endif - -/* VS2010 defines stdint.h, but not inttypes.h */ -#if defined(_MSC_VER) && _MSC_VER < 1800 -#define PRId64 "I64d" -#else #include -#endif +#include -#endif // VPX_VPX_INTEGER_H_ +#endif // VPX_VPX_VPX_INTEGER_H_ diff --git a/bin/windows/vpx/lib/32/libcompat-to-msvc.lib b/bin/windows/vpx/lib/32/libcompat-to-msvc.lib deleted file mode 100644 index 6ec8b870e27..00000000000 Binary files a/bin/windows/vpx/lib/32/libcompat-to-msvc.lib and /dev/null differ diff --git a/bin/windows/vpx/lib/32/libvpx.lib b/bin/windows/vpx/lib/32/libvpx.lib index 1a9753e32c4..32abf476b36 100644 Binary files a/bin/windows/vpx/lib/32/libvpx.lib and b/bin/windows/vpx/lib/32/libvpx.lib differ diff --git a/bin/windows/vpx/lib/64/libcompat-to-msvc.lib b/bin/windows/vpx/lib/64/libcompat-to-msvc.lib deleted file mode 100644 index 5428547cca8..00000000000 Binary files a/bin/windows/vpx/lib/64/libcompat-to-msvc.lib and /dev/null differ diff --git a/bin/windows/vpx/lib/64/libvpx.lib b/bin/windows/vpx/lib/64/libvpx.lib index 3b552c027da..62878593157 100644 Binary files a/bin/windows/vpx/lib/64/libvpx.lib and b/bin/windows/vpx/lib/64/libvpx.lib differ diff --git a/bin/windows/vpx/lib/instructions.txt b/bin/windows/vpx/lib/instructions.txt deleted file mode 100644 index a028c759571..00000000000 --- a/bin/windows/vpx/lib/instructions.txt +++ /dev/null @@ -1,44 +0,0 @@ -Instructions for Building EDuke32's Library Dependencies Targeting Win32 and Win64 -================================================================================== - -First, follow these instructions: http://wiki.eduke32.com/wiki/Building_EDuke32_on_Windows - -Download the latest sources from the link provided. - -The build output listed as "Desired Results" is what EDuke32 needs to function. - -The desired results for each library in some cases may need to be installed to the compiler. "x depends on the results of y to compile" means that the build output of x must be added to the compiler in this way. Copy files listed in each category to the appropriate destinations. Unless otherwise noted, do NOT copy the ".dll.a" file or else the final product may depend on external DLLs (which you may actually want). - -For MinGW (MinGW32): -from the compiler root (ex. C:/MinGW/) - * headers: include/ - * libraries: lib/ - -For MinGW-w64: -from the compiler root (ex. C:/MinGW-w64/mingw32-dw2/) - * headers: -w64-mingw32/include/ - * libraries: -w64-mingw32/lib/ - -Binaries (if mentioned) need to be present with the finished EDuke32 executables. They are not needed during compilation. - -NB: Text formatted as code blocks are commands to be pasted into the Windows command prompt. -http://wiki.eduke32.com/wiki/Working_with_the_Windows_Command_Prompt - -[//]: # (Plain text readers: This refers to lines beginning with exactly four spaces.) - - -libvpx ------- -### Prerequisites ### -Download the binary of yasm (http://yasm.tortall.net/) for your host system architecture. Both builds target both architectures. -The build environment needs pr.exe (https://mingw-lib.googlecode.com/files/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2). -### Download ### - * Instructions: http://www.webmproject.org/code/ - * Stable: http://downloads.webmproject.org/releases/webm/ - * Git: https://chromium.googlesource.com/webm/libvpx -### Build ### - sh ./configure --disable-vp8-encoder --disable-vp9-encoder --disable-multithread --disable-spatial-resampling --as=yasm && make libvpx.a -### Desired Results ### - * headers: vpx/vp8.h vpx/vp8dx.h vpx/vpx_codec.h vpx/vpx_decoder.h vpx/vpx_frame_buffer.h vpx/vpx_image.h vpx/vpx_integer.h - * libraries: libvpx.a - diff --git a/bin/windows/vpx/licenses/libvpx.txt b/bin/windows/vpx/licenses/libvpx.txt new file mode 100644 index 00000000000..1ce44343c4a --- /dev/null +++ b/bin/windows/vpx/licenses/libvpx.txt @@ -0,0 +1,31 @@ +Copyright (c) 2010, The WebM Project authors. 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 Google, nor the WebM Project, nor the names + of its contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/bin/windows/vpx/src/_dbg_LOAD_IMAGE.h b/bin/windows/vpx/src/_dbg_LOAD_IMAGE.h deleted file mode 100644 index 0568f301685..00000000000 --- a/bin/windows/vpx/src/_dbg_LOAD_IMAGE.h +++ /dev/null @@ -1,55 +0,0 @@ -/** - * This file has no copyright assigned and is placed in the Public Domain. - * This file is part of the w64 mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER.PD within this package. - */ -#ifndef _dbg_LOAD_IMAGE_h -#define _dbg_LOAD_IMAGE_h - -#ifndef WINAPI -#define WINAPI __stdcall -#endif - -#define IMAGEAPI DECLSPEC_IMPORT WINAPI -#define DBHLP_DEPRECIATED __declspec(deprecated) - -#define DBHLPAPI IMAGEAPI - -#ifndef EBACKTRACE_MINGW32 - -#define IMAGE_SEPARATION (64*1024) - - typedef struct _LOADED_IMAGE { - PSTR ModuleName; - HANDLE hFile; - PUCHAR MappedAddress; -#ifdef _IMAGEHLP64 - PIMAGE_NT_HEADERS64 FileHeader; -#else - PIMAGE_NT_HEADERS32 FileHeader; -#endif - PIMAGE_SECTION_HEADER LastRvaSection; - ULONG NumberOfSections; - PIMAGE_SECTION_HEADER Sections; - ULONG Characteristics; - BOOLEAN fSystemImage; - BOOLEAN fDOSImage; - BOOLEAN fReadOnly; - UCHAR Version; - LIST_ENTRY Links; - ULONG SizeOfImage; - } LOADED_IMAGE,*PLOADED_IMAGE; - -#endif - -#define MAX_SYM_NAME 2000 - - typedef struct _MODLOAD_DATA { - DWORD ssize; - DWORD ssig; - PVOID data; - DWORD size; - DWORD flags; - } MODLOAD_DATA,*PMODLOAD_DATA; - -#endif diff --git a/bin/windows/vpx/src/_dbg_common.h b/bin/windows/vpx/src/_dbg_common.h deleted file mode 100644 index 2c412e4ccad..00000000000 --- a/bin/windows/vpx/src/_dbg_common.h +++ /dev/null @@ -1,2051 +0,0 @@ -/** - * This file has no copyright assigned and is placed in the Public Domain. - * This file is part of the w64 mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER.PD within this package. - */ -#ifndef _dbg_common_h -#define _dbg_common_h - -// from _mingw_mac.h -#ifndef __MINGW_EXTENSION -#if defined(__GNUC__) || defined(__GNUG__) -#define __MINGW_EXTENSION __extension__ -#else -#define __MINGW_EXTENSION -#endif -#endif - -/* Special case nameless struct/union. */ -#ifndef __C89_NAMELESS -#define __C89_NAMELESS __MINGW_EXTENSION - -#define __C89_NAMELESSSTRUCTNAME -#define __C89_NAMELESSUNIONNAME -#endif - -#include "_dbg_LOAD_IMAGE.h" - -// from winnt.h -#if defined(UNICODE) - typedef LPWSTR LPTCH,PTCH; - typedef LPWSTR PTSTR,LPTSTR; - typedef LPCWSTR PCTSTR,LPCTSTR; - typedef LPUWSTR PUTSTR,LPUTSTR; - typedef LPCUWSTR PCUTSTR,LPCUTSTR; - typedef LPWSTR LP; -#else - typedef LPSTR LPTCH,PTCH; - typedef LPSTR PTSTR,LPTSTR,PUTSTR,LPUTSTR; - typedef LPCSTR PCTSTR,LPCTSTR,PCUTSTR,LPCUTSTR; -#endif - -#ifdef __cplusplus -extern "C" { -#endif - - typedef WINBOOL (CALLBACK *PFIND_DEBUG_FILE_CALLBACK)(HANDLE FileHandle,PCSTR FileName,PVOID CallerData); - typedef WINBOOL (CALLBACK *PFIND_DEBUG_FILE_CALLBACKW)(HANDLE FileHandle,PCWSTR FileName,PVOID CallerData); - typedef WINBOOL (CALLBACK *PFINDFILEINPATHCALLBACK)(PCSTR filename,PVOID context); - typedef WINBOOL (CALLBACK *PFINDFILEINPATHCALLBACKW)(PCWSTR filename,PVOID context); - typedef WINBOOL (CALLBACK *PFIND_EXE_FILE_CALLBACK)(HANDLE FileHandle,PCSTR FileName,PVOID CallerData); - typedef WINBOOL (CALLBACK *PFIND_EXE_FILE_CALLBACKW)(HANDLE FileHandle,PCWSTR FileName,PVOID CallerData); - - typedef WINBOOL (WINAPI *PSYMBOLSERVERPROC)(LPCSTR,LPCSTR,PVOID,DWORD,DWORD,LPSTR); - typedef WINBOOL (WINAPI *PSYMBOLSERVEROPENPROC)(VOID); - typedef WINBOOL (WINAPI *PSYMBOLSERVERCLOSEPROC)(VOID); - typedef WINBOOL (WINAPI *PSYMBOLSERVERSETOPTIONSPROC)(UINT_PTR,ULONG64); - typedef WINBOOL (CALLBACK WINAPI *PSYMBOLSERVERCALLBACKPROC)(UINT_PTR action,ULONG64 data,ULONG64 context); - typedef UINT_PTR (WINAPI *PSYMBOLSERVERGETOPTIONSPROC)(); - typedef WINBOOL (WINAPI *PSYMBOLSERVERPINGPROC)(LPCSTR); - -#ifndef EBACKTRACE_MINGW32 - HANDLE IMAGEAPI FindDebugInfoFile(PCSTR FileName,PCSTR SymbolPath,PSTR DebugFilePath); -#endif - HANDLE IMAGEAPI FindDebugInfoFileEx(PCSTR FileName,PCSTR SymbolPath,PSTR DebugFilePath,PFIND_DEBUG_FILE_CALLBACK Callback,PVOID CallerData); - HANDLE IMAGEAPI FindDebugInfoFileExW(PCWSTR FileName,PCWSTR SymbolPath,PWSTR DebugFilePath,PFIND_DEBUG_FILE_CALLBACKW Callback,PVOID CallerData); - WINBOOL IMAGEAPI SymFindFileInPath(HANDLE hprocess,PCSTR SearchPath,PCSTR FileName,PVOID id,DWORD two,DWORD three,DWORD flags,LPSTR FoundFile,PFINDFILEINPATHCALLBACK callback,PVOID context); - WINBOOL IMAGEAPI SymFindFileInPathW(HANDLE hprocess,PCWSTR SearchPath,PCWSTR FileName,PVOID id,DWORD two,DWORD three,DWORD flags,LPSTR FoundFile,PFINDFILEINPATHCALLBACKW callback,PVOID context); -#ifndef EBACKTRACE_MINGW32 - HANDLE IMAGEAPI FindExecutableImage(PCSTR FileName,PCSTR SymbolPath,PSTR ImageFilePath); -#endif - HANDLE IMAGEAPI FindExecutableImageEx(PCSTR FileName,PCSTR SymbolPath,PSTR ImageFilePath,PFIND_EXE_FILE_CALLBACK Callback,PVOID CallerData); - HANDLE IMAGEAPI FindExecutableImageExW(PCWSTR FileName,PCWSTR SymbolPath,PWSTR ImageFilePath,PFIND_EXE_FILE_CALLBACKW Callback,PVOID CallerData); - PIMAGE_NT_HEADERS IMAGEAPI ImageNtHeader(PVOID Base); - PVOID IMAGEAPI ImageDirectoryEntryToDataEx(PVOID Base,BOOLEAN MappedAsImage,USHORT DirectoryEntry,PULONG Size,PIMAGE_SECTION_HEADER *FoundHeader); - PVOID IMAGEAPI ImageDirectoryEntryToData(PVOID Base,BOOLEAN MappedAsImage,USHORT DirectoryEntry,PULONG Size); - PIMAGE_SECTION_HEADER IMAGEAPI ImageRvaToSection(PIMAGE_NT_HEADERS NtHeaders,PVOID Base,ULONG Rva); - PVOID IMAGEAPI ImageRvaToVa(PIMAGE_NT_HEADERS NtHeaders,PVOID Base,ULONG Rva,PIMAGE_SECTION_HEADER *LastRvaSection); - -#define SSRVOPT_CALLBACK 0x0001 -#define SSRVOPT_DWORD 0x0002 -#define SSRVOPT_DWORDPTR 0x0004 -#define SSRVOPT_GUIDPTR 0x0008 -#define SSRVOPT_OLDGUIDPTR 0x0010 -#define SSRVOPT_UNATTENDED 0x0020 -#define SSRVOPT_NOCOPY 0x0040 -#define SSRVOPT_PARENTWIN 0x0080 -#define SSRVOPT_PARAMTYPE 0x0100 -#define SSRVOPT_SECURE 0x0200 -#define SSRVOPT_TRACE 0x0400 -#define SSRVOPT_SETCONTEXT 0x0800 -#define SSRVOPT_PROXY 0x1000 -#define SSRVOPT_DOWNSTREAM_STORE 0x2000 -#define SSRVOPT_RESET ((ULONG_PTR)-1) - -#define SSRVACTION_TRACE 1 -#define SSRVACTION_QUERYCANCEL 2 -#define SSRVACTION_EVENT 3 - -#if !defined _WIN64 && !defined EBACKTRACE_MINGW32 - typedef struct _IMAGE_DEBUG_INFORMATION { - LIST_ENTRY List; - DWORD ReservedSize; - PVOID ReservedMappedBase; - USHORT ReservedMachine; - USHORT ReservedCharacteristics; - DWORD ReservedCheckSum; - DWORD ImageBase; - DWORD SizeOfImage; - DWORD ReservedNumberOfSections; - PIMAGE_SECTION_HEADER ReservedSections; - DWORD ReservedExportedNamesSize; - PSTR ReservedExportedNames; - DWORD ReservedNumberOfFunctionTableEntries; - PIMAGE_FUNCTION_ENTRY ReservedFunctionTableEntries; - DWORD ReservedLowestFunctionStartingAddress; - DWORD ReservedHighestFunctionEndingAddress; - DWORD ReservedNumberOfFpoTableEntries; - PFPO_DATA ReservedFpoTableEntries; - DWORD SizeOfCoffSymbols; - PIMAGE_COFF_SYMBOLS_HEADER CoffSymbols; - DWORD ReservedSizeOfCodeViewSymbols; - PVOID ReservedCodeViewSymbols; - PSTR ImageFilePath; - PSTR ImageFileName; - PSTR ReservedDebugFilePath; - DWORD ReservedTimeDateStamp; - WINBOOL ReservedRomImage; - PIMAGE_DEBUG_DIRECTORY ReservedDebugDirectory; - DWORD ReservedNumberOfDebugDirectories; - DWORD ReservedOriginalFunctionTableBaseAddress; - DWORD Reserved[2]; - } IMAGE_DEBUG_INFORMATION,*PIMAGE_DEBUG_INFORMATION; - - PIMAGE_DEBUG_INFORMATION IMAGEAPI MapDebugInformation(HANDLE FileHandle,PSTR FileName,PSTR SymbolPath,DWORD ImageBase); - WINBOOL IMAGEAPI UnmapDebugInformation(PIMAGE_DEBUG_INFORMATION DebugInfo); -#endif - - typedef WINBOOL (CALLBACK *PENUMDIRTREE_CALLBACK)(LPCSTR FilePath,PVOID CallerData); - - WINBOOL IMAGEAPI SearchTreeForFile(PSTR RootPath,PSTR InputPathName,PSTR OutputPathBuffer); - WINBOOL IMAGEAPI SearchTreeForFileW(PWSTR RootPath,PWSTR InputPathName,PWSTR OutputPathBuffer); - WINBOOL IMAGEAPI EnumDirTree(HANDLE hProcess,PSTR RootPath,PSTR InputPathName,PSTR OutputPathBuffer,PENUMDIRTREE_CALLBACK Callback,PVOID CallbackData); - WINBOOL IMAGEAPI MakeSureDirectoryPathExists(PCSTR DirPath); - -#ifndef EBACKTRACE_MINGW32 -#define UNDNAME_COMPLETE (0x0000) -#define UNDNAME_NO_LEADING_UNDERSCORES (0x0001) -#define UNDNAME_NO_MS_KEYWORDS (0x0002) -#define UNDNAME_NO_FUNCTION_RETURNS (0x0004) -#define UNDNAME_NO_ALLOCATION_MODEL (0x0008) -#define UNDNAME_NO_ALLOCATION_LANGUAGE (0x0010) -#define UNDNAME_NO_MS_THISTYPE (0x0020) -#define UNDNAME_NO_CV_THISTYPE (0x0040) -#define UNDNAME_NO_THISTYPE (0x0060) -#define UNDNAME_NO_ACCESS_SPECIFIERS (0x0080) -#define UNDNAME_NO_THROW_SIGNATURES (0x0100) -#define UNDNAME_NO_MEMBER_TYPE (0x0200) -#define UNDNAME_NO_RETURN_UDT_MODEL (0x0400) -#define UNDNAME_32_BIT_DECODE (0x0800) -#define UNDNAME_NAME_ONLY (0x1000) -#define UNDNAME_NO_ARGUMENTS (0x2000) -#define UNDNAME_NO_SPECIAL_SYMS (0x4000) - -#define UNDNAME_NO_ARGUMENTS (0x2000) -#define UNDNAME_NO_SPECIAL_SYMS (0x4000) -#endif - - DWORD IMAGEAPI WINAPI UnDecorateSymbolName(PCSTR DecoratedName,PSTR UnDecoratedName,DWORD UndecoratedLength,DWORD Flags); - DWORD IMAGEAPI WINAPI UnDecorateSymbolNameW(PCWSTR DecoratedName,PWSTR UnDecoratedName,DWORD UndecoratedLength,DWORD Flags); - -#ifdef DBGHELP_TRANSLATE_TCHAR -#define UnDecorateSymbolName UnDecorateSymbolNameW -#endif - -#define DBHHEADER_DEBUGDIRS 0x1 -#define DBHHEADER_CVMISC 0x2 - - typedef struct _MODLOAD_CVMISC { - DWORD oCV; - size_t cCV; - DWORD oMisc; - size_t cMisc; - DWORD dtImage; - DWORD cImage; - } MODLOAD_CVMISC, *PMODLOAD_CVMISC; - -#ifndef EBACKTRACE_MINGW32 - typedef enum { - AddrMode1616, - AddrMode1632, - AddrModeReal, - AddrModeFlat - } ADDRESS_MODE; -#endif - - typedef struct _tagADDRESS64 { - DWORD64 Offset; - WORD Segment; - ADDRESS_MODE Mode; - } ADDRESS64,*LPADDRESS64; - -#ifdef _IMAGEHLP64 -#define ADDRESS ADDRESS64 -#define LPADDRESS LPADDRESS64 -#elif !defined(EBACKTRACE_MINGW32) - typedef struct _tagADDRESS { - DWORD Offset; - WORD Segment; - ADDRESS_MODE Mode; - } ADDRESS,*LPADDRESS; - - static __inline void Address32To64(LPADDRESS a32,LPADDRESS64 a64) { - a64->Offset = (ULONG64)(LONG64)(LONG)a32->Offset; - a64->Segment = a32->Segment; - a64->Mode = a32->Mode; - } - - static __inline void Address64To32(LPADDRESS64 a64,LPADDRESS a32) { - a32->Offset = (ULONG)a64->Offset; - a32->Segment = a64->Segment; - a32->Mode = a64->Mode; - } -#endif - - typedef struct _KDHELP64 { - DWORD64 Thread; - DWORD ThCallbackStack; - DWORD ThCallbackBStore; - DWORD NextCallback; - DWORD FramePointer; - DWORD64 KiCallUserMode; - DWORD64 KeUserCallbackDispatcher; - DWORD64 SystemRangeStart; - DWORD64 KiUserExceptionDispatcher; - DWORD64 StackBase; - DWORD64 StackLimit; - DWORD64 Reserved[5]; - } KDHELP64,*PKDHELP64; - -#ifdef _IMAGEHLP64 -#define KDHELP KDHELP64 -#define PKDHELP PKDHELP64 -#elif !defined(EBACKTRACE_MINGW32) - typedef struct _KDHELP { - DWORD Thread; - DWORD ThCallbackStack; - DWORD NextCallback; - DWORD FramePointer; - DWORD KiCallUserMode; - DWORD KeUserCallbackDispatcher; - DWORD SystemRangeStart; - DWORD ThCallbackBStore; - DWORD KiUserExceptionDispatcher; - DWORD StackBase; - DWORD StackLimit; - DWORD Reserved[5]; - } KDHELP,*PKDHELP; - - static __inline void KdHelp32To64(PKDHELP p32,PKDHELP64 p64) { - p64->Thread = p32->Thread; - p64->ThCallbackStack = p32->ThCallbackStack; - p64->NextCallback = p32->NextCallback; - p64->FramePointer = p32->FramePointer; - p64->KiCallUserMode = p32->KiCallUserMode; - p64->KeUserCallbackDispatcher = p32->KeUserCallbackDispatcher; - p64->SystemRangeStart = p32->SystemRangeStart; - p64->KiUserExceptionDispatcher = p32->KiUserExceptionDispatcher; - p64->StackBase = p32->StackBase; - p64->StackLimit = p32->StackLimit; - } -#endif - - typedef struct _tagSTACKFRAME64 { - ADDRESS64 AddrPC; - ADDRESS64 AddrReturn; - ADDRESS64 AddrFrame; - ADDRESS64 AddrStack; - ADDRESS64 AddrBStore; - PVOID FuncTableEntry; - DWORD64 Params[4]; - WINBOOL Far; - WINBOOL Virtual; - DWORD64 Reserved[3]; - KDHELP64 KdHelp; - } STACKFRAME64,*LPSTACKFRAME64; - -#ifdef _IMAGEHLP64 -#define STACKFRAME STACKFRAME64 -#define LPSTACKFRAME LPSTACKFRAME64 -#elif !defined(EBACKTRACE_MINGW32) - typedef struct _tagSTACKFRAME { - ADDRESS AddrPC; - ADDRESS AddrReturn; - ADDRESS AddrFrame; - ADDRESS AddrStack; - PVOID FuncTableEntry; - DWORD Params[4]; - WINBOOL Far; - WINBOOL Virtual; - DWORD Reserved[3]; - KDHELP KdHelp; - ADDRESS AddrBStore; - } STACKFRAME,*LPSTACKFRAME; -#endif - - typedef WINBOOL (WINAPI *PREAD_PROCESS_MEMORY_ROUTINE64)(HANDLE hProcess,DWORD64 qwBaseAddress,PVOID lpBuffer,DWORD nSize,LPDWORD lpNumberOfBytesRead); - typedef PVOID (WINAPI *PFUNCTION_TABLE_ACCESS_ROUTINE64)(HANDLE hProcess,DWORD64 AddrBase); - typedef DWORD64 (WINAPI *PGET_MODULE_BASE_ROUTINE64)(HANDLE hProcess,DWORD64 Address); - typedef DWORD64 (WINAPI *PTRANSLATE_ADDRESS_ROUTINE64)(HANDLE hProcess,HANDLE hThread,LPADDRESS64 lpaddr); - - WINBOOL IMAGEAPI StackWalk64(DWORD MachineType,HANDLE hProcess,HANDLE hThread,LPSTACKFRAME64 StackFrame,PVOID ContextRecord,PREAD_PROCESS_MEMORY_ROUTINE64 ReadMemoryRoutine,PFUNCTION_TABLE_ACCESS_ROUTINE64 FunctionTableAccessRoutine,PGET_MODULE_BASE_ROUTINE64 -GetModuleBaseRoutine,PTRANSLATE_ADDRESS_ROUTINE64 TranslateAddress); - -#ifdef _IMAGEHLP64 -#define PREAD_PROCESS_MEMORY_ROUTINE PREAD_PROCESS_MEMORY_ROUTINE64 -#define PFUNCTION_TABLE_ACCESS_ROUTINE PFUNCTION_TABLE_ACCESS_ROUTINE64 -#define PGET_MODULE_BASE_ROUTINE PGET_MODULE_BASE_ROUTINE64 -#define PTRANSLATE_ADDRESS_ROUTINE PTRANSLATE_ADDRESS_ROUTINE64 -#define StackWalk StackWalk64 -#elif !defined(EBACKTRACE_MINGW32) - typedef WINBOOL (WINAPI *PREAD_PROCESS_MEMORY_ROUTINE)(HANDLE hProcess,DWORD lpBaseAddress,PVOID lpBuffer,DWORD nSize,PDWORD lpNumberOfBytesRead); - typedef PVOID (WINAPI *PFUNCTION_TABLE_ACCESS_ROUTINE)(HANDLE hProcess,DWORD AddrBase); - typedef DWORD (WINAPI *PGET_MODULE_BASE_ROUTINE)(HANDLE hProcess,DWORD Address); - typedef DWORD (WINAPI *PTRANSLATE_ADDRESS_ROUTINE)(HANDLE hProcess,HANDLE hThread,LPADDRESS lpaddr); - - WINBOOL IMAGEAPI StackWalk(DWORD MachineType,HANDLE hProcess,HANDLE hThread,LPSTACKFRAME StackFrame,PVOID ContextRecord,PREAD_PROCESS_MEMORY_ROUTINE ReadMemoryRoutine,PFUNCTION_TABLE_ACCESS_ROUTINE FunctionTableAccessRoutine,PGET_MODULE_BASE_ROUTINE -GetModuleBaseRoutine,PTRANSLATE_ADDRESS_ROUTINE TranslateAddress); -#endif - -#ifndef EBACKTRACE_MINGW32 -#define API_VERSION_NUMBER 11 - - typedef struct API_VERSION { - USHORT MajorVersion; - USHORT MinorVersion; - USHORT Revision; - USHORT Reserved; - } API_VERSION,*LPAPI_VERSION; -#endif - - LPAPI_VERSION IMAGEAPI ImagehlpApiVersion(VOID); - LPAPI_VERSION IMAGEAPI ImagehlpApiVersionEx(LPAPI_VERSION AppVersion); - DWORD IMAGEAPI GetTimestampForLoadedLibrary(HMODULE Module); - - typedef WINBOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK64)(PCSTR ModuleName,DWORD64 BaseOfDll,PVOID UserContext); - typedef WINBOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACKW64)(PCWSTR ModuleName,DWORD64 BaseOfDll,PVOID UserContext); - typedef WINBOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK64)(PCSTR SymbolName,DWORD64 SymbolAddress,ULONG SymbolSize,PVOID UserContext); - typedef WINBOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK64W)(PCWSTR SymbolName,DWORD64 SymbolAddress,ULONG SymbolSize,PVOID UserContext); - typedef WINBOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACK64)(PCSTR ModuleName,DWORD64 ModuleBase,ULONG ModuleSize,PVOID UserContext); - typedef WINBOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACKW64)(PCWSTR ModuleName,DWORD64 ModuleBase,ULONG ModuleSize,PVOID UserContext); - typedef WINBOOL (CALLBACK *PSYMBOL_REGISTERED_CALLBACK64)(HANDLE hProcess,ULONG ActionCode,ULONG64 CallbackData,ULONG64 UserContext); - typedef PVOID (CALLBACK *PSYMBOL_FUNCENTRY_CALLBACK)(HANDLE hProcess,DWORD AddrBase,PVOID UserContext); - typedef PVOID (CALLBACK *PSYMBOL_FUNCENTRY_CALLBACK64)(HANDLE hProcess,ULONG64 AddrBase,ULONG64 UserContext); - -#ifdef _IMAGEHLP64 -#define PSYM_ENUMMODULES_CALLBACK PSYM_ENUMMODULES_CALLBACK64 -#define PSYM_ENUMSYMBOLS_CALLBACK PSYM_ENUMSYMBOLS_CALLBACK64 -#define PSYM_ENUMSYMBOLS_CALLBACKW PSYM_ENUMSYMBOLS_CALLBACK64W -#define PENUMLOADED_MODULES_CALLBACK PENUMLOADED_MODULES_CALLBACK64 -#define PSYMBOL_REGISTERED_CALLBACK PSYMBOL_REGISTERED_CALLBACK64 -#define PSYMBOL_FUNCENTRY_CALLBACK PSYMBOL_FUNCENTRY_CALLBACK64 -#elif !defined(EBACKTRACE_MINGW32) - typedef WINBOOL (CALLBACK *PSYM_ENUMMODULES_CALLBACK)(PCSTR ModuleName,ULONG BaseOfDll,PVOID UserContext); - typedef WINBOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACK)(PCSTR SymbolName,ULONG SymbolAddress,ULONG SymbolSize,PVOID UserContext); - typedef WINBOOL (CALLBACK *PSYM_ENUMSYMBOLS_CALLBACKW)(PCWSTR SymbolName,ULONG SymbolAddress,ULONG SymbolSize,PVOID UserContext); - typedef WINBOOL (CALLBACK *PENUMLOADED_MODULES_CALLBACK)(PCSTR ModuleName,ULONG ModuleBase,ULONG ModuleSize,PVOID UserContext); - typedef WINBOOL (CALLBACK *PSYMBOL_REGISTERED_CALLBACK)(HANDLE hProcess,ULONG ActionCode,PVOID CallbackData,PVOID UserContext); -#endif - -#define SYMFLAG_VALUEPRESENT 0x00000001 -#define SYMFLAG_REGISTER 0x00000008 -#define SYMFLAG_REGREL 0x00000010 -#define SYMFLAG_FRAMEREL 0x00000020 -#define SYMFLAG_PARAMETER 0x00000040 -#define SYMFLAG_LOCAL 0x00000080 -#define SYMFLAG_CONSTANT 0x00000100 -#define SYMFLAG_EXPORT 0x00000200 -#define SYMFLAG_FORWARDER 0x00000400 -#define SYMFLAG_FUNCTION 0x00000800 -#define SYMFLAG_VIRTUAL 0x00001000 -#define SYMFLAG_THUNK 0x00002000 -#define SYMFLAG_TLSREL 0x00004000 - -#ifndef EBACKTRACE_MINGW32 - typedef enum { - SymNone = 0, - SymCoff, - SymCv, - SymPdb, - SymExport, - SymDeferred, - SymSym, - SymDia, - SymVirtual, - NumSymTypes - } SYM_TYPE; -#endif - - typedef struct _IMAGEHLP_SYMBOL64 { - DWORD SizeOfStruct; - DWORD64 Address; - DWORD Size; - DWORD Flags; - DWORD MaxNameLength; - CHAR Name[1]; - } IMAGEHLP_SYMBOL64,*PIMAGEHLP_SYMBOL64; - - typedef struct _IMAGEHLP_SYMBOL64_PACKAGE { - IMAGEHLP_SYMBOL64 sym; - CHAR name[MAX_SYM_NAME + 1]; - } IMAGEHLP_SYMBOL64_PACKAGE,*PIMAGEHLP_SYMBOL64_PACKAGE; - -#ifdef _IMAGEHLP64 - -#define IMAGEHLP_SYMBOL IMAGEHLP_SYMBOL64 -#define PIMAGEHLP_SYMBOL PIMAGEHLP_SYMBOL64 -#define IMAGEHLP_SYMBOL_PACKAGE IMAGEHLP_SYMBOL64_PACKAGE -#define PIMAGEHLP_SYMBOL_PACKAGE PIMAGEHLP_SYMBOL64_PACKAGE -#elif !defined(EBACKTRACE_MINGW32) - - typedef struct _IMAGEHLP_SYMBOL { - DWORD SizeOfStruct; - DWORD Address; - DWORD Size; - DWORD Flags; - DWORD MaxNameLength; - CHAR Name[1]; - } IMAGEHLP_SYMBOL,*PIMAGEHLP_SYMBOL; - - typedef struct _IMAGEHLP_SYMBOL_PACKAGE { - IMAGEHLP_SYMBOL sym; - CHAR name[MAX_SYM_NAME + 1]; - } IMAGEHLP_SYMBOL_PACKAGE,*PIMAGEHLP_SYMBOL_PACKAGE; -#endif - - typedef struct _IMAGEHLP_MODULE64 { - DWORD SizeOfStruct; - DWORD64 BaseOfImage; - DWORD ImageSize; - DWORD TimeDateStamp; - DWORD CheckSum; - DWORD NumSyms; - SYM_TYPE SymType; - CHAR ModuleName[32]; - CHAR ImageName[256]; - CHAR LoadedImageName[256]; - CHAR LoadedPdbName[256]; - DWORD CVSig; - CHAR CVData[MAX_PATH*3]; - DWORD PdbSig; - GUID PdbSig70; - DWORD PdbAge; - WINBOOL PdbUnmatched; - WINBOOL DbgUnmatched; - WINBOOL LineNumbers; - WINBOOL GlobalSymbols; - WINBOOL TypeInfo; - WINBOOL SourceIndexed; - WINBOOL Publics; - } IMAGEHLP_MODULE64,*PIMAGEHLP_MODULE64; - - typedef struct _IMAGEHLP_MODULE64W { - DWORD SizeOfStruct; - DWORD64 BaseOfImage; - DWORD ImageSize; - DWORD TimeDateStamp; - DWORD CheckSum; - DWORD NumSyms; - SYM_TYPE SymType; - WCHAR ModuleName[32]; - WCHAR ImageName[256]; - WCHAR LoadedImageName[256]; - WCHAR LoadedPdbName[256]; - DWORD CVSig; - WCHAR CVData[MAX_PATH*3]; - DWORD PdbSig; - GUID PdbSig70; - DWORD PdbAge; - WINBOOL PdbUnmatched; - WINBOOL DbgUnmatched; - WINBOOL LineNumbers; - WINBOOL GlobalSymbols; - WINBOOL TypeInfo; - WINBOOL SourceIndexed; - WINBOOL Publics; - } IMAGEHLP_MODULEW64,*PIMAGEHLP_MODULEW64; - -#ifdef _IMAGEHLP64 -#define IMAGEHLP_MODULE IMAGEHLP_MODULE64 -#define PIMAGEHLP_MODULE PIMAGEHLP_MODULE64 -#define IMAGEHLP_MODULEW IMAGEHLP_MODULEW64 -#define PIMAGEHLP_MODULEW PIMAGEHLP_MODULEW64 -#elif !defined(EBACKTRACE_MINGW32) - typedef struct _IMAGEHLP_MODULE { - DWORD SizeOfStruct; - DWORD BaseOfImage; - DWORD ImageSize; - DWORD TimeDateStamp; - DWORD CheckSum; - DWORD NumSyms; - SYM_TYPE SymType; - CHAR ModuleName[32]; - CHAR ImageName[256]; - CHAR LoadedImageName[256]; - } IMAGEHLP_MODULE,*PIMAGEHLP_MODULE; - - typedef struct _IMAGEHLP_MODULEW { - DWORD SizeOfStruct; - DWORD BaseOfImage; - DWORD ImageSize; - DWORD TimeDateStamp; - DWORD CheckSum; - DWORD NumSyms; - SYM_TYPE SymType; - WCHAR ModuleName[32]; - WCHAR ImageName[256]; - WCHAR LoadedImageName[256]; - } IMAGEHLP_MODULEW,*PIMAGEHLP_MODULEW; -#endif - - typedef struct _IMAGEHLP_LINE64 { - DWORD SizeOfStruct; - PVOID Key; - DWORD LineNumber; - PCHAR FileName; - DWORD64 Address; - } IMAGEHLP_LINE64,*PIMAGEHLP_LINE64; - - typedef struct _IMAGEHLP_LINEW64 { - DWORD SizeOfStruct; - PVOID Key; - DWORD LineNumber; - PWSTR FileName; - DWORD64 Address; - } IMAGEHLP_LINEW64, *PIMAGEHLP_LINEW64; - -#ifdef _IMAGEHLP64 -#define IMAGEHLP_LINE IMAGEHLP_LINE64 -#define PIMAGEHLP_LINE PIMAGEHLP_LINE64 -#elif !defined(EBACKTRACE_MINGW32) - typedef struct _IMAGEHLP_LINE { - DWORD SizeOfStruct; - PVOID Key; - DWORD LineNumber; - PCHAR FileName; - DWORD Address; - } IMAGEHLP_LINE,*PIMAGEHLP_LINE; -#endif - - typedef struct _SOURCEFILE { - DWORD64 ModBase; - PCHAR FileName; - } SOURCEFILE,*PSOURCEFILE; - - typedef struct _SOURCEFILEW { - DWORD64 ModBase; - PWCHAR FileName; - } SOURCEFILEW,*PSOURCEFILEW; - -#ifndef EBACKTRACE_MINGW32 -#define CBA_DEFERRED_SYMBOL_LOAD_START 0x00000001 -#define CBA_DEFERRED_SYMBOL_LOAD_COMPLETE 0x00000002 -#define CBA_DEFERRED_SYMBOL_LOAD_FAILURE 0x00000003 -#define CBA_SYMBOLS_UNLOADED 0x00000004 -#define CBA_DUPLICATE_SYMBOL 0x00000005 -#define CBA_READ_MEMORY 0x00000006 -#define CBA_DEFERRED_SYMBOL_LOAD_CANCEL 0x00000007 -#define CBA_SET_OPTIONS 0x00000008 -#define CBA_EVENT 0x00000010 -#define CBA_DEFERRED_SYMBOL_LOAD_PARTIAL 0x00000020 -#define CBA_DEBUG_INFO 0x10000000 -#define CBA_SRCSRV_INFO 0x20000000 -#define CBA_SRCSRV_EVENT 0x40000000 -#endif - - typedef struct _IMAGEHLP_CBA_READ_MEMORY { - DWORD64 addr; - PVOID buf; - DWORD bytes; - DWORD *bytesread; - } IMAGEHLP_CBA_READ_MEMORY,*PIMAGEHLP_CBA_READ_MEMORY; - - enum { - sevInfo = 0, - sevProblem, - sevAttn, - sevFatal, - sevMax - }; - - typedef struct _IMAGEHLP_CBA_EVENT { - DWORD severity; - DWORD code; - PCHAR desc; - PVOID object; - } IMAGEHLP_CBA_EVENT,*PIMAGEHLP_CBA_EVENT; - - typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD64 { - DWORD SizeOfStruct; - DWORD64 BaseOfImage; - DWORD CheckSum; - DWORD TimeDateStamp; - CHAR FileName[MAX_PATH]; - BOOLEAN Reparse; - HANDLE hFile; - DWORD Flags; - } IMAGEHLP_DEFERRED_SYMBOL_LOAD64,*PIMAGEHLP_DEFERRED_SYMBOL_LOAD64; - -#define DSLFLAG_MISMATCHED_PDB 0x1 -#define DSLFLAG_MISMATCHED_DBG 0x2 - -#ifdef _IMAGEHLP64 -#define IMAGEHLP_DEFERRED_SYMBOL_LOAD IMAGEHLP_DEFERRED_SYMBOL_LOAD64 -#define PIMAGEHLP_DEFERRED_SYMBOL_LOAD PIMAGEHLP_DEFERRED_SYMBOL_LOAD64 -#elif !defined(EBACKTRACE_MINGW32) - typedef struct _IMAGEHLP_DEFERRED_SYMBOL_LOAD { - DWORD SizeOfStruct; - DWORD BaseOfImage; - DWORD CheckSum; - DWORD TimeDateStamp; - CHAR FileName[MAX_PATH]; - BOOLEAN Reparse; - HANDLE hFile; - } IMAGEHLP_DEFERRED_SYMBOL_LOAD,*PIMAGEHLP_DEFERRED_SYMBOL_LOAD; -#endif - - typedef struct _IMAGEHLP_DUPLICATE_SYMBOL64 { - DWORD SizeOfStruct; - DWORD NumberOfDups; - PIMAGEHLP_SYMBOL64 Symbol; - DWORD SelectedSymbol; - } IMAGEHLP_DUPLICATE_SYMBOL64,*PIMAGEHLP_DUPLICATE_SYMBOL64; - -#ifdef _IMAGEHLP64 -#define IMAGEHLP_DUPLICATE_SYMBOL IMAGEHLP_DUPLICATE_SYMBOL64 -#define PIMAGEHLP_DUPLICATE_SYMBOL PIMAGEHLP_DUPLICATE_SYMBOL64 -#elif !defined(EBACKTRACE_MINGW32) - typedef struct _IMAGEHLP_DUPLICATE_SYMBOL { - DWORD SizeOfStruct; - DWORD NumberOfDups; - PIMAGEHLP_SYMBOL Symbol; - DWORD SelectedSymbol; - } IMAGEHLP_DUPLICATE_SYMBOL,*PIMAGEHLP_DUPLICATE_SYMBOL; -#endif - -typedef struct _SYMSRV_INDEX_INFO { - DWORD sizeofstruct; - CHAR file[MAX_PATH +1]; - WINBOOL stripped; - DWORD timestamp; - DWORD size; - CHAR dbgfile[MAX_PATH +1]; - CHAR pdbfile[MAX_PATH + 1]; - GUID guid; - DWORD sig; - DWORD age; -} SYMSRV_INDEX_INFO, *PSYMSRV_INDEX_INFO; - -typedef struct _SYMSRV_INDEX_INFOW { - DWORD sizeofstruct; - WCHAR file[MAX_PATH +1]; - WINBOOL stripped; - DWORD timestamp; - DWORD size; - WCHAR dbgfile[MAX_PATH +1]; - WCHAR pdbfile[MAX_PATH + 1]; - GUID guid; - DWORD sig; - DWORD age; -} SYMSRV_INDEX_INFOW, *PSYMSRV_INDEX_INFOW; - - WINBOOL IMAGEAPI SymSetParentWindow(HWND hwnd); - PCHAR IMAGEAPI SymSetHomeDirectory(HANDLE hProcess,PCSTR dir); - PCHAR IMAGEAPI SymSetHomeDirectoryW(HANDLE hProcess,PCWSTR dir); - PCHAR IMAGEAPI SymGetHomeDirectory(DWORD type,PSTR dir,size_t size); - PWCHAR IMAGEAPI SymGetHomeDirectoryW(DWORD type,PWSTR dir,size_t size); - -#define hdBase 0 -#define hdSym 1 -#define hdSrc 2 -#define hdMax 3 - -#ifndef EBACKTRACE_MINGW32 -#define SYMOPT_CASE_INSENSITIVE 0x00000001 -#define SYMOPT_UNDNAME 0x00000002 -#define SYMOPT_DEFERRED_LOADS 0x00000004 -#define SYMOPT_NO_CPP 0x00000008 -#define SYMOPT_LOAD_LINES 0x00000010 -#define SYMOPT_OMAP_FIND_NEAREST 0x00000020 -#define SYMOPT_LOAD_ANYTHING 0x00000040 -#define SYMOPT_IGNORE_CVREC 0x00000080 -#define SYMOPT_NO_UNQUALIFIED_LOADS 0x00000100 -#define SYMOPT_FAIL_CRITICAL_ERRORS 0x00000200 -#define SYMOPT_EXACT_SYMBOLS 0x00000400 -#define SYMOPT_ALLOW_ABSOLUTE_SYMBOLS 0x00000800 -#define SYMOPT_IGNORE_NT_SYMPATH 0x00001000 -#define SYMOPT_INCLUDE_32BIT_MODULES 0x00002000 -#define SYMOPT_PUBLICS_ONLY 0x00004000 -#define SYMOPT_NO_PUBLICS 0x00008000 -#define SYMOPT_AUTO_PUBLICS 0x00010000 -#define SYMOPT_NO_IMAGE_SEARCH 0x00020000 -#define SYMOPT_SECURE 0x00040000 -#define SYMOPT_NO_PROMPTS 0x00080000 -#define SYMOPT_ALLOW_ZERO_ADDRESS 0x01000000 -#define SYMOPT_DISABLE_SYMSRV_AUTODETECT 0x02000000 -#define SYMOPT_FAVOR_COMPRESSED 0x00800000 -#define SYMOPT_FLAT_DIRECTORY 0x00400000 -#define SYMOPT_IGNORE_IMAGEDIR 0x00200000 -#define SYMOPT_OVERWRITE 0x00100000 - -#define SYMOPT_DEBUG 0x80000000 -#endif - - DWORD IMAGEAPI SymSetOptions(DWORD SymOptions); - DWORD IMAGEAPI SymGetOptions(VOID); - WINBOOL IMAGEAPI SymCleanup(HANDLE hProcess); - WINBOOL IMAGEAPI SymMatchString(PCSTR string,PCSTR expression,WINBOOL fCase); - WINBOOL IMAGEAPI SymMatchStringW(PCWSTR string,PCWSTR expression,WINBOOL fCase); - - typedef WINBOOL (CALLBACK *PSYM_ENUMSOURCEFILES_CALLBACK)(PSOURCEFILE pSourceFile,PVOID UserContext); - typedef WINBOOL (CALLBACK *PSYM_ENUMSOURCEFILES_CALLBACKW)(PSOURCEFILEW pSourceFile,PVOID UserContext); -#define PSYM_ENUMSOURCFILES_CALLBACK PSYM_ENUMSOURCEFILES_CALLBACK - - WINBOOL IMAGEAPI SymEnumSourceFiles(HANDLE hProcess,ULONG64 ModBase,PCSTR Mask,PSYM_ENUMSOURCEFILES_CALLBACK cbSrcFiles,PVOID UserContext); - WINBOOL IMAGEAPI SymEnumSourceFilesW(HANDLE hProcess,ULONG64 ModBase,PCWSTR Mask,PSYM_ENUMSOURCEFILES_CALLBACKW cbSrcFiles,PVOID UserContext); - WINBOOL IMAGEAPI SymEnumerateModules64(HANDLE hProcess,PSYM_ENUMMODULES_CALLBACK64 EnumModulesCallback,PVOID UserContext); - WINBOOL IMAGEAPI SymEnumerateModulesW64(HANDLE hProcess,PSYM_ENUMMODULES_CALLBACKW64 EnumModulesCallback,PVOID UserContext); - -#ifdef _IMAGEHLP64 -#define SymEnumerateModules SymEnumerateModules64 -#elif !defined(EBACKTRACE_MINGW32) - WINBOOL IMAGEAPI SymEnumerateModules(HANDLE hProcess,PSYM_ENUMMODULES_CALLBACK EnumModulesCallback,PVOID UserContext); -#endif - - WINBOOL IMAGEAPI SymEnumerateSymbols64(HANDLE hProcess,DWORD64 BaseOfDll,PSYM_ENUMSYMBOLS_CALLBACK64 EnumSymbolsCallback,PVOID UserContext); - WINBOOL IMAGEAPI SymEnumerateSymbolsW64(HANDLE hProcess,DWORD64 BaseOfDll,PSYM_ENUMSYMBOLS_CALLBACK64W EnumSymbolsCallback,PVOID UserContext); - -#ifdef _IMAGEHLP64 -#define SymEnumerateSymbols SymEnumerateSymbols64 -#define SymEnumerateSymbolsW SymEnumerateSymbolsW64 -#elif !defined(EBACKTRACE_MINGW32) - WINBOOL IMAGEAPI SymEnumerateSymbols(HANDLE hProcess,DWORD BaseOfDll,PSYM_ENUMSYMBOLS_CALLBACK EnumSymbolsCallback,PVOID UserContext); - WINBOOL IMAGEAPI SymEnumerateSymbolsW(HANDLE hProcess,DWORD BaseOfDll,PSYM_ENUMSYMBOLS_CALLBACKW EnumSymbolsCallback,PVOID UserContext); -#endif - - WINBOOL IMAGEAPI EnumerateLoadedModules64(HANDLE hProcess,PENUMLOADED_MODULES_CALLBACK64 EnumLoadedModulesCallback,PVOID UserContext); - WINBOOL IMAGEAPI EnumerateLoadedModulesW64(HANDLE hProcess,PENUMLOADED_MODULES_CALLBACKW64 EnumLoadedModulesCallback,PVOID UserContext); - -#ifdef DBGHELP_TRANSLATE_TCHAR - #define EnumerateLoadedModules64 EnumerateLoadedModulesW64 -#endif - -#ifdef _IMAGEHLP64 -#define EnumerateLoadedModules EnumerateLoadedModules64 -#elif !defined(EBACKTRACE_MINGW32) - WINBOOL IMAGEAPI EnumerateLoadedModules(HANDLE hProcess,PENUMLOADED_MODULES_CALLBACK EnumLoadedModulesCallback,PVOID UserContext); -#endif - - PVOID IMAGEAPI SymFunctionTableAccess64(HANDLE hProcess,DWORD64 AddrBase); - -#ifdef _IMAGEHLP64 -#define SymFunctionTableAccess SymFunctionTableAccess64 -#elif !defined(EBACKTRACE_MINGW32) - PVOID IMAGEAPI SymFunctionTableAccess(HANDLE hProcess,DWORD AddrBase); -#endif - - WINBOOL IMAGEAPI SymGetModuleInfo64(HANDLE hProcess,DWORD64 qwAddr,PIMAGEHLP_MODULE64 ModuleInfo); - WINBOOL IMAGEAPI SymGetModuleInfoW64(HANDLE hProcess,DWORD64 qwAddr,PIMAGEHLP_MODULEW64 ModuleInfo); - -#ifdef _IMAGEHLP64 -#define SymGetModuleInfo SymGetModuleInfo64 -#define SymGetModuleInfoW SymGetModuleInfoW64 -#elif !defined(EBACKTRACE_MINGW32) - WINBOOL IMAGEAPI SymGetModuleInfo(HANDLE hProcess,DWORD dwAddr,PIMAGEHLP_MODULE ModuleInfo); - WINBOOL IMAGEAPI SymGetModuleInfoW(HANDLE hProcess,DWORD dwAddr,PIMAGEHLP_MODULEW ModuleInfo); -#endif - - DWORD64 IMAGEAPI SymGetModuleBase64(HANDLE hProcess,DWORD64 qwAddr); - -#ifdef _IMAGEHLP64 -#define SymGetModuleBase SymGetModuleBase64 -#elif !defined(EBACKTRACE_MINGW32) - DWORD IMAGEAPI SymGetModuleBase(HANDLE hProcess,DWORD dwAddr); -#endif - - WINBOOL IMAGEAPI SymGetSymNext64(HANDLE hProcess,PIMAGEHLP_SYMBOL64 Symbol); - -#ifdef _IMAGEHLP64 -#define SymGetSymNext SymGetSymNext64 -#elif !defined(EBACKTRACE_MINGW32) - WINBOOL IMAGEAPI SymGetSymNext(HANDLE hProcess,PIMAGEHLP_SYMBOL Symbol); -#endif - - WINBOOL IMAGEAPI SymGetSymPrev64(HANDLE hProcess,PIMAGEHLP_SYMBOL64 Symbol); - -#ifdef _IMAGEHLP64 -#define SymGetSymPrev SymGetSymPrev64 -#elif !defined(EBACKTRACE_MINGW32) - WINBOOL IMAGEAPI SymGetSymPrev(HANDLE hProcess,PIMAGEHLP_SYMBOL Symbol); -#endif - - typedef struct _SRCCODEINFO { - DWORD SizeOfStruct; - PVOID Key; - DWORD64 ModBase; - CHAR Obj[MAX_PATH + 1]; - CHAR FileName[MAX_PATH + 1]; - DWORD LineNumber; - DWORD64 Address; - } SRCCODEINFO,*PSRCCODEINFO; - - typedef struct _SRCCODEINFOW { - DWORD SizeOfStruct; - PVOID Key; - DWORD64 ModBase; - WCHAR Obj[MAX_PATH + 1]; - WCHAR FileName[MAX_PATH + 1]; - DWORD LineNumber; - DWORD64 Address; - } SRCCODEINFOW,*PSRCCODEINFOW; - - typedef WINBOOL (CALLBACK *PSYM_ENUMLINES_CALLBACK)(PSRCCODEINFO LineInfo,PVOID UserContext); - typedef WINBOOL (CALLBACK *PSYM_ENUMLINES_CALLBACKW)(PSRCCODEINFOW LineInfo,PVOID UserContext); - - WINBOOL IMAGEAPI SymEnumLines(HANDLE hProcess,ULONG64 Base,PCSTR Obj,PCSTR File,PSYM_ENUMLINES_CALLBACK EnumLinesCallback,PVOID UserContext); - WINBOOL IMAGEAPI SymEnumLinesW(HANDLE hProcess,ULONG64 Base,PCWSTR Obj,PCSTR File,PSYM_ENUMLINES_CALLBACKW EnumLinesCallback,PVOID UserContext); - WINBOOL IMAGEAPI SymGetLineFromAddr64(HANDLE hProcess,DWORD64 qwAddr,PDWORD pdwDisplacement,PIMAGEHLP_LINE64 Line64); - WINBOOL IMAGEAPI SymGetLineFromAddrW64(HANDLE hProcess,DWORD64 qwAddr,PDWORD pdwDisplacement,PIMAGEHLP_LINEW64 Line64); - -#ifdef _IMAGEHLP64 -#define SymGetLineFromAddr SymGetLineFromAddr64 -#elif !defined(EBACKTRACE_MINGW32) - WINBOOL IMAGEAPI SymGetLineFromAddr(HANDLE hProcess,DWORD dwAddr,PDWORD pdwDisplacement,PIMAGEHLP_LINE Line); -#endif - - WINBOOL IMAGEAPI SymGetLineFromName64(HANDLE hProcess,PCSTR ModuleName,PCSTR FileName,DWORD dwLineNumber,PLONG plDisplacement,PIMAGEHLP_LINE64 Line); - WINBOOL IMAGEAPI SymGetLineFromNameW64(HANDLE hProcess,PCWSTR ModuleName,PCWSTR FileName,DWORD dwLineNumber,PLONG plDisplacement,PIMAGEHLP_LINEW64 Line); - -#ifdef _IMAGEHLP64 -#define SymGetLineFromName SymGetLineFromName64 -#elif !defined(EBACKTRACE_MINGW32) - WINBOOL IMAGEAPI SymGetLineFromName(HANDLE hProcess,PCSTR ModuleName,PCSTR FileName,DWORD dwLineNumber,PLONG plDisplacement,PIMAGEHLP_LINE Line); -#endif - - WINBOOL IMAGEAPI SymGetLineNext64(HANDLE hProcess,PIMAGEHLP_LINE64 Line); - WINBOOL IMAGEAPI SymGetLineNextW64(HANDLE hProcess,PIMAGEHLP_LINEW64 Line); - -#ifdef _IMAGEHLP64 -#define SymGetLineNext SymGetLineNext64 -#elif !defined(EBACKTRACE_MINGW32) - WINBOOL IMAGEAPI SymGetLineNext(HANDLE hProcess,PIMAGEHLP_LINE Line); -#endif - - WINBOOL IMAGEAPI SymGetLinePrev64(HANDLE hProcess,PIMAGEHLP_LINE64 Line); - WINBOOL IMAGEAPI SymGetLinePrevW64(HANDLE hProcess,PIMAGEHLP_LINEW64 Line); - -#ifdef _IMAGEHLP64 -#define SymGetLinePrev SymGetLinePrev64 -#elif !defined(EBACKTRACE_MINGW32) - WINBOOL IMAGEAPI SymGetLinePrev(HANDLE hProcess,PIMAGEHLP_LINE Line); -#endif - -#ifndef EBACKTRACE_MINGW32 - WINBOOL IMAGEAPI SymMatchFileName(PCSTR FileName,PCSTR Match,PSTR *FileNameStop,PSTR *MatchStop); -#endif - WINBOOL IMAGEAPI SymMatchFileNameW(PCWSTR FileName,PCWSTR Match,PWSTR *FileNameStop,PWSTR *MatchStop); -#ifndef EBACKTRACE_MINGW32 - WINBOOL IMAGEAPI SymInitialize(HANDLE hProcess,PCSTR UserSearchPath,WINBOOL fInvadeProcess); -#endif - WINBOOL IMAGEAPI SymInitializeW(HANDLE hProcess,PCWSTR UserSearchPath,WINBOOL fInvadeProcess); -#ifndef EBACKTRACE_MINGW32 - WINBOOL IMAGEAPI SymGetSearchPath(HANDLE hProcess,PSTR SearchPath,DWORD SearchPathLength); -#endif - WINBOOL IMAGEAPI SymGetSearchPathW(HANDLE hProcess,PWSTR SearchPath,DWORD SearchPathLength); -#ifndef EBACKTRACE_MINGW32 - WINBOOL IMAGEAPI SymSetSearchPath(HANDLE hProcess,PCSTR SearchPath); -#endif - WINBOOL IMAGEAPI SymSetSearchPathW(HANDLE hProcess,PCWSTR SearchPath); - DWORD64 IMAGEAPI SymLoadModule64(HANDLE hProcess,HANDLE hFile,PSTR ImageName,PSTR ModuleName,DWORD64 BaseOfDll,DWORD SizeOfDll); - -#define SLMFLAG_VIRTUAL 0x1 - - DWORD64 IMAGEAPI SymLoadModuleEx(HANDLE hProcess,HANDLE hFile,PCSTR ImageName,PCSTR ModuleName,DWORD64 BaseOfDll,DWORD DllSize,PMODLOAD_DATA Data,DWORD Flags); - DWORD64 IMAGEAPI SymLoadModuleExW(HANDLE hProcess,HANDLE hFile,PCWSTR ImageName,PCWSTR ModuleName,DWORD64 BaseOfDll,DWORD DllSize,PMODLOAD_DATA Data,DWORD Flags); - -#ifdef _IMAGEHLP64 -#define SymLoadModule SymLoadModule64 -#elif !defined(EBACKTRACE_MINGW32) - DWORD IMAGEAPI SymLoadModule(HANDLE hProcess,HANDLE hFile,PCSTR ImageName,PCSTR ModuleName,DWORD BaseOfDll,DWORD SizeOfDll); -#endif - - WINBOOL IMAGEAPI SymUnloadModule64(HANDLE hProcess,DWORD64 BaseOfDll); - -#ifdef _IMAGEHLP64 -#define SymUnloadModule SymUnloadModule64 -#elif !defined(EBACKTRACE_MINGW32) - WINBOOL IMAGEAPI SymUnloadModule(HANDLE hProcess,DWORD BaseOfDll); -#endif - - WINBOOL IMAGEAPI SymUnDName64(PIMAGEHLP_SYMBOL64 sym,PSTR UnDecName,DWORD UnDecNameLength); - -#ifdef _IMAGEHLP64 -#define SymUnDName SymUnDName64 -#elif !defined(EBACKTRACE_MINGW32) - WINBOOL IMAGEAPI SymUnDName(PIMAGEHLP_SYMBOL sym,PSTR UnDecName,DWORD UnDecNameLength); -#endif - - WINBOOL IMAGEAPI SymRegisterCallback64(HANDLE hProcess,PSYMBOL_REGISTERED_CALLBACK64 CallbackFunction,ULONG64 UserContext); - WINBOOL IMAGEAPI SymRegisterCallback64W(HANDLE hProcess,PSYMBOL_REGISTERED_CALLBACK64 CallbackFunction,ULONG64 UserContext); - - WINBOOL IMAGEAPI SymRegisterFunctionEntryCallback64(HANDLE hProcess,PSYMBOL_FUNCENTRY_CALLBACK64 CallbackFunction,ULONG64 UserContext); - -#ifdef _IMAGEHLP64 -#define SymRegisterCallback SymRegisterCallback64 -#define SymRegisterFunctionEntryCallback SymRegisterFunctionEntryCallback64 -#elif !defined(EBACKTRACE_MINGW32) - WINBOOL IMAGEAPI SymRegisterCallback(HANDLE hProcess,PSYMBOL_REGISTERED_CALLBACK CallbackFunction,PVOID UserContext); - WINBOOL IMAGEAPI SymRegisterFunctionEntryCallback(HANDLE hProcess,PSYMBOL_FUNCENTRY_CALLBACK CallbackFunction,PVOID UserContext); -#endif - - typedef struct _IMAGEHLP_SYMBOL_SRC { - DWORD sizeofstruct; - DWORD type; - char file[MAX_PATH]; - } IMAGEHLP_SYMBOL_SRC,*PIMAGEHLP_SYMBOL_SRC; - - typedef struct _MODULE_TYPE_INFO { - USHORT dataLength; - USHORT leaf; - BYTE data[1]; - } MODULE_TYPE_INFO,*PMODULE_TYPE_INFO; - - typedef struct _SYMBOL_INFO { - ULONG SizeOfStruct; - ULONG TypeIndex; - ULONG64 Reserved[2]; - ULONG info; - ULONG Size; - ULONG64 ModBase; - ULONG Flags; - ULONG64 Value; - ULONG64 Address; - ULONG Register; - ULONG Scope; - ULONG Tag; - ULONG NameLen; - ULONG MaxNameLen; - CHAR Name[1]; - } SYMBOL_INFO,*PSYMBOL_INFO; - - typedef struct _SYMBOL_INFOW { - ULONG SizeOfStruct; - ULONG TypeIndex; - ULONG64 Reserved[2]; - ULONG info; - ULONG Size; - ULONG64 ModBase; - ULONG Flags; - ULONG64 Value; - ULONG64 Address; - ULONG Register; - ULONG Scope; - ULONG Tag; - ULONG NameLen; - ULONG MaxNameLen; - WCHAR Name[1]; - } SYMBOL_INFOW,*PSYMBOL_INFOW; - -#define SYMFLAG_CLR_TOKEN 0x00040000 -#define SYMFLAG_CONSTANT 0x00000100 -#define SYMFLAG_EXPORT 0x00000200 -#define SYMFLAG_FORWARDER 0x00000400 -#define SYMFLAG_FRAMEREL 0x00000020 -#define SYMFLAG_FUNCTION 0x00000800 -#define SYMFLAG_ILREL 0x00010000 -#define SYMFLAG_LOCAL 0x00000080 -#define SYMFLAG_METADATA 0x00020000 -#define SYMFLAG_PARAMETER 0x00000040 -#define SYMFLAG_REGISTER 0x00000008 -#define SYMFLAG_REGREL 0x00000010 -#define SYMFLAG_SLOT 0x00008000 -#define SYMFLAG_THUNK 0x00002000 -#define SYMFLAG_TLSREL 0x00004000 -#define SYMFLAG_VALUEPRESENT 0x00000001 -#define SYMFLAG_VIRTUAL 0x00001000 - - typedef struct _SYMBOL_INFO_PACKAGE { - SYMBOL_INFO si; - CHAR name[MAX_SYM_NAME + 1]; - } SYMBOL_INFO_PACKAGE,*PSYMBOL_INFO_PACKAGE; - - typedef struct _IMAGEHLP_STACK_FRAME { - ULONG64 InstructionOffset; - ULONG64 ReturnOffset; - ULONG64 FrameOffset; - ULONG64 StackOffset; - ULONG64 BackingStoreOffset; - ULONG64 FuncTableEntry; - ULONG64 Params[4]; - ULONG64 Reserved[5]; - WINBOOL Virtual; - ULONG Reserved2; - } IMAGEHLP_STACK_FRAME,*PIMAGEHLP_STACK_FRAME; - - typedef VOID IMAGEHLP_CONTEXT,*PIMAGEHLP_CONTEXT; - - WINBOOL IMAGEAPI SymSetContext(HANDLE hProcess,PIMAGEHLP_STACK_FRAME StackFrame,PIMAGEHLP_CONTEXT Context); - WINBOOL IMAGEAPI SymFromAddr(HANDLE hProcess,DWORD64 Address,PDWORD64 Displacement,PSYMBOL_INFO Symbol); - WINBOOL IMAGEAPI SymFromAddrW(HANDLE hProcess,DWORD64 Address,PDWORD64 Displacement,PSYMBOL_INFOW Symbol); - WINBOOL IMAGEAPI SymFromToken(HANDLE hProcess,DWORD64 Base,DWORD Token,PSYMBOL_INFO Symbol); - WINBOOL IMAGEAPI SymFromTokenW(HANDLE hProcess,DWORD64 Base,DWORD Token,PSYMBOL_INFOW Symbol); - WINBOOL IMAGEAPI SymFromName(HANDLE hProcess,PCSTR Name,PSYMBOL_INFO Symbol); - WINBOOL IMAGEAPI SymFromNameW(HANDLE hProcess,PCWSTR Name,PSYMBOL_INFOW Symbol); - - typedef WINBOOL (CALLBACK *PSYM_ENUMERATESYMBOLS_CALLBACK)(PSYMBOL_INFO pSymInfo,ULONG SymbolSize,PVOID UserContext); - typedef WINBOOL (CALLBACK *PSYM_ENUMERATESYMBOLS_CALLBACKW)(PSYMBOL_INFOW pSymInfo,ULONG SymbolSize,PVOID UserContext); - - WINBOOL IMAGEAPI SymEnumSymbols(HANDLE hProcess,ULONG64 BaseOfDll,PCSTR Mask,PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback,PVOID UserContext); - WINBOOL IMAGEAPI SymEnumSymbolsW(HANDLE hProcess,ULONG64 BaseOfDll,PCWSTR Mask,PSYM_ENUMERATESYMBOLS_CALLBACKW EnumSymbolsCallback,PVOID UserContext); - WINBOOL IMAGEAPI SymEnumSymbolsForAddr(HANDLE hProcess,DWORD64 Address,PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback,PVOID UserContext); - WINBOOL IMAGEAPI SymEnumSymbolsForAddrW(HANDLE hProcess,DWORD64 Address,PSYM_ENUMERATESYMBOLS_CALLBACKW EnumSymbolsCallback,PVOID UserContext); - -#define SYMENUMFLAG_FULLSRCH 1 -#define SYMENUMFLAG_SPEEDSRCH 2 - - typedef enum _IMAGEHLP_SYMBOL_TYPE_INFO { - TI_GET_SYMTAG, - TI_GET_SYMNAME, - TI_GET_LENGTH, - TI_GET_TYPE, - TI_GET_TYPEID, - TI_GET_BASETYPE, - TI_GET_ARRAYINDEXTYPEID, - TI_FINDCHILDREN, - TI_GET_DATAKIND, - TI_GET_ADDRESSOFFSET, - TI_GET_OFFSET, - TI_GET_VALUE, - TI_GET_COUNT, - TI_GET_CHILDRENCOUNT, - TI_GET_BITPOSITION, - TI_GET_VIRTUALBASECLASS, - TI_GET_VIRTUALTABLESHAPEID, - TI_GET_VIRTUALBASEPOINTEROFFSET, - TI_GET_CLASSPARENTID, - TI_GET_NESTED, - TI_GET_SYMINDEX, - TI_GET_LEXICALPARENT, - TI_GET_ADDRESS, - TI_GET_THISADJUST, - TI_GET_UDTKIND, - TI_IS_EQUIV_TO, - TI_GET_CALLING_CONVENTION - } IMAGEHLP_SYMBOL_TYPE_INFO; - - typedef struct _TI_FINDCHILDREN_PARAMS { - ULONG Count; - ULONG Start; - ULONG ChildId[1]; - } TI_FINDCHILDREN_PARAMS; - - WINBOOL IMAGEAPI SymGetTypeInfo(HANDLE hProcess,DWORD64 ModBase,ULONG TypeId,IMAGEHLP_SYMBOL_TYPE_INFO GetType,PVOID pInfo); - WINBOOL IMAGEAPI SymEnumTypes(HANDLE hProcess,ULONG64 BaseOfDll,PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback,PVOID UserContext); - WINBOOL IMAGEAPI SymEnumTypesW(HANDLE hProcess,ULONG64 BaseOfDll,PSYM_ENUMERATESYMBOLS_CALLBACKW EnumSymbolsCallback,PVOID UserContext); - WINBOOL IMAGEAPI SymGetTypeFromName(HANDLE hProcess,ULONG64 BaseOfDll,PCSTR Name,PSYMBOL_INFO Symbol); - WINBOOL IMAGEAPI SymGetTypeFromNameW(HANDLE hProcess,ULONG64 BaseOfDll,PCWSTR Name,PSYMBOL_INFOW Symbol); - WINBOOL IMAGEAPI SymAddSymbol(HANDLE hProcess,ULONG64 BaseOfDll,PCSTR Name,DWORD64 Address,DWORD Size,DWORD Flags); - WINBOOL IMAGEAPI SymAddSymbolW(HANDLE hProcess,ULONG64 BaseOfDll,PCWSTR Name,DWORD64 Address,DWORD Size,DWORD Flags); - WINBOOL IMAGEAPI SymDeleteSymbol(HANDLE hProcess,ULONG64 BaseOfDll,PCSTR Name,DWORD64 Address,DWORD Flags); - WINBOOL IMAGEAPI SymDeleteSymbolW(HANDLE hProcess,ULONG64 BaseOfDll,PCWSTR Name,DWORD64 Address,DWORD Flags); - - typedef WINBOOL (WINAPI *PDBGHELP_CREATE_USER_DUMP_CALLBACK)(DWORD DataType,PVOID *Data,LPDWORD DataLength,PVOID UserData); - - WINBOOL WINAPI DbgHelpCreateUserDump(LPCSTR FileName,PDBGHELP_CREATE_USER_DUMP_CALLBACK Callback,PVOID UserData); - WINBOOL WINAPI DbgHelpCreateUserDumpW(LPCWSTR FileName,PDBGHELP_CREATE_USER_DUMP_CALLBACK Callback,PVOID UserData); - WINBOOL IMAGEAPI SymGetSymFromAddr64(HANDLE hProcess,DWORD64 qwAddr,PDWORD64 pdwDisplacement,PIMAGEHLP_SYMBOL64 Symbol); - -#ifdef _IMAGEHLP64 -#define SymGetSymFromAddr SymGetSymFromAddr64 -#elif !defined(EBACKTRACE_MINGW32) - WINBOOL IMAGEAPI SymGetSymFromAddr(HANDLE hProcess,DWORD dwAddr,PDWORD pdwDisplacement,PIMAGEHLP_SYMBOL Symbol); -#endif - - WINBOOL IMAGEAPI SymGetSymFromName64(HANDLE hProcess,PCSTR Name,PIMAGEHLP_SYMBOL64 Symbol); - -#ifdef _IMAGEHLP64 -#define SymGetSymFromName SymGetSymFromName64 -#elif !defined(EBACKTRACE_MINGW32) - WINBOOL IMAGEAPI SymGetSymFromName(HANDLE hProcess,PCSTR Name,PIMAGEHLP_SYMBOL Symbol); -#endif - - DBHLP_DEPRECIATED WINBOOL IMAGEAPI FindFileInPath(HANDLE hprocess,PCSTR SearchPath,PCSTR FileName,PVOID id,DWORD two,DWORD three,DWORD flags,PSTR FilePath); - DBHLP_DEPRECIATED WINBOOL IMAGEAPI FindFileInSearchPath(HANDLE hprocess,PCSTR SearchPath,PCSTR FileName,DWORD one,DWORD two,DWORD three,PSTR FilePath); - DBHLP_DEPRECIATED WINBOOL IMAGEAPI SymEnumSym(HANDLE hProcess,ULONG64 BaseOfDll,PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback,PVOID UserContext); - -#ifdef __cplusplus -} -#endif - -#ifndef EBACKTRACE_MINGW32 -#define SYMF_OMAP_GENERATED 0x00000001 -#define SYMF_OMAP_MODIFIED 0x00000002 -#define SYMF_REGISTER 0x00000008 -#define SYMF_REGREL 0x00000010 -#define SYMF_FRAMEREL 0x00000020 -#define SYMF_PARAMETER 0x00000040 -#define SYMF_LOCAL 0x00000080 -#define SYMF_CONSTANT 0x00000100 -#define SYMF_EXPORT 0x00000200 -#define SYMF_FORWARDER 0x00000400 -#define SYMF_FUNCTION 0x00000800 -#define SYMF_VIRTUAL 0x00001000 -#define SYMF_THUNK 0x00002000 -#define SYMF_TLSREL 0x00004000 -#endif - -#define IMAGEHLP_SYMBOL_INFO_VALUEPRESENT 1 -#define IMAGEHLP_SYMBOL_INFO_REGISTER SYMF_REGISTER -#define IMAGEHLP_SYMBOL_INFO_REGRELATIVE SYMF_REGREL -#define IMAGEHLP_SYMBOL_INFO_FRAMERELATIVE SYMF_FRAMEREL -#define IMAGEHLP_SYMBOL_INFO_PARAMETER SYMF_PARAMETER -#define IMAGEHLP_SYMBOL_INFO_LOCAL SYMF_LOCAL -#define IMAGEHLP_SYMBOL_INFO_CONSTANT SYMF_CONSTANT -#define IMAGEHLP_SYMBOL_FUNCTION SYMF_FUNCTION -#define IMAGEHLP_SYMBOL_VIRTUAL SYMF_VIRTUAL -#define IMAGEHLP_SYMBOL_THUNK SYMF_THUNK -#define IMAGEHLP_SYMBOL_INFO_TLSRELATIVE SYMF_TLSREL - -#include - -#define MINIDUMP_SIGNATURE ('PMDM') -#define MINIDUMP_VERSION (42899) - typedef DWORD RVA; - typedef ULONG64 RVA64; - - typedef struct _MINIDUMP_LOCATION_DESCRIPTOR { - ULONG32 DataSize; - RVA Rva; - } MINIDUMP_LOCATION_DESCRIPTOR; - - typedef struct _MINIDUMP_LOCATION_DESCRIPTOR64 { - ULONG64 DataSize; - RVA64 Rva; - } MINIDUMP_LOCATION_DESCRIPTOR64; - - typedef struct _MINIDUMP_MEMORY_DESCRIPTOR { - ULONG64 StartOfMemoryRange; - MINIDUMP_LOCATION_DESCRIPTOR Memory; - } MINIDUMP_MEMORY_DESCRIPTOR,*PMINIDUMP_MEMORY_DESCRIPTOR; - - typedef struct _MINIDUMP_MEMORY_DESCRIPTOR64 { - ULONG64 StartOfMemoryRange; - ULONG64 DataSize; - } MINIDUMP_MEMORY_DESCRIPTOR64,*PMINIDUMP_MEMORY_DESCRIPTOR64; - - typedef struct _MINIDUMP_HEADER { - ULONG32 Signature; - ULONG32 Version; - ULONG32 NumberOfStreams; - RVA StreamDirectoryRva; - ULONG32 CheckSum; - __C89_NAMELESS union { - ULONG32 Reserved; - ULONG32 TimeDateStamp; - }; - ULONG64 Flags; - } MINIDUMP_HEADER,*PMINIDUMP_HEADER; - - typedef struct _MINIDUMP_DIRECTORY { - ULONG32 StreamType; - MINIDUMP_LOCATION_DESCRIPTOR Location; - } MINIDUMP_DIRECTORY,*PMINIDUMP_DIRECTORY; - - typedef struct _MINIDUMP_STRING { - ULONG32 Length; - WCHAR Buffer[0]; - } MINIDUMP_STRING,*PMINIDUMP_STRING; - - typedef enum _MINIDUMP_STREAM_TYPE { - UnusedStream = 0, - ReservedStream0 = 1, - ReservedStream1 = 2, - ThreadListStream = 3, - ModuleListStream = 4, - MemoryListStream = 5, - ExceptionStream = 6, - SystemInfoStream = 7, - ThreadExListStream = 8, - Memory64ListStream = 9, - CommentStreamA = 10, - CommentStreamW = 11, - HandleDataStream = 12, - FunctionTableStream = 13, - UnloadedModuleListStream = 14, - MiscInfoStream = 15, - LastReservedStream = 0xffff - } MINIDUMP_STREAM_TYPE; - - typedef union _CPU_INFORMATION { - struct { - ULONG32 VendorId[3]; - ULONG32 VersionInformation; - ULONG32 FeatureInformation; - ULONG32 AMDExtendedCpuFeatures; - } X86CpuInfo; - struct { - ULONG64 ProcessorFeatures[2]; - } OtherCpuInfo; - } CPU_INFORMATION,*PCPU_INFORMATION; - - typedef struct _MINIDUMP_SYSTEM_INFO { - USHORT ProcessorArchitecture; - USHORT ProcessorLevel; - USHORT ProcessorRevision; - __C89_NAMELESS union { - USHORT Reserved0; - __C89_NAMELESS struct { - UCHAR NumberOfProcessors; - UCHAR ProductType; - }; - }; - ULONG32 MajorVersion; - ULONG32 MinorVersion; - ULONG32 BuildNumber; - ULONG32 PlatformId; - RVA CSDVersionRva; - __C89_NAMELESS union { - ULONG32 Reserved1; - __C89_NAMELESS struct { - USHORT SuiteMask; - USHORT Reserved2; - }; - }; - CPU_INFORMATION Cpu; - } MINIDUMP_SYSTEM_INFO,*PMINIDUMP_SYSTEM_INFO; - - C_ASSERT(sizeof(((PPROCESS_INFORMATION)0)->dwThreadId)==4); - - typedef struct _MINIDUMP_THREAD { - ULONG32 ThreadId; - ULONG32 SuspendCount; - ULONG32 PriorityClass; - ULONG32 Priority; - ULONG64 Teb; - MINIDUMP_MEMORY_DESCRIPTOR Stack; - MINIDUMP_LOCATION_DESCRIPTOR ThreadContext; - } MINIDUMP_THREAD,*PMINIDUMP_THREAD; - - typedef struct _MINIDUMP_THREAD_LIST { - ULONG32 NumberOfThreads; - MINIDUMP_THREAD Threads[0]; - } MINIDUMP_THREAD_LIST,*PMINIDUMP_THREAD_LIST; - - typedef struct _MINIDUMP_THREAD_EX { - ULONG32 ThreadId; - ULONG32 SuspendCount; - ULONG32 PriorityClass; - ULONG32 Priority; - ULONG64 Teb; - MINIDUMP_MEMORY_DESCRIPTOR Stack; - MINIDUMP_LOCATION_DESCRIPTOR ThreadContext; - MINIDUMP_MEMORY_DESCRIPTOR BackingStore; - } MINIDUMP_THREAD_EX,*PMINIDUMP_THREAD_EX; - - typedef struct _MINIDUMP_THREAD_EX_LIST { - ULONG32 NumberOfThreads; - MINIDUMP_THREAD_EX Threads[0]; - } MINIDUMP_THREAD_EX_LIST,*PMINIDUMP_THREAD_EX_LIST; - - typedef struct _MINIDUMP_EXCEPTION { - ULONG32 ExceptionCode; - ULONG32 ExceptionFlags; - ULONG64 ExceptionRecord; - ULONG64 ExceptionAddress; - ULONG32 NumberParameters; - ULONG32 __unusedAlignment; - ULONG64 ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; - } MINIDUMP_EXCEPTION,*PMINIDUMP_EXCEPTION; - - typedef struct MINIDUMP_EXCEPTION_STREAM { - ULONG32 ThreadId; - ULONG32 __alignment; - MINIDUMP_EXCEPTION ExceptionRecord; - MINIDUMP_LOCATION_DESCRIPTOR ThreadContext; - } MINIDUMP_EXCEPTION_STREAM,*PMINIDUMP_EXCEPTION_STREAM; - - typedef struct _MINIDUMP_MODULE { - ULONG64 BaseOfImage; - ULONG32 SizeOfImage; - ULONG32 CheckSum; - ULONG32 TimeDateStamp; - RVA ModuleNameRva; - VS_FIXEDFILEINFO VersionInfo; - MINIDUMP_LOCATION_DESCRIPTOR CvRecord; - MINIDUMP_LOCATION_DESCRIPTOR MiscRecord; - ULONG64 Reserved0; - ULONG64 Reserved1; - } MINIDUMP_MODULE,*PMINIDUMP_MODULE; - - typedef struct _MINIDUMP_MODULE_LIST { - ULONG32 NumberOfModules; - MINIDUMP_MODULE Modules[0]; - } MINIDUMP_MODULE_LIST,*PMINIDUMP_MODULE_LIST; - - typedef struct _MINIDUMP_MEMORY_LIST { - ULONG32 NumberOfMemoryRanges; - MINIDUMP_MEMORY_DESCRIPTOR MemoryRanges[0]; - } MINIDUMP_MEMORY_LIST,*PMINIDUMP_MEMORY_LIST; - - typedef struct _MINIDUMP_MEMORY64_LIST { - ULONG64 NumberOfMemoryRanges; - RVA64 BaseRva; - MINIDUMP_MEMORY_DESCRIPTOR64 MemoryRanges[0]; - } MINIDUMP_MEMORY64_LIST,*PMINIDUMP_MEMORY64_LIST; - - typedef struct _MINIDUMP_EXCEPTION_INFORMATION { - DWORD ThreadId; - PEXCEPTION_POINTERS ExceptionPointers; - WINBOOL ClientPointers; - } MINIDUMP_EXCEPTION_INFORMATION,*PMINIDUMP_EXCEPTION_INFORMATION; - - typedef struct _MINIDUMP_EXCEPTION_INFORMATION64 { - DWORD ThreadId; - ULONG64 ExceptionRecord; - ULONG64 ContextRecord; - WINBOOL ClientPointers; - } MINIDUMP_EXCEPTION_INFORMATION64,*PMINIDUMP_EXCEPTION_INFORMATION64; - - typedef struct _MINIDUMP_HANDLE_DESCRIPTOR { - ULONG64 Handle; - RVA TypeNameRva; - RVA ObjectNameRva; - ULONG32 Attributes; - ULONG32 GrantedAccess; - ULONG32 HandleCount; - ULONG32 PointerCount; - } MINIDUMP_HANDLE_DESCRIPTOR,*PMINIDUMP_HANDLE_DESCRIPTOR; - - typedef struct _MINIDUMP_HANDLE_DATA_STREAM { - ULONG32 SizeOfHeader; - ULONG32 SizeOfDescriptor; - ULONG32 NumberOfDescriptors; - ULONG32 Reserved; - } MINIDUMP_HANDLE_DATA_STREAM,*PMINIDUMP_HANDLE_DATA_STREAM; - - typedef struct _MINIDUMP_FUNCTION_TABLE_DESCRIPTOR { - ULONG64 MinimumAddress; - ULONG64 MaximumAddress; - ULONG64 BaseAddress; - ULONG32 EntryCount; - ULONG32 SizeOfAlignPad; - } MINIDUMP_FUNCTION_TABLE_DESCRIPTOR,*PMINIDUMP_FUNCTION_TABLE_DESCRIPTOR; - - typedef struct _MINIDUMP_FUNCTION_TABLE_STREAM { - ULONG32 SizeOfHeader; - ULONG32 SizeOfDescriptor; - ULONG32 SizeOfNativeDescriptor; - ULONG32 SizeOfFunctionEntry; - ULONG32 NumberOfDescriptors; - ULONG32 SizeOfAlignPad; - } MINIDUMP_FUNCTION_TABLE_STREAM,*PMINIDUMP_FUNCTION_TABLE_STREAM; - - typedef struct _MINIDUMP_UNLOADED_MODULE { - ULONG64 BaseOfImage; - ULONG32 SizeOfImage; - ULONG32 CheckSum; - ULONG32 TimeDateStamp; - RVA ModuleNameRva; - } MINIDUMP_UNLOADED_MODULE,*PMINIDUMP_UNLOADED_MODULE; - - typedef struct _MINIDUMP_UNLOADED_MODULE_LIST { - ULONG32 SizeOfHeader; - ULONG32 SizeOfEntry; - ULONG32 NumberOfEntries; - } MINIDUMP_UNLOADED_MODULE_LIST,*PMINIDUMP_UNLOADED_MODULE_LIST; - -#define MINIDUMP_MISC1_PROCESS_ID 0x00000001 -#define MINIDUMP_MISC1_PROCESS_TIMES 0x00000002 -#define MINIDUMP_MISC1_PROCESSOR_POWER_INFO 0x00000004 - - typedef struct _MINIDUMP_MISC_INFO { - ULONG32 SizeOfInfo; - ULONG32 Flags1; - ULONG32 ProcessId; - ULONG32 ProcessCreateTime; - ULONG32 ProcessUserTime; - ULONG32 ProcessKernelTime; - } MINIDUMP_MISC_INFO,*PMINIDUMP_MISC_INFO; - - typedef struct _MINIDUMP_USER_RECORD { - ULONG32 Type; - MINIDUMP_LOCATION_DESCRIPTOR Memory; - } MINIDUMP_USER_RECORD,*PMINIDUMP_USER_RECORD; - - typedef struct _MINIDUMP_USER_STREAM { - ULONG32 Type; - ULONG BufferSize; - PVOID Buffer; - } MINIDUMP_USER_STREAM,*PMINIDUMP_USER_STREAM; - - typedef struct _MINIDUMP_USER_STREAM_INFORMATION { - ULONG UserStreamCount; - PMINIDUMP_USER_STREAM UserStreamArray; - } MINIDUMP_USER_STREAM_INFORMATION,*PMINIDUMP_USER_STREAM_INFORMATION; - - typedef enum _MINIDUMP_CALLBACK_TYPE { - ModuleCallback, - ThreadCallback, - ThreadExCallback, - IncludeThreadCallback, - IncludeModuleCallback, - MemoryCallback, - CancelCallback, - WriteKernelMinidumpCallback, - KernelMinidumpStatusCallback, - RemoveMemoryCallback, - IncludeVmRegionCallback, - IoStartCallback, - IoWriteAllCallback, - IoFinishCallback, - ReadMemoryFailureCallback, - SecondaryFlagsCallback - } MINIDUMP_CALLBACK_TYPE; - - typedef struct _MINIDUMP_THREAD_CALLBACK { - ULONG ThreadId; - HANDLE ThreadHandle; - CONTEXT Context; - ULONG SizeOfContext; - ULONG64 StackBase; - ULONG64 StackEnd; - } MINIDUMP_THREAD_CALLBACK,*PMINIDUMP_THREAD_CALLBACK; - - typedef struct _MINIDUMP_THREAD_EX_CALLBACK { - ULONG ThreadId; - HANDLE ThreadHandle; - CONTEXT Context; - ULONG SizeOfContext; - ULONG64 StackBase; - ULONG64 StackEnd; - ULONG64 BackingStoreBase; - ULONG64 BackingStoreEnd; - } MINIDUMP_THREAD_EX_CALLBACK,*PMINIDUMP_THREAD_EX_CALLBACK; - - typedef struct _MINIDUMP_INCLUDE_THREAD_CALLBACK { - ULONG ThreadId; - } MINIDUMP_INCLUDE_THREAD_CALLBACK,*PMINIDUMP_INCLUDE_THREAD_CALLBACK; - - typedef enum _THREAD_WRITE_FLAGS { - ThreadWriteThread = 0x0001, - ThreadWriteStack = 0x0002, - ThreadWriteContext = 0x0004, - ThreadWriteBackingStore = 0x0008, - ThreadWriteInstructionWindow = 0x0010, - ThreadWriteThreadData = 0x0020, - ThreadWriteThreadInfo = 0x0040 - } THREAD_WRITE_FLAGS; - - typedef struct _MINIDUMP_MODULE_CALLBACK { - PWCHAR FullPath; - ULONG64 BaseOfImage; - ULONG SizeOfImage; - ULONG CheckSum; - ULONG TimeDateStamp; - VS_FIXEDFILEINFO VersionInfo; - PVOID CvRecord; - ULONG SizeOfCvRecord; - PVOID MiscRecord; - ULONG SizeOfMiscRecord; - } MINIDUMP_MODULE_CALLBACK,*PMINIDUMP_MODULE_CALLBACK; - - typedef struct _MINIDUMP_INCLUDE_MODULE_CALLBACK { - ULONG64 BaseOfImage; - } MINIDUMP_INCLUDE_MODULE_CALLBACK,*PMINIDUMP_INCLUDE_MODULE_CALLBACK; - - typedef enum _MODULE_WRITE_FLAGS { - ModuleWriteModule = 0x0001, - ModuleWriteDataSeg = 0x0002, - ModuleWriteMiscRecord = 0x0004, - ModuleWriteCvRecord = 0x0008, - ModuleReferencedByMemory = 0x0010, - ModuleWriteTlsData = 0x0020, - ModuleWriteCodeSegs = 0x0040 - } MODULE_WRITE_FLAGS; - - typedef enum _MINIDUMP_SECONDARY_FLAGS { - MiniSecondaryWithoutPowerInfo = 0x00000001 - } MINIDUMP_SECONDARY_FLAGS; - - typedef struct _MINIDUMP_CALLBACK_INPUT { - ULONG ProcessId; - HANDLE ProcessHandle; - ULONG CallbackType; - __C89_NAMELESS union { - MINIDUMP_THREAD_CALLBACK Thread; - MINIDUMP_THREAD_EX_CALLBACK ThreadEx; - MINIDUMP_MODULE_CALLBACK Module; - MINIDUMP_INCLUDE_THREAD_CALLBACK IncludeThread; - MINIDUMP_INCLUDE_MODULE_CALLBACK IncludeModule; - }; - } MINIDUMP_CALLBACK_INPUT,*PMINIDUMP_CALLBACK_INPUT; - -typedef struct _MINIDUMP_MEMORY_INFO { - ULONG64 BaseAddress; - ULONG64 AllocationBase; - ULONG32 AllocationProtect; - ULONG32 __alignment1; - ULONG64 RegionSize; - ULONG32 State; - ULONG32 Protect; - ULONG32 Type; - ULONG32 __alignment2; -} MINIDUMP_MEMORY_INFO, *PMINIDUMP_MEMORY_INFO; - -typedef struct _MINIDUMP_MISC_INFO_2 { - ULONG32 SizeOfInfo; - ULONG32 Flags1; - ULONG32 ProcessId; - ULONG32 ProcessCreateTime; - ULONG32 ProcessUserTime; - ULONG32 ProcessKernelTime; - ULONG32 ProcessorMaxMhz; - ULONG32 ProcessorCurrentMhz; - ULONG32 ProcessorMhzLimit; - ULONG32 ProcessorMaxIdleState; - ULONG32 ProcessorCurrentIdleState; -} MINIDUMP_MISC_INFO_2, *PMINIDUMP_MISC_INFO_2; - -typedef struct _MINIDUMP_MEMORY_INFO_LIST { - ULONG SizeOfHeader; - ULONG SizeOfEntry; - ULONG64 NumberOfEntries; -} MINIDUMP_MEMORY_INFO_LIST, *PMINIDUMP_MEMORY_INFO_LIST; - - typedef struct _MINIDUMP_CALLBACK_OUTPUT { - __C89_NAMELESS union { - ULONG ModuleWriteFlags; - ULONG ThreadWriteFlags; - ULONG SecondaryFlags; - __C89_NAMELESS struct { - ULONG64 MemoryBase; - ULONG MemorySize; - }; - __C89_NAMELESS struct { - WINBOOL CheckCancel; - WINBOOL Cancel; - }; - HANDLE Handle; - }; - __C89_NAMELESS struct { - MINIDUMP_MEMORY_INFO VmRegion; - WINBOOL Continue; - }; - HRESULT Status; - } MINIDUMP_CALLBACK_OUTPUT, *PMINIDUMP_CALLBACK_OUTPUT; - - typedef enum _MINIDUMP_TYPE { - MiniDumpNormal = 0x00000000, - MiniDumpWithDataSegs = 0x00000001, - MiniDumpWithFullMemory = 0x00000002, - MiniDumpWithHandleData = 0x00000004, - MiniDumpFilterMemory = 0x00000008, - MiniDumpScanMemory = 0x00000010, - MiniDumpWithUnloadedModules = 0x00000020, - MiniDumpWithIndirectlyReferencedMemory = 0x00000040, - MiniDumpFilterModulePaths = 0x00000080, - MiniDumpWithProcessThreadData = 0x00000100, - MiniDumpWithPrivateReadWriteMemory = 0x00000200, - MiniDumpWithoutOptionalData = 0x00000400, - MiniDumpWithFullMemoryInfo = 0x00000800, - MiniDumpWithThreadInfo = 0x00001000, - MiniDumpWithCodeSegs = 0x00002000, - MiniDumpWithoutAuxiliaryState = 0x00004000, - MiniDumpWithFullAuxiliaryState = 0x00008000, - MiniDumpWithPrivateWriteCopyMemory = 0x00010000, - MiniDumpIgnoreInaccessibleMemory = 0x00020000, - MiniDumpWithTokenInformation = 0x00040000 - } MINIDUMP_TYPE; - -#define MINIDUMP_THREAD_INFO_ERROR_THREAD 0x00000001 -#define MINIDUMP_THREAD_INFO_WRITING_THREAD 0x00000002 -#define MINIDUMP_THREAD_INFO_EXITED_THREAD 0x00000004 -#define MINIDUMP_THREAD_INFO_INVALID_INFO 0x00000008 -#define MINIDUMP_THREAD_INFO_INVALID_CONTEXT 0x00000010 -#define MINIDUMP_THREAD_INFO_INVALID_TEB 0x00000020 - -typedef struct _MINIDUMP_THREAD_INFO { - ULONG32 ThreadId; - ULONG32 DumpFlags; - ULONG32 DumpError; - ULONG32 ExitStatus; - ULONG64 CreateTime; - ULONG64 ExitTime; - ULONG64 KernelTime; - ULONG64 UserTime; - ULONG64 StartAddress; - ULONG64 Affinity; -} MINIDUMP_THREAD_INFO, *PMINIDUMP_THREAD_INFO; - -typedef struct _MINIDUMP_THREAD_INFO_LIST { - ULONG SizeOfHeader; - ULONG SizeOfEntry; - ULONG NumberOfEntries; -} MINIDUMP_THREAD_INFO_LIST, *PMINIDUMP_THREAD_INFO_LIST; - -#ifdef __cplusplus -extern "C" { -#endif - - typedef WINBOOL (WINAPI *MINIDUMP_CALLBACK_ROUTINE)(PVOID CallbackParam,CONST PMINIDUMP_CALLBACK_INPUT CallbackInput,PMINIDUMP_CALLBACK_OUTPUT CallbackOutput); - - typedef struct _MINIDUMP_CALLBACK_INFORMATION { - MINIDUMP_CALLBACK_ROUTINE CallbackRoutine; - PVOID CallbackParam; - } MINIDUMP_CALLBACK_INFORMATION,*PMINIDUMP_CALLBACK_INFORMATION; - -#define RVA_TO_ADDR(Mapping,Rva) ((PVOID)(((ULONG_PTR) (Mapping)) + (Rva))) - - WINBOOL WINAPI MiniDumpWriteDump(HANDLE hProcess,DWORD ProcessId,HANDLE hFile,MINIDUMP_TYPE DumpType,CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam,CONST PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam,CONST PMINIDUMP_CALLBACK_INFORMATION CallbackParam); - WINBOOL WINAPI MiniDumpReadDumpStream(PVOID BaseOfDump,ULONG StreamNumber,PMINIDUMP_DIRECTORY *Dir,PVOID *StreamPointer,ULONG *StreamSize); - -WINBOOL WINAPI EnumerateLoadedModulesEx( - HANDLE hProcess, - PENUMLOADED_MODULES_CALLBACK64 EnumLoadedModulesCallback, - PVOID UserContext -); - -WINBOOL WINAPI EnumerateLoadedModulesExW( - HANDLE hProcess, - PENUMLOADED_MODULES_CALLBACKW64 EnumLoadedModulesCallback, - PVOID UserContext -); - -WINBOOL WINAPI SymAddSourceStream( - HANDLE hProcess, - ULONG64 Base, - PCSTR StreamFile, - PBYTE Buffer, - size_t Size -); - -WINBOOL WINAPI SymAddSourceStreamW( - HANDLE hProcess, - ULONG64 Base, - PCWSTR StreamFile, - PBYTE Buffer, - size_t Size -); - -WINBOOL WINAPI SymEnumSourceLines( - HANDLE hProcess, - ULONG64 Base, - PCSTR Obj, - PCSTR File, - DWORD Line, - DWORD Flags, - PSYM_ENUMLINES_CALLBACK EnumLinesCallback, - PVOID UserContext -); - -WINBOOL WINAPI SymEnumSourceLinesW( - HANDLE hProcess, - ULONG64 Base, - PCWSTR Obj, - PCWSTR File, - DWORD Line, - DWORD Flags, - PSYM_ENUMLINES_CALLBACKW EnumLinesCallback, - PVOID UserContext -); - -WINBOOL WINAPI SymEnumTypesByName( - HANDLE hProcess, - ULONG64 BaseOfDll, - PCSTR mask, - PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback, - PVOID UserContext -); - -WINBOOL WINAPI SymEnumTypesByNameW( - HANDLE hProcess, - ULONG64 BaseOfDll, - PCSTR mask, - PSYM_ENUMERATESYMBOLS_CALLBACKW EnumSymbolsCallback, - PVOID UserContext -); - -HANDLE WINAPI SymFindDebugInfoFile( - HANDLE hProcess, - PCSTR FileName, - PSTR DebugFilePath, - PFIND_DEBUG_FILE_CALLBACK Callback, - PVOID CallerData -); - -HANDLE WINAPI SymFindDebugInfoFileW( - HANDLE hProcess, - PCWSTR FileName, - PWSTR DebugFilePath, - PFIND_DEBUG_FILE_CALLBACKW Callback, - PVOID CallerData -); - -HANDLE WINAPI SymFindExecutableImage( - HANDLE hProcess, - PCSTR FileName, - PSTR ImageFilePath, - PFIND_EXE_FILE_CALLBACK Callback, - PVOID CallerData -); - -HANDLE WINAPI SymFindExecutableImageW( - HANDLE hProcess, - PCWSTR FileName, - PWSTR ImageFilePath, - PFIND_EXE_FILE_CALLBACKW Callback, - PVOID CallerData -); - -WINBOOL WINAPI SymFromIndex( - HANDLE hProcess, - ULONG64 BaseOfDll, - DWORD Index, - PSYMBOL_INFO Symbol -); - -WINBOOL WINAPI SymFromIndexW( - HANDLE hProcess, - ULONG64 BaseOfDll, - DWORD Index, - PSYMBOL_INFOW Symbol -); - -WINBOOL WINAPI SymGetScope( - HANDLE hProcess, - ULONG64 BaseOfDll, - DWORD Index, - PSYMBOL_INFO Symbol -); - -WINBOOL WINAPI SymGetScopeW( - HANDLE hProcess, - ULONG64 BaseOfDll, - DWORD Index, - PSYMBOL_INFOW Symbol -); - -WINBOOL WINAPI SymGetSourceFileFromToken( - HANDLE hProcess, - PVOID Token, - PCSTR Params, - PSTR FilePath, - DWORD Size -); - -WINBOOL WINAPI SymGetSourceFileFromTokenW( - HANDLE hProcess, - PVOID Token, - PCWSTR Params, - PWSTR FilePath, - DWORD Size -); - -WINBOOL WINAPI SymGetSourceFileToken( - HANDLE hProcess, - ULONG64 Base, - PCSTR FileSpec, - PVOID *Token, - DWORD *Size -); - -WINBOOL WINAPI SymGetSourceFileTokenW( - HANDLE hProcess, - ULONG64 Base, - PCWSTR FileSpec, - PVOID *Token, - DWORD *Size -); - -WINBOOL WINAPI SymGetSourceFile( - HANDLE hProcess, - ULONG64 Base, - PCSTR Params, - PCSTR FileSpec, - PSTR FilePath, - DWORD Size -); - -WINBOOL WINAPI SymGetSourceFileW( - HANDLE hProcess, - ULONG64 Base, - PCWSTR Params, - PCWSTR FileSpec, - PWSTR FilePath, - DWORD Size -); - -WINBOOL WINAPI SymGetSourceVarFromToken( - HANDLE hProcess, - PVOID Token, - PCSTR Params, - PCSTR VarName, - PSTR Value, - DWORD Size -); - -WINBOOL WINAPI SymGetSourceVarFromTokenW( - HANDLE hProcess, - PVOID Token, - PCWSTR Params, - PCWSTR VarName, - PWSTR Value, - DWORD Size -); - -WINBOOL WINAPI SymGetSymbolFile( - HANDLE hProcess, - PCSTR SymPath, - PCSTR ImageFile, - DWORD Type, - PSTR SymbolFile, - size_t cSymbolFile, - PSTR DbgFile, - size_t cDbgFile -); - -WINBOOL WINAPI SymGetSymbolFileW( - HANDLE hProcess, - PCWSTR SymPath, - PCWSTR ImageFile, - DWORD Type, - PWSTR SymbolFile, - size_t cSymbolFile, - PWSTR DbgFile, - size_t cDbgFile -); - -WINBOOL WINAPI SymNext( - HANDLE hProcess, - PSYMBOL_INFO Symbol -); - -WINBOOL WINAPI SymNextW( - HANDLE hProcess, - PSYMBOL_INFOW Symbol -); - -WINBOOL WINAPI SymPrev( - HANDLE hProcess, - PSYMBOL_INFO Symbol -); - -WINBOOL WINAPI SymPrevW( - HANDLE hProcess, - PSYMBOL_INFOW Symbol -); - -WINBOOL WINAPI SymRefreshModuleList( - HANDLE hProcess -); - -#define SYMSEARCH_MASKOBJS 0x01 -#define SYMSEARCH_RECURSE 0x02 -#define SYMSEARCH_GLOBALSONLY 0x04 -#define SYMSEARCH_ALLITEMS 0x08 - -WINBOOL WINAPI SymSearch( - HANDLE hProcess, - ULONG64 BaseOfDll, - DWORD Index, - DWORD SymTag, - PCSTR Mask, - DWORD64 Address, - PSYM_ENUMERATESYMBOLS_CALLBACK EnumSymbolsCallback, - PVOID UserContext, - DWORD Options -); - -WINBOOL WINAPI SymSearchW( - HANDLE hProcess, - ULONG64 BaseOfDll, - DWORD Index, - DWORD SymTag, - PCWSTR Mask, - DWORD64 Address, - PSYM_ENUMERATESYMBOLS_CALLBACKW EnumSymbolsCallback, - PVOID UserContext, - DWORD Options -); - -WINBOOL WINAPI SymSrvGetFileIndexString( - HANDLE hProcess, - PCSTR SrvPath, - PCSTR File, - PSTR Index, - size_t Size, - DWORD Flags -); - -WINBOOL WINAPI SymSrvGetFileIndexStringW( - HANDLE hProcess, - PCWSTR SrvPath, - PCWSTR File, - PWSTR Index, - size_t Size, - DWORD Flags -); - -#ifdef DBGHELP_TRANSLATE_TCHAR -#define SymSrvGetFileIndexString SymSrvGetFileIndexStringW -#endif - -WINBOOL WINAPI SymSrvGetFileIndexInfo( - PCSTR File, - PSYMSRV_INDEX_INFO Info, - DWORD Flags -); - -WINBOOL WINAPI SymSrvGetFileIndexInfoW( - PCWSTR File, - PSYMSRV_INDEX_INFOW Info, - DWORD Flags -); - -#ifdef DBGHELP_TRANSLATE_TCHAR -#define SymSrvGetFileIndexInfo SymSrvGetFileIndexInfoW -#endif - -WINBOOL WINAPI SymSrvGetFileIndexes( - PCTSTR File, - GUID *Id, - DWORD *Val1, - DWORD *Val2, - DWORD Flags -); - -WINBOOL WINAPI SymSrvGetFileIndexesW( - PCWSTR File, - GUID *Id, - DWORD *Val1, - DWORD *Val2, - DWORD Flags -); - -#ifdef DBGHELP_TRANSLATE_TCHAR -#define SymSrvGetFileIndexes SymSrvGetFileIndexesW -#endif - -PCSTR WINAPI SymSrvGetSupplement( - HANDLE hProcess, - PCSTR SymPath, - PCSTR Node, - PCSTR File -); - -PCWSTR WINAPI SymSrvGetSupplementW( - HANDLE hProcess, - PCWSTR SymPath, - PCWSTR Node, - PCWSTR File -); - -#ifdef DBGHELP_TRANSLATE_TCHAR -#define SymSrvGetSupplement SymSrvGetSupplementW -#endif - -WINBOOL WINAPI SymSrvIsStore( - HANDLE hProcess, - PCSTR path -); - -WINBOOL WINAPI SymSrvIsStoreW( - HANDLE hProcess, - PCWSTR path -); - -#ifdef DBGHELP_TRANSLATE_TCHAR -#define SymSrvIsStore SymSrvIsStoreW -#endif - -PCSTR WINAPI SymSrvStoreFile( - HANDLE hProcess, - PCSTR SrvPath, - PCSTR File, - DWORD Flags -); - -PCWSTR WINAPI SymSrvStoreFileW( - HANDLE hProcess, - PCWSTR SrvPath, - PCWSTR File, - DWORD Flags -); - -#define SYMSTOREOPT_COMPRESS 0x01 -#define SYMSTOREOPT_OVERWRITE 0x02 -#define SYMSTOREOPT_RETURNINDEX 0x04 -#define SYMSTOREOPT_POINTER 0x08 -#define SYMSTOREOPT_PASS_IF_EXISTS 0x40 - -#ifdef DBGHELP_TRANSLATE_TCHAR -#define SymSrvStoreFile SymSrvStoreFileW -#endif - -PCSTR WINAPI SymSrvStoreSupplement( - HANDLE hProcess, - const PCTSTR SymPath, - PCSTR Node, - PCSTR File, - DWORD Flags -); - -PCWSTR WINAPI SymSrvStoreSupplementW( - HANDLE hProcess, - const PCWSTR SymPath, - PCWSTR Node, - PCWSTR File, - DWORD Flags -); - -#ifdef DBGHELP_TRANSLATE_TCHAR -#define SymSrvStoreSupplement SymSrvStoreSupplementW -#endif - -PCSTR WINAPI SymSrvDeltaName( - HANDLE hProcess, - PCSTR SymPath, - PCSTR Type, - PCSTR File1, - PCSTR File2 -); - -PCWSTR WINAPI SymSrvDeltaNameW( - HANDLE hProcess, - PCWSTR SymPath, - PCWSTR Type, - PCWSTR File1, - PCWSTR File2 -); - -#ifdef DBGHELP_TRANSLATE_TCHAR -#define SymSrvDeltaName SymSrvDeltaNameW -#endif - -#include - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/bin/windows/vpx/src/backtrace.c b/bin/windows/vpx/src/backtrace.c deleted file mode 100644 index 4bbe88bbe9d..00000000000 --- a/bin/windows/vpx/src/backtrace.c +++ /dev/null @@ -1,702 +0,0 @@ -/* - Copyright (c) 2010 , - Cloud Wu . All rights reserved. - - http://www.codingnow.com - - Use, modification and distribution are subject to the "New BSD License" - as listed at . - - filename: backtrace.c - - build command: gcc -O2 -shared -Wall -o backtrace.dll backtrace.c -lbfd -liberty -limagehlp - - how to use: Call LoadLibraryA("backtrace.dll"); at beginning of your program . - - */ - -/* modified from original for EDuke32 */ - -// warnings cleaned up, ported to 64-bit, and heavily extended by Hendricks266 - -#include -#include -#include - -// Tenuous: MinGW provides _IMAGEHLP_H while MinGW-w64 defines _IMAGEHLP_. -#ifdef _IMAGEHLP_H -# define EBACKTRACE_MINGW32 -#endif -#ifdef _IMAGEHLP_ -# define EBACKTRACE_MINGW_W64 -#endif -#if defined(EBACKTRACE_MINGW32) && !defined(EBACKTRACE_MINGW_W64) -# include "_dbg_common.h" -#endif - -#ifndef PACKAGE -# define PACKAGE EBACKTRACE1 -#endif -#ifndef PACKAGE_VERSION -# define PACKAGE_VERSION 1 -#endif - -#if defined(_M_X64) || defined(__amd64__) || defined(__x86_64__) || defined(_WIN64) -# define EBACKTRACE64 -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -#ifndef DBG_PRINTEXCEPTION_C -# define DBG_PRINTEXCEPTION_C (0x40010006) -#endif -#ifndef MS_VC_EXCEPTION -# define MS_VC_EXCEPTION 1080890248 -#endif - -#if defined __GNUC__ || defined __clang__ -# define ATTRIBUTE(attrlist) __attribute__(attrlist) -#else -# define ATTRIBUTE(attrlist) -#endif - -#define BUFFER_MAX (16*1024) - -struct bfd_ctx { - bfd * handle; - asymbol ** symbol; -}; - -struct bfd_set { - char * name; - struct bfd_ctx * bc; - struct bfd_set *next; -}; - -struct find_info { - asymbol **symbol; - bfd_vma counter; - const char *file; - const char *func; - unsigned line; -}; - -struct output_buffer { - char * buf; - size_t sz; - size_t ptr; -}; - -static void -output_init(struct output_buffer *ob, char * buf, size_t sz) -{ - ob->buf = buf; - ob->sz = sz; - ob->ptr = 0; - ob->buf[0] = '\0'; -} - -static void -output_print(struct output_buffer *ob, const char * format, ...) -{ - va_list ap; - - if (ob->sz == ob->ptr) - return; - ob->buf[ob->ptr] = '\0'; - va_start(ap,format); - vsnprintf(ob->buf + ob->ptr , ob->sz - ob->ptr , format, ap); - va_end(ap); - - ob->ptr = strlen(ob->buf + ob->ptr) + ob->ptr; -} - -static void -lookup_section(bfd *abfd, asection *sec, void *opaque_data) -{ - struct find_info *data = opaque_data; - bfd_vma vma; - - if (data->func) - return; - - if (!(bfd_get_section_flags(abfd, sec) & SEC_ALLOC)) - return; - - vma = bfd_get_section_vma(abfd, sec); - if (data->counter < vma || vma + bfd_get_section_size(sec) <= data->counter) - return; - - bfd_find_nearest_line(abfd, sec, data->symbol, data->counter - vma, &(data->file), &(data->func), &(data->line)); -} - -static void -find(struct bfd_ctx * b, DWORD offset, const char **file, const char **func, unsigned *line) -{ - struct find_info data; - data.func = NULL; - data.symbol = b->symbol; - data.counter = offset; - data.file = NULL; - data.func = NULL; - data.line = 0; - - bfd_map_over_sections(b->handle, &lookup_section, &data); - if (file) { - *file = data.file; - } - if (func) { - *func = data.func; - } - if (line) { - *line = data.line; - } -} - -static int -init_bfd_ctx(struct bfd_ctx *bc, const char * procname, struct output_buffer *ob) -{ - int r1, r2, r3; - bfd *b; - void *symbol_table; - unsigned dummy = 0; - bc->handle = NULL; - bc->symbol = NULL; - - b = bfd_openr(procname, 0); - if (!b) { - output_print(ob,"Failed to open bfd from (%s)\n" , procname); - return 1; - } - - r1 = bfd_check_format(b, bfd_object); - r2 = bfd_check_format_matches(b, bfd_object, NULL); - r3 = bfd_get_file_flags(b) & HAS_SYMS; - - if (!(r1 && r2 && r3)) { - bfd_close(b); - if (!(r1 && r2)) - output_print(ob,"Failed to init bfd from (%s): %d %d %d\n", procname, r1, r2, r3); - return 1; - } - - if (bfd_read_minisymbols(b, FALSE, &symbol_table, &dummy) == 0) { - if (bfd_read_minisymbols(b, TRUE, &symbol_table, &dummy) < 0) { - free(symbol_table); - bfd_close(b); - output_print(ob,"Failed to read symbols from (%s)\n", procname); - return 1; - } - } - - bc->handle = b; - bc->symbol = symbol_table; - - return 0; -} - -static void -close_bfd_ctx(struct bfd_ctx *bc) -{ - if (bc) { - if (bc->symbol) { - free(bc->symbol); - } - if (bc->handle) { - bfd_close(bc->handle); - } - } -} - -static struct bfd_ctx * -get_bc(struct output_buffer *ob , struct bfd_set *set , const char *procname) -{ - struct bfd_ctx bc; - while(set->name) { - if (strcmp(set->name , procname) == 0) { - return set->bc; - } - set = set->next; - } - if (init_bfd_ctx(&bc, procname , ob)) { - return NULL; - } - set->next = calloc(1, sizeof(*set)); - set->bc = malloc(sizeof(struct bfd_ctx)); - memcpy(set->bc, &bc, sizeof(bc)); - set->name = strdup(procname); - - return set->bc; -} - -static void -release_set(struct bfd_set *set) -{ - while(set) { - struct bfd_set * temp = set->next; - if (set->name) - free(set->name); - close_bfd_ctx(set->bc); - free(set); - set = temp; - } -} - -static char procname[MAX_PATH]; - -#ifdef EBACKTRACE64 -# define MachineType IMAGE_FILE_MACHINE_AMD64 -# define MAYBE64(x) x ## 64 -#else -# define MachineType IMAGE_FILE_MACHINE_I386 -# define MAYBE64(x) x -#endif - -static void -_backtrace(struct output_buffer *ob, struct bfd_set *set, int depth , LPCONTEXT context) -{ - MAYBE64(STACKFRAME) frame; - HANDLE process, thread; - char symbol_buffer[sizeof(MAYBE64(IMAGEHLP_SYMBOL)) + 255]; - char module_name_raw[MAX_PATH]; - struct bfd_ctx *bc = NULL; - - GetModuleFileNameA(NULL, procname, sizeof procname); - - memset(&frame,0,sizeof(frame)); - -#ifdef EBACKTRACE64 - frame.AddrPC.Offset = context->Rip; - frame.AddrStack.Offset = context->Rsp; - frame.AddrFrame.Offset = context->Rbp; -#else - frame.AddrPC.Offset = context->Eip; - frame.AddrStack.Offset = context->Esp; - frame.AddrFrame.Offset = context->Ebp; -#endif - - frame.AddrPC.Mode = AddrModeFlat; - frame.AddrStack.Mode = AddrModeFlat; - frame.AddrFrame.Mode = AddrModeFlat; - - process = GetCurrentProcess(); - thread = GetCurrentThread(); - - while(MAYBE64(StackWalk)(MachineType, - process, - thread, - &frame, - context, - NULL, - MAYBE64(SymFunctionTableAccess), - MAYBE64(SymGetModuleBase), NULL)) { - MAYBE64(IMAGEHLP_SYMBOL) *symbol; - MAYBE64(DWORD) module_base; - const char * module_name = "[unknown module]"; - - const char * file = NULL; - const char * func = NULL; - unsigned line = 0; - - --depth; - if (depth < 0) - break; - - symbol = (MAYBE64(IMAGEHLP_SYMBOL) *)symbol_buffer; - symbol->SizeOfStruct = (sizeof *symbol) + 255; - symbol->MaxNameLength = 254; - - module_base = MAYBE64(SymGetModuleBase)(process, frame.AddrPC.Offset); - - if (module_base && - GetModuleFileNameA((HINSTANCE)(intptr_t)module_base, module_name_raw, MAX_PATH)) { - module_name = module_name_raw; - bc = get_bc(ob, set, module_name); - } - - if (bc) { - find(bc,frame.AddrPC.Offset,&file,&func,&line); - } - - if (file == NULL) { - MAYBE64(DWORD) dummy = 0; - if (MAYBE64(SymGetSymFromAddr)(process, frame.AddrPC.Offset, &dummy, symbol)) { - file = symbol->Name; - } - else { - file = "[unknown file]"; - } - } - - output_print(ob,"0x%p : %s : %s", frame.AddrPC.Offset, module_name, file); - if (func != NULL) - output_print(ob, " (%d) : in function (%s)", line, func); - output_print(ob, "\n"); - } -} - -static LPTSTR FormatErrorMessage(DWORD dwMessageId) -{ - LPTSTR lpBuffer = NULL; - - // adapted from http://stackoverflow.com/a/455533 - FormatMessage( - FORMAT_MESSAGE_FROM_SYSTEM - |FORMAT_MESSAGE_ALLOCATE_BUFFER - |FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - dwMessageId, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US) - (LPTSTR)&lpBuffer, - 0, - NULL); - - return lpBuffer; // must be LocalFree()'d by caller -} - -static LPTSTR FormatExceptionCodeMessage(DWORD dwMessageId) -{ - LPTSTR lpBuffer = NULL; - - FormatMessage( - FORMAT_MESSAGE_FROM_HMODULE - |FORMAT_MESSAGE_ALLOCATE_BUFFER - |FORMAT_MESSAGE_IGNORE_INSERTS, - GetModuleHandleA("ntdll.dll"), - dwMessageId, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US) - (LPTSTR)&lpBuffer, - 0, - NULL); - - return lpBuffer; // must be LocalFree()'d by caller -} - - -// adapted from http://www.catch22.net/tuts/custom-messagebox -static HHOOK hMsgBoxHook; - -LRESULT CALLBACK CBTProc(int nCode, WPARAM wParam, LPARAM lParam) -{ - if (nCode < 0) - return CallNextHookEx(hMsgBoxHook, nCode, wParam, lParam); - - switch (nCode) - { - case HCBT_ACTIVATE: - { - // Get handle to the message box! - HWND hwnd = (HWND)wParam; - - // Do customization! - SetWindowTextA(GetDlgItem(hwnd, IDYES), "Quit"); - SetWindowTextA(GetDlgItem(hwnd, IDNO), "Continue"); - SetWindowTextA(GetDlgItem(hwnd, IDCANCEL), "Ignore"); - return 0; - } - break; - } - - // Call the next hook, if there is one - return CallNextHookEx(hMsgBoxHook, nCode, wParam, lParam); -} - -int ExceptionMessage(TCHAR *szText, TCHAR *szCaption) -{ - int retval; - - // Install a window hook, so we can intercept the message-box - // creation, and customize it - hMsgBoxHook = SetWindowsHookEx( - WH_CBT, - CBTProc, - NULL, - GetCurrentThreadId() // Only install for THIS thread!!! - ); - - // Display a standard message box - retval = MessageBoxA(NULL, szText, szCaption, MB_YESNOCANCEL|MB_ICONERROR|MB_TASKMODAL); - - // remove the window hook - UnhookWindowsHookEx(hMsgBoxHook); - - return retval; -} - -static char crashlogfilename[MAX_PATH] = "crash.log"; -static char propername[MAX_PATH] = "this application"; - -__declspec(dllexport) void SetTechnicalName(const char* input) -{ - snprintf(crashlogfilename, MAX_PATH, "%s.crash.log", input); -} -__declspec(dllexport) void SetProperName(const char* input) -{ - strncpy(propername, input, MAX_PATH); -} - -static char * g_output = NULL; -static PVOID g_prev = NULL; - -static LONG WINAPI -exception_filter(LPEXCEPTION_POINTERS info) -{ - struct output_buffer ob; - int logfd, written, msgboxID; - PEXCEPTION_RECORD exception; - BOOL initialized = FALSE; - char *ExceptionPrinted; - - for (exception = info->ExceptionRecord; exception != NULL; exception = exception->ExceptionRecord) - { -#if 0 - if (exception->ExceptionFlags & EXCEPTION_NONCONTINUABLE) - continuable = FALSE; -#endif - - switch (exception->ExceptionCode) - { - case EXCEPTION_BREAKPOINT: - case EXCEPTION_SINGLE_STEP: - case DBG_CONTROL_C: - case DBG_PRINTEXCEPTION_C: - case MS_VC_EXCEPTION: - break; - default: - { - LPTSTR ExceptionCodeMsg = FormatExceptionCodeMessage(exception->ExceptionCode); - // The message for this exception code is broken. - LPTSTR ExceptionText = exception->ExceptionCode == EXCEPTION_ACCESS_VIOLATION ? "Access violation." : ExceptionCodeMsg; - - if (!initialized) - { - output_init(&ob, g_output, BUFFER_MAX); - initialized = TRUE; - } - - output_print(&ob, "Caught exception 0x%08X at 0x%p: %s\n", exception->ExceptionCode, exception->ExceptionAddress, ExceptionText); - - LocalFree(ExceptionCodeMsg); - } - break; - } - } - - if (!initialized) - return EXCEPTION_CONTINUE_SEARCH; // EXCEPTION_CONTINUE_EXECUTION - - ExceptionPrinted = (char*)calloc(strlen(g_output) + 37 + 2*MAX_PATH, sizeof(char)); - strcpy(ExceptionPrinted, g_output); - strcat(ExceptionPrinted, "\nPlease send "); - strcat(ExceptionPrinted, crashlogfilename); - strcat(ExceptionPrinted, " to the maintainers of "); - strcat(ExceptionPrinted, propername); - strcat(ExceptionPrinted, "."); - - { - DWORD error = 0; - BOOL SymInitialized = SymInitialize(GetCurrentProcess(), NULL, TRUE); - - if (!SymInitialized) - { - LPTSTR errorText; - - error = GetLastError(); - errorText = FormatErrorMessage(error); - output_print(&ob, "SymInitialize() failed with error %d: %s\n", error, errorText); - LocalFree(errorText); - } - - if (SymInitialized || error == 87) - { - struct bfd_set *set = calloc(1,sizeof(*set)); - bfd_init(); - _backtrace(&ob , set , 128 , info->ContextRecord); - release_set(set); - - SymCleanup(GetCurrentProcess()); - } - } - - logfd = open(crashlogfilename, O_APPEND | O_CREAT | O_RDWR, S_IRUSR | S_IWUSR); - - if (logfd) { - time_t curtime; - struct tm *curltime; - const char *theasctime; - const char *finistr = "---------------\n"; - - while ((written = write(logfd, g_output, strlen(g_output)))) { - g_output += written; - } - - curtime = time(NULL); - curltime = localtime(&curtime); - theasctime = curltime ? asctime(curltime) : NULL; - - if (theasctime) - write(logfd, theasctime, strlen(theasctime)); - write(logfd, finistr, strlen(finistr)); - close(logfd); - } - - //fputs(g_output, stderr); - - msgboxID = ExceptionMessage(ExceptionPrinted, propername); - - free(ExceptionPrinted); - - switch (msgboxID) - { - case IDYES: - exit(0xBAC); - break; - case IDNO: - break; - case IDCANCEL: - return EXCEPTION_CONTINUE_EXECUTION; - break; - } - - return EXCEPTION_CONTINUE_SEARCH; -} - -static void -backtrace_register(void) -{ - if (g_output == NULL) { - g_output = malloc(BUFFER_MAX); - g_prev = AddVectoredExceptionHandler(1, exception_filter); - } -} - -static void -backtrace_unregister(void) -{ - if (g_output) { - free(g_output); - RemoveVectoredExceptionHandler(g_prev); - g_prev = NULL; - g_output = NULL; - } -} - -BOOL WINAPI -DllMain(HINSTANCE hinstDLL ATTRIBUTE((unused)), DWORD dwReason, LPVOID lpvReserved ATTRIBUTE((unused))) -{ - switch (dwReason) { - case DLL_PROCESS_ATTACH: - backtrace_register(); - break; - case DLL_PROCESS_DETACH: - backtrace_unregister(); - break; - } - return TRUE; -} - - -/* cut dependence on libintl... libbfd needs this */ -char *libintl_dgettext (const char *domain_name ATTRIBUTE((unused)), const char *msgid ATTRIBUTE((unused))) -{ - static char buf[1024] = "XXX placeholder XXX"; - return buf; -} - -int __printf__ ( const char * format, ... ); -int libintl_fprintf ( FILE * stream, const char * format, ... ); -int libintl_sprintf ( char * str, const char * format, ... ); -int libintl_snprintf ( char *buffer, int buf_size, const char *format, ... ); -int libintl_vprintf ( const char * format, va_list arg ); -int libintl_vfprintf ( FILE * stream, const char * format, va_list arg ); -int libintl_vsprintf ( char * str, const char * format, va_list arg ); - -int __printf__ ( const char * format, ... ) -{ - int value; - va_list arg; - va_start(arg, format); - value = vprintf ( format, arg ); - va_end(arg); - return value; -} - -int libintl_fprintf ( FILE * stream, const char * format, ... ) -{ - int value; - va_list arg; - va_start(arg, format); - value = vfprintf ( stream, format, arg ); - va_end(arg); - return value; -} -int libintl_sprintf ( char * str, const char * format, ... ) -{ - int value; - va_list arg; - va_start(arg, format); - value = vsprintf ( str, format, arg ); - va_end(arg); - return value; -} -int libintl_snprintf ( char *buffer, int buf_size, const char *format, ... ) -{ - int value; - va_list arg; - va_start(arg, format); - value = vsnprintf ( buffer, buf_size, format, arg ); - va_end(arg); - return value; -} -int libintl_vprintf ( const char * format, va_list arg ) -{ - return vprintf ( format, arg ); -} -int libintl_vfprintf ( FILE * stream, const char * format, va_list arg ) -{ - return vfprintf ( stream, format, arg ); -} -int libintl_vsprintf ( char * str, const char * format, va_list arg ) -{ - return vsprintf ( str, format, arg ); -} - -/* cut dependence on zlib... libbfd needs this */ - -int compress (unsigned char *dest ATTRIBUTE((unused)), unsigned long destLen ATTRIBUTE((unused)), const unsigned char source ATTRIBUTE((unused)), unsigned long sourceLen ATTRIBUTE((unused))) -{ - return 0; -} -unsigned long compressBound (unsigned long sourceLen) -{ - return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + (sourceLen >> 25) + 13; -} -int inflateEnd(void *strm ATTRIBUTE((unused))) -{ - return 0; -} -int inflateInit_(void *strm ATTRIBUTE((unused)), const char *version ATTRIBUTE((unused)), int stream_size ATTRIBUTE((unused))) -{ - return 0; -} -int inflateReset(void *strm ATTRIBUTE((unused))) -{ - return 0; -} -int inflate(void *strm ATTRIBUTE((unused)), int flush ATTRIBUTE((unused))) -{ - return 0; -} diff --git a/bin/windows/vpx/src/compat-to-msvc/Makefile b/bin/windows/vpx/src/compat-to-msvc/Makefile deleted file mode 100644 index 7c5f3760de4..00000000000 --- a/bin/windows/vpx/src/compat-to-msvc/Makefile +++ /dev/null @@ -1,22 +0,0 @@ - -o=o - -NAME:=libcompat-to-msvc - - -%.$o: %.c - gcc -Wall -Wextra -O3 -c $< -o $@ - -%.$o: %.S - gcc -c $< -o $@ - -OBJS=dll_math.$o io_math.$o dll_dependency.$o vsnprintf.$o - -.INTERMEDIATE: $(OBJS) - -$(NAME).a: $(OBJS) - ar rc $@ $^ - ranlib $@ - -clean: - -rm -f *.a *.o diff --git a/bin/windows/vpx/src/compat-to-msvc/dll_dependency.S b/bin/windows/vpx/src/compat-to-msvc/dll_dependency.S deleted file mode 100644 index 31fd95c8223..00000000000 --- a/bin/windows/vpx/src/compat-to-msvc/dll_dependency.S +++ /dev/null @@ -1,88 +0,0 @@ -/* Implementation for gcc's internal stack-allocation routines. */ -.global ___chkstk -.global __alloca - -.global ___chkstk_ms -___chkstk_ms: -#ifdef _WIN64 - pushq %rax - pushq %rcx - cmpq $0x1000, %rax - leaq 24(%rsp), %rcx - jb .Lchkstk_ms_end -.Lchkstk_ms_loop: - subq $0x1000, %rcx - subq $0x1000, %rax - orq $0x0, (%rcx) - cmpq $0x1000, %rax - ja .Lchkstk_ms_loop -.Lchkstk_ms_end: - subq %rax, %rcx - orq $0x0, (%rcx) - popq %rcx - popq %rax - ret -#else - pushl %eax - pushl %ecx - cmpl $0x1000, %eax - leal 12(%esp), %ecx - jb chkstk_ms_end -chkstk_ms_loop: - subl $0x1000, %ecx - subl $0x1000, %eax - orl $0x0, (%ecx) - cmpl $0x1000, %eax - ja chkstk_ms_loop -chkstk_ms_end: - subl %eax, %ecx - orl $0x0, (%ecx) - popl %ecx - popl %eax - ret -#endif - -#ifdef _WIN64 -__alloca: - movq %rcx, %rax -.align 4 -___chkstk: - popq %r11 - movq %rsp, %r10 - cmpq $0x1000, %rax - jb .Lchkstk_end -.Lchkstk_loop: - subq $0x1000, %r10 - subq $0x1000, %rax - orl $0x0, (%r10) - cmpq $0x1000, %rax - ja .Lchkstk_loop -.Lchkstk_end: - subq %rax, %r10 - movq %rsp, %rax - orl $0x0, (%r10) - movq %r10, %rsp - pushq %r11 - ret -#else -___chkstk: -__alloca: - pushl %ecx - leal 8(%esp), %ecx - cmpl $0x1000, %eax /* > 4k ?*/ - jb chkstk_end -chkstk_loop: - subl $0x1000, %ecx - subl $0x1000, %eax - orl $0x0, (%ecx) - cmpl $0x1000, %eax - ja chkstk_loop -chkstk_end: - subl %eax, %ecx - orl $0x0, (%ecx) - movl %esp, %eax - movl %ecx, %esp - movl (%eax), %ecx - pushl 4(%eax) - ret -#endif diff --git a/bin/windows/vpx/src/compat-to-msvc/dll_math.c b/bin/windows/vpx/src/compat-to-msvc/dll_math.c deleted file mode 100644 index 966fb99d711..00000000000 --- a/bin/windows/vpx/src/compat-to-msvc/dll_math.c +++ /dev/null @@ -1,572 +0,0 @@ -/*- - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This software was developed by the Computer Systems Engineering group - * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and - * contributed to Berkeley. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. 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. - * 4. Neither the name of the University 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef _LIBKERN_QUAD_H_ -#define _LIBKERN_QUAD_H_ - -/* - * Quad arithmetic. - * - * This library makes the following assumptions: - * - * - The type long long (aka quad_t) exists. - * - * - A quad variable is exactly twice as long as `long'. - * - * - The machine's arithmetic is two's complement. - * - * This library can provide 128-bit arithmetic on a machine with 128-bit - * quads and 64-bit longs, for instance, or 96-bit arithmetic on machines - * with 48-bit longs. - */ -/* -#include -#include -#include -#include -*/ - -#include -typedef long long quad_t; -typedef unsigned long long u_quad_t; -typedef unsigned long u_long; -#ifndef CHAR_BIT -# define CHAR_BIT __CHAR_BIT__ -#endif - -/* - * Define the order of 32-bit words in 64-bit words. - * For little endian only. - */ -#define _QUAD_HIGHWORD 1 -#define _QUAD_LOWWORD 0 - -/* - * Depending on the desired operation, we view a `long long' (aka quad_t) in - * one or more of the following formats. - */ -union uu { - quad_t q; /* as a (signed) quad */ - quad_t uq; /* as an unsigned quad */ - long sl[2]; /* as two signed longs */ - u_long ul[2]; /* as two unsigned longs */ -}; - -/* - * Define high and low longwords. - */ -#define H _QUAD_HIGHWORD -#define L _QUAD_LOWWORD - -/* - * Total number of bits in a quad_t and in the pieces that make it up. - * These are used for shifting, and also below for halfword extraction - * and assembly. - */ -#define QUAD_BITS (sizeof(quad_t) * CHAR_BIT) -#define LONG_BITS (sizeof(long) * CHAR_BIT) -#define HALF_BITS (sizeof(long) * CHAR_BIT / 2) - -/* - * Extract high and low shortwords from longword, and move low shortword of - * longword to upper half of long, i.e., produce the upper longword of - * ((quad_t)(x) << (number_of_bits_in_long/2)). (`x' must actually be u_long.) - * - * These are used in the multiply code, to split a longword into upper - * and lower halves, and to reassemble a product as a quad_t, shifted left - * (sizeof(long)*CHAR_BIT/2). - */ -#define HHALF(x) ((x) >> HALF_BITS) -#define LHALF(x) ((x) & ((1 << HALF_BITS) - 1)) -#define LHUP(x) ((x) << HALF_BITS) - -typedef unsigned int qshift_t; - -quad_t __ashldi3(quad_t, qshift_t); -quad_t __ashrdi3(quad_t, qshift_t); -int __cmpdi2(quad_t a, quad_t b); -quad_t __divdi3(quad_t a, quad_t b); -quad_t __lshrdi3(quad_t, qshift_t); -quad_t __moddi3(quad_t a, quad_t b); -u_quad_t __qdivrem(u_quad_t u, u_quad_t v, u_quad_t *rem); -u_quad_t __udivdi3(u_quad_t a, u_quad_t b); -u_quad_t __umoddi3(u_quad_t a, u_quad_t b); -int __ucmpdi2(u_quad_t a, u_quad_t b); - -#endif /* !_LIBKERN_QUAD_H_ */ - -#if defined (_X86_) && !defined (__x86_64__) -/* - * Shift a (signed) quad value left (arithmetic shift left). - * This is the same as logical shift left! - */ -quad_t -__ashldi3(a, shift) - quad_t a; - qshift_t shift; -{ - union uu aa; - - aa.q = a; - if (shift >= LONG_BITS) { - aa.ul[H] = shift >= QUAD_BITS ? 0 : - aa.ul[L] << (shift - LONG_BITS); - aa.ul[L] = 0; - } else if (shift > 0) { - aa.ul[H] = (aa.ul[H] << shift) | - (aa.ul[L] >> (LONG_BITS - shift)); - aa.ul[L] <<= shift; - } - return (aa.q); -} - -/* - * Shift a (signed) quad value right (arithmetic shift right). - */ -quad_t -__ashrdi3(a, shift) - quad_t a; - qshift_t shift; -{ - union uu aa; - - aa.q = a; - if (shift >= LONG_BITS) { - long s; - - /* - * Smear bits rightward using the machine's right-shift - * method, whether that is sign extension or zero fill, - * to get the `sign word' s. Note that shifting by - * LONG_BITS is undefined, so we shift (LONG_BITS-1), - * then 1 more, to get our answer. - */ - s = (aa.sl[H] >> (LONG_BITS - 1)) >> 1; - aa.ul[L] = shift >= QUAD_BITS ? s : - aa.sl[H] >> (shift - LONG_BITS); - aa.ul[H] = s; - } else if (shift > 0) { - aa.ul[L] = (aa.ul[L] >> shift) | - (aa.ul[H] << (LONG_BITS - shift)); - aa.sl[H] >>= shift; - } - return (aa.q); -} - -/* - * Return 0, 1, or 2 as a <, =, > b respectively. - * Both a and b are considered signed---which means only the high word is - * signed. - */ -int -__cmpdi2(a, b) - quad_t a, b; -{ - union uu aa, bb; - - aa.q = a; - bb.q = b; - return (aa.sl[H] < bb.sl[H] ? 0 : aa.sl[H] > bb.sl[H] ? 2 : - aa.ul[L] < bb.ul[L] ? 0 : aa.ul[L] > bb.ul[L] ? 2 : 1); -} - -/* - * Divide two signed quads. - * ??? if -1/2 should produce -1 on this machine, this code is wrong - */ -quad_t -__divdi3(a, b) - quad_t a, b; -{ - u_quad_t ua, ub, uq; - int neg; - - if (a < 0) - ua = -(u_quad_t)a, neg = 1; - else - ua = a, neg = 0; - if (b < 0) - ub = -(u_quad_t)b, neg ^= 1; - else - ub = b; - uq = __qdivrem(ua, ub, (u_quad_t *)0); - return (neg ? -uq : uq); -} - -/* - * Shift an (unsigned) quad value right (logical shift right). - */ -quad_t -__lshrdi3(a, shift) - quad_t a; - qshift_t shift; -{ - union uu aa; - - aa.q = a; - if (shift >= LONG_BITS) { - aa.ul[L] = shift >= QUAD_BITS ? 0 : - aa.ul[H] >> (shift - LONG_BITS); - aa.ul[H] = 0; - } else if (shift > 0) { - aa.ul[L] = (aa.ul[L] >> shift) | - (aa.ul[H] << (LONG_BITS - shift)); - aa.ul[H] >>= shift; - } - return (aa.q); -} - -/* - * Return remainder after dividing two signed quads. - * - * XXX - * If -1/2 should produce -1 on this machine, this code is wrong. - */ -quad_t -__moddi3(a, b) - quad_t a, b; -{ - u_quad_t ua, ub, ur; - int neg; - - if (a < 0) - ua = -(u_quad_t)a, neg = 1; - else - ua = a, neg = 0; - if (b < 0) - ub = -(u_quad_t)b; - else - ub = b; - (void)__qdivrem(ua, ub, &ur); - return (neg ? -ur : ur); -} - - -/* - * Multiprecision divide. This algorithm is from Knuth vol. 2 (2nd ed), - * section 4.3.1, pp. 257--259. - */ - -#define B (1 << HALF_BITS) /* digit base */ - -/* Combine two `digits' to make a single two-digit number. */ -#define COMBINE(a, b) (((u_long)(a) << HALF_BITS) | (b)) - -/* select a type for digits in base B: use unsigned short if they fit */ -#if ULONG_MAX == 0xffffffff && USHRT_MAX >= 0xffff -typedef unsigned short digit; -#else -typedef u_long digit; -#endif - -/* - * Shift p[0]..p[len] left `sh' bits, ignoring any bits that - * `fall out' the left (there never will be any such anyway). - * We may assume len >= 0. NOTE THAT THIS WRITES len+1 DIGITS. - */ -static void -__shl(register digit *p, register int len, register int sh) -{ - register int i; - - for (i = 0; i < len; i++) - p[i] = LHALF(p[i] << sh) | (p[i + 1] >> (HALF_BITS - sh)); - p[i] = LHALF(p[i] << sh); -} - -/* - * __qdivrem(u, v, rem) returns u/v and, optionally, sets *rem to u%v. - * - * We do this in base 2-sup-HALF_BITS, so that all intermediate products - * fit within u_long. As a consequence, the maximum length dividend and - * divisor are 4 `digits' in this base (they are shorter if they have - * leading zeros). - */ -u_quad_t -__qdivrem(uq, vq, arq) - u_quad_t uq, vq, *arq; -{ - union uu tmp; - digit *u, *v, *q; - register digit v1, v2; - u_long qhat, rhat, t; - int m, n, d, j, i; - digit uspace[5], vspace[5], qspace[5]; - - /* - * Take care of special cases: divide by zero, and u < v. - */ - if (vq == 0) { - /* divide by zero. */ - static volatile const unsigned int zero = 0; - - tmp.ul[H] = tmp.ul[L] = 1 / zero; - if (arq) - *arq = uq; - return (tmp.q); - } - if (uq < vq) { - if (arq) - *arq = uq; - return (0); - } - u = &uspace[0]; - v = &vspace[0]; - q = &qspace[0]; - - /* - * Break dividend and divisor into digits in base B, then - * count leading zeros to determine m and n. When done, we - * will have: - * u = (u[1]u[2]...u[m+n]) sub B - * v = (v[1]v[2]...v[n]) sub B - * v[1] != 0 - * 1 < n <= 4 (if n = 1, we use a different division algorithm) - * m >= 0 (otherwise u < v, which we already checked) - * m + n = 4 - * and thus - * m = 4 - n <= 2 - */ - tmp.uq = uq; - u[0] = 0; - u[1] = HHALF(tmp.ul[H]); - u[2] = LHALF(tmp.ul[H]); - u[3] = HHALF(tmp.ul[L]); - u[4] = LHALF(tmp.ul[L]); - tmp.uq = vq; - v[1] = HHALF(tmp.ul[H]); - v[2] = LHALF(tmp.ul[H]); - v[3] = HHALF(tmp.ul[L]); - v[4] = LHALF(tmp.ul[L]); - for (n = 4; v[1] == 0; v++) { - if (--n == 1) { - u_long rbj; /* r*B+u[j] (not root boy jim) */ - digit q1, q2, q3, q4; - - /* - * Change of plan, per exercise 16. - * r = 0; - * for j = 1..4: - * q[j] = floor((r*B + u[j]) / v), - * r = (r*B + u[j]) % v; - * We unroll this completely here. - */ - t = v[2]; /* nonzero, by definition */ - q1 = u[1] / t; - rbj = COMBINE(u[1] % t, u[2]); - q2 = rbj / t; - rbj = COMBINE(rbj % t, u[3]); - q3 = rbj / t; - rbj = COMBINE(rbj % t, u[4]); - q4 = rbj / t; - if (arq) - *arq = rbj % t; - tmp.ul[H] = COMBINE(q1, q2); - tmp.ul[L] = COMBINE(q3, q4); - return (tmp.q); - } - } - - /* - * By adjusting q once we determine m, we can guarantee that - * there is a complete four-digit quotient at &qspace[1] when - * we finally stop. - */ - for (m = 4 - n; u[1] == 0; u++) - m--; - for (i = 4 - m; --i >= 0;) - q[i] = 0; - q += 4 - m; - - /* - * Here we run Program D, translated from MIX to C and acquiring - * a few minor changes. - * - * D1: choose multiplier 1 << d to ensure v[1] >= B/2. - */ - d = 0; - for (t = v[1]; t < B / 2; t <<= 1) - d++; - if (d > 0) { - __shl(&u[0], m + n, d); /* u <<= d */ - __shl(&v[1], n - 1, d); /* v <<= d */ - } - /* - * D2: j = 0. - */ - j = 0; - v1 = v[1]; /* for D3 -- note that v[1..n] are constant */ - v2 = v[2]; /* for D3 */ - do { - register digit uj0, uj1, uj2; - - /* - * D3: Calculate qhat (\^q, in TeX notation). - * Let qhat = min((u[j]*B + u[j+1])/v[1], B-1), and - * let rhat = (u[j]*B + u[j+1]) mod v[1]. - * While rhat < B and v[2]*qhat > rhat*B+u[j+2], - * decrement qhat and increase rhat correspondingly. - * Note that if rhat >= B, v[2]*qhat < rhat*B. - */ - uj0 = u[j + 0]; /* for D3 only -- note that u[j+...] change */ - uj1 = u[j + 1]; /* for D3 only */ - uj2 = u[j + 2]; /* for D3 only */ - if (uj0 == v1) { - qhat = B; - rhat = uj1; - goto qhat_too_big; - } else { - u_long nn = COMBINE(uj0, uj1); - qhat = nn / v1; - rhat = nn % v1; - } - while (v2 * qhat > COMBINE(rhat, uj2)) { - qhat_too_big: - qhat--; - if ((rhat += v1) >= B) - break; - } - /* - * D4: Multiply and subtract. - * The variable `t' holds any borrows across the loop. - * We split this up so that we do not require v[0] = 0, - * and to eliminate a final special case. - */ - for (t = 0, i = n; i > 0; i--) { - t = u[i + j] - v[i] * qhat - t; - u[i + j] = LHALF(t); - t = (B - HHALF(t)) & (B - 1); - } - t = u[j] - t; - u[j] = LHALF(t); - /* - * D5: test remainder. - * There is a borrow if and only if HHALF(t) is nonzero; - * in that (rare) case, qhat was too large (by exactly 1). - * Fix it by adding v[1..n] to u[j..j+n]. - */ - if (HHALF(t)) { - qhat--; - for (t = 0, i = n; i > 0; i--) { /* D6: add back. */ - t += u[i + j] + v[i]; - u[i + j] = LHALF(t); - t = HHALF(t); - } - u[j] = LHALF(u[j] + t); - } - q[j] = qhat; - } while (++j <= m); /* D7: loop on j. */ - - /* - * If caller wants the remainder, we have to calculate it as - * u[m..m+n] >> d (this is at most n digits and thus fits in - * u[m+1..m+n], but we may need more source digits). - */ - if (arq) { - if (d) { - for (i = m + n; i > m; --i) - u[i] = (u[i] >> d) | - LHALF(u[i - 1] << (HALF_BITS - d)); - u[i] = 0; - } - tmp.ul[H] = COMBINE(uspace[1], uspace[2]); - tmp.ul[L] = COMBINE(uspace[3], uspace[4]); - *arq = tmp.q; - } - - tmp.ul[H] = COMBINE(qspace[1], qspace[2]); - tmp.ul[L] = COMBINE(qspace[3], qspace[4]); - return (tmp.q); -} - -/* - * Return 0, 1, or 2 as a <, =, > b respectively. - * Neither a nor b are considered signed. - */ -int -__ucmpdi2(a, b) - u_quad_t a, b; -{ - union uu aa, bb; - - aa.uq = a; - bb.uq = b; - return (aa.ul[H] < bb.ul[H] ? 0 : aa.ul[H] > bb.ul[H] ? 2 : - aa.ul[L] < bb.ul[L] ? 0 : aa.ul[L] > bb.ul[L] ? 2 : 1); -} - -/* - * Divide two unsigned quads. - */ -u_quad_t -__udivdi3(a, b) - u_quad_t a, b; -{ - - return (__qdivrem(a, b, (u_quad_t *)0)); -} - -/* - * Return remainder after dividing two unsigned quads. - */ -u_quad_t -__umoddi3(a, b) - u_quad_t a, b; -{ - u_quad_t r; - - (void)__qdivrem(a, b, &r); - return (r); -} - -/* - * Divide two unsigned quads. - * This function is new in GCC 7. - */ -u_quad_t -__udivmoddi4(a, b, rem) - u_quad_t a, b, *rem; -{ - u_quad_t ua, ub, uq, ur; - - ua = a; - ub = b; - uq = __qdivrem(ua, ub, &ur); - if (rem) - *rem = ur; - return uq; -} -#else -static int __attribute__((unused)) dummy; -#endif /* defined (_X86_) && !defined (__x86_64__) */ - diff --git a/bin/windows/vpx/src/compat-to-msvc/io_math.c b/bin/windows/vpx/src/compat-to-msvc/io_math.c deleted file mode 100644 index 39d5a8e3943..00000000000 --- a/bin/windows/vpx/src/compat-to-msvc/io_math.c +++ /dev/null @@ -1,39 +0,0 @@ -// Some libraries expect these functions, for which Visual Studio (pre-2013) falls down on the job. - -#include -#include - -#ifndef _MSC_VER -# include -int64_t _ftelli64( - FILE *stream -); -int _fseeki64( - FILE *stream, - int64_t offset, - int origin -); -#endif - -int fseeko(FILE *fp, off_t offset, int whence) -{ - return _fseeki64(fp, (int64_t)offset, whence); -} -int fseeko64(FILE *fp, off64_t offset, int whence) -{ - return _fseeki64(fp, (int64_t)offset, whence); -} - -off_t ftello(FILE *stream) -{ - return (off_t)_ftelli64(stream); -} -off64_t ftello64(FILE *stream) -{ - return (off64_t)_ftelli64(stream); -} - -long lround(double d) -{ - return (long)(d > 0 ? d + 0.5 : ceil(d - 0.5)); -} diff --git a/bin/windows/vpx/src/compat-to-msvc/vsnprintf.c b/bin/windows/vpx/src/compat-to-msvc/vsnprintf.c deleted file mode 100644 index 15de014c4ac..00000000000 --- a/bin/windows/vpx/src/compat-to-msvc/vsnprintf.c +++ /dev/null @@ -1,19 +0,0 @@ -/** - * This file has no copyright assigned and is placed in the Public Domain. - * This file is part of the mingw-w64 runtime package. - * No warranty is given; refer to the file DISCLAIMER.PD within this package. - */ -#define __CRT__NO_INLINE -#include -#include - -extern int __cdecl _vsnprintf(char * __restrict__, size_t, const char * __restrict__, va_list); - -int __cdecl __ms_vsnprintf (char * __restrict__ s, size_t n, const char * __restrict__ format, va_list arg) -{ - return _vsnprintf(s, n, format, arg); -} -int __cdecl __mingw_vsnprintf (char * __restrict__ s, size_t n, const char * __restrict__ format, va_list arg) -{ - return _vsnprintf(s, n, format, arg); -} diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 636135d1638..ba17e090404 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -412,7 +412,7 @@ if( MSVC AND NOT VPX_FOUND ) # Use prebuilt library set( VPX_ROOT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../bin/Windows/vpx" ) set( VPX_INCLUDE_DIR ${VPX_ROOT_PATH}/include ) - set( VPX_LIBRARIES libvpx libcompat-to-msvc ) + set( VPX_LIBRARIES libvpx ) if( ARM64 ) link_directories( ${VPX_ROOT_PATH}/lib/arm64 ) elseif( X64 )