Add more rr tags, some implemented
Jeffrey Pfau jeffrey@endrift.com
Tue, 29 Jul 2014 22:50:46 -0700
2 files changed,
37 insertions(+),
2 deletions(-)
M
src/gba/gba-rr.c
→
src/gba/gba-rr.c
@@ -211,14 +211,34 @@ switch (tag) {
case TAG_INPUT: vf->read(vf, &rr->currentInput, sizeof(uint16_t)); break; + case TAG_PREVIOUSLY: + vf->read(vf, &rr->previously, sizeof(rr->previously)); + break; case TAG_NEXT_TIME: vf->read(vf, &rr->nextTime, sizeof(rr->nextTime)); break; + case TAG_MAX_STREAM: + vf->read(vf, &rr->maxStreamId, sizeof(rr->maxStreamId)); + break; + case TAG_FRAME_COUNT: + vf->read(vf, &rr->frames, sizeof(rr->frames)); + break; + case TAG_LAG_COUNT: + vf->read(vf, &rr->lagFrames, sizeof(rr->lagFrames)); + break; + + // To be spec'd + case TAG_RR_COUNT: + case TAG_INIT_TYPE: + case TAG_AUTHOR: + case TAG_COMMENT: + break; + + // Empty markers case TAG_FRAME: case TAG_LAG: case TAG_BEGIN: case TAG_END: - case TAG_PREVIOUSLY: case TAG_INVALID: break; }
M
src/gba/gba-rr.h
→
src/gba/gba-rr.h
@@ -8,14 +8,28 @@ struct VDir;
struct VFile; enum GBARRTag { + // Playback tags TAG_INVALID = 0x00, TAG_INPUT = 0x01, TAG_FRAME = 0x02, TAG_LAG = 0x03, + + // Stream chunking tags TAG_BEGIN = 0x10, TAG_END = 0x11, TAG_PREVIOUSLY = 0x12, - TAG_NEXT_TIME = 0x13 + TAG_NEXT_TIME = 0x13, + TAG_MAX_STREAM = 0x14, + + // Recording information tags + TAG_FRAME_COUNT = 0x20, + TAG_LAG_COUNT = 0x21, + TAG_RR_COUNT = 0x22, + TAG_INIT_TYPE = 0x23, + + // User metadata tags + TAG_AUTHOR = 0x30, + TAG_COMMENT = 0x31 }; struct GBARRContext {@@ -39,6 +53,7 @@ struct VFile* movieStream;
uint16_t currentInput; enum GBARRTag peekedTag; uint32_t nextTime; + uint32_t previously; }; void GBARRContextCreate(struct GBA*);