options: make option struct the talloc parent of options
[mplayer.git] / TOOLS / vdpau_functions.py
blob27d6ff45f34a93f1d46a47bb47d8f3867a50daac
1 # Generate vdpau_template.c
3 functions = """
4 # get_error_string should be first, because the function lookup loop should
5 # have it available to print errors for other functions
6 get_error_string
8 bitmap_surface_create
9 bitmap_surface_destroy
10 bitmap_surface_put_bits_native
11 bitmap_surface_query_capabilities
12 decoder_create
13 decoder_destroy
14 decoder_render
15 device_destroy
16 generate_csc_matrix GenerateCSCMatrix # CSC completely capitalized
17 output_surface_create
18 output_surface_destroy
19 output_surface_get_bits_native
20 output_surface_put_bits_indexed
21 output_surface_put_bits_native
22 output_surface_render_bitmap_surface
23 output_surface_render_output_surface
24 preemption_callback_register
25 presentation_queue_block_until_surface_idle
26 presentation_queue_create
27 presentation_queue_destroy
28 presentation_queue_display
29 presentation_queue_get_time
30 presentation_queue_query_surface_status
31 presentation_queue_target_create_x11
32 presentation_queue_target_destroy
33 video_mixer_create
34 video_mixer_destroy
35 video_mixer_query_feature_support
36 video_mixer_render
37 video_mixer_set_attribute_values
38 video_mixer_set_feature_enables
39 video_surface_create
40 video_surface_destroy
41 video_surface_put_bits_y_cb_cr
42 """
44 print("""
45 /* List the VDPAU functions used by MPlayer.
46 * Generated by vdpau_functions.py.
47 * First argument on each line is the VDPAU function type name,
48 * second macro name needed to get function address,
49 * third name MPlayer uses for the function.
51 """)
52 for line in functions.splitlines():
53 parts = line.split('#')[0].strip().split()
54 if not parts:
55 continue # empty/comment line
56 if len(parts) > 1:
57 mp_name, vdpau_name = parts
58 else:
59 mp_name = parts[0]
60 vdpau_name = ''.join(part.capitalize() for part in mp_name.split('_'))
61 macro_name = mp_name.upper()
62 print('VDP_FUNCTION(Vdp%s, VDP_FUNC_ID_%s, %s)' % (vdpau_name, macro_name, mp_name))