Skip to content

Commit 66e8a6f

Browse files
ngphibangkartben
authored andcommitted
drivers: video: Combine some API function pointer types
Some API function pointer types such as set/get_format(), set/get_frmival() are indentical. Combine them to save some spaces. Signed-off-by: Phi Bang Nguyen <[email protected]>
1 parent 2ac3164 commit 66e8a6f

File tree

1 file changed

+12
-28
lines changed

1 file changed

+12
-28
lines changed

include/zephyr/drivers/video.h

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -238,36 +238,20 @@ enum video_signal_result {
238238
};
239239

240240
/**
241-
* @typedef video_api_set_format_t
242-
* @brief Set video format
241+
* @typedef video_api_format_t
242+
* @brief Function pointer type for video_set/get_format()
243243
*
244-
* See video_set_format() for argument descriptions.
244+
* See video_set/get_format() for argument descriptions.
245245
*/
246-
typedef int (*video_api_set_format_t)(const struct device *dev, struct video_format *fmt);
246+
typedef int (*video_api_format_t)(const struct device *dev, struct video_format *fmt);
247247

248248
/**
249-
* @typedef video_api_get_format_t
250-
* @brief Get current video format
249+
* @typedef video_api_frmival_t
250+
* @brief Function pointer type for video_set/get_frmival()
251251
*
252-
* See video_get_format() for argument descriptions.
252+
* See video_set/get_frmival() for argument descriptions.
253253
*/
254-
typedef int (*video_api_get_format_t)(const struct device *dev, struct video_format *fmt);
255-
256-
/**
257-
* @typedef video_api_set_frmival_t
258-
* @brief Set video frame interval
259-
*
260-
* See video_set_frmival() for argument descriptions.
261-
*/
262-
typedef int (*video_api_set_frmival_t)(const struct device *dev, struct video_frmival *frmival);
263-
264-
/**
265-
* @typedef video_api_get_frmival_t
266-
* @brief Get current video frame interval
267-
*
268-
* See video_get_frmival() for argument descriptions.
269-
*/
270-
typedef int (*video_api_get_frmival_t)(const struct device *dev, struct video_frmival *frmival);
254+
typedef int (*video_api_frmival_t)(const struct device *dev, struct video_frmival *frmival);
271255

272256
/**
273257
* @typedef video_api_enum_frmival_t
@@ -345,8 +329,8 @@ typedef int (*video_api_set_signal_t)(const struct device *dev, struct k_poll_si
345329

346330
__subsystem struct video_driver_api {
347331
/* mandatory callbacks */
348-
video_api_set_format_t set_format;
349-
video_api_get_format_t get_format;
332+
video_api_format_t set_format;
333+
video_api_format_t get_format;
350334
video_api_set_stream_t set_stream;
351335
video_api_get_caps_t get_caps;
352336
/* optional callbacks */
@@ -356,8 +340,8 @@ __subsystem struct video_driver_api {
356340
video_api_ctrl_t set_ctrl;
357341
video_api_ctrl_t get_volatile_ctrl;
358342
video_api_set_signal_t set_signal;
359-
video_api_set_frmival_t set_frmival;
360-
video_api_get_frmival_t get_frmival;
343+
video_api_frmival_t set_frmival;
344+
video_api_frmival_t get_frmival;
361345
video_api_enum_frmival_t enum_frmival;
362346
};
363347

0 commit comments

Comments
 (0)