Example #1
0
    while True:
        #Handle stats
        handle_stats(loop_counter)
        loop_counter += 1

        #Handle keypresses
        handle_keypresses()

        #Check free mem and log warning
        if memory_usage_check:
            check_free_gpumem()

        #Check if we need to rotate:
        if not disable_autorotation:
            if screen_manager_main.get_active_screen_run_time(
            ) >= screen_manager_main.get_active_screen_duration():
                screen_manager_main.rotate_next()
                #In case the screen in cache had disconnected or reconnectable streams, check and update it once it becomes active
                logger.debug(
                    "MAIN: after rotate_next start update_active_screen")
                screen_manager_main.update_active_screen()

        else:
            logger.debug(
                "MAIN: disable_autorotation is True, use keyboard only to rotate between screens"
            )

        #Only update the screen/check connectable cameras every interval_check_status seconds
        if loop_counter % int(interval_check_status) == 0:
            # Only try to redraw the screen when disable_probing_for_all_streams option is false, but keep the loop
            logger.debug("MAIN: regular start update_active_screen (every " +
Example #2
0
    while True:
        #Handle stats
        handle_stats(loop_counter)
        loop_counter += 1

        #Handle keypresses
        handle_keypresses()

        #Check free mem and log warning
        if memory_usage_check:
            check_free_gpumem()

        #Check if we need to rotate:
        if not disable_autorotation:
            if screen_manager_main.get_active_screen_run_time() >= screen_manager_main.get_active_screen_duration():
                screen_manager_main.rotate_next()
                #In case the screen in cache had disconnected or reconnectable streams, check and update it once it becomes active
                logger.debug("MAIN: after rotate_next start update_active_screen")
                screen_manager_main.update_active_screen()

        else:
            logger.debug("MAIN: disable_autorotation is True, use keyboard only to rotate between screens")

        #Only update the screen/check connectable cameras every interval_check_status seconds
        if loop_counter % int(interval_check_status) == 0:
            # Only try to redraw the screen when disable_probing_for_all_streams option is false, but keep the loop
            logger.debug("MAIN: regular start update_active_screen (every " + str(interval_check_status) + " seconds since start of rpisurv)")
            screen_manager_main.update_active_screen()