aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/vdpau/vdpau_private.h
diff options
context:
space:
mode:
authorChristian König <[email protected]>2011-07-10 13:40:04 +0200
committerChristian König <[email protected]>2011-07-10 13:48:37 +0200
commit3d769619e2937cb4f2a036e82b396d9e53d65ba8 (patch)
tree1ff721fc64e569b9200a90bfb1e759277f9f3a2e /src/gallium/state_trackers/vdpau/vdpau_private.h
parent3ed8182c76c61ae0296ac442546df142f1d75b00 (diff)
vdpau: implement VdpOutputSurfaceGetParameters
Diffstat (limited to 'src/gallium/state_trackers/vdpau/vdpau_private.h')
-rw-r--r--src/gallium/state_trackers/vdpau/vdpau_private.h51
1 files changed, 36 insertions, 15 deletions
diff --git a/src/gallium/state_trackers/vdpau/vdpau_private.h b/src/gallium/state_trackers/vdpau/vdpau_private.h
index 8cf9ca1f4e5..bbc426e0e27 100644
--- a/src/gallium/state_trackers/vdpau/vdpau_private.h
+++ b/src/gallium/state_trackers/vdpau/vdpau_private.h
@@ -84,7 +84,7 @@ PipeToChroma(enum pipe_video_chroma_format pipe_type)
static inline enum pipe_format
-FormatToPipe(VdpYCbCrFormat vdpau_format)
+FormatYCBCRToPipe(VdpYCbCrFormat vdpau_format)
{
switch (vdpau_format) {
case VDP_YCBCR_FORMAT_NV12:
@@ -106,6 +106,29 @@ FormatToPipe(VdpYCbCrFormat vdpau_format)
return -1;
}
+static inline VdpYCbCrFormat
+PipeToFormatYCBCR(enum pipe_format p_format)
+{
+ switch (p_format) {
+ case PIPE_FORMAT_NV12:
+ return VDP_YCBCR_FORMAT_NV12;
+ case PIPE_FORMAT_YV12:
+ return VDP_YCBCR_FORMAT_YV12;
+ case PIPE_FORMAT_UYVY:
+ return VDP_YCBCR_FORMAT_UYVY;
+ case PIPE_FORMAT_YUYV:
+ return VDP_YCBCR_FORMAT_YUYV;
+ //case PIPE_FORMAT_YUVA:
+ // return VDP_YCBCR_FORMAT_Y8U8V8A8;
+ case PIPE_FORMAT_VUYA:
+ return VDP_YCBCR_FORMAT_V8U8Y8A8;
+ default:
+ assert(0);
+ }
+
+ return -1;
+}
+
static inline enum pipe_format
FormatRGBAToPipe(VdpRGBAFormat vdpau_format)
{
@@ -127,22 +150,20 @@ FormatRGBAToPipe(VdpRGBAFormat vdpau_format)
return -1;
}
-static inline VdpYCbCrFormat
-PipeToFormat(enum pipe_format p_format)
+static inline VdpRGBAFormat
+PipeToFormatRGBA(enum pipe_format p_format)
{
switch (p_format) {
- case PIPE_FORMAT_NV12:
- return VDP_YCBCR_FORMAT_NV12;
- case PIPE_FORMAT_YV12:
- return VDP_YCBCR_FORMAT_YV12;
- case PIPE_FORMAT_UYVY:
- return VDP_YCBCR_FORMAT_UYVY;
- case PIPE_FORMAT_YUYV:
- return VDP_YCBCR_FORMAT_YUYV;
- //case PIPE_FORMAT_YUVA:
- // return VDP_YCBCR_FORMAT_Y8U8V8A8;
- case PIPE_FORMAT_VUYA:
- return VDP_YCBCR_FORMAT_V8U8Y8A8;
+ case PIPE_FORMAT_A8_UNORM:
+ return VDP_RGBA_FORMAT_A8;
+ case PIPE_FORMAT_B10G10R10A2_UNORM:
+ return VDP_RGBA_FORMAT_B10G10R10A2;
+ case PIPE_FORMAT_B8G8R8A8_UNORM:
+ return VDP_RGBA_FORMAT_B8G8R8A8;
+ case PIPE_FORMAT_R10G10B10A2_UNORM:
+ return VDP_RGBA_FORMAT_R10G10B10A2;
+ case PIPE_FORMAT_R8G8B8A8_UNORM:
+ return VDP_RGBA_FORMAT_R8G8B8A8;
default:
assert(0);
}