[vlc-devel] [PATCH] display: use an optional callback to set the viewpoint

Steve Lhomme robux4 at ycbcr.xyz
Tue Sep 8 09:44:47 CEST 2020


On 2020-09-07 21:32, Romain Vimont wrote:
> On Mon, Sep 07, 2020 at 08:37:49AM +0200, Steve Lhomme wrote:
>> In the future it may be called directly from the thread generating the event to
>> lower the latency.
>> ---
>>   include/vlc_vout_display.h              | 12 ++++++-----
>>   modules/video_output/caopengllayer.m    | 25 +++++++++++-----------
>>   modules/video_output/ios.m              | 12 +++++++----
>>   modules/video_output/macosx.m           | 11 ++++++----
>>   modules/video_output/opengl/display.c   | 10 ++++++---
>>   modules/video_output/win32/direct3d11.c | 28 +++++++++++++------------
>>   modules/video_output/win32/glwin32.c    | 12 ++++++-----
>>   src/video_output/display.c              | 10 +++++----
>>   8 files changed, 69 insertions(+), 51 deletions(-)
>>
>> diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
>> index c0014b2924d..e5ab39d9fd6 100644
>> --- a/include/vlc_vout_display.h
>> +++ b/include/vlc_vout_display.h
>> @@ -214,11 +214,6 @@ enum vout_display_query {
>>        *                      is necessary
>>        */
>>       VOUT_DISPLAY_CHANGE_SOURCE_CROP,
>> -
>> -    /**
>> -     * Notifies a change of VR/360° viewpoint.
>> -     */
>> -    VOUT_DISPLAY_CHANGE_VIEWPOINT,   /* const vlc_viewpoint_t * */
>>   };
>>   
>>   /**
>> @@ -359,6 +354,13 @@ struct vout_display_t {
>>        */
>>       int        (*control)(vout_display_t *, int query, va_list);
>>   
>> +    /**
>> +     * Notifies a change of VR/360° viewpoint.
>> +     *
>> +     * May be NULL.
>> +     */
>> +    int (*set_viewpoint)(vout_display_t *, const vlc_viewpoint_t*);
> 
> Generally, I prefer a specific callback like this instead of a generic
> "control" with varargs, but why only set_viewpoint()?
> 
> Is it a first step to remove "control" from vout_display_t, or is it for
> another reason?

Yes, and because I haven't gotten rid of RESET_PICTURES yet, the only 
call that still has a vararg param (not so variable).


More information about the vlc-devel mailing list