[vlc-devel] [PATCH 6/7] vout: display: rename display function to vout_display_XXX

Thomas Guillem thomas at gllm.fr
Wed Oct 9 17:58:52 CEST 2019



On Wed, Oct 9, 2019, at 17:36, Steve Lhomme wrote:
> Not to be confused with regular the vout_XXX API.
> They're not public functions
> ---
>  src/video_output/display.c      | 62 ++++++++++++++++-----------------
>  src/video_output/video_output.c | 22 ++++++------
>  src/video_output/vout_wrapper.c |  4 +--
>  src/video_output/vout_wrapper.h | 18 +++++-----
>  4 files changed, 53 insertions(+), 53 deletions(-)
> 
> diff --git a/src/video_output/display.c b/src/video_output/display.c
> index e95e9539f17..4fe7654e710 100644
> --- a/src/video_output/display.c
> +++ b/src/video_output/display.c
> @@ -406,14 +406,14 @@ picture_pool_t *vout_GetPool(vout_display_t *vd, 
> unsigned count)
>      return osys->pool;
>  }
>  
> -bool vout_IsDisplayFiltered(vout_display_t *vd)
> +bool VoutDisplayIsFiltered(vout_display_t *vd)

I prefer vout_display_Is*

>  {
>      vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, display);
>  
>      return osys->converters == NULL || !filter_chain_IsEmpty(osys->converters);
>  }
>  
> -picture_t *vout_ConvertForDisplay(vout_display_t *vd, picture_t *picture)
> +picture_t *VoutDisplayConvertForDisplay(vout_display_t *vd, picture_t *picture)
>  {
>      vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, display);
>  
> @@ -447,14 +447,14 @@ picture_t *vout_display_Prepare(vout_display_t 
> *vd, picture_t *picture,
>                                  subpicture_t *subpic, vlc_tick_t date)
>  {
>      assert(subpic == NULL); /* TODO */
> -    picture = vout_ConvertForDisplay(vd, picture);
> +    picture = VoutDisplayConvertForDisplay(vd, picture);
>  
>      if (picture != NULL && vd->prepare != NULL)
>          vd->prepare(vd, picture, subpic, date);
>      return picture;
>  }
>  
> -void vout_FilterFlush(vout_display_t *vd)
> +void VoutDisplayFlush(vout_display_t *vd)
>  {
>      vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, display);
>  
> @@ -462,7 +462,7 @@ void vout_FilterFlush(vout_display_t *vd)
>          filter_chain_VideoFlush(osys->converters);
>  }
>  
> -static void vout_display_Reset(vout_display_t *vd)
> +static void VoutDisplayReset(vout_display_t *vd)
>  {
>      vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, display);
>  
> @@ -482,7 +482,7 @@ static void vout_display_Reset(vout_display_t *vd)
>          msg_Err(vd, "Failed to adjust render format");
>  }
>  
> -static void vout_display_CheckReset(vout_display_t *vd)
> +static void VoutDisplayCheckReset(vout_display_t *vd)
>  {
>  #ifdef _WIN32
>      vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, display);
> @@ -490,14 +490,14 @@ static void vout_display_CheckReset(vout_display_t *vd)
>      if (unlikely(atomic_exchange_explicit(&osys->reset_pictures, false,
>                                            memory_order_relaxed))) {
>          atomic_thread_fence(memory_order_acquire);
> -        vout_display_Reset(vd);
> +        VoutDisplayReset(vd);
>      }
>  #else
>      (void) vd;
>  #endif
>  }
>  
> -static int vout_UpdateSourceCrop(vout_display_t *vd)
> +static int VoutDisplayUpdateSourceCrop(vout_display_t *vd)
>  {
>      vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, display);
>      unsigned crop_num = osys->crop.num;
> @@ -555,7 +555,7 @@ static int vout_UpdateSourceCrop(vout_display_t *vd)
>      return ret;
>  }
>  
> -static int vout_SetSourceAspect(vout_display_t *vd,
> +static int VoutDisplaySetSourceAspect(vout_display_t *vd,
>                                  unsigned sar_num, unsigned sar_den)
>  {
>      vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, display);
> @@ -575,7 +575,7 @@ static int vout_SetSourceAspect(vout_display_t *vd,
>  
>      /* If a crop ratio is requested, recompute the parameters */
>      if (osys->crop.num != 0 && osys->crop.den != 0
> -     && vout_UpdateSourceCrop(vd))
> +     && VoutDisplayUpdateSourceCrop(vd))
>          ret = -1;
>  
>      return ret;
> @@ -605,7 +605,7 @@ void 
> vout_UpdateDisplaySourceProperties(vout_display_t *vd, const 
> video_format_t
>          osys->source.i_sar_den = fixed_src.i_sar_den;
>  
>          /* FIXME it will override any AR that the user would have 
> forced */
> -        err1 = vout_SetSourceAspect(vd, osys->source.i_sar_num,
> +        err1 = VoutDisplaySetSourceAspect(vd, osys->source.i_sar_num,
>                                      osys->source.i_sar_den);
>      }
>      if (source->i_x_offset       != osys->source.i_x_offset ||
> @@ -617,13 +617,13 @@ void 
> vout_UpdateDisplaySourceProperties(vout_display_t *vd, const 
> video_format_t
>  
>          /* Force the vout to reapply the current user crop settings
>           * over the new decoder crop settings. */
> -        err2 = vout_UpdateSourceCrop(vd);
> +        err2 = VoutDisplayUpdateSourceCrop(vd);
>      }
>  
>      if (err1 || err2)
> -        vout_display_Reset(vd);
> +        VoutDisplayReset(vd);
>  
> -    vout_display_CheckReset(vd);
> +    VoutDisplayCheckReset(vd);
>  }
>  
>  void vout_display_SetSize(vout_display_t *vd, unsigned width, unsigned 
> height)
> @@ -633,11 +633,11 @@ void vout_display_SetSize(vout_display_t *vd, 
> unsigned width, unsigned height)
>      osys->cfg.display.width  = width;
>      osys->cfg.display.height = height;
>      if (vout_display_Control(vd, VOUT_DISPLAY_CHANGE_DISPLAY_SIZE, 
> &osys->cfg))
> -        vout_display_Reset(vd);
> -    vout_display_CheckReset(vd);
> +        VoutDisplayReset(vd);
> +    VoutDisplayCheckReset(vd);
>  }
>  
> -void vout_SetDisplayFilled(vout_display_t *vd, bool is_filled)
> +void VoutDisplaySetFilled(vout_display_t *vd, bool is_filled)
>  {
>      vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, display);
>  
> @@ -647,11 +647,11 @@ void vout_SetDisplayFilled(vout_display_t *vd, 
> bool is_filled)
>      osys->cfg.is_display_filled = is_filled;
>      if (vout_display_Control(vd, VOUT_DISPLAY_CHANGE_DISPLAY_FILLED,
>                               &osys->cfg))
> -        vout_display_Reset(vd);
> -    vout_display_CheckReset(vd);
> +        VoutDisplayReset(vd);
> +    VoutDisplayCheckReset(vd);
>  }
>  
> -void vout_SetDisplayZoom(vout_display_t *vd, unsigned num, unsigned den)
> +void VoutDisplaySetZoom(vout_display_t *vd, unsigned num, unsigned den)
>  {
>      vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, display);
>  
> @@ -662,11 +662,11 @@ void vout_SetDisplayZoom(vout_display_t *vd, 
> unsigned num, unsigned den)
>      osys->cfg.zoom.num = num;
>      osys->cfg.zoom.den = den;
>      if (vout_display_Control(vd, VOUT_DISPLAY_CHANGE_ZOOM, &osys->cfg))
> -        vout_display_Reset(vd);
> -    vout_display_CheckReset(vd);
> +        VoutDisplayReset(vd);
> +    VoutDisplayCheckReset(vd);
>  }
>  
> -void vout_SetDisplayAspect(vout_display_t *vd, unsigned dar_num, 
> unsigned dar_den)
> +void VoutDisplaySetAspectRatio(vout_display_t *vd, unsigned dar_num, 
> unsigned dar_den)
>  {
>      vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, 
> display);
>  
> @@ -680,12 +680,12 @@ void vout_SetDisplayAspect(vout_display_t *vd, 
> unsigned dar_num, unsigned dar_de
>          sar_den = 0;
>      }
>  
> -    if (vout_SetSourceAspect(vd, sar_num, sar_den))
> -        vout_display_Reset(vd);
> -    vout_display_CheckReset(vd);
> +    if (VoutDisplaySetSourceAspect(vd, sar_num, sar_den))
> +        VoutDisplayReset(vd);
> +    VoutDisplayCheckReset(vd);
>  }
>  
> -void vout_SetDisplayCrop(vout_display_t *vd,
> +void VoutDisplaySetCrop(vout_display_t *vd,
>                           unsigned crop_num, unsigned crop_den,
>                           unsigned left, unsigned top, int right, int bottom)
>  {
> @@ -703,13 +703,13 @@ void vout_SetDisplayCrop(vout_display_t *vd,
>          osys->crop.num    = crop_num;
>          osys->crop.den    = crop_den;
>  
> -        if (vout_UpdateSourceCrop(vd))
> -            vout_display_Reset(vd);
> -        vout_display_CheckReset(vd);
> +        if (VoutDisplayUpdateSourceCrop(vd))
> +            VoutDisplayReset(vd);
> +        VoutDisplayCheckReset(vd);
>      }
>  }
>  
> -void vout_SetDisplayViewpoint(vout_display_t *vd,
> +void VoutDisplaySetViewpoint(vout_display_t *vd,
>                                const vlc_viewpoint_t *p_viewpoint)
>  {
>      vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, 
> display);
> diff --git a/src/video_output/video_output.c 
> b/src/video_output/video_output.c
> index adbacd0633f..8970a43c2ca 100644
> --- a/src/video_output/video_output.c
> +++ b/src/video_output/video_output.c
> @@ -442,7 +442,7 @@ void vout_ChangeDisplayFilled(vout_thread_t *vout, 
> bool is_filled)
>      vlc_mutex_unlock(&sys->window_lock);
>  
>      if (sys->display != NULL)
> -        vout_SetDisplayFilled(sys->display, is_filled);
> +        VoutDisplaySetFilled(sys->display, is_filled);
>      vlc_mutex_unlock(&sys->display_lock);
>  }
>  
> @@ -476,7 +476,7 @@ void vout_ChangeZoom(vout_thread_t *vout, unsigned 
> num, unsigned den)
>      vlc_mutex_unlock(&sys->window_lock);
>  
>      if (sys->display != NULL)
> -        vout_SetDisplayZoom(sys->display, num, den);
> +        VoutDisplaySetZoom(sys->display, num, den);
>      vlc_mutex_unlock(&sys->display_lock);
>  }
>  
> @@ -496,7 +496,7 @@ void vout_ChangeDisplayAspectRatio(vout_thread_t *vout,
>      vlc_mutex_unlock(&sys->window_lock);
>  
>      if (sys->display != NULL)
> -        vout_SetDisplayAspect(sys->display, dar_num, dar_den);
> +        VoutDisplaySetAspectRatio(sys->display, dar_num, dar_den);
>      vlc_mutex_unlock(&sys->display_lock);
>  }
>  
> @@ -519,7 +519,7 @@ void vout_ChangeCropRatio(vout_thread_t *vout, 
> unsigned num, unsigned den)
>      vlc_mutex_unlock(&sys->window_lock);
>  
>      if (sys->display != NULL)
> -        vout_SetDisplayCrop(sys->display, num, den, 0, 0, 0, 0);
> +        VoutDisplaySetCrop(sys->display, num, den, 0, 0, 0, 0);
>      vlc_mutex_unlock(&sys->display_lock);
>  }
>  
> @@ -551,7 +551,7 @@ void vout_ChangeCropWindow(vout_thread_t *vout,
>      vlc_mutex_unlock(&sys->window_lock);
>  
>      if (sys->display != NULL)
> -        vout_SetDisplayCrop(vout->p->display, 0, 0, x, y, width, height);
> +        VoutDisplaySetCrop(sys->display, 0, 0, x, y, width, height);
>      vlc_mutex_unlock(&vout->p->display_lock);
>  }
>  
> @@ -583,7 +583,7 @@ void vout_ChangeCropBorder(vout_thread_t *vout,
>      vlc_mutex_unlock(&sys->window_lock);
>  
>      if (sys->display != NULL)
> -        vout_SetDisplayCrop(vout->p->display, 0, 0,
> +        VoutDisplaySetCrop(vout->p->display, 0, 0,
>                              left, top, -right, -bottom);
>      vlc_mutex_unlock(&sys->display_lock);
>  }
> @@ -1156,7 +1156,7 @@ static int 
> ThreadDisplayRenderPicture(vout_thread_t *vout, bool is_forced)
>      /* Render the direct buffer */
>      vout_UpdateDisplaySourceProperties(vd, &todisplay->format);
>  
> -    todisplay = vout_ConvertForDisplay(vd, todisplay);
> +    todisplay = VoutDisplayConvertForDisplay(vd, todisplay);
>      if (todisplay == NULL) {
>          vlc_mutex_unlock(&sys->display_lock);
>  
> @@ -1371,7 +1371,7 @@ static void vout_FlushUnlocked(vout_thread_t 
> *vout, bool below,
>  
>      vlc_mutex_lock(&vout->p->display_lock);
>      assert(vout->p->display != NULL);
> -    vout_FilterFlush(vout->p->display);
> +    VoutDisplayFlush(vout->p->display);
>      vlc_mutex_unlock(&vout->p->display_lock);
>  
>      vlc_clock_Reset(vout->p->clock);
> @@ -1568,10 +1568,10 @@ static int vout_Start(vout_thread_t *vout, 
> const vout_configuration_t *cfg)
>          goto error;
>      }
>  
> -    vout_SetDisplayCrop(sys->display, num, den, x, y, w, h);
> +    VoutDisplaySetCrop(sys->display, num, den, x, y, w, h);
>  
>      if (num != 0 && den != 0)
> -        vout_SetDisplayAspect(sys->display, num, den);
> +        VoutDisplaySetAspectRatio(sys->display, num, den);
>      vlc_mutex_unlock(&sys->display_lock);
>  
>      assert(sys->decoder_pool != NULL && sys->private_pool != NULL);
> @@ -1637,7 +1637,7 @@ static void ThreadControl(vout_thread_t *vout, 
> vout_control_cmd_t cmd)
>          break;
>      case VOUT_CONTROL_VIEWPOINT:
>          vlc_mutex_lock(&vout->p->display_lock);
> -        vout_SetDisplayViewpoint(vout->p->display, &cmd.viewpoint);
> +        VoutDisplaySetViewpoint(vout->p->display, &cmd.viewpoint);
>          vlc_mutex_unlock(&vout->p->display_lock);
>          break;
>      default:
> diff --git a/src/video_output/vout_wrapper.c 
> b/src/video_output/vout_wrapper.c
> index 9ac6e2eab08..71c555a4f64 100644
> --- a/src/video_output/vout_wrapper.c
> +++ b/src/video_output/vout_wrapper.c
> @@ -82,7 +82,7 @@ vout_display_t *vout_OpenWrapper(vout_thread_t *vout,
>      sys->decoder_pool = NULL;
>      sys->display_pool = NULL;
>  
> -    const bool use_dr = !vout_IsDisplayFiltered(vd);
> +    const bool use_dr = !VoutDisplayIsFiltered(vd);
>      const bool allow_dr = !vd->info.has_pictures_invalid && use_dr;
>      const unsigned private_picture  = 4; /* XXX 3 for filter, 1 for 
> SPU */
>      const unsigned decoder_picture  = 1 + sys->dpb_size;
> @@ -156,7 +156,7 @@ void vout_CloseWrapper(vout_thread_t *vout, 
> vout_display_t *vd)
>  
>      picture_pool_Release(sys->private_pool);
>  
> -    if (sys->display_pool != NULL || vout_IsDisplayFiltered(vd))
> +    if (sys->display_pool != NULL || VoutDisplayIsFiltered(vd))
>          picture_pool_Release(sys->decoder_pool);
>  
>  #ifdef _WIN32
> diff --git a/src/video_output/vout_wrapper.h 
> b/src/video_output/vout_wrapper.h
> index d95a34359d0..e0ae7d9d13b 100644
> --- a/src/video_output/vout_wrapper.h
> +++ b/src/video_output/vout_wrapper.h
> @@ -32,16 +32,16 @@ picture_pool_t *vout_GetPool(vout_display_t *vd, 
> unsigned count);
>  /**
>   * It destroy a vout managed display.
>   */
> -bool vout_IsDisplayFiltered(vout_display_t *);
> -picture_t * vout_ConvertForDisplay(vout_display_t *, picture_t *);
> -void vout_FilterFlush(vout_display_t *);
> -
> -void vout_SetDisplayFilled(vout_display_t *, bool is_filled);
> -void vout_SetDisplayZoom(vout_display_t *, unsigned num, unsigned den);
> -void vout_SetDisplayAspect(vout_display_t *, unsigned num, unsigned 
> den);
> -void vout_SetDisplayCrop(vout_display_t *, unsigned num, unsigned den,
> +bool VoutDisplayIsFiltered(vout_display_t *);
> +picture_t * VoutDisplayConvertForDisplay(vout_display_t *, picture_t 
> *);
> +void VoutDisplayFlush(vout_display_t *);
> +
> +void VoutDisplaySetFilled(vout_display_t *, bool is_filled);
> +void VoutDisplaySetZoom(vout_display_t *, unsigned num, unsigned den);
> +void VoutDisplaySetAspectRatio(vout_display_t *, unsigned num, 
> unsigned den);
> +void VoutDisplaySetCrop(vout_display_t *, unsigned num, unsigned den,
>                           unsigned left, unsigned top, int right, int 
> bottom);
> -void vout_SetDisplayViewpoint(vout_display_t *, const vlc_viewpoint_t 
> *);
> +void VoutDisplaySetViewpoint(vout_display_t *, const vlc_viewpoint_t 
> *);
>  
>  #endif /* LIBVLC_VOUT_WRAPPER_H */
>  
> -- 
> 2.17.1
> 
> _______________________________________________
> 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