[vlc-devel] [PATCH 8/9] vout: allow basic VOUT_DISPLAY_CHANGE_STEREO_MODE changes when crop+sar is supported
Thomas Guillem
thomas at gllm.fr
Sat Oct 27 16:26:32 CEST 2018
you missed all openGL vouts.
On Sat, Oct 27, 2018, at 08:46, Steve Lhomme wrote:
> In the future changing to device and/or shader based stereo mode will only be
> supported by a few modules.
>
> --
> another alternative would be for modules to advertise the non-crop
> stereo display
> modes they support in vout_display_info_t. It may also be possible to
> know when a
> display cannot handle a mode and look for another one. Rather than just
> failing to
> set a control value.
> ---
> modules/hw/mmal/vout.c | 15 +++++++++++++++
> modules/hw/vdpau/display.c | 17 +++++++++++++++++
> modules/video_output/android/display.c | 16 ++++++++++++++++
> modules/video_output/caopengllayer.m | 17 +++++++++++++++++
> modules/video_output/ios.m | 17 +++++++++++++++++
> modules/video_output/kva.c | 17 +++++++++++++++++
> modules/video_output/win32/common.c | 16 ++++++++++++++++
> modules/video_output/xcb/x11.c | 17 +++++++++++++++++
> modules/video_output/xcb/xvideo.c | 17 +++++++++++++++++
> 9 files changed, 149 insertions(+)
>
> diff --git a/modules/hw/mmal/vout.c b/modules/hw/mmal/vout.c
> index 19a58347b1..56acdceaef 100644
> --- a/modules/hw/mmal/vout.c
> +++ b/modules/hw/mmal/vout.c
> @@ -631,6 +631,21 @@ static int vd_control(vout_display_t *vd, int
> query, va_list args)
> ret = VLC_SUCCESS;
> break;
>
> + case VOUT_DISPLAY_CHANGE_STEREO_MODE:
> + tmp_cfg = va_arg(args, const vout_display_cfg_t *);
> + switch (tmp_cfg->stereo_mode)
> + {
> + /* allow basic crop handling */
> + case VIDEO_STEREO_OUTPUT_AUTO:
> + case VIDEO_STEREO_OUTPUT_ORIGINAL:
> + case VIDEO_STEREO_OUTPUT_LEFT_ONLY:
> + case VIDEO_STEREO_OUTPUT_RIGHT_ONLY:
> + ret = VLC_SUCCESS;
> + break;
> + default: break;
> + }
> + break;
> +
> case VOUT_DISPLAY_RESET_PICTURES:
> vlc_assert_unreachable();
> case VOUT_DISPLAY_CHANGE_ZOOM:
> diff --git a/modules/hw/vdpau/display.c b/modules/hw/vdpau/display.c
> index 9774f47eb3..f68bb3dfb0 100644
> --- a/modules/hw/vdpau/display.c
> +++ b/modules/hw/vdpau/display.c
> @@ -385,6 +385,23 @@ static int Control(vout_display_t *vd, int query,
> va_list ap)
> case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
> vout_display_SendEventPicturesInvalid (vd);
> return VLC_SUCCESS;
> + case VOUT_DISPLAY_CHANGE_STEREO_MODE:
> + {
> + const vout_display_cfg_t *cfg = va_arg(ap, const
> vout_display_cfg_t *);
> + switch (cfg->stereo_mode)
> + {
> + /* allow basic crop handling */
> + case VIDEO_STEREO_OUTPUT_AUTO:
> + case VIDEO_STEREO_OUTPUT_ORIGINAL:
> + case VIDEO_STEREO_OUTPUT_LEFT_ONLY:
> + case VIDEO_STEREO_OUTPUT_RIGHT_ONLY:
> + return VLC_SUCCESS;
> + default:
> + return VLC_EGENERIC;
> + }
> + break;
> + }
> +
> default:
> msg_Err(vd, "unknown control request %d", query);
> return VLC_EGENERIC;
> diff --git a/modules/video_output/android/display.c b/modules/
> video_output/android/display.c
> index e3dfeab2ab..c0477595ed 100644
> --- a/modules/video_output/android/display.c
> +++ b/modules/video_output/android/display.c
> @@ -1042,6 +1042,22 @@ static int Control(vout_display_t *vd, int query,
> va_list args)
> FixSubtitleFormat(sys);
> return VLC_SUCCESS;
> }
> + case VOUT_DISPLAY_CHANGE_STEREO_MODE:
> + {
> + const vout_display_cfg_t *cfg = va_arg(args, const
> vout_display_cfg_t *);
> + switch (cfg->stereo_mode)
> + {
> + /* allow basic crop handling */
> + case VIDEO_STEREO_OUTPUT_AUTO:
> + case VIDEO_STEREO_OUTPUT_ORIGINAL:
> + case VIDEO_STEREO_OUTPUT_LEFT_ONLY:
> + case VIDEO_STEREO_OUTPUT_RIGHT_ONLY:
> + return VLC_SUCCESS;
> + default:
> + return VLC_EGENERIC;
> + }
> + break;
> + }
> case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
> {
> const vout_display_cfg_t *cfg = va_arg(args, const
> vout_display_cfg_t *);
> diff --git a/modules/video_output/caopengllayer.m b/modules/
> video_output/caopengllayer.m
> index d334c6b62c..0534facca5 100644
> --- a/modules/video_output/caopengllayer.m
> +++ b/modules/video_output/caopengllayer.m
> @@ -361,6 +361,23 @@ static int Control (vout_display_t *vd, int query,
> va_list ap)
> return VLC_SUCCESS;
> }
>
> + case VOUT_DISPLAY_CHANGE_STEREO_MODE:
> + {
> + const vout_display_cfg_t *cfg = va_arg(ap, const
> vout_display_cfg_t *);
> + switch (cfg->stereo_mode)
> + {
> + /* allow basic crop handling */
> + case VIDEO_STEREO_OUTPUT_AUTO:
> + case VIDEO_STEREO_OUTPUT_ORIGINAL:
> + case VIDEO_STEREO_OUTPUT_LEFT_ONLY:
> + case VIDEO_STEREO_OUTPUT_RIGHT_ONLY:
> + return VLC_SUCCESS;
> + default:
> + return VLC_EGENERIC;
> + }
> + break;
> + }
> +
> case VOUT_DISPLAY_CHANGE_VIEWPOINT:
> {
> int ret;
> diff --git a/modules/video_output/ios.m b/modules/video_output/ios.m
> index 7629cdbb87..d79691bce5 100644
> --- a/modules/video_output/ios.m
> +++ b/modules/video_output/ios.m
> @@ -285,6 +285,23 @@ static int Control(vout_display_t *vd, int query,
> va_list ap)
> return VLC_SUCCESS;
> }
>
> + case VOUT_DISPLAY_CHANGE_STEREO_MODE:
> + {
> + const vout_display_cfg_t *cfg = va_arg(ap, const
> vout_display_cfg_t *);
> + switch (cfg->stereo_mode)
> + {
> + /* allow basic crop handling */
> + case VIDEO_STEREO_OUTPUT_AUTO:
> + case VIDEO_STEREO_OUTPUT_ORIGINAL:
> + case VIDEO_STEREO_OUTPUT_LEFT_ONLY:
> + case VIDEO_STEREO_OUTPUT_RIGHT_ONLY:
> + return VLC_SUCCESS;
> + default:
> + return VLC_EGENERIC;
> + }
> + break;
> + }
> +
> case VOUT_DISPLAY_CHANGE_VIEWPOINT:
> return vout_display_opengl_SetViewpoint(glsys->vgl,
> &va_arg (ap, const vout_display_cfg_t* )->viewpoint);
> diff --git a/modules/video_output/kva.c b/modules/video_output/kva.c
> index 1cb5417ed4..17f4283867 100644
> --- a/modules/video_output/kva.c
> +++ b/modules/video_output/kva.c
> @@ -461,6 +461,23 @@ static int Control( vout_display_t *vd, int query,
> va_list args )
> return VLC_SUCCESS;
> }
>
> + case VOUT_DISPLAY_CHANGE_STEREO_MODE:
> + {
> + const vout_display_cfg_t *cfg = va_arg(args, const
> vout_display_cfg_t *);
> + switch (cfg->stereo_mode)
> + {
> + /* allow basic crop handling */
> + case VIDEO_STEREO_OUTPUT_AUTO:
> + case VIDEO_STEREO_OUTPUT_ORIGINAL:
> + case VIDEO_STEREO_OUTPUT_LEFT_ONLY:
> + case VIDEO_STEREO_OUTPUT_RIGHT_ONLY:
> + return VLC_SUCCESS;
> + default:
> + return VLC_EGENERIC;
> + }
> + break;
> + }
> +
> case VOUT_DISPLAY_RESET_PICTURES:
> case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:
> /* TODO */
> diff --git a/modules/video_output/win32/common.c b/modules/video_output/
> win32/common.c
> index eb2c08a54c..3415b99fb4 100644
> --- a/modules/video_output/win32/common.c
> +++ b/modules/video_output/win32/common.c
> @@ -618,6 +618,22 @@ int CommonControl(vout_display_t *vd, int query,
> va_list args)
> UpdateRects(vd, cfg, true);
> return VLC_SUCCESS;
> }
> + case VOUT_DISPLAY_CHANGE_STEREO_MODE:
> + {
> + const vout_display_cfg_t *cfg = va_arg(args, const
> vout_display_cfg_t *);
> + switch (cfg->stereo_mode)
> + {
> + /* allow basic crop handling */
> + case VIDEO_STEREO_OUTPUT_AUTO:
> + case VIDEO_STEREO_OUTPUT_ORIGINAL:
> + case VIDEO_STEREO_OUTPUT_LEFT_ONLY:
> + case VIDEO_STEREO_OUTPUT_RIGHT_ONLY:
> + return VLC_SUCCESS;
> + default:
> + return VLC_EGENERIC;
> + }
> + break;
> + }
> #if !VLC_WINSTORE_APP
> case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE: /* const
> vout_display_cfg_t *p_cfg */
> { /* Update dimensions */
> diff --git a/modules/video_output/xcb/x11.c b/modules/video_output/xcb/
> x11.c
> index fecf7f0856..da5b18b962 100644
> --- a/modules/video_output/xcb/x11.c
> +++ b/modules/video_output/xcb/x11.c
> @@ -478,6 +478,23 @@ static int Control (vout_display_t *vd, int query,
> va_list ap)
> vout_display_SendEventPicturesInvalid (vd);
> return VLC_SUCCESS;
>
> + case VOUT_DISPLAY_CHANGE_STEREO_MODE:
> + {
> + const vout_display_cfg_t *cfg = va_arg(ap, const
> vout_display_cfg_t *);
> + switch (cfg->stereo_mode)
> + {
> + /* allow basic crop handling */
> + case VIDEO_STEREO_OUTPUT_AUTO:
> + case VIDEO_STEREO_OUTPUT_ORIGINAL:
> + case VIDEO_STEREO_OUTPUT_LEFT_ONLY:
> + case VIDEO_STEREO_OUTPUT_RIGHT_ONLY:
> + return VLC_SUCCESS;
> + default:
> + return VLC_EGENERIC;
> + }
> + break;
> + }
> +
> case VOUT_DISPLAY_RESET_PICTURES:
> {
> ResetPictures (vd);
> diff --git a/modules/video_output/xcb/xvideo.c b/modules/video_output/
> xcb/xvideo.c
> index 394144cb20..4ea98e8d47 100644
> --- a/modules/video_output/xcb/xvideo.c
> +++ b/modules/video_output/xcb/xvideo.c
> @@ -741,6 +741,23 @@ static int Control (vout_display_t *vd, int query,
> va_list ap)
> return VLC_SUCCESS;
> }
>
> + case VOUT_DISPLAY_CHANGE_STEREO_MODE:
> + {
> + const vout_display_cfg_t *cfg = va_arg(ap, const vout_display_cfg_t *);
> + switch (cfg->stereo_mode)
> + {
> + /* allow basic crop handling */
> + case VIDEO_STEREO_OUTPUT_AUTO:
> + case VIDEO_STEREO_OUTPUT_ORIGINAL:
> + case VIDEO_STEREO_OUTPUT_LEFT_ONLY:
> + case VIDEO_STEREO_OUTPUT_RIGHT_ONLY:
> + return VLC_SUCCESS;
> + default:
> + return VLC_EGENERIC;
> + }
> + break;
> + }
> +
> case VOUT_DISPLAY_RESET_PICTURES:
> vlc_assert_unreachable();
> default:
> --
> 2.17.0
>
> _______________________________________________
> 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