wayland: allow de-interlaced picture buffers.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Mon, 6 Aug 2012 08:24:33 +0000 (10:24 +0200)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Mon, 6 Aug 2012 16:56:20 +0000 (18:56 +0200)
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
test/common/va_display_wayland.c
test/putsurface/putsurface_wayland.c
va/wayland/va_backend_wayland.h
va/wayland/va_wayland.c
va/wayland/va_wayland.h

index 7cdb5c4..332d16d 100644 (file)
@@ -172,7 +172,7 @@ va_put_surface_wayland(
     if (!ensure_window(va_dpy, dst_rect->width, dst_rect->height))
         return VA_STATUS_ERROR_ALLOCATION_FAILED;
 
-    va_status = vaGetSurfaceBufferWl(va_dpy, surface, &buffer);
+    va_status = vaGetSurfaceBufferWl(va_dpy, surface, VA_FRAME_PICTURE, &buffer);
     if (va_status != VA_STATUS_SUCCESS)
         return va_status;
 
index 109ec48..3e1d495 100644 (file)
@@ -156,7 +156,7 @@ va_put_surface(
             wl_display_iterate(wl_drawable->display, WL_DISPLAY_READABLE);
     }
 
-    va_status = vaGetSurfaceBufferWl(va_dpy, va_surface, &buffer);
+    va_status = vaGetSurfaceBufferWl(va_dpy, va_surface, VA_FRAME_PICTURE, &buffer);
     if (va_status != VA_STATUS_SUCCESS)
         return va_status;
 
index dfa43eb..b33e3a1 100644 (file)
@@ -49,6 +49,7 @@ struct VADriverVTableWayland {
     VAStatus (*vaGetSurfaceBufferWl)(
         struct VADriverContext *ctx,
         VASurfaceID             surface,
+        unsigned int            flags,
         struct wl_buffer      **out_buffer
     );
 
@@ -56,6 +57,7 @@ struct VADriverVTableWayland {
     VAStatus (*vaGetImageBufferWl)(
         struct VADriverContext *ctx,
         VAImageID               image,
+        unsigned int            flags,
         struct wl_buffer      **out_buffer
     );
 };
index cfd2ec1..196ab51 100644 (file)
@@ -163,6 +163,7 @@ VAStatus
 vaGetSurfaceBufferWl(
     VADisplay           dpy,
     VASurfaceID         surface,
+    unsigned int        flags,
     struct wl_buffer  **out_buffer
 )
 {
@@ -172,13 +173,15 @@ vaGetSurfaceBufferWl(
         return VA_STATUS_ERROR_INVALID_DISPLAY;
     if (!ctx->vtable_wayland || !ctx->vtable_wayland->vaGetSurfaceBufferWl)
         return VA_STATUS_ERROR_UNIMPLEMENTED;
-    return ctx->vtable_wayland->vaGetSurfaceBufferWl(ctx, surface, out_buffer);
+    return ctx->vtable_wayland->vaGetSurfaceBufferWl(ctx, surface, flags,
+                                                     out_buffer);
 }
 
 VAStatus
 vaGetImageBufferWl(
     VADisplay           dpy,
     VAImageID           image,
+    unsigned int        flags,
     struct wl_buffer  **out_buffer
 )
 {
@@ -188,5 +191,6 @@ vaGetImageBufferWl(
         return VA_STATUS_ERROR_INVALID_DISPLAY;
     if (!ctx->vtable_wayland || !ctx->vtable_wayland->vaGetImageBufferWl)
         return VA_STATUS_ERROR_UNIMPLEMENTED;
-    return ctx->vtable_wayland->vaGetImageBufferWl(ctx, image, out_buffer);
+    return ctx->vtable_wayland->vaGetImageBufferWl(ctx, image, flags,
+                                                   out_buffer);
 }
index 009f2d1..46fbf2c 100644 (file)
@@ -75,8 +75,15 @@ vaGetDisplayWl(struct wl_display *display);
  * color conversion be needed, then VA/VPP API can fulfill this
  * purpose.
  *
+ * The @flags describe the desired picture structure. This is useful
+ * to expose a de-interlaced buffer. If the VA driver does not support
+ * any of the supplied flags, then #VA_STATUS_ERROR_FLAG_NOT_SUPPORTED
+ * is returned. The following flags are allowed: \c VA_FRAME_PICTURE,
+ * \c VA_TOP_FIELD, \c VA_BOTTOM_FIELD.
+ *
  * @param[in]   dpy         the VA display
  * @param[in]   surface     the VA surface
+ * @param[in]   flags       the deinterlacing flags
  * @param[out]  out_buffer  a wl_buffer wrapping the VA @surface
  * @return VA_STATUS_SUCCESS if successful
  */
@@ -84,6 +91,7 @@ VAStatus
 vaGetSurfaceBufferWl(
     VADisplay           dpy,
     VASurfaceID         surface,
+    unsigned int        flags,
     struct wl_buffer  **out_buffer
 );
 
@@ -97,8 +105,12 @@ vaGetSurfaceBufferWl(
  * color conversion be needed, then VA/VPP API can fulfill this
  * purpose.
  *
+ * The @flags describe the desired picture structure. See
+ * vaGetSurfaceBufferWl() description for more details.
+ *
  * @param[in]   dpy         the VA display
  * @param[in]   image       the VA image
+ * @param[in]   flags       the deinterlacing flags
  * @param[out]  out_buffer  a wl_buffer wrapping the VA @image
  * @return VA_STATUS_SUCCESS if successful
  */
@@ -106,6 +118,7 @@ VAStatus
 vaGetImageBufferWl(
     VADisplay           dpy,
     VAImageID           image,
+    unsigned int        flags,
     struct wl_buffer  **out_buffer
 );