server: Move pixel format conversion out of do_client_update_fb
parent
7e2b4fef8c
commit
add8d8e8db
10
src/server.c
10
src/server.c
|
@ -509,6 +509,11 @@ static void process_fb_update_requests(struct nvnc_client* client)
|
||||||
struct nvnc_fb* fb = client->server->display->buffer;
|
struct nvnc_fb* fb = client->server->display->buffer;
|
||||||
assert(fb);
|
assert(fb);
|
||||||
|
|
||||||
|
if (!client->has_pixfmt) {
|
||||||
|
rfb_pixfmt_from_fourcc(&client->pixfmt, fb->fourcc_format);
|
||||||
|
client->has_pixfmt = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (fb->width != client->known_width
|
if (fb->width != client->known_width
|
||||||
|| fb->height != client->known_height)
|
|| fb->height != client->known_height)
|
||||||
send_desktop_resize(client, fb);
|
send_desktop_resize(client, fb);
|
||||||
|
@ -1107,11 +1112,6 @@ static void do_client_update_fb(void* work)
|
||||||
|
|
||||||
enum rfb_encodings encoding = choose_frame_encoding(client);
|
enum rfb_encodings encoding = choose_frame_encoding(client);
|
||||||
|
|
||||||
if (!client->has_pixfmt) {
|
|
||||||
rfb_pixfmt_from_fourcc(&client->pixfmt, fb->fourcc_format);
|
|
||||||
client->has_pixfmt = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (encoding) {
|
switch (encoding) {
|
||||||
case RFB_ENCODING_RAW:
|
case RFB_ENCODING_RAW:
|
||||||
raw_encode_frame(&update->frame, &client->pixfmt, fb,
|
raw_encode_frame(&update->frame, &client->pixfmt, fb,
|
||||||
|
|
Loading…
Reference in New Issue