file seek support, new test cases, AVI use file seek

This commit is contained in:
2021-02-25 07:42:27 +01:00
parent f04742a1b0
commit c89f599112
6 changed files with 189 additions and 38 deletions

View File

@@ -79,14 +79,14 @@ struct AVIMainHeader : AVIChunk {
uint32_t height;
uint32_t reserved[4];
};
} __attribute__((__packed__));
struct AVIRect {
uint16_t left;
uint16_t top;
uint16_t right;
uint16_t bottom;
};
} __attribute__((__packed__));
struct AVIStreamHeader : AVIChunk {
@@ -110,9 +110,10 @@ struct AVIStreamHeader : AVIChunk {
bool isVideo() const {return fccType == FOURCC("vids");}
bool isAudio() const {return fccType == FOURCC("auds");}
};
} __attribute__((__packed__));
struct BitMapInfoHeader {
uint32_t biSize;
int32_t biWidth;
int32_t biHeight;
@@ -124,22 +125,28 @@ struct BitMapInfoHeader {
int32_t biYPelsPerMeter;
uint32_t biClrUsed;
uint32_t biClrImportant;
};
} __attribute__((__packed__));
struct RGBQUAD {
uint8_t rgbBlue;
uint8_t rgbGreen;
uint8_t rgbRed;
uint8_t rgbReserved;
};
} __attribute__((__packed__));
struct BitMapInfo : AVIChunk {
// <data from AVIChunk>
BitMapInfoHeader bmi_header;
RGBQUAD bmi_colors[1];
};
struct WaveFormat : AVIChunk {
// <data from AVIChunk>
uint16_t format_tag;
uint16_t channels;
@@ -147,21 +154,25 @@ struct WaveFormat : AVIChunk {
uint32_t avg_bytes_per_sec;
uint16_t block_align;
uint16_t size;
};
} __attribute__((__packed__));
struct AVIIndexEntry {
uint32_t ckid;
uint32_t flags;
uint32_t chunk_offset;
uint32_t chunk_length;
};
} __attribute__((__packed__));
struct ChunkInfo {
uint32_t offset;
uint32_t entry_offset;
uint32_t size;
};
} __attribute__((__packed__));