summaryrefslogtreecommitdiff
path: root/ivi-layermanagement-api/ilmCommon/include/ilm_types.h
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2022-03-20 22:58:36 +0100
committerTran Ba Khang(MS/EMC31-XC) <Khang.TranBa@vn.bosch.com>2023-03-20 14:23:35 +0700
commit85be38aed104e41311763361052364f02702d8b4 (patch)
tree554d9859d564f6edcadb9d810f339071d8271b12 /ivi-layermanagement-api/ilmCommon/include/ilm_types.h
parentb090cb09fbf7fec9e18fc76c5ba31ac9adc76e74 (diff)
downloadwayland-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/ilmCommon/include/ilm_types.h')
-rw-r--r--ivi-layermanagement-api/ilmCommon/include/ilm_types.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/ivi-layermanagement-api/ilmCommon/include/ilm_types.h b/ivi-layermanagement-api/ilmCommon/include/ilm_types.h
index 98a8e62..64e30a7 100644
--- a/ivi-layermanagement-api/ilmCommon/include/ilm_types.h
+++ b/ivi-layermanagement-api/ilmCommon/include/ilm_types.h
@@ -287,4 +287,33 @@ typedef void(*notificationFunc)(ilmObjectType object,
typedef void(*shutdownNotificationFunc)(t_ilm_shutdown_error_type error_type,
int errornum,
void* user_data);
+
+/**
+ * Typedef for notification callback on screenshot send done event
+ * @param user_data the use data, be passed when call the screenshot api
+ * @param fd fd for file containing image data, don't close it in callback,
+ * it will be closed and shouldn't be accessed any longer after the callback execution.
+ * @param width image width in pixels
+ * @param height image height in pixels
+ * @param stride number of bytes per pixel row
+ * @param format image format of type wl_shm.format
+ * @param timestamp timestamp in milliseconds
+ */
+typedef ilmErrorTypes(*screenshotDoneNotificationFunc)(void *user_data,
+ t_ilm_int fd,
+ t_ilm_uint width,
+ t_ilm_uint height,
+ t_ilm_uint stride,
+ t_ilm_uint format,
+ t_ilm_uint timestamp);
+
+/**
+ * Typedef for notification callback on screenshot send error event
+ * @param user_data the use data, be passed when call the screenshot api
+ * @param error error code
+ * @param message error description
+ */
+typedef void(*screenshotErrorNotificationFunc)(void *user_data,
+ t_ilm_uint error,
+ const char *message);
#endif /* _ILM_TYPES_H_*/