Go to the documentation of this file.
25 #ifndef _GPMF_COMMON_H
26 #define _GPMF_COMMON_H
47 #define GPMF_ERR uint32_t
81 #define MAKEID(a,b,c,d) (((d&0xff)<<24)|((c&0xff)<<16)|((b&0xff)<<8)|(a&0xff))
82 #define STR2FOURCC(s) ((s[0]<<0)|(s[1]<<8)|(s[2]<<16)|(s[3]<<24))
84 #define BYTESWAP64(a) (((a&0xff)<<56)|((a&0xff00)<<40)|((a&0xff0000)<<24)|((a&0xff000000)<<8) | ((a>>56)&0xff)|((a>>40)&0xff00)|((a>>24)&0xff0000)|((a>>8)&0xff000000) )
85 #define BYTESWAP32(a) (((a&0xff)<<24)|((a&0xff00)<<8)|((a>>8)&0xff00)|((a>>24)&0xff))
86 #define BYTESWAP16(a) ((((a)>>8)&0xff)|(((a)<<8)&0xff00))
87 #define BYTESWAP2x16(a) (((a>>8)&0xff)|((a<<8)&0xff00)|((a>>8)&0xff0000)|((a<<8)&0xff000000))
88 #define NOSWAP8(a) (a)
90 #define GPMF_SAMPLES(a) (((a>>24) & 0xff)|(((a>>16)&0xff)<<8))
91 #define GPMF_SAMPLE_SIZE(a) (((a)>>8)&0xff)
92 #define GPMF_SAMPLE_TYPE(a) (a&0xff)
93 #define GPMF_MAKE_TYPE_SIZE_COUNT(t,s,c) ((t)&0xff)|(((s)&0xff)<<8)|(((c)&0xff)<<24)|(((c)&0xff00)<<8)
94 #define GPMF_DATA_SIZE(a) ((GPMF_SAMPLE_SIZE(a)*GPMF_SAMPLES(a)+3)&~0x3)
95 #define GPMF_DATA_PACKEDSIZE(a) ((GPMF_SAMPLE_SIZE(a)*GPMF_SAMPLES(a)))
96 #define GPMF_VALID_FOURCC(a) (((((a>>24)&0xff)>='a'&&((a>>24)&0xff)<='z') || (((a>>24)&0xff)>='A'&&((a>>24)&0xff)<='Z') || (((a>>24)&0xff)>='0'&&((a>>24)&0xff)<='9') || (((a>>24)&0xff)==' ') ) && \
97 ( (((a>>16)&0xff)>='a'&&((a>>16)&0xff)<='z') || (((a>>16)&0xff)>='A'&&((a>>16)&0xff)<='Z') || (((a>>16)&0xff)>='0'&&((a>>16)&0xff)<='9') || (((a>>16)&0xff)==' ') ) && \
98 ( (((a>>8)&0xff)>='a'&&((a>>8)&0xff)<='z') || (((a>>8)&0xff)>='A'&&((a>>8)&0xff)<='Z') || (((a>>8)&0xff)>='0'&&((a>>8)&0xff)<='9') || (((a>>8)&0xff)==' ') ) && \
99 ( (((a>>0)&0xff)>='a'&&((a>>0)&0xff)<='z') || (((a>>0)&0xff)>='A'&&((a>>0)&0xff)<='Z') || (((a>>0)&0xff)>='0'&&((a>>0)&0xff)<='9') || (((a>>0)&0xff)==' ') ))
101 #define PRINTF_4CC(k) ((k) >> 0) & 0xff, ((k) >> 8) & 0xff, ((k) >> 16) & 0xff, ((k) >> 24) & 0xff
@ GPMF_TYPE_UTC_DATE_TIME
@ GPMF_ERROR_SCALE_NOT_SUPPORTED
@ GPMF_KEY_ORIENTATION_OUT
@ GPMF_TYPE_UNSIGNED_BYTE
@ GPMF_TYPE_UNSIGNED_SHORT
@ GPMF_KEY_EMPTY_PAYLOADS
@ GPMF_ERROR_UNKNOWN_TYPE
@ GPMF_KEY_ORIENTATION_IN
#define MAKEID(a, b, c, d)
@ GPMF_ERROR_TYPE_NOT_SUPPORTED
@ GPMF_TYPE_UNSIGNED_64BIT_INT
@ GPMF_ERROR_BAD_STRUCTURE
@ GPMF_TYPE_UNSIGNED_LONG
@ GPMF_TYPE_Q15_16_FIXED_POINT
@ GPMF_TYPE_SIGNED_64BIT_INT
@ GPMF_TYPE_Q31_32_FIXED_POINT