summaryrefslogtreecommitdiffstats
path: root/TOOLS
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-05-06 00:17:21 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-08-29 20:18:42 +0300
commitdc44507f2ad9d6301557d32d41a87cee6e6ae934 (patch)
treec41a75c7b4965f92b377b42124d544c657b5d9e1 /TOOLS
parent09943048cbe71cb15742608400c595cf5d4d1c45 (diff)
downloadmpv-dc44507f2ad9d6301557d32d41a87cee6e6ae934.tar.bz2
mpv-dc44507f2ad9d6301557d32d41a87cee6e6ae934.tar.xz
vo_vdpau: Add template file for VDPAU functions
Add a template file that contains a single listing of various information needed about the VDPAU interface functions, and is then included multiple times to create required declarations and tables. Previously some of the information needed to be duplicated for each of those uses.
Diffstat (limited to 'TOOLS')
-rw-r--r--TOOLS/vdpau_functions.py56
1 files changed, 56 insertions, 0 deletions
diff --git a/TOOLS/vdpau_functions.py b/TOOLS/vdpau_functions.py
new file mode 100644
index 0000000000..386d70ab33
--- /dev/null
+++ b/TOOLS/vdpau_functions.py
@@ -0,0 +1,56 @@
+# Generate vdpau_template.c
+
+functions = """
+# 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
+decoder_create
+decoder_destroy
+decoder_render
+device_destroy
+generate_csc_matrix GenerateCSCMatrix # CSC completely capitalized
+output_surface_create
+output_surface_destroy
+output_surface_put_bits_indexed
+output_surface_put_bits_native
+output_surface_render_bitmap_surface
+output_surface_render_output_surface
+presentation_queue_block_until_surface_idle
+presentation_queue_create
+presentation_queue_destroy
+presentation_queue_display
+presentation_queue_target_create_x11
+presentation_queue_target_destroy
+video_mixer_create
+video_mixer_destroy
+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
+"""
+
+print("""
+/* List the VDPAU functions used by MPlayer.
+ * Generated by vdpau_functions.py.
+ * First argument on each line is the VDPAU function type name,
+ * second macro name needed to get function address,
+ * third name MPlayer uses for the function.
+ */
+""")
+for line in functions.splitlines():
+ parts = line.split('#')[0].strip().split()
+ if not parts:
+ continue # empty/comment line
+ if len(parts) > 1:
+ mp_name, vdpau_name = parts
+ else:
+ mp_name = parts[0]
+ vdpau_name = ''.join(part.capitalize() for part in mp_name.split('_'))
+ macro_name = mp_name.upper()
+ print('VDP_FUNCTION(Vdp%s, VDP_FUNC_ID_%s, %s)' % (vdpau_name, macro_name, mp_name))