Browse Source

Added float representation of levels

master
Maximilian Stiefel 4 years ago
parent
commit
ad284b4d36
  1. 26
      edid.json
  2. 20
      edid_stockach.json
  3. 21
      main.c

26
edid.json

@ -1,20 +1,26 @@
{
"header": {
"manufacturer_id": "GSM",
"product_code": 22997,
"serial_number": 607492,
"week_of_manufacture": 3,
"year_of_manufacture": 2013,
"manufacturer_id": "DEL",
"product_code": 16455,
"serial_number": 825316684,
"week_of_manufacture": 32,
"year_of_manufacture": 2009,
"edid_version": 1,
"edid_revision": 3
},
"video_input_parameters": {
"input_type": "analog",
"levels": 3,
"levels": {
"upper": 0.7,
"lower": -0.3
},
"blank_to_black": false,
"seperate_sync": true,
"composite_sync": false,
"sync_on_green": false,
"vsync_serrated": false
"composite_sync": true,
"sync_on_green": true,
"vsync_serrated": false,
"horizontal_screen_size": 38,
"vertical_screen_size": 30
"gamma": 2.2
}
}
}

20
edid_stockach.json

@ -0,0 +1,20 @@
{
"header": {
"manufacturer_id": "GSM",
"product_code": 22997,
"serial_number": 607492,
"week_of_manufacture": 3,
"year_of_manufacture": 2013,
"edid_version": 1,
"edid_revision": 3
},
"video_input_parameters": {
"input_type": "analog",
"levels": 3,
"blank_to_black": false,
"seperate_sync": true,
"composite_sync": false,
"sync_on_green": false,
"vsync_serrated": false
}
}

21
main.c

@ -219,6 +219,8 @@ static int generate_video_input_parameters( edid_t* edid,
size_t json_len)
{
char* multi_use_str;
float multi_use_flt0;
float multi_use_flt1;
unsigned int multi_use_int;
bool multi_use_bool;
@ -230,8 +232,23 @@ static int generate_video_input_parameters( edid_t* edid,
edid->basic_display_parameters.video_input_parameters
.analog.input_type = 0;
// Levels
json_scanf( json_str, json_len, "{video_input_parameters: {levels: %d}",
&multi_use_int);
json_scanf( json_str, json_len, "{video_input_parameters: {levels: {upper: %f}}}",
&multi_use_flt0);
json_scanf( json_str, json_len, "{video_input_parameters: {levels: {lower: %f}}}",
&multi_use_flt1);
if (multi_use_flt0 == 0.7f && multi_use_flt1 == -0.3f) {
multi_use_int = 0;
} else if (multi_use_flt0 == 0.714f && multi_use_flt1 == -0.286f) {
multi_use_int = 1;
} else if (multi_use_flt0 == 1.0f && multi_use_flt1 == -0.4f) {
multi_use_int = 2;
} else if (multi_use_flt0 == 0.7f && multi_use_flt1 == 0.0f) {
multi_use_int = 3;
} else {
printf("Error: The levels %f/%f are not conforming to the standard.\n",
multi_use_flt0, multi_use_flt1);
}
printf("level> %d\n", multi_use_int);
edid->basic_display_parameters.video_input_parameters
.analog.levels = 0x3 & multi_use_int;
// Blank to black

Loading…
Cancel
Save