diff options
author | Maarten Lankhorst <[email protected]> | 2011-12-19 10:10:06 +0100 |
---|---|---|
committer | Christian König <[email protected]> | 2011-12-19 13:33:47 +0100 |
commit | 89b9863252272a7109d468738517a0d68376a909 (patch) | |
tree | 089405ccc55f01d16e0eac3e403d1c777903cd61 /src/gallium/state_trackers/vdpau/query.c | |
parent | 417aad5a992c8d7659438d20f82b4cf405c9c7b2 (diff) |
vdpau: Add support for parameters
Currently only validating, since nothing else can be done with it yet
Signed-off-by: Maarten Lankhorst <[email protected]>
v2: removed check_video_surface
Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/vdpau/query.c')
-rw-r--r-- | src/gallium/state_trackers/vdpau/query.c | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/vdpau/query.c b/src/gallium/state_trackers/vdpau/query.c index 191e163af8e..cbd5afd142e 100644 --- a/src/gallium/state_trackers/vdpau/query.c +++ b/src/gallium/state_trackers/vdpau/query.c @@ -288,7 +288,18 @@ vlVdpVideoMixerQueryParameterSupport(VdpDevice device, VdpVideoMixerParameter pa if (!is_supported) return VDP_STATUS_INVALID_POINTER; - return VDP_STATUS_NO_IMPLEMENTATION; + switch (parameter) { + case VDP_VIDEO_MIXER_PARAMETER_VIDEO_SURFACE_WIDTH: + case VDP_VIDEO_MIXER_PARAMETER_VIDEO_SURFACE_HEIGHT: + case VDP_VIDEO_MIXER_PARAMETER_CHROMA_TYPE: + case VDP_VIDEO_MIXER_PARAMETER_LAYERS: + *is_supported = VDP_TRUE; + break; + default: + *is_supported = VDP_FALSE; + break; + } + return VDP_STATUS_OK; } /** @@ -298,10 +309,34 @@ VdpStatus vlVdpVideoMixerQueryParameterValueRange(VdpDevice device, VdpVideoMixerParameter parameter, void *min_value, void *max_value) { + vlVdpDevice *dev = vlGetDataHTAB(device); + struct pipe_screen *screen; + enum pipe_video_profile prof = PIPE_VIDEO_PROFILE_UNKNOWN; + if (!dev) + return VDP_STATUS_INVALID_HANDLE; if (!(min_value && max_value)) return VDP_STATUS_INVALID_POINTER; - - return VDP_STATUS_NO_IMPLEMENTATION; + screen = dev->vscreen->pscreen; + switch (parameter) { + case VDP_VIDEO_MIXER_PARAMETER_VIDEO_SURFACE_WIDTH: + *(uint32_t*)min_value = 48; + *(uint32_t*)max_value = screen->get_video_param(screen, prof, PIPE_VIDEO_CAP_MAX_WIDTH); + break; + case VDP_VIDEO_MIXER_PARAMETER_VIDEO_SURFACE_HEIGHT: + *(uint32_t*)min_value = 48; + *(uint32_t*)max_value = screen->get_video_param(screen, prof, PIPE_VIDEO_CAP_MAX_HEIGHT); + break; + + case VDP_VIDEO_MIXER_PARAMETER_LAYERS: + *(uint32_t*)min_value = 0; + *(uint32_t*)max_value = 4; + break; + + case VDP_VIDEO_MIXER_PARAMETER_CHROMA_TYPE: + default: + return VDP_STATUS_INVALID_VIDEO_MIXER_PARAMETER; + } + return VDP_STATUS_OK; } /** |