[vlc-devel] [PATCH] demux: mock: Add orientation option

Alexandre Janniaux ajanni at videolabs.io
Thu Sep 17 13:00:15 CEST 2020


Hi,

On Thu, Sep 17, 2020 at 10:17:25AM +0200, Romain Vimont wrote:
> On Thu, Sep 17, 2020 at 09:26:51AM +0200, Tanguy Dubroca wrote:
> >
> >
> > On 9/16/20 5:31 PM, Rémi Denis-Courmont wrote:
> > > Le keskiviikkona 16. syyskuuta 2020, 17.01.50 EEST Tanguy Dubroca a écrit :
> > > > Usage: ./vlc 'mock://<mock options>;video_orientation=<orientation>'
> > > >
> > > > The video_orientation option is a simplification of the values from
> > > > video_orientation_t. The possible values are:
> > > >
> > > > - normal
> > > > - transposed / antitransposed
> > > > - hflipped / vflipped
> > > > - rotated_90 / rotated_180 / rotated_270
> > > >
> > > > Fix #25054
> > > > ---
> > > >   modules/demux/mock.c | 39 ++++++++++++++++++++++++++++++++++++++-
> > > >   1 file changed, 38 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/modules/demux/mock.c b/modules/demux/mock.c
> > > > index 3e40de176d..d2156132ea 100644
> > > > --- a/modules/demux/mock.c
> > > > +++ b/modules/demux/mock.c
> > > > @@ -118,6 +118,10 @@ var_Read_float(const char *psz)
> > > >       return atof(psz);
> > > >   }
> > > >
> > > > +typedef char* orientation_str_t;
> > > Yuck, no please. A character pointer is a character point.
> > I agree that a bare char* would be better, but in this case a typedef
> > is necessary to make the macro generate a valid call. The OVERRIDE_OPTION
> > macro generates a call like this:
> >
> > var_Read ## type(...)
> >
> > So using a bare char* would not work.
>
> For simplicity, maybe the orientation should just be exposed as an
> integer? (it's just a mock)

It's just a mock, but the goal is to use it in integration tests so
I believe having a more self-explaining and reliable way to achieve
this is preferred here.

Regards,
--
Alexandre Janniaux
Videolabs


More information about the vlc-devel mailing list