diff options
-rw-r--r-- | meta-oe/recipes-graphics/neatvnc/neatvnc/0001-Add-method-to-listen-on-multiple-fds.patch | 309 | ||||
-rw-r--r-- | meta-oe/recipes-graphics/neatvnc/neatvnc/0001-Use-aml-v1.patch | 281 | ||||
-rw-r--r-- | meta-oe/recipes-graphics/neatvnc/neatvnc/0001-meson-Use-new-pkgconfig-for-aml1.patch | 27 | ||||
-rw-r--r-- | meta-oe/recipes-graphics/neatvnc/neatvnc_0.9.5.bb (renamed from meta-oe/recipes-graphics/neatvnc/neatvnc_0.8.1.bb) | 8 |
4 files changed, 623 insertions, 2 deletions
diff --git a/meta-oe/recipes-graphics/neatvnc/neatvnc/0001-Add-method-to-listen-on-multiple-fds.patch b/meta-oe/recipes-graphics/neatvnc/neatvnc/0001-Add-method-to-listen-on-multiple-fds.patch new file mode 100644 index 0000000000..601ddeed93 --- /dev/null +++ b/meta-oe/recipes-graphics/neatvnc/neatvnc/0001-Add-method-to-listen-on-multiple-fds.patch | |||
@@ -0,0 +1,309 @@ | |||
1 | From a701040581706a2abf3483ea68d19142cbd68bcf Mon Sep 17 00:00:00 2001 | ||
2 | From: Andri Yngvason <andri@yngvason.is> | ||
3 | Date: Sat, 23 Nov 2024 11:36:06 +0000 | ||
4 | Subject: [PATCH] Add method to listen on multiple fds | ||
5 | |||
6 | Upstream-Status: Backport [https://github.com/any1/neatvnc/commit/a701040581706a2abf3483ea68d19142cbd68bcf] | ||
7 | --- | ||
8 | examples/draw.c | 2 +- | ||
9 | examples/png-server.c | 2 +- | ||
10 | include/common.h | 15 ++++-- | ||
11 | include/neatvnc.h | 14 ++++- | ||
12 | src/server.c | 122 ++++++++++++++++++++++++++++++------------ | ||
13 | 5 files changed, 116 insertions(+), 39 deletions(-) | ||
14 | |||
15 | diff --git a/examples/draw.c b/examples/draw.c | ||
16 | index 7fb8fe6..13d5d09 100644 | ||
17 | --- a/examples/draw.c | ||
18 | +++ b/examples/draw.c | ||
19 | @@ -340,7 +340,7 @@ int main(int argc, char* argv[]) | ||
20 | |||
21 | aml_run(aml); | ||
22 | |||
23 | - nvnc_close(server); | ||
24 | + nvnc_del(server); | ||
25 | nvnc_display_unref(draw.display); | ||
26 | nvnc_fb_pool_unref(draw.fb_pool); | ||
27 | pixman_image_unref(draw.whiteboard); | ||
28 | diff --git a/examples/png-server.c b/examples/png-server.c | ||
29 | index b8cc015..e35a6f1 100644 | ||
30 | --- a/examples/png-server.c | ||
31 | +++ b/examples/png-server.c | ||
32 | @@ -68,7 +68,7 @@ int main(int argc, char* argv[]) | ||
33 | |||
34 | aml_run(aml); | ||
35 | |||
36 | - nvnc_close(server); | ||
37 | + nvnc_del(server); | ||
38 | nvnc_display_unref(display); | ||
39 | nvnc_fb_unref(fb); | ||
40 | aml_unref(aml); | ||
41 | diff --git a/include/common.h b/include/common.h | ||
42 | index e0b87c2..14c0ed9 100644 | ||
43 | --- a/include/common.h | ||
44 | +++ b/include/common.h | ||
45 | @@ -157,12 +157,21 @@ enum nvnc__socket_type { | ||
46 | NVNC__SOCKET_FROM_FD, | ||
47 | }; | ||
48 | |||
49 | +struct nvnc__socket { | ||
50 | + struct nvnc* parent; | ||
51 | + enum nvnc_stream_type type; | ||
52 | + bool is_external; | ||
53 | + int fd; | ||
54 | + struct aml_handler* poll_handle; | ||
55 | + LIST_ENTRY(nvnc__socket) link; | ||
56 | +}; | ||
57 | + | ||
58 | +LIST_HEAD(nvnc__socket_list, nvnc__socket); | ||
59 | + | ||
60 | struct nvnc { | ||
61 | struct nvnc_common common; | ||
62 | bool is_closing; | ||
63 | - int fd; | ||
64 | - enum nvnc__socket_type socket_type; | ||
65 | - struct aml_handler* poll_handle; | ||
66 | + struct nvnc__socket_list sockets; | ||
67 | struct nvnc_client_list clients; | ||
68 | char name[256]; | ||
69 | void* userdata; | ||
70 | diff --git a/include/neatvnc.h b/include/neatvnc.h | ||
71 | index 78d9f97..c9303a8 100644 | ||
72 | --- a/include/neatvnc.h | ||
73 | +++ b/include/neatvnc.h | ||
74 | @@ -74,6 +74,11 @@ enum nvnc_fb_type { | ||
75 | NVNC_FB_GBM_BO, | ||
76 | }; | ||
77 | |||
78 | +enum nvnc_stream_type { | ||
79 | + NVNC_STREAM_NORMAL = 0, | ||
80 | + NVNC_STREAM_WEBSOCKET, | ||
81 | +}; | ||
82 | + | ||
83 | /* This is the same as wl_output_transform */ | ||
84 | enum nvnc_transform { | ||
85 | NVNC_TRANSFORM_NORMAL = 0, | ||
86 | @@ -135,11 +140,18 @@ typedef bool (*nvnc_desktop_layout_fn)( | ||
87 | |||
88 | extern const char nvnc_version[]; | ||
89 | |||
90 | +struct nvnc* nvnc_new(void); | ||
91 | +void nvnc_del(struct nvnc* self); | ||
92 | + | ||
93 | +int nvnc_listen(struct nvnc* self, int fd, enum nvnc_stream_type type); | ||
94 | + | ||
95 | struct nvnc* nvnc_open(const char* addr, uint16_t port); | ||
96 | struct nvnc* nvnc_open_unix(const char *addr); | ||
97 | struct nvnc* nvnc_open_websocket(const char* addr, uint16_t port); | ||
98 | struct nvnc* nvnc_open_from_fd(int fd); | ||
99 | -void nvnc_close(struct nvnc* self); | ||
100 | + | ||
101 | +void nvnc_close(struct nvnc* self) | ||
102 | + __attribute__((deprecated("replaced with nvnc_del"))); | ||
103 | |||
104 | void nvnc_add_display(struct nvnc*, struct nvnc_display*); | ||
105 | void nvnc_remove_display(struct nvnc*, struct nvnc_display*); | ||
106 | diff --git a/src/server.c b/src/server.c | ||
107 | index b94ed0d..ded2dab 100644 | ||
108 | --- a/src/server.c | ||
109 | +++ b/src/server.c | ||
110 | @@ -1981,7 +1981,9 @@ static void on_client_event(struct stream* stream, enum stream_event event) | ||
111 | |||
112 | static void on_connection(void* obj) | ||
113 | { | ||
114 | - struct nvnc* server = aml_get_userdata(obj); | ||
115 | + struct aml_handler* poll_handle = obj; | ||
116 | + struct nvnc__socket* socket = aml_get_userdata(poll_handle); | ||
117 | + struct nvnc* server = socket->parent; | ||
118 | |||
119 | struct nvnc_client* client = calloc(1, sizeof(*client)); | ||
120 | if (!client) | ||
121 | @@ -2002,7 +2004,7 @@ static void on_connection(void* obj) | ||
122 | client->ext_clipboard_max_unsolicited_text_size = | ||
123 | MAX_CLIENT_UNSOLICITED_TEXT_SIZE; | ||
124 | |||
125 | - int fd = accept(server->fd, NULL, 0); | ||
126 | + int fd = accept(socket->fd, NULL, 0); | ||
127 | if (fd < 0) { | ||
128 | nvnc_log(NVNC_LOG_WARNING, "Failed to accept a connection"); | ||
129 | goto accept_failure; | ||
130 | @@ -2012,7 +2014,7 @@ static void on_connection(void* obj) | ||
131 | setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one)); | ||
132 | |||
133 | #ifdef ENABLE_WEBSOCKET | ||
134 | - if (server->socket_type == NVNC__SOCKET_WEBSOCKET) | ||
135 | + if (socket->type == NVNC_STREAM_WEBSOCKET) | ||
136 | { | ||
137 | client->net_stream = stream_ws_new(fd, on_client_event, client); | ||
138 | } | ||
139 | @@ -2182,44 +2184,60 @@ static int bind_address(const char* name, uint16_t port, | ||
140 | return -1; | ||
141 | } | ||
142 | |||
143 | -static struct nvnc* open_common(const char* address, uint16_t port, | ||
144 | - int fd, enum nvnc__socket_type type) | ||
145 | +static struct nvnc__socket* nvnc__listen(struct nvnc* self, int fd, | ||
146 | + enum nvnc_stream_type type) | ||
147 | { | ||
148 | - nvnc__log_init(); | ||
149 | + struct nvnc__socket* socket = calloc(1, sizeof(*self)); | ||
150 | + if (!socket) | ||
151 | + return NULL; | ||
152 | |||
153 | - aml_require_workers(aml_get_default(), -1); | ||
154 | + if (listen(fd, 16) < 0) | ||
155 | + goto failure; | ||
156 | |||
157 | - struct nvnc* self = calloc(1, sizeof(*self)); | ||
158 | - if (!self) | ||
159 | - return NULL; | ||
160 | + socket->parent = self; | ||
161 | + socket->type = type; | ||
162 | + socket->fd = fd; | ||
163 | + socket->is_external = true; | ||
164 | |||
165 | - self->socket_type = type; | ||
166 | + socket->poll_handle = aml_handler_new(fd, on_connection, socket, NULL); | ||
167 | + if (!socket->poll_handle) { | ||
168 | + goto failure; | ||
169 | + } | ||
170 | |||
171 | - strcpy(self->name, DEFAULT_NAME); | ||
172 | + aml_start(aml_get_default(), socket->poll_handle); | ||
173 | |||
174 | - LIST_INIT(&self->clients); | ||
175 | + LIST_INSERT_HEAD(&self->sockets, socket, link); | ||
176 | + return socket; | ||
177 | |||
178 | - self->fd = bind_address(address, port, fd, type); | ||
179 | - if (self->fd < 0) | ||
180 | +failure: | ||
181 | + free(socket); | ||
182 | + return NULL; | ||
183 | +} | ||
184 | + | ||
185 | +static struct nvnc* open_common(const char* address, uint16_t port, | ||
186 | + int fd, enum nvnc__socket_type type) | ||
187 | +{ | ||
188 | + struct nvnc* self = nvnc_new(); | ||
189 | + if (!self) | ||
190 | + return NULL; | ||
191 | + | ||
192 | + int bound_fd = bind_address(address, port, fd, type); | ||
193 | + if (bound_fd < 0) | ||
194 | goto bind_failure; | ||
195 | |||
196 | - if (listen(self->fd, 16) < 0) | ||
197 | - goto listen_failure; | ||
198 | + enum nvnc_stream_type stream_type = type == NVNC__SOCKET_WEBSOCKET ? | ||
199 | + NVNC_STREAM_WEBSOCKET : NVNC_STREAM_NORMAL; | ||
200 | |||
201 | - self->poll_handle = aml_handler_new(self->fd, on_connection, self, NULL); | ||
202 | - if (!self->poll_handle) | ||
203 | - goto handle_failure; | ||
204 | + struct nvnc__socket* socket = nvnc__listen(self, bound_fd, stream_type); | ||
205 | + if (!socket) | ||
206 | + goto listen_failure; | ||
207 | |||
208 | - if (aml_start(aml_get_default(), self->poll_handle) < 0) | ||
209 | - goto poll_start_failure; | ||
210 | + socket->is_external = type == NVNC__SOCKET_FROM_FD; | ||
211 | |||
212 | return self; | ||
213 | |||
214 | -poll_start_failure: | ||
215 | - aml_unref(self->poll_handle); | ||
216 | -handle_failure: | ||
217 | listen_failure: | ||
218 | - close(self->fd); | ||
219 | + close(bound_fd); | ||
220 | if (type == NVNC__SOCKET_UNIX) { | ||
221 | unlink(address); | ||
222 | } | ||
223 | @@ -2229,6 +2247,31 @@ bind_failure: | ||
224 | return NULL; | ||
225 | } | ||
226 | |||
227 | +EXPORT | ||
228 | +struct nvnc* nvnc_new(void) | ||
229 | +{ | ||
230 | + nvnc__log_init(); | ||
231 | + aml_require_workers(aml_get_default(), -1); | ||
232 | + | ||
233 | + struct nvnc* self = calloc(1, sizeof(*self)); | ||
234 | + if (!self) | ||
235 | + return NULL; | ||
236 | + | ||
237 | + strcpy(self->name, DEFAULT_NAME); | ||
238 | + | ||
239 | + LIST_INIT(&self->sockets); | ||
240 | + LIST_INIT(&self->clients); | ||
241 | + | ||
242 | + return self; | ||
243 | +} | ||
244 | + | ||
245 | +EXPORT | ||
246 | +int nvnc_listen(struct nvnc* self, int fd, enum nvnc_stream_type type) | ||
247 | +{ | ||
248 | + struct nvnc__socket* socket = nvnc__listen(self, fd, type); | ||
249 | + return socket ? 0 : -1; | ||
250 | +} | ||
251 | + | ||
252 | EXPORT | ||
253 | struct nvnc* nvnc_open(const char* address, uint16_t port) | ||
254 | { | ||
255 | @@ -2270,7 +2313,7 @@ static void unlink_fd_path(int fd) | ||
256 | } | ||
257 | |||
258 | EXPORT | ||
259 | -void nvnc_close(struct nvnc* self) | ||
260 | +void nvnc_del(struct nvnc* self) | ||
261 | { | ||
262 | self->is_closing = true; | ||
263 | |||
264 | @@ -2293,12 +2336,20 @@ void nvnc_close(struct nvnc* self) | ||
265 | while (!LIST_EMPTY(&self->clients)) | ||
266 | client_close(LIST_FIRST(&self->clients)); | ||
267 | |||
268 | - aml_stop(aml_get_default(), self->poll_handle); | ||
269 | - // Do not unlink an externally managed fd. | ||
270 | - if(self->socket_type != NVNC__SOCKET_FROM_FD) { | ||
271 | - unlink_fd_path(self->fd); | ||
272 | + while (!LIST_EMPTY(&self->sockets)) { | ||
273 | + struct nvnc__socket* socket = LIST_FIRST(&self->sockets); | ||
274 | + LIST_REMOVE(socket, link); | ||
275 | + | ||
276 | + aml_stop(aml_get_default(), socket->poll_handle); | ||
277 | + aml_unref(socket->poll_handle); | ||
278 | + | ||
279 | + if (!socket->is_external) { | ||
280 | + unlink_fd_path(socket->fd); | ||
281 | + } | ||
282 | + close(socket->fd); | ||
283 | + | ||
284 | + free(socket); | ||
285 | } | ||
286 | - close(self->fd); | ||
287 | |||
288 | #ifdef HAVE_CRYPTO | ||
289 | crypto_rsa_priv_key_del(self->rsa_priv); | ||
290 | @@ -2314,10 +2365,15 @@ void nvnc_close(struct nvnc* self) | ||
291 | |||
292 | free(self->ext_clipboard_provide_msg.buffer); | ||
293 | |||
294 | - aml_unref(self->poll_handle); | ||
295 | free(self); | ||
296 | } | ||
297 | |||
298 | +EXPORT | ||
299 | +void nvnc_close(struct nvnc* self) | ||
300 | +{ | ||
301 | + nvnc_del(self); | ||
302 | +} | ||
303 | + | ||
304 | static void process_pending_fence(struct nvnc_client* client) | ||
305 | { | ||
306 | if (client->pending_fence.n_pending_requests == 0) { | ||
307 | -- | ||
308 | 2.43.0 | ||
309 | |||
diff --git a/meta-oe/recipes-graphics/neatvnc/neatvnc/0001-Use-aml-v1.patch b/meta-oe/recipes-graphics/neatvnc/neatvnc/0001-Use-aml-v1.patch new file mode 100644 index 0000000000..26c3a0230c --- /dev/null +++ b/meta-oe/recipes-graphics/neatvnc/neatvnc/0001-Use-aml-v1.patch | |||
@@ -0,0 +1,281 @@ | |||
1 | From a4b238241f3f3016ef3ddcd260c1490a9c9e8168 Mon Sep 17 00:00:00 2001 | ||
2 | From: Andri Yngvason <andri@yngvason.is> | ||
3 | Date: Sun, 23 Mar 2025 15:55:11 +0000 | ||
4 | Subject: [PATCH] Use aml v1 | ||
5 | |||
6 | Upstream-Status: Backport [https://github.com/any1/neatvnc/commit/a4b238241f3f3016ef3ddcd260c1490a9c9e8168] | ||
7 | --- | ||
8 | meson.build | 2 +- | ||
9 | src/enc/h264/ffmpeg-impl.c | 8 ++++---- | ||
10 | src/enc/h264/v4l2m2m-impl.c | 4 ++-- | ||
11 | src/enc/raw.c | 8 ++++---- | ||
12 | src/enc/tight.c | 18 +++++++++--------- | ||
13 | src/enc/zrle.c | 8 ++++---- | ||
14 | src/resampler.c | 7 ++----- | ||
15 | src/server.c | 6 ++---- | ||
16 | src/stream/gnutls.c | 6 +++--- | ||
17 | src/stream/tcp.c | 6 +++--- | ||
18 | 11 files changed, 35 insertions(+), 41 deletions(-) | ||
19 | |||
20 | diff --git a/meson.build b/meson.build | ||
21 | index 1017ffd..e731886 100644 | ||
22 | --- a/meson.build | ||
23 | +++ b/meson.build | ||
24 | @@ -71,7 +71,7 @@ libavcodec = dependency('libavcodec', required: get_option('h264')) | ||
25 | libavfilter = dependency('libavfilter', required: get_option('h264')) | ||
26 | libavutil = dependency('libavutil', required: get_option('h264')) | ||
27 | |||
28 | -aml_version = ['>=0.3.0', '<0.4.0'] | ||
29 | +aml_version = ['>=1.0.0', '<2.0.0'] | ||
30 | aml_project = subproject('aml', required: false, version: aml_version) | ||
31 | if aml_project.found() | ||
32 | aml = aml_project.get_variable('aml_dep') | ||
33 | diff --git a/src/enc/h264/ffmpeg-impl.c b/src/enc/h264/ffmpeg-impl.c | ||
34 | index 3bd584c..148b1c3 100644 | ||
35 | --- a/src/enc/h264/ffmpeg-impl.c | ||
36 | +++ b/src/enc/h264/ffmpeg-impl.c | ||
37 | @@ -415,9 +415,9 @@ get_frame_failure: | ||
38 | return rc == AVERROR(EAGAIN) ? 0 : rc; | ||
39 | } | ||
40 | |||
41 | -static void h264_encoder__do_work(void* handle) | ||
42 | +static void h264_encoder__do_work(struct aml_work* work) | ||
43 | { | ||
44 | - struct h264_encoder_ffmpeg* self = aml_get_userdata(handle); | ||
45 | + struct h264_encoder_ffmpeg* self = aml_get_userdata(work); | ||
46 | |||
47 | AVFrame* frame = fb_to_avframe(self->current_fb); | ||
48 | assert(frame); // TODO | ||
49 | @@ -453,9 +453,9 @@ failure: | ||
50 | av_frame_free(&frame); | ||
51 | } | ||
52 | |||
53 | -static void h264_encoder__on_work_done(void* handle) | ||
54 | +static void h264_encoder__on_work_done(struct aml_work* work) | ||
55 | { | ||
56 | - struct h264_encoder_ffmpeg* self = aml_get_userdata(handle); | ||
57 | + struct h264_encoder_ffmpeg* self = aml_get_userdata(work); | ||
58 | |||
59 | uint64_t pts = nvnc_fb_get_pts(self->current_fb); | ||
60 | nvnc_fb_release(self->current_fb); | ||
61 | diff --git a/src/enc/h264/v4l2m2m-impl.c b/src/enc/h264/v4l2m2m-impl.c | ||
62 | index b9d1236..d286932 100644 | ||
63 | --- a/src/enc/h264/v4l2m2m-impl.c | ||
64 | +++ b/src/enc/h264/v4l2m2m-impl.c | ||
65 | @@ -511,9 +511,9 @@ static void encode_buffer(struct h264_encoder_v4l2m2m* self, | ||
66 | } | ||
67 | } | ||
68 | |||
69 | -static void process_fd_events(void* handle) | ||
70 | +static void process_fd_events(struct aml_handler* handler) | ||
71 | { | ||
72 | - struct h264_encoder_v4l2m2m* self = aml_get_userdata(handle); | ||
73 | + struct h264_encoder_v4l2m2m* self = aml_get_userdata(handler); | ||
74 | process_dst_bufs(self); | ||
75 | } | ||
76 | |||
77 | diff --git a/src/enc/raw.c b/src/enc/raw.c | ||
78 | index 806f074..2bc8302 100644 | ||
79 | --- a/src/enc/raw.c | ||
80 | +++ b/src/enc/raw.c | ||
81 | @@ -126,9 +126,9 @@ static int raw_encode_frame(struct raw_encoder_work* ctx, struct vec* dst, | ||
82 | return 0; | ||
83 | } | ||
84 | |||
85 | -static void raw_encoder_do_work(void* obj) | ||
86 | +static void raw_encoder_do_work(struct aml_work* work) | ||
87 | { | ||
88 | - struct raw_encoder_work* ctx = aml_get_userdata(obj); | ||
89 | + struct raw_encoder_work* ctx = aml_get_userdata(work); | ||
90 | int rc __attribute__((unused)); | ||
91 | |||
92 | struct nvnc_fb* fb = ctx->fb; | ||
93 | @@ -163,9 +163,9 @@ static void raw_encoder_do_work(void* obj) | ||
94 | assert(ctx->result); | ||
95 | } | ||
96 | |||
97 | -static void raw_encoder_on_done(void* obj) | ||
98 | +static void raw_encoder_on_done(struct aml_work* work) | ||
99 | { | ||
100 | - struct raw_encoder_work* ctx = aml_get_userdata(obj); | ||
101 | + struct raw_encoder_work* ctx = aml_get_userdata(work); | ||
102 | struct raw_encoder* self = ctx->parent; | ||
103 | |||
104 | assert(ctx->result); | ||
105 | diff --git a/src/enc/tight.c b/src/enc/tight.c | ||
106 | index a361974..441df19 100644 | ||
107 | --- a/src/enc/tight.c | ||
108 | +++ b/src/enc/tight.c | ||
109 | @@ -106,8 +106,8 @@ struct tight_zs_worker_ctx { | ||
110 | |||
111 | struct encoder_impl encoder_impl_tight; | ||
112 | |||
113 | -static void do_tight_zs_work(void*); | ||
114 | -static void on_tight_zs_work_done(void*); | ||
115 | +static void do_tight_zs_work(struct aml_work*); | ||
116 | +static void on_tight_zs_work_done(struct aml_work*); | ||
117 | static int schedule_tight_finish(struct tight_encoder* self); | ||
118 | |||
119 | static inline struct tight_encoder* tight_encoder(struct encoder* encoder) | ||
120 | @@ -428,9 +428,9 @@ static void tight_encode_tile(struct tight_encoder* self, | ||
121 | tile->state = TIGHT_TILE_ENCODED; | ||
122 | } | ||
123 | |||
124 | -static void do_tight_zs_work(void* obj) | ||
125 | +static void do_tight_zs_work(struct aml_work* work) | ||
126 | { | ||
127 | - struct tight_zs_worker_ctx* ctx = aml_get_userdata(obj); | ||
128 | + struct tight_zs_worker_ctx* ctx = aml_get_userdata(work); | ||
129 | struct tight_encoder* self = ctx->encoder; | ||
130 | int index = ctx->index; | ||
131 | |||
132 | @@ -440,7 +440,7 @@ static void do_tight_zs_work(void* obj) | ||
133 | tight_encode_tile(self, x, y); | ||
134 | } | ||
135 | |||
136 | -static void on_tight_zs_work_done(void* obj) | ||
137 | +static void on_tight_zs_work_done(struct aml_work* obj) | ||
138 | { | ||
139 | struct tight_zs_worker_ctx* ctx = aml_get_userdata(obj); | ||
140 | struct tight_encoder* self = ctx->encoder; | ||
141 | @@ -509,15 +509,15 @@ static void tight_finish(struct tight_encoder* self) | ||
142 | tight_finish_tile(self, x, y); | ||
143 | } | ||
144 | |||
145 | -static void do_tight_finish(void* obj) | ||
146 | +static void do_tight_finish(struct aml_work* work) | ||
147 | { | ||
148 | - struct tight_encoder* self = aml_get_userdata(obj); | ||
149 | + struct tight_encoder* self = aml_get_userdata(work); | ||
150 | tight_finish(self); | ||
151 | } | ||
152 | |||
153 | -static void on_tight_finished(void* obj) | ||
154 | +static void on_tight_finished(struct aml_work* work) | ||
155 | { | ||
156 | - struct tight_encoder* self = aml_get_userdata(obj); | ||
157 | + struct tight_encoder* self = aml_get_userdata(work); | ||
158 | |||
159 | struct encoded_frame* result; | ||
160 | result = encoded_frame_new(self->dst.data, self->dst.len, self->n_rects, | ||
161 | diff --git a/src/enc/zrle.c b/src/enc/zrle.c | ||
162 | index 42044dc..e775f34 100644 | ||
163 | --- a/src/enc/zrle.c | ||
164 | +++ b/src/enc/zrle.c | ||
165 | @@ -315,9 +315,9 @@ static int zrle_encode_frame(struct zrle_encoder* self, | ||
166 | return 0; | ||
167 | } | ||
168 | |||
169 | -static void zrle_encoder_do_work(void* obj) | ||
170 | +static void zrle_encoder_do_work(struct aml_work* work) | ||
171 | { | ||
172 | - struct zrle_encoder* self = aml_get_userdata(obj); | ||
173 | + struct zrle_encoder* self = aml_get_userdata(work); | ||
174 | int rc __attribute__((unused)); | ||
175 | |||
176 | struct nvnc_fb* fb = self->current_fb; | ||
177 | @@ -349,9 +349,9 @@ static void zrle_encoder_do_work(void* obj) | ||
178 | assert(self->current_result); | ||
179 | } | ||
180 | |||
181 | -static void zrle_encoder_on_done(void* obj) | ||
182 | +static void zrle_encoder_on_done(struct aml_work* work) | ||
183 | { | ||
184 | - struct zrle_encoder* self = aml_get_userdata(obj); | ||
185 | + struct zrle_encoder* self = aml_get_userdata(work); | ||
186 | |||
187 | assert(self->current_result); | ||
188 | |||
189 | diff --git a/src/resampler.c b/src/resampler.c | ||
190 | index e24798b..8f4cfa0 100644 | ||
191 | --- a/src/resampler.c | ||
192 | +++ b/src/resampler.c | ||
193 | @@ -147,9 +147,8 @@ void resample_now(struct nvnc_fb* dst, struct nvnc_fb* src, | ||
194 | pixman_image_unref(dstimg); | ||
195 | } | ||
196 | |||
197 | -static void do_work(void* handle) | ||
198 | +static void do_work(struct aml_work* work) | ||
199 | { | ||
200 | - struct aml_work* work = handle; | ||
201 | struct resampler_work* ctx = aml_get_userdata(work); | ||
202 | |||
203 | struct nvnc_fb* src = ctx->src; | ||
204 | @@ -159,11 +158,9 @@ static void do_work(void* handle) | ||
205 | resample_now(dst, src, &dst_side_data->buffer_damage); | ||
206 | } | ||
207 | |||
208 | -static void on_work_done(void* handle) | ||
209 | +static void on_work_done(struct aml_work* work) | ||
210 | { | ||
211 | - struct aml_work* work = handle; | ||
212 | struct resampler_work* ctx = aml_get_userdata(work); | ||
213 | - | ||
214 | ctx->on_done(ctx->dst, &ctx->frame_damage, ctx->userdata); | ||
215 | } | ||
216 | |||
217 | diff --git a/src/server.c b/src/server.c | ||
218 | index f172658..61da4dd 100644 | ||
219 | --- a/src/server.c | ||
220 | +++ b/src/server.c | ||
221 | @@ -210,9 +210,8 @@ static void client_close(struct nvnc_client* client) | ||
222 | free(client); | ||
223 | } | ||
224 | |||
225 | -static void do_deferred_client_close(void* obj) | ||
226 | +static void do_deferred_client_close(struct aml_idle* idle) | ||
227 | { | ||
228 | - struct aml_idle* idle = obj; | ||
229 | struct nvnc_client* client = aml_get_userdata(idle); | ||
230 | client->close_task = NULL; | ||
231 | aml_stop(aml_get_default(), idle); | ||
232 | @@ -2033,9 +2032,8 @@ static void on_client_event(struct stream* stream, enum stream_event event) | ||
233 | client->buffer_index = 0; | ||
234 | } | ||
235 | |||
236 | -static void on_connection(void* obj) | ||
237 | +static void on_connection(struct aml_handler* poll_handle) | ||
238 | { | ||
239 | - struct aml_handler* poll_handle = obj; | ||
240 | struct nvnc__socket* socket = aml_get_userdata(poll_handle); | ||
241 | struct nvnc* server = socket->parent; | ||
242 | |||
243 | diff --git a/src/stream/gnutls.c b/src/stream/gnutls.c | ||
244 | index 14661e5..00a7c13 100644 | ||
245 | --- a/src/stream/gnutls.c | ||
246 | +++ b/src/stream/gnutls.c | ||
247 | @@ -171,10 +171,10 @@ static void stream_gnutls__on_writable(struct stream* self) | ||
248 | } | ||
249 | } | ||
250 | |||
251 | -static void stream_gnutls__on_event(void* obj) | ||
252 | +static void stream_gnutls__on_event(struct aml_handler* handler) | ||
253 | { | ||
254 | - struct stream* self = aml_get_userdata(obj); | ||
255 | - uint32_t events = aml_get_revents(obj); | ||
256 | + struct stream* self = aml_get_userdata(handler); | ||
257 | + uint32_t events = aml_get_revents(handler); | ||
258 | |||
259 | stream_ref(self); | ||
260 | |||
261 | diff --git a/src/stream/tcp.c b/src/stream/tcp.c | ||
262 | index 37f139a..95f5aa8 100644 | ||
263 | --- a/src/stream/tcp.c | ||
264 | +++ b/src/stream/tcp.c | ||
265 | @@ -191,10 +191,10 @@ static void stream_tcp__on_writable(struct stream* self) | ||
266 | } | ||
267 | } | ||
268 | |||
269 | -static void stream_tcp__on_event(void* obj) | ||
270 | +static void stream_tcp__on_event(struct aml_handler* handler) | ||
271 | { | ||
272 | - struct stream* self = aml_get_userdata(obj); | ||
273 | - uint32_t events = aml_get_revents(obj); | ||
274 | + struct stream* self = aml_get_userdata(handler); | ||
275 | + uint32_t events = aml_get_revents(handler); | ||
276 | |||
277 | // We hold a reference here in case the stream gets destroyed inside | ||
278 | // callback. | ||
279 | -- | ||
280 | 2.43.0 | ||
281 | |||
diff --git a/meta-oe/recipes-graphics/neatvnc/neatvnc/0001-meson-Use-new-pkgconfig-for-aml1.patch b/meta-oe/recipes-graphics/neatvnc/neatvnc/0001-meson-Use-new-pkgconfig-for-aml1.patch new file mode 100644 index 0000000000..ec47fb61fb --- /dev/null +++ b/meta-oe/recipes-graphics/neatvnc/neatvnc/0001-meson-Use-new-pkgconfig-for-aml1.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | From c1f4833dc13403882a3efbb8a69de33191fb72c6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Andri Yngvason <andri@yngvason.is> | ||
3 | Date: Sun, 27 Jul 2025 14:17:54 +0000 | ||
4 | Subject: [PATCH] meson: Use new pkgconfig for aml1 | ||
5 | |||
6 | Upstream-Status: Backport [https://github.com/any1/neatvnc/commit/c1f4833dc13403882a3efbb8a69de33191fb72c6] | ||
7 | |||
8 | --- | ||
9 | meson.build | 2 +- | ||
10 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
11 | |||
12 | diff --git a/meson.build b/meson.build | ||
13 | index e731886..59364a7 100644 | ||
14 | --- a/meson.build | ||
15 | +++ b/meson.build | ||
16 | @@ -76,7 +76,7 @@ aml_project = subproject('aml', required: false, version: aml_version) | ||
17 | if aml_project.found() | ||
18 | aml = aml_project.get_variable('aml_dep') | ||
19 | else | ||
20 | - aml = dependency('aml', version: aml_version) | ||
21 | + aml = dependency('aml1', version: aml_version) | ||
22 | endif | ||
23 | |||
24 | inc = include_directories('include') | ||
25 | -- | ||
26 | 2.43.0 | ||
27 | |||
diff --git a/meta-oe/recipes-graphics/neatvnc/neatvnc_0.8.1.bb b/meta-oe/recipes-graphics/neatvnc/neatvnc_0.9.5.bb index 2b26ec57ae..b83a886f11 100644 --- a/meta-oe/recipes-graphics/neatvnc/neatvnc_0.8.1.bb +++ b/meta-oe/recipes-graphics/neatvnc/neatvnc_0.9.5.bb | |||
@@ -4,9 +4,13 @@ HOMEPAGE = "https://github.com/any1/neatvnc" | |||
4 | LICENSE = "ISC" | 4 | LICENSE = "ISC" |
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=94fc374e7174f41e3afe0f027ee59ff7" | 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=94fc374e7174f41e3afe0f027ee59ff7" |
6 | 6 | ||
7 | SRC_URI = "git://github.com/any1/neatvnc;branch=v0.8;protocol=https" | 7 | SRC_URI = "git://github.com/any1/neatvnc;branch=v0.9;protocol=https \ |
8 | file://0001-meson-Use-new-pkgconfig-for-aml1.patch \ | ||
9 | file://0001-Add-method-to-listen-on-multiple-fds.patch \ | ||
10 | file://0001-Use-aml-v1.patch \ | ||
11 | " | ||
8 | 12 | ||
9 | SRCREV = "07081567ab21a2b099ceb41ae8cab872a31cbb9a" | 13 | SRCREV = "36ef59a83291368d72f471700702a8b6a76f763b" |
10 | 14 | ||
11 | 15 | ||
12 | DEPENDS = "libdrm pixman aml zlib" | 16 | DEPENDS = "libdrm pixman aml zlib" |