boxheader_param_t * gene_boxheader( int fd, OPJ_OFF_T offset) { Byte8_t boxlen; Byte_t headlen; char *boxtype; boxheader_param_t *boxheader; boxlen = fetch_4bytebigendian( fd, offset); boxtype = (char *)fetch_bytes( fd, offset+4, 4); headlen = 8; if( boxlen == 1){ /* read XLBox */ boxlen = fetch_8bytebigendian( fd, offset+8); headlen = 16; } boxheader = (boxheader_param_t *)malloc( sizeof( boxheader_param_t)); boxheader->headlen = headlen; boxheader->length = boxlen; strncpy( boxheader->type, boxtype, 4); boxheader->next = NULL; free( boxtype); return boxheader; }
Byte8_t fetch_DBox8bytebigendian( box_param_t *box, OPJ_OFF_T offset) { return fetch_8bytebigendian( box->fd, get_DBoxoff( box)+offset); }