diff options
Diffstat (limited to 'libs/nativewindow/include/android/native_window.h')
-rw-r--r-- | libs/nativewindow/include/android/native_window.h | 81 |
1 files changed, 26 insertions, 55 deletions
diff --git a/libs/nativewindow/include/android/native_window.h b/libs/nativewindow/include/android/native_window.h index f0e1c4d749..36aad2eced 100644 --- a/libs/nativewindow/include/android/native_window.h +++ b/libs/nativewindow/include/android/native_window.h @@ -34,7 +34,6 @@ #define ANDROID_NATIVE_WINDOW_H #include <stdint.h> -#include <stdbool.h> #include <sys/cdefs.h> #include <android/data_space.h> @@ -157,7 +156,6 @@ int32_t ANativeWindow_getFormat(ANativeWindow* window); * For all of these parameters, if 0 is supplied then the window's base * value will come back in force. * - * \param window pointer to an ANativeWindow object. * \param width width of the buffers in pixels. * \param height height of the buffers in pixels. * \param format one of the AHardwareBuffer_Format constants. @@ -187,17 +185,22 @@ int32_t ANativeWindow_lock(ANativeWindow* window, ANativeWindow_Buffer* outBuffe */ int32_t ANativeWindow_unlockAndPost(ANativeWindow* window); +#if __ANDROID_API__ >= 26 + /** * Set a transform that will be applied to future buffers posted to the window. * * Available since API level 26. * - * \param window pointer to an ANativeWindow object. * \param transform combination of {@link ANativeWindowTransform} flags * \return 0 for success, or -EINVAL if \p transform is invalid */ int32_t ANativeWindow_setBuffersTransform(ANativeWindow* window, int32_t transform) __INTRODUCED_IN(26); +#endif // __ANDROID_API__ >= 26 + +#if __ANDROID_API__ >= 28 + /** * All buffers queued after this call will be associated with the dataSpace * parameter specified. @@ -210,7 +213,6 @@ int32_t ANativeWindow_setBuffersTransform(ANativeWindow* window, int32_t transfo * * Available since API level 28. * - * \param window pointer to an ANativeWindow object. * \param dataSpace data space of all buffers queued after this call. * \return 0 for success, -EINVAL if window is invalid or the dataspace is not * supported. @@ -227,6 +229,10 @@ int32_t ANativeWindow_setBuffersDataSpace(ANativeWindow* window, int32_t dataSpa */ int32_t ANativeWindow_getBuffersDataSpace(ANativeWindow* window) __INTRODUCED_IN(28); +#endif // __ANDROID_API__ >= 28 + +#if __ANDROID_API__ >= 30 + /** Compatibility value for ANativeWindow_setFrameRate. */ enum ANativeWindow_FrameRateCompatibility { /** @@ -250,41 +256,6 @@ enum ANativeWindow_FrameRateCompatibility { }; /** - * Same as ANativeWindow_setFrameRateWithChangeStrategy(window, frameRate, compatibility, - * ANATIVEWINDOW_CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS). - * - * See ANativeWindow_setFrameRateWithChangeStrategy(). - * - * Available since API level 30. - */ -int32_t ANativeWindow_setFrameRate(ANativeWindow* window, float frameRate, int8_t compatibility) - __INTRODUCED_IN(30); - -/** - * Provides a hint to the window that buffers should be preallocated ahead of - * time. Note that the window implementation is not guaranteed to preallocate - * any buffers, for instance if an implementation disallows allocation of new - * buffers, or if there is insufficient memory in the system to preallocate - * additional buffers - * - * Available since API level 30. - */ -void ANativeWindow_tryAllocateBuffers(ANativeWindow* window) __INTRODUCED_IN(30); - -/** Change frame rate strategy value for ANativeWindow_setFrameRate. */ -enum ANativeWindow_ChangeFrameRateStrategy { - /** - * Change the frame rate only if the transition is going to be seamless. - */ - ANATIVEWINDOW_CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS = 0, - /** - * Change the frame rate even if the transition is going to be non-seamless, - * i.e. with visual interruptions for the user. - */ - ANATIVEWINDOW_CHANGE_FRAME_RATE_ALWAYS = 1 -} __INTRODUCED_IN(31); - -/** * Sets the intended frame rate for this window. * * On devices that are capable of running the display at different refresh @@ -300,12 +271,7 @@ enum ANativeWindow_ChangeFrameRateStrategy { * this ANativeWindow is consumed by something other than the system compositor, * e.g. a media codec, this call has no effect. * - * You can register for changes in the refresh rate using - * \a AChoreographer_registerRefreshRateCallback. - * - * Available since API level 31. - * - * \param window pointer to an ANativeWindow object. + * Available since API level 30. * * \param frameRate The intended frame rate of this window, in frames per * second. 0 is a special value that indicates the app will accept the system's @@ -317,20 +283,25 @@ enum ANativeWindow_ChangeFrameRateStrategy { * \param compatibility The frame rate compatibility of this window. The * compatibility value may influence the system's choice of display refresh * rate. See the ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_* values for more info. - * This parameter is ignored when frameRate is 0. - * - * \param changeFrameRateStrategy Whether display refresh rate transitions caused by this - * window should be seamless. - * A seamless transition is one that doesn't have any visual interruptions, such as a black - * screen for a second or two. See the ANATIVEWINDOW_CHANGE_FRAME_RATE_* values. - * This parameter is ignored when frameRate is 0. * * \return 0 for success, -EINVAL if the window, frame rate, or compatibility * value are invalid. */ -int32_t ANativeWindow_setFrameRateWithChangeStrategy(ANativeWindow* window, float frameRate, - int8_t compatibility, int8_t changeFrameRateStrategy) - __INTRODUCED_IN(31); +int32_t ANativeWindow_setFrameRate(ANativeWindow* window, float frameRate, int8_t compatibility) + __INTRODUCED_IN(30); + +/** + * Provides a hint to the window that buffers should be preallocated ahead of + * time. Note that the window implementation is not guaranteed to preallocate + * any buffers, for instance if an implementation disallows allocation of new + * buffers, or if there is insufficient memory in the system to preallocate + * additional buffers + * + * Available since API level 30. + */ +void ANativeWindow_tryAllocateBuffers(ANativeWindow* window); + +#endif // __ANDROID_API__ >= 30 #ifdef __cplusplus }; |