'Uses the frame index, which is much faster than looking up each frame definition
if only the names and IDs are needed.'

def frame_ids_and_names(self, name=None):

    if (not self._frame_idx):
        self._buildframeindex()
    return dict(((fID, finfo.name) for (fID, finfo) in self._frame_idx.items() if ((name is None) or (re.search(name, finfo.name) is not None))))
