(转)Hdmi edid 数据解析

Hdmi edid 数据解析

(转自:http://blog.chinaunix.net/uid-20672559-id-3384035.html)

一.EDID数据格式:

EDID 1.3 data format
Byte sequence

00-19 Header information
00–07 Header information "00h FFh FFh FFh FFh FFh FFh 00h"
08–09 Manufacturer ID. These IDs are assigned by Microsoft. "00001=A”; “00010=B”; ... “11010=Z”. Bit 7 (at address 08h) is 0, the first character (letter) is located at bits 6 → 2 (at address 08h), the second character (letter) is located at bits 1 & 0 (at address 08h) and bits 7 → 5 (at address 09h), and the third character (letter) is located at bits 4 → 0 (at address 09h).
10–11 Product ID Code (stored as LSB first). Assigned by manufacturer.
12–15 32-bit Serial Number. No requirement for the format. Usually stored as LSB first. In order to maintain compatibility with previous requirements the field should set at least one byte of the field to be non-zero if an ASCII serial number descriptor is provided in the detailed timing section.
16 Week of Manufacture. This varies by manufacturer. One way is to count January 1–7 as week 1, January 8–15 as week 2 and so on. Some count based on the week number (Sunday-Saturday). Valid range is 1-54.
17 Year of Manufacture. Add 1990 to the value for actual year.
18 EDID Version Number "01h"
19 EDID Revision Number "03h"

20-24 Basic display parameters
20 Video input definition
7 0=analog 1=digital
6 video level

00=0.7, 0.3; 01=0.714, 0.286; 10=1, 0.4; 11=0.7, 0
5
4 blank-to-black setup
3 separate syncs
2 composite sync
1 sync on green
0 serration vsync 1=DFP 1.x compatible
21 Maximum Horizontal Image Size (in centimeters).
22 Maximum Vertical Image Size (in centimetres).
23 Display Gamma. Divide by 100, then add 1 for actual value.
24 Power Management and Supported Feature(s):
7 standby
6 suspend
5 active-off/low power
4 Display type:

00=monochrome, 01=RGB colour, 10=non RGB multicolour, 11=undefined
3
2 standard colour space
1 preferred timing mode
0 default GTF supported

25-34 Chromaticity coordinates
25 low significant bits for Red X (bit 7-6), Red Y (bit 5-4), Green X (bit 3-2), Green Y (bit 1-0).
26 low significant bits for Blue X (bit 7-6), Blue Y (bit 5-4), White X (bit 3-2), White Y (bit 1-0).
27–34 high significant bits for Red X, Red Y, Green X, Green Y, Blue X, Blue Y, White X, White Y. To decode actual value, rearrange bits as follows: High significant bits 7-0 for (channel), low significant bits for (channel). Actual value is between 0.000 and 0.999, but encoded value is between 000h and 3FFh. Normalize by *999/1023.

35 Established timing I:

720×[email protected] Hz, 720×[email protected] Hz, 640×[email protected] Hz, 640×[email protected] Hz, 640×[email protected] Hz, 640×[email protected] Hz, 800×[email protected] Hz, 800×[email protected] Hz

36 Established timing II:

800×[email protected] Hz, 800×[email protected] Hz, 832×[email protected] Hz, 1024×[email protected] Hz (Interlaced), 1024×[email protected] Hz, 1024×[email protected] Hz, 1024×[email protected] Hz, 1280×[email protected] Hz

37 Manufacturer‘s reserved timing:

00h for none
bit 7: 1152x870 @ 75 Hz (Mac II, Apple)

38–53 Standard timing identification

First byte: Horizontal resolution. Multiply by 8, then add 248 for actual value.
Second byte:

bit 7-6
Aspect ratio. Actual vertical resolution depends on horizontal resolution.
00=16:10, 01=4:3, 10=5:4, 11=16:9 (00=1:1 prior to v1.3)
bit 5-0
Vertical frequency. Add 60 to get actual value.

54–71 Descriptor Block 1
54–55 Pixel Clock (in 10 kHz) or 0 (55 MSB 54 LSB)

If Pixel Clock is non null:
56: Horizontal Active (in pixels)
57: Horizontal Blanking (in pixels)
58: Horizontal Active high (4 upper bits)
Horizontal Blanking high (4 lower bits)
59: Vertical Active (in lines)
60: Vertical Blanking (in lines)
61: high significant bits for Vertical Active (4 upper bits)
high significant bits for Vertical Blanking (4 lower bits)
62: Horizontal Sync Offset (in pixels)
63: Horizontal Sync Pulse Width (in pixels)
64: Vertical Sync Offset (in lines) (4 upper bits)
Vertical Sync Pulse Width (in lines) (4 lower bits)
65: high significant bits for Horizontal Sync Offset (bit 7-6)
high significant bits for Horizontal Sync Pulse Width (bit 5-4)
high significant bits for Vertical Sync Offset (bit 3-2)
high significant bits for Vertical Sync Pulse Width (bit 1-0)
66: Horizontal Image Size (in mm)
67: Vertical Image Size (in mm)
68: high significant bits for Horizontal Image Size (4 upper bits)
high significant bits for Vertical Image Size (4 lower bits)
69: Horizontal Border (in pixels representing only one side)
70: Vertical Border (in lines representing only one side)
71: Interlaced or not (bit 7)
Stereo or not (bit 6-5) ("00" means not)
Separate Sync or not (bit 4-3)
Vertical Sync positive or not (bit 2)
Horizontal Sync positive or not (bit 1)
Stereo Mode (bit 0) (unused if 6-5 are 00)
If Pixel Clock is null:
56: 0
57: Block type
FFh=Monitor Serial Number, FEh=ASCII string, FDh=Monitor Range Limits, FCh=Monitor name, 
FBh=Colour Point Data, FAh, Standard Timing Data, F9h=Currently undefined, 
0Fh=defined by manufacturer
58: 0
59–71: Descriptor block contents.
If block type is FFh, FEh, or FCh, the entire area is a text string.
If block type is FDh:
59–63:
Min Vertical frequency, Max Vertical frequency, 
Min Horizontal frequency (in kHz), Max Horizontal frequency (in kHz), pixel clock 
(in MHz (multiply by 10 for actual value))
64–65: Secondary GTF toggle
If encoded value is 000A, bytes 59-63 are used. If encoded value is 0200, 
bytes 67–71 are used.
66: Start horizontal frequency (in kHz). Multiply by 2 for actual value.
67: C. Divide by 2 for actual value.
68-69: M (stored as LSB first).
70: K
71: J. Divide by 2 for actual value.
If block type is FBh:
59: W Index 0. If set to 0, bytes 60-63 are not used. If set to 1, 60–63 are 
assigned to white point index #1
64: W Index 1. If set to 0, bytes 65-68 are not used. If set to 2, 65–68 are 
assigned to white point index #2
White point index structure:
First byte
bit 3-2: low significant bits for White X (bit 3-2), White Y (bit 1-0)
Second to third byte: high significant bits for White X, White Y.
Fourth byte: Gamma. Divide by 100, then add 1 for actual value.
To decode White X and White Y, see bytes 25-34.
If block type is FAh:
59–70: Standard Timing Identification. 2 bytes for each record.
For structure details, see bytes 38-53.

72–89 Descriptor Block 2

90–107 Descriptor Block 3

108–125 Descriptor Block 4

126 Extension Flag.

This is the number of extension blocks which follow this block. Prior to EDID 1.3, it is ignored, and should be set to 0.

127 Checksum.

This byte should be programmed such that the sum of all 128 bytes equals 00h.

CEA EDID Timing Extension Version 3 data format:

Byte sequence
00: Extension tag (which kind of extension block this is); 02h for CEA EDID
01: Revision number (Version number); 03h for Version 3
02: Byte number "d" within this block where the 18-byte DTDs begin. If no non-DTD data is present 
in this extension block, the value should be set to 04h (the byte after next). If set to 00h,
there are no DTDs present in this block and no non-DTD data.
03: Number of DTDs present, other Version 2+ information
bit 7: 1 if display supports underscan, 0 if not
bit 6: 1 if display supports basic audio, 0 if not
bit 5: 1 if display supports YCbCr 4:4:4, 0 if not
bit 4: 1 if display supports YCbCr 4:2:2, 0 if not
bit 3..0: total number of native formats in the DTDs included in this block
04: Start of Data Block Collection. If byte 02 is set to 04h, this is where the DTD collection
begins. If byte 02 is set to another value, byte 04 is where the Data Block Collection begins,
and the DTD collection follows immediately thereafter.

The Data Block Collection contains one or more data blocks detailing video, audio, and speaker
placement information about the display. The blocks can be placed in any order, and the initial
byte of each block defines both its type and its length:
bit 7..5: Block Type Tag (1 is audio, 2 is video, 3 is vendor specific, 4 is speaker
allocation, all other values Reserved) 
bit 4..0: Total number of bytes in this block following this byte
Once one data block has ended, the next byte is assumed to be the beginning of the next data
block. This is the case until the byte (designated in Byte 02, above) where the DTDs are known 
to begin.

Any Audio Data Block contains one or more 3-byte Short Audio Descriptors (SADs). Each SAD
details audio format, channel number, and bitrate/resolution capabilities of the display as
follows:
SAD Byte 1 (format and number of channels):
bit 7: Reserved (0)
bit 6..3: Audio format code
1 = Linear Pulse Code Modulation (LPCM)
2 = AC-3
3 = MPEG1 (Layers 1 and 2)
4 = MP3
5 = MPEG2
6 = AAC
7 = DTS
8 = ATRAC
0, 15: Reserved 
9 = One-bit audio aka SACD
10 = DD+
11 = DTS-HD
12 = MLP/Dolby TrueHD
13 = DST Audio
14 = Microsoft WMA Pro
bit 2..0: number of channels minus 1 (i.e. 000 = 1 channel; 001 = 2 channels; 111 =
8 channels)

SAD Byte 2 (sampling frequencies supported):
bit 7: Reserved (0)
bit 6: 192kHz
bit 5: 176kHz
bit 4: 96kHz
bit 3: 88kHz
bit 2: 48kHz
bit 1: 44kHz
bit 0: 32kHz

SAD Byte 3 (bitrate):
For LPCM, bits 7:3 are reserved and the remaining bits define bit depth
bit 2: 24 bit
bit 1: 20 bit
bit 0: 16 bit
For all other sound formats, bits 7..0 designate the maximum supported bitrate divided by 
8kbps.

Any Video Data Block will contain one or more 1-byte Short Video Descriptors (SVDs). They are 
decoded as follows:
bit 7: 1 to designate that this should be considered a "native" resolution, 0 for non-native
bit 6..0: index value to a table of standard resolutions/timings from CEA/EIA-861E:

Code
Short Aspect
Name Ratio HxV @ F

1 DMT0659 4:3 640x480p @ 59.94/60Hz
2 480p 4:3 720x480p @ 59.94/60Hz
3 480pH 16:9 720x480p @ 59.94/60Hz
4 720p 16:9 1280x720p @ 59.94/60Hz
5 1080i 16:9 1920x1080i @ 59.94/60Hz
6 480i 4:3 720(1440)x480i @ 59.94/60Hz
7 480iH 16:9 720(1440)x480i @ 59.94/60Hz
8 240p 4:3 720(1440)x240p @ 59.94/60Hz
9 240pH 16:9 720(1440)x240p @ 59.94/60Hz
10 480i4x 4:3 (2880)x480i @ 59.94/60Hz
11 480i4xH 16:9 (2880)x480i @ 59.94/60Hz
12 240p4x 4:3 (2880)x240p @ 59.94/60Hz
13 240p4xH 16:9 (2880)x240p @ 59.94/60Hz
14 480p2x 4:3 1440x480p @ 59.94/60Hz
15 480p2xH 16:9 1440x480p @ 59.94/60Hz
16 1080p 16:9 1920x1080p @ 59.94/60Hz
17 576p 4:3 720x576p @ 50Hz
18 576pH 16:9 720x576p @ 50Hz
19 720p50 16:9 1280x720p @ 50Hz
20 1080i25 16:9 1920x1080i @ 50Hz*
21 576i 4:3 720(1440)x576i @ 50Hz
22 576iH 16:9 720(1440)x576i @ 50Hz
23 288p 4:3 720(1440)x288p @ 50Hz
24 288pH 16:9 720(1440)x288p @ 50Hz
25 576i4x 4:3 (2880)x576i @ 50Hz
26 576i4xH 16:9 (2880)x576i @ 50Hz
27 288p4x 4:3 (2880)x288p @ 50Hz
28 288p4xH 16:9 (2880)x288p @ 50Hz
29 576p2x 4:3 1440x576p @ 50Hz
30 576p2xH 16:9 1440x576p @ 50Hz
31 1080p50 16:9 1920x1080p @ 50Hz
32 1080p24 16:9 1920x1080p @ 23.98/24Hz
33 1080p25 16:9 1920x1080p @ 25Hz
34 1080p30 16:9 1920x1080p @ 29.97/30Hz
35 480p4x 4:3 (2880)x480p @ 59.94/60Hz
36 480p4xH 16:9 (2880)x480p @ 59.94/60Hz
37 576p4x 4:3 (2880)x576p @ 50Hz
38 576p4xH 16:9 (2880)x576p @ 50Hz
39 1080i25 16:9 1920x1080i(1250 Total) @ 50Hz*
40 1080i50 16:9 1920x1080i @ 100Hz
41 720p100 16:9 1280x720p @ 100Hz
42 576p100 4:3 720x576p @ 100Hz
43 576p100H 16:9 720x576p @ 100Hz
44 576i50 4:3 720(1440)x576i @ 100Hz
45 576i50H 16:9 720(1440)x576i @ 100Hz
46 1080i60 16:9 1920x1080i @ 119.88/120Hz
47 720p120 16:9 1280x720p @ 119.88/120Hz
48 480p119 4:3 720x480p @ 119.88/120Hz
49 480p119H 16:9 720x480p @ 119.88/120Hz
50 480i59 4:3 720(1440)x480i @ 119.88/120Hz
51 480i59H 16:9 720(1440)x480i @ 119.88/120Hz
52 576p200 4:3 720x576p @ 200Hz
53 576p200H 16:9 720x576p @ 200Hz
54 576i100 4:3 720(1440)x576i @ 200Hz
55 576i100H 16:9 720(1440)x576i @ 200Hz
56 480p239 4:3 720x480p @ 239.76/240Hz
57 480p239H 16:9 720x480p @ 239.76/240Hz
58 480i119 4:3 720(1440)x480i @ 239.76/240Hz
59 480i119H 16:9 720(1440)x480i @ 239.76/240Hz
60 720p24 16:9 1280x720p @ 23.98/24Hz
61 720p25 16:9 1280x720p @ 25Hz
62 720p30 16:9 1280x720p @ 29.97/30Hz
63 1080p120 16:9 1920x1080p @ 119.88/120Hz

二.hdmi ddc bus是通过 i2c总线来通信的,因此要在kernel注册i2c驱动:

i2c驱动的设备节点是/dev/hdmi_ddc_misc,这个驱动非常的简单,只做了将35 byte的edid数据从kernel空间传到用户空间。

然后就可以在用户空间读到这35 byte的数据:

fh = open("/dev/hdmi_ddc_misc",O_RDWR);
if (fh == -1) {
printf("open hdmi_ddc device error! ");
return 0;
}
if(ioctl(fh,HDMI_DDC_I2C_READ,hdmi_edid_data)<0){
perror("ioctl error");
exit(1);
}

三.在用户空间对edid数据的解析:

//printf("Established timing monitor support:\n");
if(hdmi_edid_data[0] & ESTABLISHED_TIMING2)videoType |= (1 << VideoStd_640x480); 
if(hdmi_edid_data[0] & ESTABLISHED_TIMING3)videoType |= (1 << VideoStd_640x480);
if(hdmi_edid_data[0] & ESTABLISHED_TIMING4)videoType |= (1 << VideoStd_640x480);
if(hdmi_edid_data[0] & ESTABLISHED_TIMING5)videoType |= (1 << VideoStd_640x480);

if(hdmi_edid_data[1] & ESTABLISHED_TIMING14)videoType |= (1 << VideoStd_800x600);
if(hdmi_edid_data[1] & ESTABLISHED_TIMING15)videoType |= (1 << VideoStd_800x600);

if(hdmi_edid_data[1] & ESTABLISHED_TIMING9)videoType |= (1 << VideoStd_1024x768);
if(hdmi_edid_data[1] & ESTABLISHED_TIMING10)videoType |= (1 << VideoStd_1024x768);
if(hdmi_edid_data[1] & ESTABLISHED_TIMING11)videoType |= (1 << VideoStd_1024x768);

if(hdmi_edid_data[1] & ESTABLISHED_TIMING8)videoType |= (1 << VideoStd_1280x1024);

//printf("Standard timing monitor support:\n");
for(i=0;i<8;i++){
if(0x01 == hdmi_edid_data[i*2+2])goto st_end;
hsize = hdmi_edid_data[i*2+2]*8+248;
if(0x00 == (hdmi_edid_data[i*2+3] & 0xc0))vsize=hsize/16*10;
if(0x40 == (hdmi_edid_data[i*2+3] & 0xc0))vsize=hsize/4*3;
if(0x80 == (hdmi_edid_data[i*2+3] & 0xc0))vsize=hsize/5*4;
if(0xc0 == (hdmi_edid_data[i*2+3] & 0xc0))vsize=hsize/16*9;
rate = (hdmi_edid_data[i*2+3] & 0x3f)+60;
//printf("monitor support %dx%[email protected]%d Hz\n",hsize,vsize,rate);
if((640 == hsize) && (480 == vsize))videoType |= (1 << VideoStd_640x480);
if((720 == hsize) && (480 == vsize))videoType |= (1 << VideoStd_720x480); 
if((800 == hsize) && (480 == vsize))videoType |= (1 << VideoStd_800x480); 
if((800 == hsize) && (600 == vsize))videoType |= (1 << VideoStd_800x600); 
if((1024 == hsize) && (768 == vsize))videoType |= (1 << VideoStd_1024x768); 
if((1280 == hsize) && (720 == vsize))videoType |= (1 << VideoStd_1280x720); 
if((1280 == hsize) && (1024 == vsize))videoType |= (1 << VideoStd_1280x1024); 
if((1600 == hsize) && (900 == vsize))videoType |= (1 << VideoStd_1600x900); 
if((1920 == hsize) && (1080 == vsize))videoType |= (1 << VideoStd_1920x1080); 
}

st_end:
//printf("CEA EDID Timing monitor support:\n");
if(0x01 != hdmi_edid_data[18])goto cet_end;
for(i=20;i<35;i++){
if(1 == (hdmi_edid_data[i] & 0x7f))videoType |= (1 << VideoStd_640x480);

if(2 == (hdmi_edid_data[i] & 0x7f))videoType |= (1 << VideoStd_720x480);
if(3 == (hdmi_edid_data[i] & 0x7f))videoType |= (1 << VideoStd_720x480);
if(48 == (hdmi_edid_data[i] & 0x7f))videoType |= (1 << VideoStd_720x480);
if(49 == (hdmi_edid_data[i] & 0x7f))videoType |= (1 << VideoStd_720x480);
if(56 == (hdmi_edid_data[i] & 0x7f))videoType |= (1 << VideoStd_720x480);
if(57 == (hdmi_edid_data[i] & 0x7f))videoType |= (1 << VideoStd_720x480);

if(4 == (hdmi_edid_data[i] & 0x7f))videoType |= (1 << VideoStd_1280x720);
if(19 == (hdmi_edid_data[i] & 0x7f))videoType |= (1 << VideoStd_1280x720); 
if(41 == (hdmi_edid_data[i] & 0x7f))videoType |= (1 << VideoStd_1280x720); 
if(47 == (hdmi_edid_data[i] & 0x7f))videoType |= (1 << VideoStd_1280x720); 
if(60 == (hdmi_edid_data[i] & 0x7f))videoType |= (1 << VideoStd_1280x720); 
if(61 == (hdmi_edid_data[i] & 0x7f))videoType |= (1 << VideoStd_1280x720); 
if(62 == (hdmi_edid_data[i] & 0x7f))videoType |= (1 << VideoStd_1280x720);

if(16 == (hdmi_edid_data[i] & 0x7f))videoType |= (1 << VideoStd_1920x1080); 
if(31 == (hdmi_edid_data[i] & 0x7f))videoType |= (1 << VideoStd_1920x1080); 
if(32 == (hdmi_edid_data[i] & 0x7f))videoType |= (1 << VideoStd_1920x1080); 
if(33 == (hdmi_edid_data[i] & 0x7f))videoType |= (1 << VideoStd_1920x1080); 
if(34 == (hdmi_edid_data[i] & 0x7f))videoType |= (1 << VideoStd_1920x1080); 
if(63 == (hdmi_edid_data[i] & 0x7f))videoType |= (1 << VideoStd_1920x1080); 
}
cet_end:

四.数据协商,设置一种最佳的分辨率:

if(videoType & (1 << VideoStd_1280x720)) {
current_videotype = VideoStd_1280x720;
goto display_set_end;
}
if(videoType & (1 << VideoStd_1600x900)) {
current_videotype = VideoStd_1600x900;
SysFs_change(Display_Output_DVI, VideoStd_1600x900); 
goto display_set_end;
}
if(videoType & (1 << VideoStd_1280x1024)){
current_videotype = VideoStd_1280x1024;
SysFs_change(Display_Output_DVI, VideoStd_1280x1024);
goto display_set_end;
}
if(videoType & (1 << VideoStd_1024x768)) {
current_videotype = VideoStd_1024x768;
SysFs_change(Display_Output_DVI, VideoStd_1024x768); 
goto display_set_end;
}
if(videoType & (1 << VideoStd_800x480)) {
current_videotype = VideoStd_800x480;
SysFs_change(Display_Output_DVI, VideoStd_800x480); 
goto display_set_end;
}
if(videoType & (1 << VideoStd_800x600)) {
current_videotype = VideoStd_800x600;
SysFs_change(Display_Output_DVI, VideoStd_800x600); 
goto display_set_end;
}
if(videoType & (1 << VideoStd_640x480)) {
current_videotype = VideoStd_640x480;
SysFs_change(Display_Output_DVI, VideoStd_640x480); 
goto display_set_end;
}
if(videoType & (1 << VideoStd_720x480)) {
current_videotype = VideoStd_720x480;
SysFs_change(Display_Output_DVI, VideoStd_720x480); 
goto display_set_end;
}
if(videoType & (1 << VideoStd_1920x1080)){
current_videotype = VideoStd_1920x1080;
SysFs_change(Display_Output_DVI, VideoStd_1920x1080);
goto display_set_end;
}
display_set_end:

五.提供给用户的API:

1.得到显示器支持的分辨率:

int get_monitor_support_video_type(void)
{
return videoType;
}

2.得到设备当前的分辨率:

int get_current_video_type(void)
{
return current_videotype;
}

3.设置分辨率:

int set_video_type(int videoType)
{
if(videoType & (1 << VideoStd_1280x720)) {
SysFs_change(Display_Output_DVI, VideoStd_1280x720); 
goto display_set_end;
}
if(videoType & (1 << VideoStd_1600x900)) {
SysFs_change(Display_Output_DVI, VideoStd_1600x900); 
goto display_set_end;
}
if(videoType & (1 << VideoStd_1280x1024)){
SysFs_change(Display_Output_DVI, VideoStd_1280x1024);
goto display_set_end;
}
if(videoType & (1 << VideoStd_1024x768)) {
SysFs_change(Display_Output_DVI, VideoStd_1024x768); 
goto display_set_end;
}
if(videoType & (1 << VideoStd_800x480)) {
SysFs_change(Display_Output_DVI, VideoStd_800x480); 
goto display_set_end;
}
if(videoType & (1 << VideoStd_800x600)) {
SysFs_change(Display_Output_DVI, VideoStd_800x600); 
goto display_set_end;
}
if(videoType & (1 << VideoStd_640x480)) {
SysFs_change(Display_Output_DVI, VideoStd_640x480); 
goto display_set_end;
}
if(videoType & (1 << VideoStd_720x480)) {
SysFs_change(Display_Output_DVI, VideoStd_720x480); 
goto display_set_end;
}
if(videoType & (1 << VideoStd_1920x1080)){
SysFs_change(Display_Output_DVI, VideoStd_1920x1080);
goto display_set_end;
}
display_set_end:
return 0;
}

其中在分析EDID的数据时,可以参考百度文库里面的一篇“电视机的EDID”,写的比较详细,是PPT的格式。

时间: 2024-10-29 20:59:44

(转)Hdmi edid 数据解析的相关文章

HDMI EDID解读

现在的显示设备比如显示器,电视等都HDMI接口,那通常每个HDMI接口都保留有一份EDID数据,这个数据可以存在程序里面由系统启动过程中来初始化,更常见的做法是每个HDMI口会有一个EEPROM来保存这份数据,这个EEPROM也只是有256bytes大小.外接设备如DVD播放器在HDMI热插拔的时候就会通过HDMI的DDC通道来读取EDID数据.EDID里面主要是定义了这显示设备所支持的图像分辨率,支持的声音格式,声音通道,及3D等等,其目的是告诉外接设备我所支持的特性,让外接设备输出一个我所支

HDMI EDID 处理过程

DDC的参数 EDID是一种VESA 标准数据格式,其中包含有关监视器及其性能的参数,包括供应商信息.最大图像大小.颜色设置.厂商预设置.频率范围的限制以及显示器名和序列号的字符串.EDID数据标准:EDID(Extended Display Identification Data Standard)至今已发布到第三版本,即EDID Version 3,前面分别有EDID Version 1.0,Revision 0,EDID Version 1,Revision 1,EDID Version

iOS网络数据解析

iOS开发过程中,网络数据的传输过程一般是:客户端发送请求给服务器,服务器接收到客户端发送的网络请求后返回相应的数据.此时客户端需要把服务器返回的数据转化为前段和移动端开发中使用的数据格式(如OC/java).后台服务器一般使用php.java..net进行开发,而前段和移动端使用的一般是OC/JAVA/HTML/CSS/JS,做好前后端的数据交互极为重要,如今数据交互常用的就是JSON和XML.下面就iOS开发过程中的JSON解析和XML解析进行简单的说明. 一.JSON解析 JSON是一种轻

json数据解析,并实现将网络json数据获取用listview显示

需要使用jar包 fastjson或gson这两个jar包. //Gson的使用方式 Gson gson=new Gson(); String str=ReadAssetsFile.readtext(this,"json_ss");//this当前类,"json_ss"需要解析的文件名 UserMessage userMessage=gson.fromJson(str,UserMessage.class);//需要解析的json文件最外层类名 //fastjson的

GPS(NMEA)数据解析

一.GPS定位信息 设置好gps模式,启动gps,正常的话在gps通路有NMEA数据上报,如下: $GPGSV,3,1,11,01,62,130,42,07,61,201,43,11,72,075,28,17,20,251,38*7A $GPGSV,3,2,11,30,63,272,44,03,00,149,,08,34,046,,13,05,309,*76 $GPGSV,3,3,11,22,08,127,,27,03,057,,28,34,312,*4C $GPGGA,042523.0,341

GPS数据解析

1.摘要 GPS模块使用串口通信,那么它的的数据处理本质上还是串口通信处理,只是GPS模块的输出的有其特定的格式,需要字符串处理逻辑来解析其含义.如何高效的处理从GPS模块接收到的数据帧,是GPS驱动设计的重点,本文使用状态机的思想来处理GPS输出的串口数据流,相对于定时从串口环形bufer取数据包然后依次解析有更高的实时性并且单片机负荷更低. 2. GPS数据协议简介 常用的GPS模块大多采用NMEA-0183 协议,目前业已成了GPS导航设备统一的RTCM(Radio Technical C

Gprinter光栅位图点阵数据解析工具

最近参与的项目有一个需求,解析佳博热敏打印机的光栅位图点阵数据并保存为图片文件.数据是通过Bus Hound抓取的,如下图所示. 其中1b 40为初始化打印机的指令,对应的ASCII码为ESC @,1b 4a 18为打印并走纸的指令,对应的ASCII码为ESC J,1d 76 30为打印光栅位图的指令,对应的ASCII码为GS v 0,其后紧跟光栅位图模式(0x00).水平方向位图字节数(0x0036)和垂直方向位图点数(0x0018),后面则为本帧的位图数据(0x36*0x18=1296字节)

iOS GET、POST数据解析

在实际开发中,JSON数据解析更简单易行,一般均使用json数据解析,因此,程序猿们请务必和后台搞好关系,让他给你json数据.    XML解析: ios SDK提供了NSXMLParser和libxml2两个类库,另外还有很多第三方类库可选:TBXML.TouchXML.KissXML.TinyXML和GDataXML. 解析XML通常有两种方式:DOM和SAX DOM解析XML时,读入整个XML文档并构建一个驻留内存的树结构(节点树),遍历树结构可以检索任意XML节点,读取它的属性和值.

第十五讲.数据解析(XML与JSON两种数据解析)

一.XML数据解析 1.SAX:Simple API for XML.基于事件驱动的解析方式,逐行解析数据.(采用协议回调机制) NSXMLParser的解析方法: 1 #import "ViewController.h" 2 #import "Model.h" 3 4 @interface ViewController ()<NSXMLParserDelegate> 5 6 @property(nonatomic,strong)UITableView