style: Format source code and support grouping client
This commit is contained in:
@@ -65,8 +65,8 @@ char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size);
|
||||
*/
|
||||
#define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_BASE64_H */
|
||||
|
||||
@@ -80,12 +80,12 @@ typedef struct name { \
|
||||
*/
|
||||
|
||||
FF_PAD_STRUCTURE(AVBPrint, 1024,
|
||||
char *str; /**< string so far */
|
||||
unsigned len; /**< length so far */
|
||||
unsigned size; /**< allocated memory */
|
||||
unsigned size_max; /**< maximum allocated memory */
|
||||
char reserved_internal_buffer[1];
|
||||
)
|
||||
char *str; /**< string so far */
|
||||
unsigned len; /**< length so far */
|
||||
unsigned size; /**< allocated memory */
|
||||
unsigned size_max; /**< maximum allocated memory */
|
||||
char reserved_internal_buffer[1];
|
||||
)
|
||||
|
||||
/**
|
||||
* Convenience macros for special values for av_bprint_init() size_max
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#define AV_CPU_FLAG_FORCE 0x80000000 /* force usage of selected flags (OR) */
|
||||
|
||||
/* lower 16 bits - CPU features */
|
||||
/* lower 16 bits - CPU features */
|
||||
#define AV_CPU_FLAG_MMX 0x0001 ///< standard MMX
|
||||
#define AV_CPU_FLAG_MMXEXT 0x0002 ///< SSE integer functions or AMD MMX ext
|
||||
#define AV_CPU_FLAG_MMX2 0x0002 ///< SSE integer functions or AMD MMX ext
|
||||
@@ -35,11 +35,11 @@
|
||||
#define AV_CPU_FLAG_SSE 0x0008 ///< SSE functions
|
||||
#define AV_CPU_FLAG_SSE2 0x0010 ///< PIV SSE2 functions
|
||||
#define AV_CPU_FLAG_SSE2SLOW 0x40000000 ///< SSE2 supported, but usually not faster
|
||||
///< than regular MMX/SSE (e.g. Core1)
|
||||
///< than regular MMX/SSE (e.g. Core1)
|
||||
#define AV_CPU_FLAG_3DNOWEXT 0x0020 ///< AMD 3DNowExt
|
||||
#define AV_CPU_FLAG_SSE3 0x0040 ///< Prescott SSE3 functions
|
||||
#define AV_CPU_FLAG_SSE3SLOW 0x20000000 ///< SSE3 supported, but usually not faster
|
||||
///< than regular MMX/SSE (e.g. Core1)
|
||||
///< than regular MMX/SSE (e.g. Core1)
|
||||
#define AV_CPU_FLAG_SSSE3 0x0080 ///< Conroe SSSE3 functions
|
||||
#define AV_CPU_FLAG_SSSE3SLOW 0x4000000 ///< SSSE3 supported, but usually not faster
|
||||
#define AV_CPU_FLAG_ATOM 0x10000000 ///< Atom processor, some SSSE3 instructions are slower
|
||||
|
||||
@@ -56,7 +56,7 @@ typedef enum {
|
||||
AV_CRC_24_IEEE,
|
||||
AV_CRC_8_EBU,
|
||||
AV_CRC_MAX, /*< Not part of public API! Do not use outside libavutil. */
|
||||
}AVCRCId;
|
||||
} AVCRCId;
|
||||
|
||||
/**
|
||||
* Initialize a CRC table.
|
||||
|
||||
@@ -159,7 +159,7 @@ AVEncryptionInfo *av_encryption_info_get_side_data(const uint8_t *side_data, siz
|
||||
* @return The new side-data pointer, or NULL.
|
||||
*/
|
||||
uint8_t *av_encryption_info_add_side_data(
|
||||
const AVEncryptionInfo *info, size_t *side_data_size);
|
||||
const AVEncryptionInfo *info, size_t *side_data_size);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -430,25 +430,25 @@ typedef struct AVFrame {
|
||||
AVFrameSideData **side_data;
|
||||
int nb_side_data;
|
||||
|
||||
/**
|
||||
* @defgroup lavu_frame_flags AV_FRAME_FLAGS
|
||||
* @ingroup lavu_frame
|
||||
* Flags describing additional frame properties.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* @defgroup lavu_frame_flags AV_FRAME_FLAGS
|
||||
* @ingroup lavu_frame
|
||||
* Flags describing additional frame properties.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* The frame data may be corrupted, e.g. due to decoding errors.
|
||||
*/
|
||||
/**
|
||||
* The frame data may be corrupted, e.g. due to decoding errors.
|
||||
*/
|
||||
#define AV_FRAME_FLAG_CORRUPT (1 << 0)
|
||||
/**
|
||||
* A flag to mark the frames which need to be decoded, but shouldn't be output.
|
||||
*/
|
||||
/**
|
||||
* A flag to mark the frames which need to be decoded, but shouldn't be output.
|
||||
*/
|
||||
#define AV_FRAME_FLAG_DISCARD (1 << 2)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Frame flags, a combination of @ref lavu_frame_flags
|
||||
@@ -831,8 +831,8 @@ AVFrameSideData *av_frame_new_side_data(AVFrame *frame,
|
||||
* the caller.
|
||||
*/
|
||||
AVFrameSideData *av_frame_new_side_data_from_buf(AVFrame *frame,
|
||||
enum AVFrameSideDataType type,
|
||||
AVBufferRef *buf);
|
||||
enum AVFrameSideDataType type,
|
||||
AVBufferRef *buf);
|
||||
|
||||
/**
|
||||
* @return a pointer to the side data of a given type on success, NULL if there
|
||||
|
||||
@@ -483,7 +483,7 @@ void *av_hwdevice_hwconfig_alloc(AVBufferRef *device_ctx);
|
||||
* on the device, or NULL if not available.
|
||||
*/
|
||||
AVHWFramesConstraints *av_hwdevice_get_hwframe_constraints(AVBufferRef *ref,
|
||||
const void *hwconfig);
|
||||
const void *hwconfig);
|
||||
|
||||
/**
|
||||
* Free an AVHWFrameConstraints structure.
|
||||
|
||||
@@ -217,9 +217,15 @@ typedef union {
|
||||
|
||||
#if defined(__GNUC__)
|
||||
|
||||
union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias;
|
||||
union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias;
|
||||
union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
|
||||
union unaligned_64 {
|
||||
uint64_t l;
|
||||
} __attribute__((packed)) av_alias;
|
||||
union unaligned_32 {
|
||||
uint32_t l;
|
||||
} __attribute__((packed)) av_alias;
|
||||
union unaligned_16 {
|
||||
uint16_t l;
|
||||
} __attribute__((packed)) av_alias;
|
||||
|
||||
# define AV_RN(s, p) (((const union unaligned_##s *) (p))->l)
|
||||
# define AV_WN(s, p, v) ((((union unaligned_##s *) (p))->l) = (v))
|
||||
|
||||
@@ -44,7 +44,8 @@ int av_lfg_init_from_data(AVLFG *c, const uint8_t *data, unsigned int length);
|
||||
* Please also consider a simple LCG like state= state*1664525+1013904223,
|
||||
* it may be good enough and faster for your specific use case.
|
||||
*/
|
||||
static inline unsigned int av_lfg_get(AVLFG *c){
|
||||
static inline unsigned int av_lfg_get(AVLFG *c)
|
||||
{
|
||||
c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63];
|
||||
return c->state[c->index++ & 63];
|
||||
}
|
||||
@@ -54,7 +55,8 @@ static inline unsigned int av_lfg_get(AVLFG *c){
|
||||
*
|
||||
* Please also consider av_lfg_get() above, it is faster.
|
||||
*/
|
||||
static inline unsigned int av_mlfg_get(AVLFG *c){
|
||||
static inline unsigned int av_mlfg_get(AVLFG *c)
|
||||
{
|
||||
unsigned int a= c->state[(c->index-55) & 63];
|
||||
unsigned int b= c->state[(c->index-24) & 63];
|
||||
return c->state[c->index++ & 63] = 2*a*b+a+b;
|
||||
|
||||
@@ -45,7 +45,7 @@ typedef enum {
|
||||
AV_CLASS_CATEGORY_DEVICE_OUTPUT,
|
||||
AV_CLASS_CATEGORY_DEVICE_INPUT,
|
||||
AV_CLASS_CATEGORY_NB ///< not part of ABI/API
|
||||
}AVClassCategory;
|
||||
} AVClassCategory;
|
||||
|
||||
#define AV_IS_INPUT_DEVICE(category) \
|
||||
(((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT) || \
|
||||
|
||||
@@ -101,25 +101,25 @@
|
||||
*/
|
||||
|
||||
#if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1110 || defined(__SUNPRO_C)
|
||||
#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
|
||||
#define DECLARE_ASM_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
|
||||
#define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v
|
||||
#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
|
||||
#define DECLARE_ASM_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
|
||||
#define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v
|
||||
#elif defined(__DJGPP__)
|
||||
#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (FFMIN(n, 16)))) v
|
||||
#define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v
|
||||
#define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v
|
||||
#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (FFMIN(n, 16)))) v
|
||||
#define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v
|
||||
#define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
|
||||
#define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (n))) v
|
||||
#define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v
|
||||
#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
|
||||
#define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (n))) v
|
||||
#define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v
|
||||
#elif defined(_MSC_VER)
|
||||
#define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v
|
||||
#define DECLARE_ASM_ALIGNED(n,t,v) __declspec(align(n)) t v
|
||||
#define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v
|
||||
#define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v
|
||||
#define DECLARE_ASM_ALIGNED(n,t,v) __declspec(align(n)) t v
|
||||
#define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v
|
||||
#else
|
||||
#define DECLARE_ALIGNED(n,t,v) t v
|
||||
#define DECLARE_ASM_ALIGNED(n,t,v) t v
|
||||
#define DECLARE_ASM_CONST(n,t,v) static const t v
|
||||
#define DECLARE_ALIGNED(n,t,v) t v
|
||||
#define DECLARE_ASM_ALIGNED(n,t,v) t v
|
||||
#define DECLARE_ASM_CONST(n,t,v) static const t v
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -143,9 +143,9 @@
|
||||
*/
|
||||
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1)
|
||||
#define av_malloc_attrib __attribute__((__malloc__))
|
||||
#define av_malloc_attrib __attribute__((__malloc__))
|
||||
#else
|
||||
#define av_malloc_attrib
|
||||
#define av_malloc_attrib
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -164,9 +164,9 @@
|
||||
*/
|
||||
|
||||
#if AV_GCC_VERSION_AT_LEAST(4,3)
|
||||
#define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__)))
|
||||
#define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__)))
|
||||
#else
|
||||
#define av_alloc_size(...)
|
||||
#define av_alloc_size(...)
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -218,7 +218,7 @@
|
||||
* before the file is actually opened.
|
||||
*/
|
||||
|
||||
enum AVOptionType{
|
||||
enum AVOptionType {
|
||||
AV_OPT_TYPE_FLAGS,
|
||||
AV_OPT_TYPE_INT,
|
||||
AV_OPT_TYPE_INT64,
|
||||
@@ -278,14 +278,14 @@ typedef struct AVOption {
|
||||
#define AV_OPT_FLAG_AUDIO_PARAM 8
|
||||
#define AV_OPT_FLAG_VIDEO_PARAM 16
|
||||
#define AV_OPT_FLAG_SUBTITLE_PARAM 32
|
||||
/**
|
||||
* The option is intended for exporting values to the caller.
|
||||
*/
|
||||
/**
|
||||
* The option is intended for exporting values to the caller.
|
||||
*/
|
||||
#define AV_OPT_FLAG_EXPORT 64
|
||||
/**
|
||||
* The option may not be set through the AVOptions API, only read.
|
||||
* This flag only makes sense when AV_OPT_FLAG_EXPORT is also set.
|
||||
*/
|
||||
/**
|
||||
* The option may not be set through the AVOptions API, only read.
|
||||
* This flag only makes sense when AV_OPT_FLAG_EXPORT is also set.
|
||||
*/
|
||||
#define AV_OPT_FLAG_READONLY 128
|
||||
#define AV_OPT_FLAG_BSF_PARAM (1<<8) ///< a generic parameter which can be set by the user for bit stream filtering
|
||||
#define AV_OPT_FLAG_FILTERING_PARAM (1<<16) ///< a generic parameter which can be set by the user for filtering
|
||||
|
||||
@@ -424,6 +424,6 @@ int av_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
|
||||
* (maximum loss for an invalid dst_pix_fmt).
|
||||
*/
|
||||
enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
|
||||
enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
|
||||
enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
|
||||
|
||||
#endif /* AVUTIL_PIXDESC_H */
|
||||
|
||||
@@ -47,6 +47,6 @@ typedef int (*av_pixelutils_sad_fn)(const uint8_t *src1, ptrdiff_t stride1,
|
||||
* invalid parameters)
|
||||
*/
|
||||
av_pixelutils_sad_fn av_pixelutils_get_sad_fn(int w_bits, int h_bits,
|
||||
int aligned, void *log_ctx);
|
||||
int aligned, void *log_ctx);
|
||||
|
||||
#endif /* AVUTIL_PIXELUTILS_H */
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
/**
|
||||
* Rational number (pair of numerator and denominator).
|
||||
*/
|
||||
typedef struct AVRational{
|
||||
typedef struct AVRational {
|
||||
int num; ///< Numerator
|
||||
int den; ///< Denominator
|
||||
} AVRational;
|
||||
@@ -86,7 +86,8 @@ static inline AVRational av_make_q(int num, int den)
|
||||
* - -1 if `a < b`
|
||||
* - `INT_MIN` if one of the values is of the form `0 / 0`
|
||||
*/
|
||||
static inline int av_cmp_q(AVRational a, AVRational b){
|
||||
static inline int av_cmp_q(AVRational a, AVRational b)
|
||||
{
|
||||
const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den;
|
||||
|
||||
if(tmp) return (int)((tmp ^ a.den ^ b.den)>>63)|1;
|
||||
@@ -101,7 +102,8 @@ static inline int av_cmp_q(AVRational a, AVRational b){
|
||||
* @return `a` in floating-point form
|
||||
* @see av_d2q()
|
||||
*/
|
||||
static inline double av_q2d(AVRational a){
|
||||
static inline double av_q2d(AVRational a)
|
||||
{
|
||||
return a.num / (double) a.den;
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ int av_thread_message_queue_recv(AVThreadMessageQueue *mq,
|
||||
* suspend its operation.
|
||||
*/
|
||||
void av_thread_message_queue_set_err_send(AVThreadMessageQueue *mq,
|
||||
int err);
|
||||
int err);
|
||||
|
||||
/**
|
||||
* Set the receiving error code.
|
||||
@@ -86,14 +86,14 @@ void av_thread_message_queue_set_err_send(AVThreadMessageQueue *mq,
|
||||
* to cause the receiving thread to stop or suspend its operation.
|
||||
*/
|
||||
void av_thread_message_queue_set_err_recv(AVThreadMessageQueue *mq,
|
||||
int err);
|
||||
int err);
|
||||
|
||||
/**
|
||||
* Set the optional free message callback function which will be called if an
|
||||
* operation is removing messages from the queue.
|
||||
*/
|
||||
void av_thread_message_queue_set_free_func(AVThreadMessageQueue *mq,
|
||||
void (*free_func)(void *msg));
|
||||
void (*free_func)(void *msg));
|
||||
|
||||
/**
|
||||
* Return the current number of messages in the queue.
|
||||
|
||||
Reference in New Issue
Block a user