[FFmpeg-devel] [PATCH]Add function pointer struct to vdpau.h

Carl Eugen Hoyos cehoyos
Thu Feb 26 21:25:54 CET 2009


Hi!

All vdpau using applications, inside and outside ffmpeg, (will) need a set 
of function pointers to use vdpau functions.
Attached patch aims at reducing possible code duplication by defining a 
struct containing all function pointers.

Please comment, Carl Eugen
-------------- next part --------------
Index: libavcodec/vdpau.h
===================================================================
--- libavcodec/vdpau.h	(revision 17619)
+++ libavcodec/vdpau.h	(working copy)
@@ -81,6 +81,82 @@
     VdpBitstreamBuffer *bitstream_buffers;
 };
 
+/**
+ * \brief A structure to hold all function pointers VDPAU uses.
+ */
+struct vdpau_function_pointers {
+    VdpGetErrorString                   *get_error_string;
+    VdpGetProcAddress                   *get_proc_address;
+    VdpGetApiVersion                    *get_api_version;
+    VdpGetInformationString             *get_information_string;
+    VdpDeviceDestroy                    *device_destroy;
+    VdpGenerateCSCMatrix                *generate_csc_matrix;
+    VdpVideoSurfaceQueryCapabilities    *video_surface_query_capabilities;
+    VdpVideoSurfaceQueryGetPutBitsYCbCrCapabilities
+                *video_surface_query_get_put_bits_y_cb_cr_capabilities;
+    VdpVideoSurfaceCreate               *video_surface_create;
+    VdpVideoSurfaceDestroy              *video_surface_destroy;
+    VdpVideoSurfaceGetParameters        *video_surface_get_parameters;
+    VdpVideoSurfaceGetBitsYCbCr         *video_surface_get_bits_y_cb_cr;
+    VdpVideoSurfacePutBitsYCbCr         *video_surface_put_bits_y_cb_cr;
+    VdpOutputSurfaceQueryCapabilities   *output_surface_query_capabilities;
+    VdpOutputSurfaceQueryGetPutBitsNativeCapabilities
+                *output_surface_query_get_put_bits_native_capabilities;
+    VdpOutputSurfaceQueryPutBitsIndexedCapabilities
+                *output_surface_query_put_bits_indexed_capabilities;
+    VdpOutputSurfaceQueryPutBitsYCbCrCapabilities
+                *output_surface_query_put_bits_y_cb_cr_capabilities;
+    VdpOutputSurfaceCreate              *output_surface_create;
+    VdpOutputSurfaceDestroy             *output_surface_destroy;
+    VdpOutputSurfaceGetParameters       *output_surface_get_parameters;
+    VdpOutputSurfaceGetBitsNative       *output_surface_get_bits_native;
+    VdpOutputSurfacePutBitsNative       *output_surface_put_bits_native;
+    VdpOutputSurfacePutBitsIndexed      *output_surface_put_bits_indexed;
+    VdpOutputSurfacePutBitsYCbCr        *output_surface_put_bits_y_cb_cr;
+    VdpBitmapSurfaceQueryCapabilities   *surface_query_capabilites;
+    VdpBitmapSurfaceCreate              *bitmap_surface_create;
+    VdpBitmapSurfaceDestroy             *bitmap_surface_destroy;
+    VdpBitmapSurfaceGetParameters       *bitmap_surface_get_parameters;
+    VdpBitmapSurfacePutBitsNative       *bitmap_surface_put_bits_native;
+    VdpOutputSurfaceRenderOutputSurface *output_surface_render_output_surface;
+    VdpOutputSurfaceRenderBitmapSurface *output_surface_render_bitmap_surface;
+    VdpDecoderQueryCapabilities         *decoder_query_capabilities;
+    VdpDecoderCreate                    *decoder_create;
+    VdpDecoderDestroy                   *decoder_destroy;
+    VdpDecoderGetParameters             *decoder_get_parameters;
+    VdpDecoderRender                    *decoder_render;
+    VdpVideoMixerQueryFeatureSupport    *video_mixer_query_feature_support;
+    VdpVideoMixerQueryParameterSupport  *video_mixer_query_parameter_support;
+    VdpVideoMixerQueryAttributeSupport  *video_mixer_query_attribute_support;
+    VdpVideoMixerQueryParameterValueRange
+                *video_mixer_query_parameter_value_range;
+    VdpVideoMixerQueryAttributeValueRange
+                *video_mixer_query_attribute_value_range;
+    VdpVideoMixerCreate                 *video_mixer_create;
+    VdpVideoMixerSetFeatureEnables      *video_mixer_set_feature_enables;
+    VdpVideoMixerSetAttributeValues     *video_mixer_set_attribute_values;
+    VdpVideoMixerGetFeatureSupport      *video_mixer_get_feature_support;
+    VdpVideoMixerGetFeatureEnables      *video_mixer_get_feature_enables;
+    VdpVideoMixerGetParameterValues     *video_mixer_get_parameter_values;
+    VdpVideoMixerGetAttributeValues     *video_mixer_get_attribute_values;
+    VdpVideoMixerDestroy                *video_mixer_destroy;
+    VdpVideoMixerRender                 *video_mixer_render;
+    VdpPresentationQueueTargetDestroy   *presentation_queue_target_destroy;
+    VdpPresentationQueueCreate          *presentation_queue_create;
+    VdpPresentationQueueDestroy         *presentation_queue_destroy;
+    VdpPresentationQueueSetBackgroundColor
+                *presentation_queue_set_background_color;
+    VdpPresentationQueueGetBackgroundColor 
+                *presentation_queue_get_background_color;
+    VdpPresentationQueueGetTime         *presentation_queue_get_time;
+    VdpPresentationQueueDisplay         *presentation_queue_display;
+    VdpPresentationQueueBlockUntilSurfaceIdle
+                *presentation_queue_block_until_surface_idle;
+    VdpPresentationQueueQuerySurfaceStatus
+                *presentation_queue_query_surface_status;
+    VdpPreemptionCallbackRegister       *preemption_callback_register;
+};
+
 /* @}*/
 
 #endif /* AVCODEC_VDPAU_H */



More information about the ffmpeg-devel mailing list