Skip to content

Commit

Permalink
drivers/video: Add config for API compatibility
Browse files Browse the repository at this point in the history
Add a Kconfig option for supporting old APIs on video driver.
  • Loading branch information
SPRESENSE committed Jul 27, 2024
1 parent e34dd06 commit 170bb73
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/video/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ config VIDEO_SCENE_TEXT
default y
---help---
Enable text scene

config VIDEO_COMPAT_OLD_APIS
bool "Use old API symbols for keeping compatibility"
default n
---help---
The video_initialize() is re-named capture_initialize() in newest.
This options restore it to older one.

endif

config VIDEO_MAX7456
Expand Down
6 changes: 6 additions & 0 deletions include/nuttx/video/v4l2_cap.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@
* Included Files
****************************************************************************/

#include <nuttx/config.h>
#include <nuttx/video/imgdata.h>
#include <nuttx/video/imgsensor.h>

#ifdef CONFIG_VIDEO_COMPAT_OLD_APIS
# define capture_initialize video_initialize
# define capture_uninitialize video_uninitialize
#endif

#ifdef __cplusplus
extern "C"
{
Expand Down
1 change: 1 addition & 0 deletions include/nuttx/video/video.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#include <sys/videoio.h>
#include <nuttx/fs/fs.h>
#include <nuttx/video/v4l2_cap.h>

#ifdef __cplusplus
extern "C"
Expand Down

0 comments on commit 170bb73

Please sign in to comment.