[vlc-devel] [PATCH] vout: add an OpenGL ES 2.0 vout display module for Android.

Rémi Denis-Courmont remi at remlab.net
Fri Jan 17 01:29:50 CET 2014


We used to have that but that caused visual glitches as the window was created and destroyed too many times.

That is why Laurent made the current wrapper.

-- 
Rémi Denis-Courmont
Sent from my NVIDIA Tegra-powered device

----- Reply message -----
De : "Felix Abecassis" <felix.abecassis at gmail.com>
Pour : "Mailing list for VLC media player developers" <vlc-devel at videolan.org>
Objet : [vlc-devel] [PATCH] vout: add an OpenGL ES 2.0 vout display module for Android.
Date : ven., janv. 17, 2014 01:23

I mean something like the following, roughly. The vout display stores
the window and is responsible for terminating it before terminating
itself.


diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index d99cf7e..86ae4b1 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -330,6 +330,8 @@ struct vout_display_t {
* It must not be overwritten nor used directly by a module.
*/
vout_display_owner_t owner;
+
+    vout_window_t *window;
};

static inline void vout_display_SendEvent(vout_display_t *vd, int query, ...)
@@ -393,16 +395,20 @@ static inline void
vout_display_SendEventMouseDoubleClick(vout_display_t *vd)
*/
static inline vout_window_t *vout_display_NewWindow(vout_display_t
*vd, const vout_window_cfg_t *cfg)
{
-    return vd->owner.window_new(vd, cfg);
+    vd->window = vd->owner.window_new(vd, cfg);
+    return vd->window;
}
/**
* Deletes a window created by vout_display_NewWindow if window is non NULL
* or any unused windows otherwise.
*/
-static inline void vout_display_DeleteWindow(vout_display_t *vd,
-                                             vout_window_t *window)
+static inline void vout_display_DeleteWindow(vout_display_t *vd,
vout_window_t *window)
{
-    vd->owner.window_del(vd, window);
+    if (vd->window)
+    {
+        vd->owner.window_del(vd, vd->window);
+        vd->window = NULL;
+    }
}

