mirror of
https://github.com/morgan9e/UxPlay
synced 2026-04-14 00:04:13 +09:00
store the display plist data in raop_t as uint16_t and uint8_t types.
This commit is contained in:
21
lib/raop.c
21
lib/raop.c
@@ -50,10 +50,10 @@ struct raop_s {
|
||||
unsigned short data_lport;
|
||||
unsigned short mirror_data_lport;
|
||||
|
||||
unsigned short display_width;
|
||||
unsigned short display_height;
|
||||
unsigned short display_refresh_rate;
|
||||
unsigned short display_max_fps;
|
||||
uint16_t display_width;
|
||||
uint16_t display_height;
|
||||
uint8_t display_refresh_rate;
|
||||
uint8_t display_max_fps;
|
||||
};
|
||||
|
||||
struct raop_conn_s {
|
||||
@@ -361,15 +361,16 @@ void raop_set_display(raop_t *raop, unsigned short width, unsigned short height,
|
||||
unsigned short refresh_rate, unsigned short max_fps){
|
||||
assert(raop);
|
||||
|
||||
if (width) raop->display_width = width;
|
||||
if (height) raop->display_height = height;
|
||||
// these must fit into two 8-bit bytes
|
||||
if (width) raop->display_width = (uint16_t) width;
|
||||
if (height) raop->display_height = (uint16_t) height;
|
||||
|
||||
// these must fit into a single byte
|
||||
// these must fit into a single 8-bit byte
|
||||
if (refresh_rate > 255) refresh_rate = 255;
|
||||
if (max_fps > 255) max_fps = 255;
|
||||
if (refresh_rate) raop->display_refresh_rate = (uint8_t) refresh_rate;
|
||||
|
||||
if (refresh_rate) raop->display_refresh_rate = refresh_rate;
|
||||
if (max_fps) raop->display_max_fps = max_fps;
|
||||
if (max_fps > 255) max_fps = 255;
|
||||
if (max_fps) raop->display_max_fps = (uint8_t) max_fps;
|
||||
|
||||
if (raop->display_max_fps > raop->display_refresh_rate) {
|
||||
raop->display_max_fps = raop->display_refresh_rate;
|
||||
|
||||
@@ -134,13 +134,13 @@ raop_handler_info(raop_conn_t *conn,
|
||||
plist_t displays_0_uuid_node = plist_new_string("e0ff8a27-6738-3d56-8a16-cc53aacee925");
|
||||
plist_t displays_0_width_physical_node = plist_new_uint(0);
|
||||
plist_t displays_0_height_physical_node = plist_new_uint(0);
|
||||
plist_t displays_0_width_node = plist_new_uint((uint16_t) conn->raop->display_width);
|
||||
plist_t displays_0_height_node = plist_new_uint((uint16_t) conn->raop->display_height);
|
||||
plist_t displays_0_width_pixels_node = plist_new_uint((uint16_t) conn->raop->display_width);
|
||||
plist_t displays_0_height_pixels_node = plist_new_uint((uint16_t) conn->raop->display_height);
|
||||
plist_t displays_0_width_node = plist_new_uint(conn->raop->display_width);
|
||||
plist_t displays_0_height_node = plist_new_uint(conn->raop->display_height);
|
||||
plist_t displays_0_width_pixels_node = plist_new_uint(conn->raop->display_width);
|
||||
plist_t displays_0_height_pixels_node = plist_new_uint(conn->raop->display_height);
|
||||
plist_t displays_0_rotation_node = plist_new_bool(0);
|
||||
plist_t displays_0_refresh_rate_node = plist_new_uint((uint8_t) conn->raop->display_refresh_rate);
|
||||
plist_t displays_0_max_fps_node = plist_new_uint((uint8_t) conn->raop->display_max_fps);
|
||||
plist_t displays_0_refresh_rate_node = plist_new_uint(conn->raop->display_refresh_rate);
|
||||
plist_t displays_0_max_fps_node = plist_new_uint(conn->raop->display_max_fps);
|
||||
plist_t displays_0_overscanned_node = plist_new_bool(1);
|
||||
plist_t displays_0_features = plist_new_uint(14);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user