[vlc-devel] [PATCH 1/8] vout display: add an API to handle surface rendering through a callback

Steve Lhomme robux4 at ycbcr.xyz
Mon May 6 15:01:30 CEST 2019


The callbacks will be used by D3D but could also be used by other rendering
engines.
---
 include/vlc_vout_display.h | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index bdae03881c..7b2c9cf0d3 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -455,5 +455,32 @@ VLC_API void vout_display_PlacePicture(vout_display_place_t *place, const video_
 void vout_display_TranslateMouseState(vout_display_t *vd, vlc_mouse_t *video,
                                       const vlc_mouse_t *window);
 
+/*** rendering to external surfaces ***/
+typedef struct
+{
+    bool hardware_decoding; /** set if D3D11_CREATE_DEVICE_VIDEO_SUPPORT is needed */
+} vlc_video_surface_device_cfg_t;
+
+typedef struct
+{
+    void *device_context; /** ID3D11DeviceContext* for D3D11, IDirect3DDevice9* for D3D9 */
+} vlc_video_surface_device_setup_t;
+
+typedef struct
+{
+    unsigned width, height;
+} vlc_video_surface_cfg_t;
+
+typedef struct
+{
+    intptr_t          surface_format; /* DXGI_FORMAT for D3D11, D3DFORMAT for D3D9 */
+} video_surface_output_cfg_t;
+
+typedef bool( *vlc_video_surface_device_setup_cb )( void *opaque, const vlc_video_surface_device_cfg_t *cfg, vlc_video_surface_device_setup_t *out );
+typedef void( *vlc_video_surface_device_cleanup_cb )( void *opaque );
+typedef bool( *vlc_video_surface_update_output_cb )( void *opaque, const vlc_video_surface_cfg_t *cfg, video_surface_output_cfg_t *output );
+typedef void( *vlc_video_swap_cb )( void* opaque );
+typedef bool( *vlc_video_surface_start_rendering_cb )( void *opaque, bool enter );
+
 /** @} */
 #endif /* VLC_VOUT_DISPLAY_H */
-- 
2.17.1



More information about the vlc-devel mailing list