diff options
author | Marek Vasut <marex@denx.de> | 2022-03-20 22:58:36 +0100 |
---|---|---|
committer | Tran Ba Khang(MS/EMC31-XC) <Khang.TranBa@vn.bosch.com> | 2023-03-20 14:23:35 +0700 |
commit | 85be38aed104e41311763361052364f02702d8b4 (patch) | |
tree | 554d9859d564f6edcadb9d810f339071d8271b12 /ivi-layermanagement-api/ilmControl/include/ilm_control.h | |
parent | b090cb09fbf7fec9e18fc76c5ba31ac9adc76e74 (diff) | |
download | wayland-ivi-extension-85be38aed104e41311763361052364f02702d8b4.tar.gz |
ilmControl: Extend screenshot API with callback support
Extend the screenshot API such that it permits user to add their own
hooks into screenshot_done and screenshot_err callbacks. This way,
the user can obtain the FD with the screenshot and process it instead
of having the screenshot written into a file in /tmp directory. Make
the filename optional, so the user can provide only the callbacks and
skip writing the file into /tmp altogether.
The library ABI is unaffected, the new functionality is added via two
library functions, ilm_takeScreenshot5() and ilm_takeSurfaceScreenshot5(),
which are now internally called by their original counterparts with
callback hooks set to NULL.
Signed-off-by: Marek Vasut <marex@denx.de>
[khangtb: rename the name of functions, ilm_takeAsyncScreenshot() and
ilm_takeAsyncSurfaceScreenshot(). Define typedef for notification
callbacks. Correct the minor things. remove the filename input from
the function, make the non-blocking]
Signed-off-by: Tran Ba Khang(MS/EMC31-XC) <Khang.TranBa@vn.bosch.com>
Diffstat (limited to 'ivi-layermanagement-api/ilmControl/include/ilm_control.h')
-rw-r--r-- | ivi-layermanagement-api/ilmControl/include/ilm_control.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/ivi-layermanagement-api/ilmControl/include/ilm_control.h b/ivi-layermanagement-api/ilmControl/include/ilm_control.h index 71e4968..c67152a 100644 --- a/ivi-layermanagement-api/ilmControl/include/ilm_control.h +++ b/ivi-layermanagement-api/ilmControl/include/ilm_control.h @@ -366,6 +366,23 @@ ilmErrorTypes ilm_displaySetRenderOrder(t_ilm_display display, t_ilm_layer *pLay ilmErrorTypes ilm_takeScreenshot(t_ilm_uint screen, t_ilm_const_string filename); /** + * \brief Take a screenshot from the current displayed layer scene with non-blocking. + * The function allows to setup callbacks when capturing the display, + * It helps to avoid a blocking, user can handle screenshot data or error in + * the callbacks. + * \param[in] screen Id of screen where screenshot should be taken + * \param[in] callback_done callback called when screenshot is acquired + * \param[in] callback_error callback called when screenshot acqusition failed + * \param[in] user_data callback user data passed in by called + * \return ILM_SUCCESS if the method call was successful + * \return ILM_FAILED if the client can not call the method on the service. + */ +ilmErrorTypes ilm_takeAsyncScreenshot(t_ilm_uint screen, + screenshotDoneNotificationFunc callback_done, + screenshotErrorNotificationFunc callback_error, + void *user_data); + +/** * \brief Take a screenshot of a certain surface * The screenshot is saved as bmp file with the corresponding filename. * \ingroup ilmControl @@ -377,6 +394,24 @@ ilmErrorTypes ilm_takeScreenshot(t_ilm_uint screen, t_ilm_const_string filename) ilmErrorTypes ilm_takeSurfaceScreenshot(t_ilm_const_string filename, t_ilm_surface surfaceid); /** + * \brief Take a screenshot of a certain surface with non-blocking. + * The function allows to setup callbacks when capturing a surface, + * It helps to avoid a blocking, user can handle screenshot data or error in + * the callbacks. + * \ingroup ilmControl + * \param[in] surfaceid Identifier of the surface to take the screenshot of + * \param[in] callback_done callback called when screenshot is acquired + * \param[in] callback_error callback called when screenshot acqusition failed + * \param[in] user_data callback user data passed in by called + * \return ILM_SUCCESS if the method call was successful + * \return ILM_FAILED if the client can not call the method on the service. + */ +ilmErrorTypes ilm_takeAsyncSurfaceScreenshot(t_ilm_surface surfaceid, + screenshotDoneNotificationFunc callback_done, + screenshotErrorNotificationFunc callback_error, + void *user_data); + +/** * \brief register for notification on property changes of layer * \ingroup ilmControl * \param[in] layer id of layer to register for notification |