Revision 69ae8acb payload.h

View differences:

payload.h
10 10
    *size = *size << 8;
11 11
    *size |= data[i];
12 12
  }
13
  *pts = 0;
13
  *dts = 0;
14 14
  for (i = 0; i < 4; i++) {
15
    *pts = *pts << 8;
16
    *pts |= data[3 + i];
15
    *dts = *dts << 8;
16
    *dts |= data[3 + i];
17
  }
18
  if (data[7] != 255) {
19
    *pts = *dts + data[7];
20
  } else {
21
    *pts = -1;
17 22
  }
18
  *dts = *pts - data[7];
19 23
}
20 24

  
21 25
static inline void payload_header_parse(const uint8_t *data, uint8_t *codec, int *width, int *height, int *frame_rate_n, int *frame_rate_d)
......
45 49
  data[0] = size >> 16;
46 50
  data[1] = size >> 8;
47 51
  data[2] = size & 0xFF;
48
  data[3] = pts >> 24;
49
  data[4] = pts >> 16;
50
  data[5] = pts >> 8;
51
  data[6] = pts & 0xFF;
52
  data[7] = (pts - dts) & 0xFF;
52
  data[3] = dts >> 24;
53
  data[4] = dts >> 16;
54
  data[5] = dts >> 8;
55
  data[6] = dts & 0xFF;
56
  if (pts != -1) {
57
    data[7] = (pts - dts) & 0xFF;
58
  } else {
59
    data[7] = 255;
60
  }
53 61
}

Also available in: Unified diff