Revision e0f42ea7 out-stream.c

View differences:

out-stream.c
10 10
void chunk_write(int id, const uint8_t *data, int size)
11 11
{
12 12
  const int header_size = 1 + 2 + 2 + 1 + 2; // 1 Frame type + 2 width + 2 height + 1 number of frames + 2 frame len
13
  int width, height, frames;
14
  int i;
15

  
16
  if (data[0] != 1) {
17
    fprintf(stderr, "Error! Non video chunk!!!\n");
18
    return;
19
  }
20
  width = data[1] << 8 | data[2];
21
  height = data[3] << 8 | data[4];
22
  dprintf("Frame size: %dx%d\n", width, height);
23
  frames = data[5];
24
  for (i = 0; i < frames; i++) {
25
    dprintf("Frame %d has size %d\n", i, data[6 + 2 * i] << 8 | data[7 + 2 * i]);
26
  }
13 27
#ifdef DEBUG
14 28
#define buff_size 8 // HACK!
15 29
  fprintf(stderr, "\tOut Chunk[%d] - %d: %s\n", id, id % buff_size, data + header_size);

Also available in: Unified diff