summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/va
diff options
context:
space:
mode:
authorThomas Balling Sørensen <tball@tball-laptop.(none)>2010-10-28 12:51:35 +0200
committerThomas Balling Sørensen <tball@tball-laptop.(none)>2010-10-28 12:51:35 +0200
commit3fac09ad873b8a5239f84d07dc12e8b08a117561 (patch)
tree7e0ec49f32349cfb04e6246dc2febcb46b72bedf /src/gallium/state_trackers/va
parentfd2cbe94dfaa98b79c16fb81d7bac84c5c683249 (diff)
vl: Initial implementation of vlVaQuerySubpictureFormats.
Diffstat (limited to 'src/gallium/state_trackers/va')
-rw-r--r--src/gallium/state_trackers/va/va_subpicture.c36
1 files changed, 34 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/va/va_subpicture.c b/src/gallium/state_trackers/va/va_subpicture.c
index 9317d313c65..442b1acea5a 100644
--- a/src/gallium/state_trackers/va/va_subpicture.c
+++ b/src/gallium/state_trackers/va/va_subpicture.c
@@ -27,8 +27,29 @@
#include <va/va.h>
#include <va/va_backend.h>
+#include <pipe/p_format.h>
#include "va_private.h"
+#define NUM_FORMAT_SUPPORTED 2
+
+typedef struct {
+ enum pipe_format;
+ VAImageFormat va_format;
+ unsigned int va_flags;
+} va_subpicture_formats_supported_t;
+
+static const va_subpicture_formats_supported_t va_subpicture_formats_supported[NUM_FORMAT_SUPPORTED] =
+{
+ { PIPE_FORMAT_B8G8R8A8_UNORM,
+ { VA_FOURCC('B','G','R','A'), VA_LSB_FIRST, 32,
+ 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 },
+ 0 },
+ { PIPE_FORMAT_R8G8B8A8_UNORM,
+ { VA_FOURCC('R','G','B','A'), VA_LSB_FIRST, 32,
+ 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 },
+ 0 }
+};
+
VAStatus
vlVaQuerySubpictureFormats( VADriverContextP ctx,
VAImageFormat *format_list,
@@ -37,8 +58,19 @@ vlVaQuerySubpictureFormats( VADriverContextP ctx,
{
if (!ctx)
return VA_STATUS_ERROR_INVALID_CONTEXT;
-
- return VA_STATUS_ERROR_UNIMPLEMENTED;
+
+ if (!(format_list && flags && num_formats))
+ return VA_STATUS_ERROR_UNKNOWN;
+
+ int n = 0;
+ /* Query supported formats */
+ for (n = 0; n < NUM_FORMAT_SUPPORTED; n++)
+ {
+ flags[n] = va_subpicture_formats_supported[n].va_flags;
+ format_list[n] = va_subpicture_formats_supported[n].va_format;
+ }
+
+ return VA_STATUS_SUCCESS;
}