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

Alexandre Janniaux ajanni at videolabs.io
Thu Sep 17 23:00:33 CEST 2020


Hi,

On Thu, Sep 17, 2020 at 10:12:02PM +0300, Rémi Denis-Courmont wrote:
> Le torstaina 17. syyskuuta 2020, 14.00.15 EEST Alexandre Janniaux a écrit :
> > > 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.
>
> The integer values are not that obscure. AFAIR, they are actually following
> the (EXIF) standard. And you can always add a value list in the descriptor,
> which will show in the CLI help.

Completely agree that it's not obscure and it can be documented.

Yet,

    input_item_New("mock://"
        "video_track_count=1;"
        "length=100000;"
        "video_orientation=hflipped",
        "dummy");

is much more readable in a test than

    input_item_New("mock://"
        "video_track_count=1;"
        "length=100000;"
        "video_orientation=1",
        "dummy");

where you find `1` by counting in the enum (well, HFLIPPED
was easy, but rotated_90 needs first finding the equivalent
orient corner and then counting all of them), or else add a
formatting string to direction print the value of ORIENT_HFLIPPED.

In VLC options, I don't really care, but in the tests we're
making, I think that immediate readability is a plus to
detect bugs in tests (that are typically not tested for
obvious recursive reasons).

Otherwise, I'm fine with an integer since it's what you
seem to expect here.

Regards,
--
Alexandre Janniaux
Videolabs


More information about the vlc-devel mailing list