/**
diff --git a/src/video_output/display.c b/src/video_output/display.c
index b268c18..40ef224 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -1324,6 +1324,8 @@ void vout_DeleteDisplay(vout_display_t *vd,
vout_display_state_t *state)
state->sar.den  = osys->sar_initial.den;
}

+    if (vd->window)
+        vout_display_DeleteWindow(vd, NULL);
VoutDisplayDestroyRender(vd);
if (osys->is_wrapper)
SplitterClose(vd);



2014/1/16 Rémi Denis-Courmont <remi at remlab.net>:
> Not sure what you mean, but the core does not know what type of window the
> vout display will want, IIRC.
>
> --
> Rémi Denis-Courmont
> Sent from my NVIDIA Tegra-powered device
>
> ----- Reply message -----
> De : "Felix Abecassis" <felix.abecassis at gmail.com>
> Pour : "Mailing list for VLC media player developers"
> <vlc-devel at videolan.org>
> Objet : [vlc-devel] [PATCH] vout: add an OpenGL ES 2.0 vout display module
> for Android.
> Date : jeu., janv. 16, 2014 17:28
>
> I understand.
> How about making the "window" an optional member of the video display
> structure? We could cancel/join the event thread of the window module
> before terminating safely the vout display.
>
> 2014/1/15 Rémi Denis-Courmont <remi at remlab.net>:
>>   Hello,
>>
>> No please. This requires polling, and for no good reasons. There is even a
>> complaint from Android porters that the vout thread polls... And it adds
>> latency. All sanely implemented vout window provider plugins (xcb, qt4,
>> skins2) already have a thread or a main loop from which they fire events,
>> at
>> this point key presses only.
>>
>> --
>> Rémi Denis-Courmont
>> Sent from my NVIDIA Tegra-powered device
>>
>> ----- Reply message -----
>> De : "Felix Abecassis" <felix.abecassis at gmail.com>
>> Pour : "Mailing list for VLC media player developers"
>> <vlc-devel at videolan.org>
>> Objet : [vlc-devel] [PATCH] vout: add an OpenGL ES 2.0 vout display module
>> for Android.
>> Date : mer., janv. 15, 2014 18:32
>>
>> I suggest adding a Manage function to the vout window module similar
>> to the Manage function we currently have for handling events for the
>> vout display module:
>>
>> diff --git a/include/vlc_vout_window.h b/include/vlc_vout_window.h
>> index ed7d42c..18e6b93 100644
>> --- a/include/vlc_vout_window.h
>> +++ b/include/vlc_vout_window.h
>> @@ -35,7 +35,7 @@
>>  /* */
>>  typedef struct vout_window_t vout_window_t;
>>  typedef struct vout_window_sys_t vout_window_sys_t;
>> -
>> +typedef struct vout_display_t vout_display_t;
>>
>>  /**
>>   * Window handle type
>> @@ -104,6 +104,7 @@ struct vout_window_t {
>>       * Do not use it directly; use vout_window_Control instead.
>>       */
>>      int (*control)(vout_window_t *, int query, va_list);
>> +    void (*manage)(vout_window_t *, vout_display_t *);
>>
>>      /* Private place holder for the vout_window_t module (optional)
>>       *
>> @@ -139,6 +140,8 @@ VLC_API void vout_window_Delete(vout_window_t *);
>>   */
>>  VLC_API int vout_window_Control(vout_window_t *, int query, ...);
>>
>> +VLC_API void vout_window_Manage(vout_window_t *, vout_display_t *);
>> +
>>  /**
>>   * Configures the window manager state for this window.
>>   */
>> diff --git a/src/video_output/window.c b/src/video_output/window.c
>> index bc45bc2..9d36469 100644
>> --- a/src/video_output/window.c
>> +++ b/src/video_output/window.c
>> @@ -144,3 +144,8 @@ int vout_window_Control(vout_window_t *window, int
>> query, ...)
>>      return ret;
>>  }
>>
>> +void vout_window_Manage(vout_window_t *window, vout_display_t
>> *display)
>> +{
>> +    if (window->manage)
>> +        window->manage(window, display);
>> +}
>>
>> 2014/1/9 Felix Abecassis <felix.abecassis at gmail.com>:
>>> 2014/1/9 Rémi Denis-Courmont <remi at remlab.net>:
>>>> Le jeudi 9 janvier 2014, 10:44:32 Felix Abecassis a écrit :
>>>>> However I don't understand why we cannot simply pass a pointer to the
>>>>> vout display to the vout window plugin and have a Manage function in
>>>>> the vout window translating events to vout_display_SendEvent() calls.
>>>>> You said above this won't work out of the box, why?
>>>>
>>>> Uh? Someone needs to write the code; that is all. I foresee no
>>>> fundamental
>>>> problems.
>>> I thought you said otherwise, sorry if I've misunderstood you.
>>>
>>>>
>>>> Note however that since the vout_window life cycle is "longer" than that
>>>> of
>>>> the vout_display, it is not *completely* straightforward.
>>> Thanks for pointing this out, I was not aware of this, I need to
>>> investigate how to solve this issue before writing the code.
>>>
>>> --
>>> Félix Abecassis
>>> http://felix.abecassis.me
>>
>>
>>
>> --
>> Félix Abecassis
>> http://felix.abecassis.me
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
>>
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
>>
>
>
>
> --
> Félix Abecassis
> http://felix.abecassis.me
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>



-- 
Félix Abecassis
http://felix.abecassis.me
_______________________________________________
vlc-devel mailing list
To unsubscribe or modify your subscription options:
https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20140117/ae8bc446/attachment.html>


More information about the vlc-devel mailing list