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

Steve Lhomme robux4 at ycbcr.xyz
Wed May 8 08:22:13 CEST 2019


On 2019-05-07 12:03, Rémi Denis-Courmont wrote:
> Sure there is. Video callbacks support it fully. X11 and HWND 
> automatically use a separate window if there is more than one track.

I think you are referring to the use of the "window" variable set to 
either "embed-hwnd" or "embed-xid". There is indeed a mechanism there 
where you can set multiple values and it keeps tracks of which ones are 
in use.

It's technically possible to set different values to "drawable-hwnd" and 
"drawable-xid" so that two video tracks could be played at the same time 
in different windows. To do that one have to call 
libvlc_media_player_set_hwnd/xwindow() between the time the first window 
is created and the second one is created. The host can tell when a 
libvlc_MediaPlayerESAdded event is received.

The API I proposed for handling the host surface size cannot work with 
this. It doesn't differentiate what window it's referring to, the value 
would apply to all of them.

I guess passing the ES ID to the size API would solve this. It might be 
tricky to implement though. The WindowSize callback will need to know 
which ES it belongs to and only apply the size if in the window it 
belons to.

The surface callbacks would not be affected as the host app can either 
change them (especially the opaque) just like it can call 
libvlc_media_player_set_hwnd/xwindow() multiple times or handle the 
device setup differently between the different IDs.

> Le 7 mai 2019 09:34:43 GMT+03:00, Steve Lhomme <robux4 at ycbcr.xyz> a écrit :
> 
>     On 2019-05-06 17:06, Rémi Denis-Courmont wrote:
> 
>         Le maanantaina 6. toukokuuta 2019, 16.01.30 EEST Steve Lhomme a
>         écrit :
> 
>             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 );
> 
>         How does the application track per-surface private data here?
> 
> 
>     There's currently no support for rendering multiple tracks in a target,
>     be it OpenGL, Direct3D, HWND, NSView. That would be another topic/task.
> 
>     >
> 
>             +
>             /** @} */
>             #endif /* VLC_VOUT_DISPLAY_H */
> 
>         -- 
>         レミ・デニ-クールモン
>         http://www.remlab.net/
>         ------------------------------------------------------------------------
>         vlc-devel mailing list
>         To unsubscribe or modify your subscription options:
>         https://mailman.videolan.org/listinfo/vlc-devel
> 
>     ------------------------------------------------------------------------
>     vlc-devel mailing list
>     To unsubscribe or modify your subscription options:
>     https://mailman.videolan.org/listinfo/vlc-devel
> 
> 
> -- 
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser 
> ma brièveté.
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
> 


More information about the vlc-devel mailing list