Ejemplo n.º 1
0
/*----------------------------------------------------------------------
|   AP4_CttsAtom::AddEntry
+---------------------------------------------------------------------*/
AP4_Result
AP4_CttsAtom::AddEntry(AP4_UI32 count, AP4_UI32 cts_offset)
{
    m_Entries.Append(AP4_CttsTableEntry(count, cts_offset));
    m_Size32 += 8;
    return AP4_SUCCESS;
}
Ejemplo n.º 2
0
/*----------------------------------------------------------------------
|       AP4_CttsAtom::AP4_CttsAtom
+---------------------------------------------------------------------*/
AP4_CttsAtom::AP4_CttsAtom(AP4_Size size, AP4_ByteStream& stream) :
    AP4_Atom(AP4_ATOM_TYPE_CTTS, size, true, stream)
{
    AP4_UI32 entry_count;
    stream.ReadUI32(entry_count);
    while (entry_count--) {
        AP4_UI32 sample_count;
        AP4_UI32 sample_offset;
        if (stream.ReadUI32(sample_count)  == AP4_SUCCESS &&
            stream.ReadUI32(sample_offset) == AP4_SUCCESS) {
            m_Entries.Append(AP4_CttsTableEntry(sample_count,
                                                sample_offset));
        }
    }
}