Example #1
0
File: xine.py Project: clones/kaa
    def _remove_shmem(self):
        if self._osd_shmem:
            try:
                self._osd_shmem.detach()
                shm.remove_memory(self._osd_shmem.shmid)
            except shm.error:
                # Probably already deleted by child
                pass
            self._osd_shmem = None

        if self._frame_shmem:
            try:
                self._frame_shmem.detach()
                shm.remove_memory(self._frame_shmem.shmid)
            except shm.error:
                pass
            self._frame_shmem = None
Example #2
0
File: xine.py Project: clones/kaa
    schemes = [ "file", "fifo", "dvd", "vcd", "cdda", "http", "tcp", "udp",
                "rtp", "smb", "mms", "pnm", "rtsp" ]
    exts = ["mpg", "mpeg", "iso"]  # FIXME: complete
    return caps, schemes, exts


if __name__ == "__main__":
    # We're being called as a child.
    import gc
    #gc.set_debug(gc.DEBUG_COLLECTABLE | gc.DEBUG_UNCOLLECTABLE | gc.DEBUG_INSTANCES | gc.DEBUG_OBJECTS)
    player = XinePlayerChild(sys.argv[1])
    kaa.main()

    # Remove shared memory.  We don't detach right away, because the vo
    # thread might still be running, and it will crash if it tries to write
    # to that memory.
    if player._osd_shmem:
        shm.remove_memory(player._osd_shmem.shmid)
    if player._frame_shmem:
        shm.remove_memory(player._frame_shmem.shmid)

    # Force garbage collection for testing.
    del player
    gc.collect()


else:
    if xine:
        register_player("xine", XinePlayer, get_capabilities)