2012-11-07 14:49:44 +00:00
|
|
|
#! /usr/bin/env perl
|
2012-07-01 23:09:03 +00:00
|
|
|
|
2012-11-07 14:49:44 +00:00
|
|
|
# Generates vdpau_template.c
|
2009-05-05 21:17:21 +00:00
|
|
|
|
2012-11-07 14:49:44 +00:00
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
|
|
|
sub camelize($) {
|
|
|
|
my $s = shift;
|
|
|
|
$s =~ s/(?:^|_)([a-z])/\u$1/g;
|
|
|
|
$s;
|
|
|
|
}
|
|
|
|
|
|
|
|
print <<EOF;
|
|
|
|
/* Lists the VDPAU functions used by MPV.
|
|
|
|
* Generated by vdpau_functions.pl.
|
|
|
|
* First argument on each line is the VDPAU function type name,
|
|
|
|
* second is the macro name needed to get the function address,
|
|
|
|
* third is the name MPV uses for the function.
|
|
|
|
*/
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
while (my $f = <DATA>) {
|
|
|
|
# strip whitespace, ignore anything after a '#'
|
|
|
|
$f =~ /^\s*(.*?)\s*(?:(?<!\\)#.*)?$/;
|
|
|
|
$f = $1;
|
|
|
|
next unless $f; # empty / comment line
|
|
|
|
|
|
|
|
my ($mp_name, $vdpau_name) = split /\s+/, $f;
|
|
|
|
$vdpau_name = camelize $mp_name unless $vdpau_name;
|
|
|
|
|
|
|
|
print "VDP_FUNCTION(Vdp$vdpau_name, VDP_FUNC_ID_\U$mp_name\E, $mp_name)\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
__DATA__
|
2009-05-05 21:17:21 +00:00
|
|
|
# get_error_string should be first, because the function lookup loop should
|
|
|
|
# have it available to print errors for other functions
|
|
|
|
get_error_string
|
|
|
|
|
|
|
|
bitmap_surface_create
|
|
|
|
bitmap_surface_destroy
|
|
|
|
bitmap_surface_put_bits_native
|
2009-09-02 17:21:24 +00:00
|
|
|
bitmap_surface_query_capabilities
|
2009-05-05 21:17:21 +00:00
|
|
|
decoder_create
|
|
|
|
decoder_destroy
|
|
|
|
decoder_render
|
|
|
|
device_destroy
|
|
|
|
generate_csc_matrix GenerateCSCMatrix # CSC completely capitalized
|
|
|
|
output_surface_create
|
|
|
|
output_surface_destroy
|
2011-10-06 18:46:01 +00:00
|
|
|
output_surface_get_bits_native
|
2009-05-05 21:17:21 +00:00
|
|
|
output_surface_put_bits_indexed
|
|
|
|
output_surface_put_bits_native
|
|
|
|
output_surface_render_bitmap_surface
|
|
|
|
output_surface_render_output_surface
|
2009-09-06 23:02:24 +00:00
|
|
|
preemption_callback_register
|
2009-05-05 21:17:21 +00:00
|
|
|
presentation_queue_block_until_surface_idle
|
|
|
|
presentation_queue_create
|
|
|
|
presentation_queue_destroy
|
|
|
|
presentation_queue_display
|
2009-11-15 02:39:22 +00:00
|
|
|
presentation_queue_get_time
|
|
|
|
presentation_queue_query_surface_status
|
2009-05-05 21:17:21 +00:00
|
|
|
presentation_queue_target_create_x11
|
|
|
|
presentation_queue_target_destroy
|
|
|
|
video_mixer_create
|
|
|
|
video_mixer_destroy
|
2009-11-15 16:39:48 +00:00
|
|
|
video_mixer_query_feature_support
|
2009-05-05 21:17:21 +00:00
|
|
|
video_mixer_render
|
|
|
|
video_mixer_set_attribute_values
|
|
|
|
video_mixer_set_feature_enables
|
|
|
|
video_surface_create
|
|
|
|
video_surface_destroy
|
|
|
|
video_surface_put_bits_y_cb_cr
|