Hello,

Le vendredi 21 octobre 2011 02:11:32 Jiggy Bau, vous avez écrit :
> Thanks for supplying the patch. I managed to compile it after some trouble
> with a missing libavcodec. I then ran it with '-vv' and '--vout xv' args.
> Output is attached. Hopefully you can make some sense of it.

Not much. VLC does not find any known XVideo picture formats nor any unknown 
ones. Normally, that would mean the adaptors don't provide any format at all.

This new patch might prove more helpful. But it smells like either your XVideo 
driver is broken, or libxcb-xv0 is.

-- 
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis
diff --git a/modules/video_output/xcb/xvideo.c b/modules/video_output/xcb/xvideo.c
index 1f3813f..b2b8df8 100644
--- a/modules/video_output/xcb/xvideo.c
+++ b/modules/video_output/xcb/xvideo.c
@@ -228,6 +228,7 @@ static vlc_fourcc_t ParseFormat (vout_display_t *vd,
         msg_Warn (vd, " order: %.32s", f->vcomp_order);
         break;
     }
+    msg_Dbg (vd, "skipped unsupported format (type %"PRIu8")", f->type);
     return 0;
 }
 
@@ -246,12 +247,18 @@ FindFormat (vout_display_t *vd,
     f = xcb_xv_list_image_formats_format (list);
 #else
     f = (xcb_xv_image_format_info_t *) (list + 1);
+    msg_Warn (vd, "using very old XCB version");
 #endif
     end = f + xcb_xv_list_image_formats_format_length (list);
+    msg_Dbg (vd, "looking for %4.4s among %tu formats", &chroma, end - f);
     for (; f < end; f++)
     {
-        if (chroma != ParseFormat (vd, f))
+        vlc_fourcc_t fourcc = ParseFormat (vd, f);
+        if (chroma != fourcc)
+        {
+            msg_Dbg (vd, "got wrong format %4.4s", &fourcc);
             continue;
+        }
 
         /* VLC pads scanline to 16 pixels internally */
         unsigned width = fmt->i_width;
@@ -261,7 +268,10 @@ FindFormat (vout_display_t *vd,
             xcb_xv_query_image_attributes (conn, port, f->id,
                                            width, height), NULL);
         if (i == NULL)
+        {
+            msg_Err (vd, "cannot query image attributes");
             continue;
+        }
 
         if (i->width != width || i->height != height)
         {
@@ -287,6 +297,7 @@ FindFormat (vout_display_t *vd,
         *pa = i;
         return f;
     }
+    msg_Dbg (vd, "format %4.4s not found", &chroma);
     return NULL;
 }
 
@@ -337,7 +348,10 @@ static int Open (vlc_object_t *obj)
         xcb_xv_query_adaptors_reply (conn,
             xcb_xv_query_adaptors (conn, p_sys->embed->handle.xid), NULL);
     if (adaptors == NULL)
+    {
+        msg_Err (vd, "cannot query adaptors");
         goto error;
+    }
 
     int forced_adaptor = var_CreateGetInteger (obj, "xvideo-adaptor");
 
@@ -351,23 +365,33 @@ static int Open (vlc_object_t *obj)
          xcb_xv_adaptor_info_next (&it))
     {
         const xcb_xv_adaptor_info_t *a = it.data;
-        char *name;
+        char *name = strndup (xcb_xv_adaptor_info_name (a), a->name_size);
 
+        msg_Dbg (vd, "checking adaptor %s", name);
+        free (name);
         if (forced_adaptor != -1 && forced_adaptor != 0)
         {
+            msg_Dbg (vd, "skipped unselected adaptor (%d to go)",
+                     forced_adaptor);
             forced_adaptor--;
             continue;
         }
 
         if (!(a->type & XCB_XV_TYPE_INPUT_MASK)
          || !(a->type & XCB_XV_TYPE_IMAGE_MASK))
+        {
+            msg_Err (vd, "skipped output-only or video-only adaptor");
             continue;
+        }
 
         xcb_xv_list_image_formats_reply_t *r =
             xcb_xv_list_image_formats_reply (conn,
                 xcb_xv_list_image_formats (conn, a->base_id), NULL);
         if (r == NULL)
+        {
+            msg_Err (vd, "cannot query image formats");
             continue;
+        }
 
         /* Look for an image format */
         const xcb_xv_image_format_info_t *xfmt = NULL;
@@ -418,7 +442,10 @@ static int Open (vlc_object_t *obj)
         }
         free (r);
         if (xfmt == NULL) /* No acceptable image formats */
+        {
+            msg_Err (vd, "cannot use any image format");
             continue;
+        }
 
         /* Grab a port */
         for (unsigned i = 0; i < a->num_ports; i++)
@@ -438,6 +465,7 @@ static int Open (vlc_object_t *obj)
              msg_Dbg (vd, "cannot grab port %"PRIu32": Xv error %"PRIu8, port,
                       result);
         }
+        msg_Err (vd, "cannot grab any port");
         continue; /* No usable port */
 
     grabbed_port:

Reply via email to