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

Tanguy Dubroca tanguy.dubroca at lse.epita.fr
Thu Sep 17 09:26:51 CEST 2020



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.
>
>> +
>> +#define var_Read_orientation_str_t(psz) NULL
>> +
>>   #define OPTIONS_AUDIO(Y) \
>>       Y(audio, packetized, bool, add_bool, Bool, true) \
>>       Y(audio, add_track_at, vlc_tick_t, add_integer, Integer,
>> VLC_TICK_INVALID) \ @@ -136,7 +140,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, orientation_str_t, add_string, String, NULL)
>>
>>   #define OPTIONS_SUB(Y) \
>>       Y(sub, packetized, bool, add_bool, Bool, true)\



More information about the vlc-devel mailing list