diff options
author | Christian König <[email protected]> | 2012-02-27 12:13:14 +0100 |
---|---|---|
committer | Christian König <[email protected]> | 2012-03-02 13:38:20 +0100 |
commit | 54faecf6076fd50ef219ffed97f9a59218f7ca68 (patch) | |
tree | 1aeb7e9bcc7a1b3dd01cf0b248d9010ca9db9e68 /src | |
parent | d14c879d82d62f4000045dc6f001186559b81faa (diff) |
st/vdpau: implement OutputSurfaceQueryPutBitsYCbCrCapabilities
Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/state_trackers/vdpau/query.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/vdpau/query.c b/src/gallium/state_trackers/vdpau/query.c index 4daf48b46b0..c93ae0cac2a 100644 --- a/src/gallium/state_trackers/vdpau/query.c +++ b/src/gallium/state_trackers/vdpau/query.c @@ -326,10 +326,42 @@ vlVdpOutputSurfaceQueryPutBitsYCbCrCapabilities(VdpDevice device, VdpRGBAFormat VdpYCbCrFormat bits_ycbcr_format, VdpBool *is_supported) { + vlVdpDevice *dev; + struct pipe_screen *pscreen; + enum pipe_format rgba_format, ycbcr_format; + + dev = vlGetDataHTAB(device); + if (!dev) + return VDP_STATUS_INVALID_HANDLE; + + pscreen = dev->vscreen->pscreen; + if (!pscreen) + return VDP_STATUS_ERROR; + + rgba_format = FormatRGBAToPipe(surface_rgba_format); + if (rgba_format == PIPE_FORMAT_NONE || rgba_format == PIPE_FORMAT_A8_UNORM) + return VDP_STATUS_INVALID_RGBA_FORMAT; + + ycbcr_format = FormatYCBCRToPipe(bits_ycbcr_format); + if (ycbcr_format == PIPE_FORMAT_NONE) + return VDP_STATUS_INVALID_INDEXED_FORMAT; + if (!is_supported) return VDP_STATUS_INVALID_POINTER; - return VDP_STATUS_NO_IMPLEMENTATION; + *is_supported = pscreen->is_format_supported + ( + pscreen, rgba_format, PIPE_TEXTURE_2D, 1, + PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET + ); + + *is_supported &= pscreen->is_video_format_supported + ( + pscreen, ycbcr_format, + PIPE_VIDEO_PROFILE_UNKNOWN + ); + + return VDP_STATUS_OK; } /** |