[vlc-devel] [PATCH v2] demux: mock: Add orientation option
Alexandre Janniaux
ajanni at videolabs.io
Mon Oct 5 20:46:23 CEST 2020
Hi,
Merged, thanks :)
Regards,
--
Alexandre Janniaux
Videolabs
On Mon, Sep 21, 2020 at 04:59:05PM +0200, Tanguy Dubroca wrote:
> Usage: ./vlc 'mock://<mock options>;video_orientation=<orientation>'
>
> The video_orientation option is an integer representing the raw
> values of video_orientation_t. Thus the range of possible values
> is ORIENT_TOP_LEFT = 0 -> ORIENT_RIGHT_BOTTOM = 7.
>
> Fix #25054
> ---
> modules/demux/mock.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/modules/demux/mock.c b/modules/demux/mock.c
> index 3e40de176d..670fc72bb0 100644
> --- a/modules/demux/mock.c
> +++ b/modules/demux/mock.c
> @@ -136,7 +136,8 @@ var_Read_float(const char *psz)
> Y(video, width, unsigned, add_integer, Unsigned, 640) \
> Y(video, height, unsigned, add_integer, Unsigned, 480) \
> Y(video, frame_rate, unsigned, add_integer, Unsigned, 25) \
> - Y(video, frame_rate_base, unsigned, add_integer, Unsigned, 1)
> + Y(video, frame_rate_base, unsigned, add_integer, Unsigned, 1) \
> + Y(video, orientation, unsigned, add_integer, Unsigned, ORIENT_NORMAL)
>
> #define OPTIONS_SUB(Y) \
> Y(sub, packetized, bool, add_bool, Bool, true)\
> @@ -649,12 +650,19 @@ ConfigureVideoTrack(demux_t *demux,
> return VLC_EGENERIC;
> }
>
> + if (options->orientation > ORIENT_RIGHT_BOTTOM)
> + {
> + msg_Err(demux, "Invalid orientation value %u", options->orientation);
> + return VLC_EGENERIC;
> + }
> +
> fmt->i_codec = chroma;
> fmt->video.i_chroma = chroma;
> fmt->video.i_width = fmt->video.i_visible_width = options->width;
> fmt->video.i_height = fmt->video.i_visible_height = options->height;
> fmt->video.i_frame_rate = options->frame_rate;
> fmt->video.i_frame_rate_base = options->frame_rate_base;
> + fmt->video.orientation = options->orientation;
>
> fmt->b_packetized = options->packetized;
>
> --
> 2.28.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