Skip to content

Commit 0ef2ba3

Browse files
committed
Use aml v1
1 parent 3466119 commit 0ef2ba3

File tree

6 files changed

+21
-26
lines changed

6 files changed

+21
-26
lines changed

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ xkbcommon = dependency('xkbcommon', version: '>=1.0.0')
5656
wayland_client = dependency('wayland-client')
5757
jansson = dependency('jansson')
5858

59-
aml_version = ['>=0.3.0', '<0.4.0']
59+
aml_version = ['>=1.0.0', '<2.0.0']
6060
neatvnc_version = ['>=0.10', '<1.0.0']
6161

6262
neatvnc_project = subproject(

src/ctl-server.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -700,10 +700,10 @@ static void recv_ready(struct ctl_client* client)
700700
client_enqueue_internal_error(client, details);
701701
}
702702

703-
static void on_ready(void* obj)
703+
static void on_ready(struct aml_handler* handler)
704704
{
705-
struct ctl_client* client = aml_get_userdata(obj);
706-
uint32_t events = aml_get_revents(obj);
705+
struct ctl_client* client = aml_get_userdata(handler);
706+
uint32_t events = aml_get_revents(handler);
707707
nvnc_trace("Client %p ready: 0x%x", client, events);
708708

709709
if (events & AML_EVENT_WRITE)
@@ -712,10 +712,10 @@ static void on_ready(void* obj)
712712
recv_ready(client);
713713
}
714714

715-
static void on_connection(void* obj)
715+
static void on_connection(struct aml_handler* handler)
716716
{
717717
nvnc_log(NVNC_LOG_DEBUG, "New connection");
718-
struct ctl* server = aml_get_userdata(obj);
718+
struct ctl* server = aml_get_userdata(handler);
719719

720720
struct ctl_client* client = calloc(1, sizeof(*client));
721721
if (!client) {

src/data-control.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static void destroy_send_context(struct send_context* ctx)
7373
free(ctx);
7474
}
7575

76-
static void on_receive(void* handler)
76+
static void on_receive(struct aml_handler* handler)
7777
{
7878
struct receive_context* ctx = aml_get_userdata(handler);
7979
int fd = aml_get_fd(handler);
@@ -101,7 +101,7 @@ static void on_receive(void* handler)
101101
destroy_receive_context(ctx);
102102
}
103103

104-
static void on_send(void* handler)
104+
static void on_send(struct aml_handler* handler)
105105
{
106106
struct send_context* ctx = aml_get_userdata(handler);
107107
int fd = aml_get_fd(handler);

src/ext-image-copy-capture.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,10 @@ static void ext_image_copy_capture_schedule_capture(struct ext_image_copy_captur
224224
#endif
225225
}
226226

227-
static void ext_image_copy_capture_schedule_from_timer(void* obj)
227+
static void ext_image_copy_capture_schedule_from_timer(struct aml_timer* timer)
228228
{
229-
struct ext_image_copy_capture* self = aml_get_userdata(obj);
229+
struct ext_image_copy_capture* self = aml_get_userdata(timer);
230230
assert(self);
231-
232231
ext_image_copy_capture_schedule_capture(self);
233232
}
234233

@@ -708,8 +707,8 @@ static struct screencopy* ext_image_copy_capture_create(struct wl_output* output
708707
self->wl_output = output;
709708
self->render_cursors = render_cursor;
710709

711-
self->timer = aml_timer_new(0, ext_image_copy_capture_schedule_from_timer, self,
712-
NULL);
710+
self->timer = aml_timer_new(0,
711+
ext_image_copy_capture_schedule_from_timer, self, NULL);
713712
assert(self->timer);
714713

715714
self->pool = wv_buffer_pool_create(NULL);
@@ -741,8 +740,8 @@ static struct screencopy* ext_image_copy_capture_create_cursor(struct wl_output*
741740
self->wl_output = output;
742741
self->wl_seat = seat;
743742

744-
self->timer = aml_timer_new(0, ext_image_copy_capture_schedule_from_timer, self,
745-
NULL);
743+
self->timer = aml_timer_new(0,
744+
ext_image_copy_capture_schedule_from_timer, self, NULL);
746745
assert(self->timer);
747746

748747
self->pool = wv_buffer_pool_create(NULL);

src/main.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -491,9 +491,9 @@ static void wayland_detach(struct wayvnc* self)
491491
ctl_server_event_detached(self->ctl);
492492
}
493493

494-
void on_wayland_event(void* obj)
494+
void on_wayland_event(struct aml_handler* handler)
495495
{
496-
struct wayvnc* self = aml_get_userdata(obj);
496+
struct wayvnc* self = aml_get_userdata(handler);
497497

498498
int rc MAYBE_UNUSED = wl_display_prepare_read(self->display);
499499
assert(rc == 0);
@@ -602,7 +602,7 @@ void wayvnc_exit(struct wayvnc* self)
602602
self->do_exit = true;
603603
}
604604

605-
void on_signal(void* obj)
605+
void on_signal(struct aml_signal* obj)
606606
{
607607
nvnc_log(NVNC_LOG_INFO, "Received termination signal.");
608608
struct wayvnc* self = aml_get_userdata(obj);
@@ -1168,7 +1168,7 @@ int wayvnc_start_capture_immediate(struct wayvnc* self)
11681168
return rc;
11691169
}
11701170

1171-
static void on_capture_restart_timer(void* obj)
1171+
static void on_capture_restart_timer(struct aml_timer* obj)
11721172
{
11731173
struct wayvnc* self = aml_get_userdata(obj);
11741174
aml_unref(self->capture_retry_timer);
@@ -1345,7 +1345,7 @@ int check_cfg_sanity(struct cfg* cfg)
13451345
return 0;
13461346
}
13471347

1348-
static void on_perf_tick(void* obj)
1348+
static void on_perf_tick(struct aml_ticker* obj)
13491349
{
13501350
struct wayvnc* self = aml_get_userdata(obj);
13511351

@@ -2205,9 +2205,6 @@ int main(int argc, char* argv[])
22052205
self.selected_seat = seat;
22062206
}
22072207

2208-
if (aml_unstable_abi_version != AML_UNSTABLE_API)
2209-
nvnc_log(NVNC_LOG_PANIC, "libaml is incompatible with this build of wayvnc!");
2210-
22112208
enum socket_type default_socket_type = SOCKET_TYPE_TCP;
22122209
if (use_unix_socket)
22132210
default_socket_type = SOCKET_TYPE_UNIX;

src/screencopy.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,9 @@ static int screencopy__start_capture(struct wlr_screencopy* self)
287287
return 0;
288288
}
289289

290-
static void screencopy__poll(void* obj)
290+
static void screencopy__poll(struct aml_timer* handler)
291291
{
292-
struct wlr_screencopy* self = aml_get_userdata(obj);
293-
292+
struct wlr_screencopy* self = aml_get_userdata(handler);
294293
screencopy__start_capture(self);
295294
}
296295

0 commit comments

Comments
 (0)