1 /*****************************************************************************
2 * vout_pictures.h : picture management definitions
3 *****************************************************************************
4 * Copyright (C) 2002-2004 the VideoLAN team
7 * Authors: Samuel Hocevar <sam@zoy.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 /*****************************************************************************
25 * Fourcc definitions that we can handle internally
26 *****************************************************************************/
28 /* Alignment of critical dynamic data structure
30 * Not all platforms support memalign so we provide a vlc_memalign wrapper
31 * void *vlc_memalign( size_t align, size_t size, void **pp_orig )
32 * *pp_orig is the pointer that has to be freed afterwards.
35 void *vlc_memalign (void **pp
, size_t align
, size_t size
)
37 #if defined (HAVE_POSIX_MEMALIGN)
38 return posix_memalign (pp
, align
, size
) ? NULL
: *pp
;
39 #elif defined (HAVE_MEMALIGN)
40 return *pp
= memalign (align
, size
);
48 ptr
= malloc (size
+ align
);
54 return (void *)(((uintptr_t)ptr
) & ~align
);