[vlc-devel] [PATCH 01/38] video_output: pass the video format to vout_SizeWindow()

Steve Lhomme robux4 at ycbcr.xyz
Wed Oct 2 08:39:50 CEST 2019


OK, this is probably not needed, I'll undo that.

On 2019-10-02 8:31, Rémi Denis-Courmont wrote:
> Hi,
> 
> It's a bit pointless change anyway, because sys and vout are part of the 
> same object, just different offsets within the allocation.
> 
> Le 2 octobre 2019 09:22:43 GMT+03:00, Thomas Guillem <thomas at gllm.fr> a 
> écrit :
> 
> 
> 
>     On Tue, Oct 1, 2019, at 13:12, Steve Lhomme wrote:
> 
>         and only pass the vout_thread_sys_t instead of the unused vout.
> 
>         This will be needed when the GetDevice call will create a window
>         without setting
>         the sys->original which is only related to the display module.
>         ------------------------------------------------------------------------
>         src/video_output/video_output.c | 19 ++++++++++---------
>         1 file changed, 10 insertions(+), 9 deletions(-)
> 
>         diff --git a/src/video_output/video_output.c
>         b/src/video_output/video_output.c
>         index eb022fb2ac0..1e7727f9730 100644
>         --- a/src/video_output/video_output.c
>         +++ b/src/video_output/video_output.c
>         @@ -147,14 +147,15 @@ static void vout_display_SizeWindow(unsigned
>         *restrict width,
>         *height = (h * cfg->zoom.num) / cfg->zoom.den;
>         }
> 
>         -static void vout_SizeWindow(vout_thread_t *vout, unsigned
>         *restrict width,
>         +static void vout_SizeWindow(vout_thread_sys_t *sys,
> 
> 
>     I disagree with the vout => sys change. If you do that, you will end up with vout_ prefixed functions using either a vout or a sys. Either all this file use a sys and functions are prefixed by vout_sys_ or you let the actual behavior.
> 
>         + const video_format_t *original,
>         + unsigned *restrict width,
>         unsigned *restrict height)
>         {
>         - vout_thread_sys_t *sys = vout->p;
>         - unsigned w = sys->original.i_visible_width;
>         - unsigned h = sys->original.i_visible_height;
>         - unsigned sar_num = sys->original.i_sar_num;
>         - unsigned sar_den = sys->original.i_sar_num;
>         + unsigned w = original->i_visible_width;
>         + unsigned h = original->i_visible_height;
>         + unsigned sar_num = original->i_sar_num;
>         + unsigned sar_den = original->i_sar_num;
> 
>         switch (sys->source.crop.mode) {
>         case VOUT_CROP_NONE:
>         @@ -190,7 +191,7 @@ static void vout_SizeWindow(vout_thread_t
>         *vout,
>         unsigned *restrict width,
> 
>         /* If the vout thread is running, the window lock must be held
>         here. */
>         vout_display_SizeWindow(width, height, w, h, sar_num, sar_den,
>         - sys->original.orientation,
>         + original->orientation,
>         &sys->display_cfg);
>         }
> 
>         @@ -203,7 +204,7 @@ static void
>         vout_UpdateWindowSizeLocked(vout_thread_t *vout)
> 
>         vlc_mutex_lock(&sys->display_lock);
>         if (sys->display != NULL) {
>         - vout_SizeWindow(vout, &width, &height);
>         + vout_SizeWindow(sys, &sys->original, &width, &height);
>         vlc_mutex_unlock(&sys->display_lock);
> 
>         msg_Dbg(vout, "requested window size: %ux%u", width, height);
>         @@ -1954,7 +1955,7 @@ int vout_Request(const
>         vout_configuration_t *cfg,
>         input_thread_t *input)
>         };
> 
>         VoutGetDisplayCfg(vout, &original, &sys->display_cfg);
>         - vout_SizeWindow(vout, &wcfg.width, &wcfg.height);
>         + vout_SizeWindow(sys, &sys->original, &wcfg.width, &wcfg.height);
> 
>         if (vout_window_Enable(sys->display_cfg.window, &wcfg)) {
>         vlc_mutex_unlock(&sys->window_lock);
>         -- 
>         2.17.1
>         ------------------------------------------------------------------------
>         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