]> git.sesse.net Git - vlc/blobdiff - src/video_output/vout_pictures.h
Preferences: don't show empty boxes ('zoom' box bug)
[vlc] / src / video_output / vout_pictures.h
index 1d95f75aa3ea27db1420d2b755c83008f731bbbf..cdae378d7e12be562b3d94fc8de98d9dbfdadcf9 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * vout_pictures.h : picture management definitions
  *****************************************************************************
- * Copyright (C) 2002 VideoLAN
- * $Id: vout_pictures.h,v 1.2 2002/07/31 20:56:53 sam Exp $
+ * Copyright (C) 2002-2004 the VideoLAN team
+ * $Id$
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -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.
  *****************************************************************************/
 
 /*****************************************************************************
 /* Packed RGB for 16, 24, 32bpp */
 #define FOURCC_BI_BITFIELDS 0x00000003
 
-/* Packed RGB 15bpp, 0x1f, 0x7e0, 0xf800 */
+/* Packed RGB 15bpp, usually 0x7c00, 0x03e0, 0x001f */
 #define FOURCC_RV15         VLC_FOURCC('R','V','1','5')
 
-/* Packed RGB 16bpp, 0x1f, 0x3e0, 0x7c00 */
+/* Packed RGB 16bpp, usually 0xf800, 0x07e0, 0x001f */
 #define FOURCC_RV16         VLC_FOURCC('R','V','1','6')
 
-/* Packed RGB 24bpp, 0xff, 0xff00, 0xff0000 */
+/* Packed RGB 24bpp, usually 0x00ff0000, 0x0000ff00, 0x000000ff */
 #define FOURCC_RV24         VLC_FOURCC('R','V','2','4')
 
-/* Packed RGB 32bpp, 0xff, 0xff00, 0xff0000 */
+/* 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')
+#define FOURCC_J420         VLC_FOURCC('J','4','2','0')
 
 /* Planar YUV 4:2:0, Y:V:U */
 #define FOURCC_YV12         VLC_FOURCC('Y','V','1','2')
 /* Packed YUV 2:1:1, Y:U:Y:V */
 #define FOURCC_Y211         VLC_FOURCC('Y','2','1','1')
 
+/* Planar YUV 4:1:1, Y:U:V */
+#define FOURCC_I411         VLC_FOURCC('I','4','1','1')
+
 /* Planar YUV 4:1:0, Y:U:V */
 #define FOURCC_I410         VLC_FOURCC('I','4','1','0')
+#define FOURCC_YVU9         VLC_FOURCC('Y','V','U','9')
 
 /* Planar Y, packed UV, from Matrox */
 #define FOURCC_YMGA         VLC_FOURCC('Y','M','G','A')
 
 /* Planar 4:2:2, Y:U:V */
 #define FOURCC_I422         VLC_FOURCC('I','4','2','2')
+#define FOURCC_J422         VLC_FOURCC('J','4','2','2')
 
 /* Planar 4:4:4, Y:U:V */
 #define FOURCC_I444         VLC_FOURCC('I','4','4','4')
+#define FOURCC_J444         VLC_FOURCC('J','4','4','4')
+
+/* Planar 4:4:4:4 Y:U:V:A */
+#define FOURCC_YUVA         VLC_FOURCC('Y','U','V','A')
+
+/* 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')
+#define FOURCC_Y800         VLC_FOURCC('Y','8','0','0')
+#define FOURCC_Y8           VLC_FOURCC('Y','8',' ',' ')
+
+/* 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
+}