diff options
author | Christian König <[email protected]> | 2011-07-12 00:12:12 +0200 |
---|---|---|
committer | Christian König <[email protected]> | 2011-07-12 00:12:12 +0200 |
commit | efc7fda4627919b5355952d955ee4a2c98505e56 (patch) | |
tree | 4398a353d70746f9d04016316bf6b6e30ebf8171 /src/gallium/state_trackers/vdpau/query.c | |
parent | df5e0b9435c869f88234a69db9bfe97342b027d4 (diff) |
[g3dvl] add some more PIPE_VIDEO_CAPs
Diffstat (limited to 'src/gallium/state_trackers/vdpau/query.c')
-rw-r--r-- | src/gallium/state_trackers/vdpau/query.c | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/src/gallium/state_trackers/vdpau/query.c b/src/gallium/state_trackers/vdpau/query.c index a32fd406bf5..ec17e59118f 100644 --- a/src/gallium/state_trackers/vdpau/query.c +++ b/src/gallium/state_trackers/vdpau/query.c @@ -128,11 +128,7 @@ vlVdpDecoderQueryCapabilities(VdpDevice device, VdpDecoderProfile profile, { vlVdpDevice *dev; struct pipe_screen *pscreen; - enum pipe_video_profile p_profile; - uint32_t max_decode_width; - uint32_t max_decode_height; - uint32_t max_2d_texture_level; VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Querying decoder\n"); @@ -152,24 +148,20 @@ vlVdpDecoderQueryCapabilities(VdpDevice device, VdpDecoderProfile profile, *is_supported = false; return VDP_STATUS_OK; } - - if (p_profile != PIPE_VIDEO_PROFILE_MPEG2_SIMPLE && p_profile != PIPE_VIDEO_PROFILE_MPEG2_MAIN) { - *is_supported = false; - return VDP_STATUS_OK; + + *is_supported = pscreen->get_video_param(pscreen, p_profile, PIPE_VIDEO_CAP_SUPPORTED); + if (*is_supported) { + *max_width = pscreen->get_video_param(pscreen, p_profile, PIPE_VIDEO_CAP_MAX_WIDTH); + *max_height = pscreen->get_video_param(pscreen, p_profile, PIPE_VIDEO_CAP_MAX_HEIGHT); + *max_level = 16; + *max_macroblocks = (*max_width/16)*(*max_height/16); + } else { + *max_width = 0; + *max_height = 0; + *max_level = 0; + *max_macroblocks = 0; } - /* XXX hack, need to implement something more sane when the decoders have been implemented */ - max_2d_texture_level = pscreen->get_param(pscreen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS); - max_decode_width = max_decode_height = pow(2,max_2d_texture_level-2); - if (!(max_decode_width && max_decode_height)) - return VDP_STATUS_RESOURCES; - - *is_supported = true; - *max_width = max_decode_width; - *max_height = max_decode_height; - *max_level = 16; - *max_macroblocks = (max_decode_width/16) * (max_decode_height/16); - return VDP_STATUS_OK; } |