def read_data(self, stream, end = None): """Parse atom data.""" super(MetadataHandlerAtom, self).read_data(stream, end) self.fields["reserved"] = [] for _ in range(self.reserved_count): self.fields["reserved"].append(read_struct(stream, self.reserved_format)) self.fields["name"] = stream.read(end - stream.tell())
def read_data(self, stream, end=None): """Parse atom data.""" super(ChunkOffsetAtom, self).read_data(stream, end) self.fields["table"] = [] while stream.tell() < end: self.fields["table"].append( read_struct(stream, self.table_row_format))
def read_data(self, stream, end=None): """Parse atom data.""" super(FileTypeAtom, self).read_data(stream, end) self.fields["compatible_brands"] = [] while stream.tell() < end: self.fields["compatible_brands"].append(read_struct(stream, ">4s"))
def read_data(self, stream, end=None): """Parse atom data.""" super(MetadataHandlerAtom, self).read_data(stream, end) self.fields["reserved"] = [] for _ in range(self.reserved_count): self.fields["reserved"].append( read_struct(stream, self.reserved_format)) self.fields["name"] = stream.read(end - stream.tell())
def read_data(self, stream, end = None): """Parse atom data.""" super(MetadataKeysAtom, self).read_data(stream, end) self.fields["keys"] = [] for _ in range(self.fields["entry_count"]): size, namespace = read_struct(stream, self.key_header_format) value = stream.read(size - struct.calcsize(self.key_header_format)) if size != len(value) + struct.calcsize(self.key_header_format): raise QuickTimeParseError("Size mismatch [%s->%s] in key structure" % (size, len(value)), stream.tell()) self.fields["keys"].append((namespace, value))
def read_data(self, stream, end=None): """Parse atom data.""" super(MetadataKeysAtom, self).read_data(stream, end) self.fields["keys"] = [] for _ in range(self.fields["entry_count"]): size, namespace = read_struct(stream, self.key_header_format) value = stream.read(size - struct.calcsize(self.key_header_format)) if size != len(value) + struct.calcsize(self.key_header_format): raise QuickTimeParseError( "Size mismatch [%s->%s] in key structure" % (size, len(value)), stream.tell()) self.fields["keys"].append((namespace, value))
def read_data(self, stream, end = None): """Parse atom data.""" super(ChunkOffsetAtom, self).read_data(stream, end) self.fields["table"] = [] while stream.tell() < end: self.fields["table"].append(read_struct(stream, self.table_row_format))