int main(){ struct range a[5]; int n=5; int i,start,end; for(i=0;i<5;i++){ scanf("%d",&start); scanf("%d",&end); a[i].s=start; a[i].e=end; } display_range(a,n); quicksort(a,0,n-1); display_range(a,n); return 0; }
void queryVideoMixer(VDPDeviceImpl *device) { VdpStatus rv; printf("\nVideo mixer:\n\n"); // Features printf("feature name sup\n"); printf("------------------------------------\n"); for(int x=0; x<mixer_features_count; ++x) { VdpBool is_supported; 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, is_supported?'y':'-'); } printf("\n"); // Parameters (+range) printf("parameter name sup min max\n"); printf("-----------------------------------------------------\n"); for(int x=0; x<mixer_parameters_count; ++x) { VdpBool is_supported; 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, 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, (void*)&minval, (void*)&maxval); if(rv == VDP_STATUS_OK) display_range(mixer_parameters[x].aux, minval, maxval); } printf("\n"); } printf("\n"); // Attributes (+range) printf("attribute name sup min max\n"); printf("-----------------------------------------------------\n"); for(int x=0; x<mixer_attributes_count; ++x) { VdpBool is_supported; 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, 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, (void*)&minval, (void*)&maxval); if(rv == VDP_STATUS_OK) display_range(mixer_attributes[x].aux, minval, maxval); } printf("\n"); } printf("\n"); }