Skip to content
Snippets Groups Projects
Commit da46c38e authored by Denis Charmet's avatar Denis Charmet
Browse files

vout: android: asynchronously resize vout window

parent 34f09854
No related branches found
No related tags found
1 merge request!1978vout: Use a fair display lock and interrupt wait
......@@ -287,7 +287,8 @@ libegl_android_plugin_la_SOURCES = video_output/opengl/egl.c
libegl_android_plugin_la_CFLAGS = $(AM_CFLAGS) $(EGL_CFLAGS) -DUSE_PLATFORM_ANDROID=1
libegl_android_plugin_la_LIBADD = $(EGL_LIBS) libandroid_utils.la
libandroid_window_plugin_la_SOURCES = video_output/android/window.c
libandroid_window_plugin_la_SOURCES = video_output/android/window.c \
video_output/wasync_resize_compressor.h
libandroid_window_plugin_la_LIBADD = libandroid_utils.la $(LIBDL)
libandroid_display_plugin_la_SOURCES = video_output/android/display.c
......
......@@ -37,6 +37,7 @@
#include <jni.h>
#include "utils.h"
#include "../wasync_resize_compressor.h"
static int Open(vlc_window_t *);
static void Close(vlc_window_t *);
......@@ -56,11 +57,16 @@ vlc_module_begin()
add_shortcut("android")
vlc_module_end()
typedef struct
{
vlc_wasync_resize_compressor_t compressor;
} vout_window_sys_t;
static void OnNewWindowSize(vlc_window_t *wnd,
unsigned i_width, unsigned i_height)
{
vlc_window_ReportSize(wnd, i_width, i_height);
vout_window_sys_t *sys = (vout_window_sys_t *) wnd->sys;
vlc_wasync_resize_compressor_reportSize(&sys->compressor, i_width, i_height);
}
static void OnNewMouseCoords(vlc_window_t *wnd,
......@@ -94,6 +100,15 @@ static int Open(vlc_window_t *wnd)
if (jobj == NULL)
return VLC_EGENERIC;
vout_window_sys_t *sys = vlc_obj_malloc(VLC_OBJECT(wnd), sizeof (*sys));
if (sys == NULL)
return VLC_ENOMEM;
if (vlc_wasync_resize_compressor_init(&sys->compressor, wnd))
return VLC_EGENERIC;
wnd->sys = sys;
AWindowHandler *p_awh = AWindowHandler_new(VLC_OBJECT(wnd), wnd,
&(awh_events_t) { OnNewWindowSize, OnNewMouseCoords });
if (p_awh == NULL)
......@@ -112,6 +127,8 @@ static int Open(vlc_window_t *wnd)
*/
static void Close(vlc_window_t *wnd)
{
vout_window_sys_t *sys = (vout_window_sys_t *) wnd->sys;
vlc_wasync_resize_compressor_destroy(&sys->compressor);
AWindowHandler_destroy(wnd->handle.anativewindow);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment