]> git.sesse.net Git - vlc/blobdiff - modules/video_output/xcb/xvideo.c
Merge branch 1.0-bugfix into master
[vlc] / modules / video_output / xcb / xvideo.c
index 5b32ad14197c341ff459c191970cab1f6656f132..38d8862d66c6c8d858af941ad737b5fef4d3d98c 100644 (file)
@@ -254,21 +254,21 @@ static vlc_fourcc_t ParseFormat (vout_thread_t *vout,
             {
               case 32:
                 if (f->depth == 24)
-                    return VLC_FOURCC ('R', 'V', '3', '2');
+                    return VLC_CODEC_RGB32;
                 break;
               case 24:
                 if (f->depth == 24)
-                    return VLC_FOURCC ('R', 'V', '2', '4');
+                    return VLC_CODEC_RGB24;
                 break;
               case 16:
                 if (f->depth == 16)
-                    return VLC_FOURCC ('R', 'V', '1', '6');
+                    return VLC_CODEC_RGB16;
                 if (f->depth == 15)
-                    return VLC_FOURCC ('R', 'V', '1', '5');
+                    return VLC_CODEC_RGB15;
                 break;
               case 8:
                 if (f->depth == 8)
-                    return VLC_FOURCC ('R', 'G', 'B', '2');
+                    return VLC_CODEC_RGB8;
                 break;
             }
             break;
@@ -293,15 +293,15 @@ static vlc_fourcc_t ParseFormat (vout_thread_t *vout,
             {
               /*untested: case 24:
                 if (f->vhorz_u_period == 1 && f->vvert_u_period == 1)
-                    return VLC_FOURCC ('I', '4', '4', '4');
+                    return VLC_CODEC_I444;
                 break;*/
               case 16:
                 if (f->vhorz_u_period == 2 && f->vvert_u_period == 1)
                 {
                     if (!strcmp ((const char *)f->vcomp_order, "YUYV"))
-                        return VLC_FOURCC ('Y', 'U', 'Y', '2');
+                        return VLC_CODEC_YUYV;
                     if (!strcmp ((const char *)f->vcomp_order, "UYVY"))
-                        return VLC_FOURCC ('U', 'Y', 'V', 'Y');
+                        return VLC_CODEC_UYVY;
                 }
                 break;
             }
@@ -313,9 +313,9 @@ static vlc_fourcc_t ParseFormat (vout_thread_t *vout,
                 if (f->vhorz_u_period == 2 && f->vvert_u_period == 2)
                 {
                     if (!strcmp ((const char *)f->vcomp_order, "YVU"))
-                        return VLC_FOURCC ('Y', 'V', '1', '2');
+                        return VLC_CODEC_YV12;
                     if (!strcmp ((const char *)f->vcomp_order, "YUV"))
-                        return VLC_FOURCC ('I', '4', '2', '0');
+                        return VLC_CODEC_I420;
                 }
             }
             break;
@@ -345,7 +345,11 @@ FindFormat (vout_thread_t *vout, vlc_fourcc_t chroma, xcb_xv_port_t port,
     xcb_connection_t *conn = vout->p_sys->conn;
     const xcb_xv_image_format_info_t *f, *end;
 
+#ifndef XCB_XV_OLD
     f = xcb_xv_list_image_formats_format (list);
+#else
+    f = (xcb_xv_image_format_info_t *) (list + 1);
+#endif
     end = f + xcb_xv_list_image_formats_format_length (list);
     for (; f < end; f++)
     {
@@ -406,9 +410,9 @@ static int Init (vout_thread_t *vout)
         /* Video chroma in preference order */
         const vlc_fourcc_t chromas[] = {
             vout->fmt_in.i_chroma,
-            VLC_FOURCC ('Y', 'U', 'Y', '2'),
-            VLC_FOURCC ('R', 'V', '2', '4'),
-            VLC_FOURCC ('R', 'V', '1', '5'),
+            VLC_CODEC_YUYV,
+            VLC_CODEC_RGB24,
+            VLC_CODEC_RGB15,
         };
         for (size_t i = 0; i < sizeof (chromas) / sizeof (chromas[0]); i++)
         {
@@ -461,9 +465,9 @@ found_adaptor:
         if (pic->i_status != FREE_PICTURE)
             continue;
 
-        vout_InitPicture (vout, pic, vout->output.i_chroma,
-                          att->width, att->height,
-                          vout->fmt_in.i_aspect);
+        picture_Setup (pic, vout->output.i_chroma,
+                       att->width, att->height,
+                       vout->fmt_in.i_aspect);
         if (PictureAlloc (vout, pic, att->data_size,
                           p_sys->shm ? p_sys->conn : NULL))
             break;