int32_t mp4ff_atom_read(mp4ff_t *f, const int32_t size, const uint8_t atom_type) { uint64_t dest_position = mp4ff_position(f)+size-8; if (atom_type == ATOM_STSZ) { /* sample size box */ mp4ff_read_stsz(f); } else if (atom_type == ATOM_STTS) { /* time to sample box */ mp4ff_read_stts(f); } else if (atom_type == ATOM_CTTS) { /* composition offset box */ mp4ff_read_ctts(f); } else if (atom_type == ATOM_STSC) { /* sample to chunk box */ mp4ff_read_stsc(f); } else if (atom_type == ATOM_STCO) { /* chunk offset box */ mp4ff_read_stco(f); } else if (atom_type == ATOM_STSD) { /* sample description box */ mp4ff_read_stsd(f); } else if (atom_type == ATOM_MVHD) { /* movie header box */ mp4ff_read_mvhd(f); } else if (atom_type == ATOM_MDHD) { /* track header */ mp4ff_read_mdhd(f); #ifdef ITUNES_DRM } else if (atom_type == ATOM_FRMA) { /* DRM track format */ mp4ff_read_frma(f); } else if (atom_type == ATOM_IVIV) { mp4ff_read_iviv(f, size-8); } else if (atom_type == ATOM_NAME) { mp4ff_read_name(f, size-8); } else if (atom_type == ATOM_PRIV) { mp4ff_read_priv(f, size-8); } else if (atom_type == ATOM_USER) { mp4ff_read_user(f, size-8); } else if (atom_type == ATOM_KEY) { mp4ff_read_key(f, size-8); #endif #ifdef USE_TAGGING } else if (atom_type == ATOM_META) { /* iTunes Metadata box */ mp4ff_read_meta(f, size); #endif } mp4ff_set_position(f, dest_position); return 0; }
int32_t mp4ff_atom_read(mp4ff_t *f, const int32_t size, const uint8_t atom_type) { uint64_t dest_position = mp4ff_position(f)+size-8; if (atom_type == ATOM_STSZ) { /* sample size box */ mp4ff_read_stsz(f); } else if (atom_type == ATOM_STTS) { /* time to sample box */ mp4ff_read_stts(f); } else if (atom_type == ATOM_CTTS) { /* composition offset box */ mp4ff_read_ctts(f); } else if (atom_type == ATOM_STSC) { /* sample to chunk box */ mp4ff_read_stsc(f); } else if (atom_type == ATOM_STCO) { /* chunk offset box */ mp4ff_read_stco(f); } else if (atom_type == ATOM_STSD) { /* sample description box */ mp4ff_read_stsd(f); } else if (atom_type == ATOM_MVHD) { /* movie header box */ mp4ff_read_mvhd(f); } else if (atom_type == ATOM_MDHD) { /* track header */ mp4ff_read_mdhd(f); #ifdef USE_TAGGING } else if (atom_type == ATOM_META) { /* iTunes Metadata box */ mp4ff_read_meta(f, size); #endif } else if (atom_type == ATOM_CHPL) { mp4ff_read_chpl(f, size); } else if (atom_type == ATOM_CHAP) { mp4ff_read_tref(f, size); } else if (atom_type == ATOM_TKHD) { mp4ff_read_tkhd(f); } mp4ff_set_position(f, dest_position); return 0; }