From 09a467217ed3347a30c3899dace68bc24021af3f Mon Sep 17 00:00:00 2001 From: José Hiram Soltren Date: Wed, 14 Nov 2012 15:06:49 -0800 Subject: Only query ranges for appropriate VDPAU attributes Update vdpauinfo.cpp to not query values from VDPAU which do not support ranges. See vdpau.h for more information. --- vdpauinfo.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vdpauinfo.cpp b/vdpauinfo.cpp index 60f3619..062859c 100644 --- a/vdpauinfo.cpp +++ b/vdpauinfo.cpp @@ -287,7 +287,8 @@ void queryVideoMixer(VDPDeviceImpl *device) is_supported = (rv == VDP_STATUS_OK && is_supported); printf("%-32s %c ", mixer_parameters[x].name, is_supported?'y':'-'); - if(is_supported) + /* VDPAU spec does not allow range query for DT_NONE types */ + if(is_supported && mixer_parameters[x].aux != DT_NONE) { uint32_t minval, maxval; rv = device->VideoMixerQueryParameterValueRange(device->device, mixer_parameters[x].id, @@ -311,7 +312,8 @@ void queryVideoMixer(VDPDeviceImpl *device) is_supported = (rv == VDP_STATUS_OK && is_supported); printf("%-32s %c ", mixer_attributes[x].name, is_supported?'y':'-'); - if(is_supported) + /* VDPAU spec does not allow range query for DT_NONE types */ + if(is_supported && mixer_attributes[x].aux != DT_NONE) { uint32_t minval, maxval; rv = device->VideoMixerQueryAttributeValueRange(device->device, mixer_parameters[x].id, -- cgit v1.2.3 From 30f825629c72613ee9b86c8e05173e884d8ee2e9 Mon Sep 17 00:00:00 2001 From: José Hiram Soltren Date: Wed, 14 Nov 2012 15:09:16 -0800 Subject: Add José Soltren to AUTHORS. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index ff1f1fd..fcbb444 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,3 +1,4 @@ Wladimir J. van der Laan Aaron Plattner Rajib Mahapatra +José Hiram Soltren -- cgit v1.2.3 From f2ced6afa0d01698745cc91710def89b670e3d56 Mon Sep 17 00:00:00 2001 From: José Hiram Soltren Date: Wed, 14 Nov 2012 15:36:25 -0800 Subject: Whitespace cleanup to vdpauinfo.cpp --- vdpauinfo.cpp | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/vdpauinfo.cpp b/vdpauinfo.cpp index 062859c..eb8c95b 100644 --- a/vdpauinfo.cpp +++ b/vdpauinfo.cpp @@ -1,5 +1,5 @@ -/* -Query and display NVIDIA VDPAU capabilities, a la glxinfo +/* +Query and display NVIDIA VDPAU capabilities, a la glxinfo version 0.0.2 Copyright (c) 2008 Wladimir J. van der Laan @@ -48,7 +48,7 @@ void queryBaseInfo(VDPDeviceImpl *device) device->GetInformationString(&info) != VDP_STATUS_OK) { fprintf(stderr, "Error querying API version or information\n"); - exit(-1); + exit(-1); } printf("API version: %i\n", api); printf("Information string: %s\n", info); @@ -114,11 +114,11 @@ void queryVideoSurface(VDPDeviceImpl *device) VdpBool is_supported = false; uint32_t max_width, max_height; - rv = device->VideoSurfaceQueryCapabilities(device->device, chroma_types[x].id, + rv = device->VideoSurfaceQueryCapabilities(device->device, chroma_types[x].id, &is_supported, &max_width, &max_height); if(rv == VDP_STATUS_OK && is_supported) { - printf("%-6s %5i %5i ", chroma_types[x].name, + printf("%-6s %5i %5i ", chroma_types[x].name, max_width, max_height); /* Find out supported formats */ for(int y=0; yOutputSurfaceQueryCapabilities(device->device, rgb_types[x].id, + rv = device->OutputSurfaceQueryCapabilities(device->device, rgb_types[x].id, &is_supported, &max_width, &max_height); device->OutputSurfaceQueryGetPutBitsNativeCapabilities(device->device, rgb_types[x].id, &native); if(rv == VDP_STATUS_OK && is_supported) { - printf("%-16s %5i %5i %c ", rgb_types[x].name, + printf("%-16s %5i %5i %c ", rgb_types[x].name, max_width, max_height, native?'y':'-'); /* Find out supported formats */ for(int y=0; yBitmapSurfaceQueryCapabilities(device->device, rgb_types[x].id, + rv = device->BitmapSurfaceQueryCapabilities(device->device, rgb_types[x].id, &is_supported, &max_width, &max_height); if(rv == VDP_STATUS_OK && is_supported) { - printf("%-16s %5i %5i\n", rgb_types[x].name, + printf("%-16s %5i %5i\n", rgb_types[x].name, max_width, max_height); } } @@ -267,12 +267,12 @@ void queryVideoMixer(VDPDeviceImpl *device) for(int x=0; xVideoMixerQueryFeatureSupport(device->device, mixer_features[x].id, + rv = device->VideoMixerQueryFeatureSupport(device->device, mixer_features[x].id, &is_supported); is_supported = (rv == VDP_STATUS_OK && is_supported); - printf("%-32s %c\n", mixer_features[x].name, + printf("%-32s %c\n", mixer_features[x].name, is_supported?'y':'-'); - + } printf("\n"); // Parameters (+range) @@ -282,16 +282,16 @@ void queryVideoMixer(VDPDeviceImpl *device) { VdpBool is_supported = false; - rv = device->VideoMixerQueryParameterSupport(device->device, mixer_parameters[x].id, + rv = device->VideoMixerQueryParameterSupport(device->device, mixer_parameters[x].id, &is_supported); is_supported = (rv == VDP_STATUS_OK && is_supported); - printf("%-32s %c ", mixer_parameters[x].name, + printf("%-32s %c ", mixer_parameters[x].name, is_supported?'y':'-'); /* VDPAU spec does not allow range query for DT_NONE types */ if(is_supported && mixer_parameters[x].aux != DT_NONE) { uint32_t minval, maxval; - rv = device->VideoMixerQueryParameterValueRange(device->device, mixer_parameters[x].id, + rv = device->VideoMixerQueryParameterValueRange(device->device, mixer_parameters[x].id, (void*)&minval, (void*)&maxval); if(rv == VDP_STATUS_OK) display_range(mixer_parameters[x].aux, minval, maxval); @@ -299,7 +299,7 @@ void queryVideoMixer(VDPDeviceImpl *device) printf("\n"); } printf("\n"); - + // Attributes (+range) printf("attribute name sup min max\n"); printf("-----------------------------------------------------\n"); @@ -307,23 +307,23 @@ void queryVideoMixer(VDPDeviceImpl *device) { VdpBool is_supported = false; - rv = device->VideoMixerQueryAttributeSupport(device->device, mixer_attributes[x].id, + rv = device->VideoMixerQueryAttributeSupport(device->device, mixer_attributes[x].id, &is_supported); is_supported = (rv == VDP_STATUS_OK && is_supported); - printf("%-32s %c ", mixer_attributes[x].name, + printf("%-32s %c ", mixer_attributes[x].name, is_supported?'y':'-'); /* VDPAU spec does not allow range query for DT_NONE types */ if(is_supported && mixer_attributes[x].aux != DT_NONE) { uint32_t minval, maxval; - rv = device->VideoMixerQueryAttributeValueRange(device->device, mixer_parameters[x].id, + rv = device->VideoMixerQueryAttributeValueRange(device->device, mixer_parameters[x].id, (void*)&minval, (void*)&maxval); if(rv == VDP_STATUS_OK) display_range(mixer_attributes[x].aux, minval, maxval); } printf("\n"); } - printf("\n"); + printf("\n"); } /******************* Decoder ****************/ @@ -362,11 +362,11 @@ void queryDecoderCaps(VDPDeviceImpl *device) VdpBool is_supported = false; uint32_t max_level, max_macroblocks, max_width, max_height; - rv = device->DecoderQueryCapabilities(device->device, decoder_profiles[x].id, + rv = device->DecoderQueryCapabilities(device->device, decoder_profiles[x].id, &is_supported, &max_level, &max_macroblocks, &max_width, &max_height); if(rv == VDP_STATUS_OK && is_supported) { - printf("%-20s %2i %5i %5i %5i\n", decoder_profiles[x].name, + printf("%-20s %2i %5i %5i %5i\n", decoder_profiles[x].name, max_level, max_macroblocks, max_width, max_height); } } @@ -387,7 +387,7 @@ int main(int argc, char **argv) } screen = DefaultScreen(display); printf("display: %s screen: %i\n", display_name, screen); - + /* Create device */ VdpDevice device; VdpGetProcAddress *get_proc_address; @@ -397,10 +397,10 @@ int main(int argc, char **argv) { fprintf(stderr, "Error creating VDPAU device: %i\n", rv); /* cannot use GetErrorString here */ exit(-1); - } - + } + VDPDeviceImpl *impl = new VDPDeviceImpl(device, get_proc_address); - + queryBaseInfo(impl); queryVideoSurface(impl); queryDecoderCaps(impl); -- cgit v1.2.3