The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

xrt: Add new API in xrt_multi_compositor_control interface

authored by

Jarvis Huang and committed by
Jakob Bornecrantz
aa9c559f 98293215

+75
+75
src/xrt/include/xrt/xrt_compositor.h
··· 642 642 XRT_COMPOSITOR_EVENT_NONE = 0, 643 643 XRT_COMPOSITOR_EVENT_STATE_CHANGE = 1, 644 644 XRT_COMPOSITOR_EVENT_OVERLAY_CHANGE = 2, 645 + XRT_COMPOSITOR_EVENT_LOSS_PENDING = 3, 646 + XRT_COMPOSITOR_EVENT_LOST = 4 645 647 }; 646 648 647 649 /*! ··· 664 666 }; 665 667 666 668 /*! 669 + * Loss pending event. 670 + */ 671 + struct xrt_compositor_event_loss_pending 672 + { 673 + enum xrt_compositor_event_type type; 674 + uint64_t loss_time_ns; 675 + }; 676 + 677 + /*! 678 + * Lost event. 679 + */ 680 + struct xrt_compositor_event_lost 681 + { 682 + enum xrt_compositor_event_type type; 683 + }; 684 + 685 + /*! 667 686 * Compositor events union. 668 687 */ 669 688 union xrt_compositor_event { 670 689 enum xrt_compositor_event_type type; 671 690 struct xrt_compositor_event_state_change state; 672 691 struct xrt_compositor_event_state_change overlay; 692 + struct xrt_compositor_event_loss_pending loss_pending; 693 + struct xrt_compositor_event_lost lost; 673 694 }; 674 695 675 696 ··· 1963 1984 xrt_result_t (*set_main_app_visibility)(struct xrt_system_compositor *xsc, 1964 1985 struct xrt_compositor *xc, 1965 1986 bool visible); 1987 + 1988 + /*! 1989 + * Notify this client/session if the compositor is going to lose the ability of rendering. 1990 + * 1991 + * @param loss_time_ns System monotonic timestamps, such as returned by os_monotonic_get_ns(). 1992 + */ 1993 + xrt_result_t (*notify_loss_pending)(struct xrt_system_compositor *xsc, 1994 + struct xrt_compositor *xc, 1995 + uint64_t loss_time_ns); 1996 + 1997 + /*! 1998 + * Notify this client/session if the compositor lost the ability of rendering. 1999 + */ 2000 + xrt_result_t (*notify_lost)(struct xrt_system_compositor *xsc, struct xrt_compositor *xc); 1966 2001 }; 1967 2002 1968 2003 /*! ··· 2072 2107 } 2073 2108 2074 2109 return xsc->xmcc->set_main_app_visibility(xsc, xc, visible); 2110 + } 2111 + 2112 + /*! 2113 + * @copydoc xrt_multi_compositor_control::notify_loss_pending 2114 + * 2115 + * Helper for calling through the function pointer. 2116 + * 2117 + * If the system compositor @p xsc does not implement @ref xrt_multi_composition_control, 2118 + * this returns @ref XRT_ERROR_MULTI_SESSION_NOT_IMPLEMENTED. 2119 + * 2120 + * @public @memberof xrt_system_compositor 2121 + */ 2122 + static inline xrt_result_t 2123 + xrt_syscomp_notify_loss_pending(struct xrt_system_compositor *xsc, struct xrt_compositor *xc, uint64_t loss_time_ns) 2124 + { 2125 + if (xsc->xmcc == NULL) { 2126 + return XRT_ERROR_MULTI_SESSION_NOT_IMPLEMENTED; 2127 + } 2128 + 2129 + return xsc->xmcc->notify_loss_pending(xsc, xc, loss_time_ns); 2130 + } 2131 + 2132 + /*! 2133 + * @copydoc xrt_multi_compositor_control::notify_lost 2134 + * 2135 + * Helper for calling through the function pointer. 2136 + * 2137 + * If the system compositor @p xsc does not implement @ref xrt_multi_composition_control, 2138 + * this returns @ref XRT_ERROR_MULTI_SESSION_NOT_IMPLEMENTED. 2139 + * 2140 + * @public @memberof xrt_system_compositor 2141 + */ 2142 + static inline xrt_result_t 2143 + xrt_syscomp_notify_lost(struct xrt_system_compositor *xsc, struct xrt_compositor *xc) 2144 + { 2145 + if (xsc->xmcc == NULL) { 2146 + return XRT_ERROR_MULTI_SESSION_NOT_IMPLEMENTED; 2147 + } 2148 + 2149 + return xsc->xmcc->notify_lost(xsc, xc); 2075 2150 } 2076 2151 2077 2152 /*!