OSDN Git Service

libva 2.3.0 pre1
[android-x86/hardware-intel-common-libva.git] / va / va.c
diff --git a/va/va.c b/va/va.c
index f29e306..4d3f628 100644 (file)
--- a/va/va.c
+++ b/va/va.c
@@ -402,6 +402,9 @@ static VAStatus va_openDriver(VADisplay dpy, char *driver_name)
                 int minor;
             } compatible_versions[] = {
                 { VA_MAJOR_VERSION, VA_MINOR_VERSION },
+                { VA_MAJOR_VERSION, 2 },
+                { VA_MAJOR_VERSION, 1 },
+                { VA_MAJOR_VERSION, 0 },
                 { -1, }
             };
 
@@ -451,7 +454,6 @@ static VAStatus va_openDriver(VADisplay dpy, char *driver_name)
                     CHECK_MAXIMUM(vaStatus, ctx, attributes);
                     CHECK_MAXIMUM(vaStatus, ctx, image_formats);
                     CHECK_MAXIMUM(vaStatus, ctx, subpic_formats);
-                    CHECK_MAXIMUM(vaStatus, ctx, display_attributes);
                     CHECK_STRING(vaStatus, ctx, vendor);
                     CHECK_VTABLE(vaStatus, ctx, Terminate);
                     CHECK_VTABLE(vaStatus, ctx, QueryConfigProfiles);
@@ -580,12 +582,22 @@ const char *vaErrorStr(VAStatus error_status)
             return "surface is in displaying (may by overlay)" ;
         case VA_STATUS_ERROR_INVALID_IMAGE_FORMAT:
             return "invalid VAImageFormat";
+        case VA_STATUS_ERROR_DECODING_ERROR:
+            return "internal decoding error";
+        case VA_STATUS_ERROR_ENCODING_ERROR:
+            return "internal encoding error";
         case VA_STATUS_ERROR_INVALID_VALUE:
             return "an invalid/unsupported value was supplied";
         case VA_STATUS_ERROR_UNSUPPORTED_FILTER:
             return "the requested filter is not supported";
         case VA_STATUS_ERROR_INVALID_FILTER_CHAIN:
             return "an invalid filter chain was supplied";
+        case VA_STATUS_ERROR_HW_BUSY:
+            return "HW busy now";
+        case VA_STATUS_ERROR_UNSUPPORTED_MEMORY_TYPE:
+            return "an unsupported memory type was supplied";
+        case VA_STATUS_ERROR_NOT_ENOUGH_BUFFER:
+            return "allocated memory size is not enough for input or output";
         case VA_STATUS_ERROR_UNKNOWN:
             return "unknown libva error";
     }
@@ -919,6 +931,21 @@ VAStatus vaQueryConfigAttributes (
   return ctx->vtable->vaQueryConfigAttributes( ctx, config_id, profile, entrypoint, attrib_list, num_attribs);
 }
 
+VAStatus vaQueryProcessingRate (
+    VADisplay dpy,
+    VAConfigID config_id,
+    VAProcessingRateParameter *proc_buf,
+    unsigned int *processing_rate      /* out */
+)
+{
+  VADriverContextP ctx;
+  CHECK_DISPLAY(dpy);
+  ctx = CTX(dpy);
+  if(!ctx->vtable->vaQueryProcessingRate)
+      return VA_STATUS_ERROR_UNIMPLEMENTED;
+  return ctx->vtable->vaQueryProcessingRate( ctx, config_id, proc_buf, processing_rate);
+}
+
 /* XXX: this is a slow implementation that will be removed */
 static VAStatus
 va_impl_query_surface_attributes(
@@ -1300,6 +1327,33 @@ VAStatus vaCreateBuffer (
   return vaStatus;
 }
 
+VAStatus vaCreateBuffer2 (
+    VADisplay dpy,
+    VAContextID context,
+    VABufferType type,
+    unsigned int width,
+    unsigned int height,
+    unsigned int *unit_size,
+    unsigned int *pitch,
+    VABufferID *buf_id
+)
+{
+  VADriverContextP ctx;
+  VAStatus vaStatus;
+
+  CHECK_DISPLAY(dpy);
+  ctx = CTX(dpy);
+  if(!ctx->vtable->vaCreateBuffer2)
+     return VA_STATUS_ERROR_UNIMPLEMENTED;
+
+  vaStatus = ctx->vtable->vaCreateBuffer2( ctx, context, type, width, height ,unit_size, pitch, buf_id);
+
+  VA_TRACE_LOG(va_TraceCreateBuffer,
+               dpy, context, type, *pitch, height, NULL, buf_id);
+
+  return vaStatus;
+}
+
 VAStatus vaBufferSetNumElements (
     VADisplay dpy,
     VABufferID buf_id, /* in */
@@ -1415,6 +1469,23 @@ vaReleaseBufferHandle(VADisplay dpy, VABufferID buf_id)
     return ctx->vtable->vaReleaseBufferHandle(ctx, buf_id);
 }
 
+VAStatus
+vaExportSurfaceHandle(VADisplay dpy, VASurfaceID surface_id,
+                      uint32_t mem_type, uint32_t flags,
+                      void *descriptor)
+{
+    VADriverContextP ctx;
+
+    CHECK_DISPLAY(dpy);
+    ctx = CTX(dpy);
+
+    if (!ctx->vtable->vaExportSurfaceHandle)
+        return VA_STATUS_ERROR_UNIMPLEMENTED;
+    return ctx->vtable->vaExportSurfaceHandle(ctx, surface_id,
+                                              mem_type, flags,
+                                              descriptor);
+}
+
 VAStatus vaBeginPicture (
     VADisplay dpy,
     VAContextID context,