1 /**************************************************************************
3 * Copyright 2010 Thomas Balling Sørensen & Orasanu Lucian.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
29 #include <va/va_backend.h>
31 #include "pipe/p_format.h"
33 #include "va_private.h"
36 enum pipe_format pipe_format;
37 VAImageFormat va_format;
38 unsigned int va_flags;
39 } va_subpicture_formats_supported_t;
41 static const va_subpicture_formats_supported_t va_subpicture_formats_supported[VA_MAX_SUBPIC_FORMATS_SUPPORTED + 1] =
43 { PIPE_FORMAT_B8G8R8A8_UNORM,
44 { VA_FOURCC('B','G','R','A'), VA_LSB_FIRST, 32, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 },
46 { PIPE_FORMAT_R8G8B8A8_UNORM,
47 { VA_FOURCC_RGBA, VA_LSB_FIRST, 32, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 },
52 vlVaQuerySubpictureFormats(VADriverContextP ctx, VAImageFormat *format_list,
53 unsigned int *flags, unsigned int *num_formats)
56 return VA_STATUS_ERROR_INVALID_CONTEXT;
58 if (!(format_list && flags && num_formats))
59 return VA_STATUS_ERROR_UNKNOWN;
61 num_formats[0] = VA_MAX_SUBPIC_FORMATS_SUPPORTED;
64 /* Query supported formats */
65 for (n = 0; n < VA_MAX_SUBPIC_FORMATS_SUPPORTED ; n++) {
66 const va_subpicture_formats_supported_t * const format_map = &va_subpicture_formats_supported[n];
67 flags[n] = format_map->va_flags;
68 format_list[n] = format_map->va_format;
71 return VA_STATUS_SUCCESS;
75 vlVaCreateSubpicture(VADriverContextP ctx, VAImageID image, VASubpictureID *subpicture)
78 return VA_STATUS_ERROR_INVALID_CONTEXT;
80 return VA_STATUS_ERROR_UNIMPLEMENTED;
84 vlVaDestroySubpicture(VADriverContextP ctx, VASubpictureID subpicture)
87 return VA_STATUS_ERROR_INVALID_CONTEXT;
89 return VA_STATUS_ERROR_UNIMPLEMENTED;
93 vlVaSubpictureImage(VADriverContextP ctx, VASubpictureID subpicture, VAImageID image)
96 return VA_STATUS_ERROR_INVALID_CONTEXT;
98 return VA_STATUS_ERROR_UNIMPLEMENTED;
102 vlVaSetSubpictureChromakey(VADriverContextP ctx, VASubpictureID subpicture,
103 unsigned int chromakey_min, unsigned int chromakey_max, unsigned int chromakey_mask)
106 return VA_STATUS_ERROR_INVALID_CONTEXT;
108 return VA_STATUS_ERROR_UNIMPLEMENTED;
112 vlVaSetSubpictureGlobalAlpha(VADriverContextP ctx, VASubpictureID subpicture, float global_alpha)
115 return VA_STATUS_ERROR_INVALID_CONTEXT;
117 return VA_STATUS_ERROR_UNIMPLEMENTED;
121 vlVaAssociateSubpicture(VADriverContextP ctx, VASubpictureID subpicture, VASurfaceID *target_surfaces,
122 int num_surfaces, short src_x, short src_y,
123 unsigned short src_width, unsigned short src_height,
124 short dest_x, short dest_y,
125 unsigned short dest_width,
126 unsigned short dest_height,
130 return VA_STATUS_ERROR_INVALID_CONTEXT;
132 return VA_STATUS_ERROR_UNIMPLEMENTED;
136 vlVaDeassociateSubpicture(VADriverContextP ctx, VASubpictureID subpicture,
137 VASurfaceID *target_surfaces, int num_surfaces)
140 return VA_STATUS_ERROR_INVALID_CONTEXT;
142 return VA_STATUS_ERROR_UNIMPLEMENTED;