X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fvideo_output%2Fvout_pictures.h;h=518e6c5cf1fd505508dabff412b26fc656b6311a;hb=146dad54bff773b990752e44b92aa35f87cbc678;hp=a636aad4d8b8031403f19fc06e9d44d6911709aa;hpb=fe087a38282e93addb25fa9598393e40ea233b09;p=vlc diff --git a/src/video_output/vout_pictures.h b/src/video_output/vout_pictures.h index a636aad4d8..518e6c5cf1 100644 --- a/src/video_output/vout_pictures.h +++ b/src/video_output/vout_pictures.h @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ /***************************************************************************** @@ -44,6 +44,9 @@ /* Packed RGB 32bpp, usually 0x00ff0000, 0x0000ff00, 0x000000ff */ #define FOURCC_RV32 VLC_FOURCC('R','V','3','2') +/* Packed RGBA 32bpp, like RV32 with 0xff000000 used for alpha */ +#define FOURCC_RGBA VLC_FOURCC('R','G','B','A') + /* Planar YUV 4:2:0, Y:U:V */ #define FOURCC_I420 VLC_FOURCC('I','4','2','0') #define FOURCC_IYUV VLC_FOURCC('I','Y','U','V') @@ -96,3 +99,37 @@ /* Palettized YUV with palette element Y:U:V:A */ #define FOURCC_YUVP VLC_FOURCC('Y','U','V','P') + +/* Planar 8-bit grayscale */ +#define FOURCC_GREY VLC_FOURCC('G','R','E','Y') + +/* Alignment of critical dynamic data structure + * + * Not all platforms support memalign so we provide a vlc_memalign wrapper + * void *vlc_memalign( size_t align, size_t size, void **pp_orig ) + * *pp_orig is the pointer that has to be freed afterwards. + */ +static inline +void *vlc_memalign (void **pp, size_t align, size_t size) +{ +#if defined (HAVE_POSIX_MEMALIGN) + return posix_memalign (pp, align, size) ? NULL : *pp; +#elif defined (HAVE_MEMALIGN) + return *pp = memalign (align, size); +#else + unsigned char *ptr; + + if (align < 1) + return NULL; + + align--; + ptr = malloc (size + align); + if (ptr == NULL) + return NULL; + + *pp = ptr; + ptr += align; + return (void *)(((uintptr_t)ptr) & ~align); +#endif +} +