Xiang Xiao
55679aec5f
drivers/camera: Support the private data for imgsensor and imgdata
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-31 08:04:39 +01:00
Xiang Xiao
1a59f4ed00
mm/map: Remove the unnessary map.h inclusion in various drivers
...
and Fix include/nuttx/mm/map.h:55:28: error: 'struct task_group_s' declared inside parameter list will not be visible outside of this definition or declaration
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-05 16:06:53 +02:00
Xiang Xiao
7179d57026
fs: Check offset and length more carefully in mmap callback
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 17:43:59 +02:00
Xiang Xiao
b0a0ba3ad7
fs: Move mmap callback before truncate in [file|mountpt]_operations
...
since mmap may exist in block_operations, but truncate may not,
moving mmap beforee truncate could make three struct more compatible
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 17:43:59 +02:00
Xiang Xiao
779a610ca3
Remove the unnecessary NULL fields in global instance definition of file_operations
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 00:32:13 +02:00
Jukka Laitinen
f33dc4df3f
Change FIOC_MMAP into file operation call
...
- Add mmap into file_operations and remove it from ioctl definitions.
- Add mm_map structure definitions to support future unmapping
- Modify all drivers to initialize the operations struct accordingly
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-02 11:23:20 -03:00
Jukka Laitinen
41e9df2f3e
Add ftruncate into file operation calls
...
- Add truncate into file_operations
- Move truncate to be common for mountpt_operations and file_operations
- Modify all drivers to initialize the operations struct accordingly
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-02 11:23:20 -03:00
Peter Bee
2b11fd585f
drivers/video: fix typo
...
Wrong buf used
Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-20 17:00:44 +08:00
Xiang Xiao
243983328a
drivers/video: Correct the code style
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-17 20:43:07 +08:00
Xiang Xiao
21e35362a3
drivers/video: Add stop_capture function
...
and ensure imgsensor_ops_s::stop_capture get called
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-17 20:43:07 +08:00
Xiang Xiao
eb4dabaac6
drivers/video: Check th size for IMGSENSOR_CTRL_TYPE_U[8|16|32]
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-17 20:43:07 +08:00
Xiang Xiao
4773eec916
drivers/video: Move the clip operation from video_s_selection to validate_frame_setting
...
to ensure the validation is same for VIDIOC_S_SELECTION, VIDIOC_S_PARM and VIDIOC_S_FMT
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-17 20:43:07 +08:00
Xiang Xiao
10d79195ba
drivers/video: Replace malloc/realloc/free with kmm_[malloc/realloc/free]
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-17 20:43:07 +08:00
Xiang Xiao
ec1cbed9b0
drivers/video: Zero all fields in an output struct
...
and don't zero fields which is used as input
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-17 20:43:07 +08:00
Xiang Xiao
5eb8189c26
drivers/video: Remove validate_frame_setting NULL check from video_[s|try]_fmt
...
since the check is already done in validate_frame_setting
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-17 20:43:07 +08:00
Peter Bee
77504aa1b5
drivers/video: minor fix
...
Fix missing header for bool in imgsensor.h and FAR in video.c
Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-09 23:37:49 +08:00
Peter Bee
31347da187
drivers/video: add support for V4L2 mmap-ed buffer
...
Support V4L2_MEMORY_MMAP memory mode
Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-07 01:21:46 +08:00
Xiang Xiao
f142cf0e55
drivers/video: Remove memset from cleanup_streamresources
...
since initialize_streamresources will do it
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 10:35:26 +01:00
Xiang Xiao
99311ed6a5
drivers/video: Should do uninitialization if is_initialized is true
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 10:35:26 +01:00
Xiang Xiao
92e72f8624
drivers/video: Return zero if gamma curve isn't supported in initialize_scene_gamma
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 10:35:26 +01:00
Xiang Xiao
c8868b3745
drivers/video: Return 0 in case g_video_sensor_ops or get_supported_value is NULL
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 10:35:26 +01:00
Peter Bee
c26fd6565d
drivers/video: enhance v4l2 compatibility
...
Add common BSD v4l2 header file
Complete ioctls according to standard v4l2 drivers
Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-03 02:48:01 +08:00
Peter Bee
87e16c3694
drivers/video: add support for yuv420p
...
Add calc functions for buffer size (yuv420p is 6Byte/4px)
Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-02 13:18:20 +08:00
Peter Bee
365b1f4bb8
drivers/video: add support for YUYV format
...
Add YUYV format which is used by most USB Cameras
Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-02 13:18:20 +08:00
Xiang Xiao
6d30726a1b
Remove the unnecessary "return;" at the end of function
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-27 22:23:50 +01:00
chao an
4f7f70598a
drviers/video: driver lock should in pairs
...
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-03 14:43:12 +01:00
Xiang Xiao
a98949d0f6
Fix video/video.c:1458:52: error: implicit conversion from enumeration type 'enum v4l2_buf_type' to different enumeration type 'imgsensor_stream_type_t' (aka 'enum imgsensor_stream_type_e') [-Werror,-Wenum-conversion]
...
ret = g_video_sensor_ops->validate_frame_setting(type, nr_fmt, sf, &si);
~~~~~~~~~~~~~~~~~~ ^~~~
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-31 13:10:09 +01:00
Xiang Xiao
09da04d7d2
Fix video/video.c:1458:52: error: implicit conversion from enumeration type 'enum v4l2_buf_type' to different enumeration type 'imgsensor_stream_type_t' (aka 'enum imgsensor_stream_type_e') [-Werror,-Wenum-conversion]
...
ret = g_video_sensor_ops->validate_frame_setting(type, nr_fmt, sf, &si);
~~~~~~~~~~~~~~~~~~ ^~~~
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-30 16:03:35 +01:00
anjiahao
d7b4e91dda
Call nxsem_destroy or nxmutex_destry in the error path
...
1.Don't check the return value of nxsem_init or nxmutex_init
2.Fix some style issue
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-30 13:56:52 +01:00
SPRESENSE
1332bdb9a7
drivers/video: Add get frame interval API
2022-10-26 03:57:26 +08:00
Xiang Xiao
dca5a3483f
drivers: Destroy mutex and sem in the error path
...
also correct the order to ensure the memory free is last step
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 15:59:46 +09:00
anjiahao
d1d46335df
Replace nxsem API when used as a lock with nxmutex API
...
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 15:59:46 +09:00
Huang Qi
e4e3208180
Replace all strncpy with strlcpy for safety
...
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-08-25 13:38:36 +08:00
SPRESENSE
b296494fb8
drivers/video: Avoid additional overflow cases
...
Add clip size validation to avoid additional overflow.
2022-05-30 20:38:47 +03:00
SPRESENSE
1212d3b7d8
drivers/video: Fix multiplication overflow
...
Add cast to uint32_t type to avoid multiplication overflow.
2022-05-30 20:38:47 +03:00
SPRESENSE
c0ea6c5b49
drivers/video: Fix thumbnail size bug
...
Fix copy size to set thumbnail component, when thumbnail format is used
without clipping.
2022-05-30 20:38:47 +03:00
SPRESENSE
9c57850466
drivers/video: Support clip
...
Support clip by ioctl(VIDIOC_S_SELECTION) and ioctl(VIDIOC_G_SELECTION).
2022-05-30 20:38:47 +03:00
SPRESENSE
b45489753a
drivers/video: Enable to select connected image sensor driver at runtime
...
Enable to select connected image sensor driver at runtime by adding is_available()
to image sensor I/F.
2022-05-30 20:38:47 +03:00
SPRESENSE
229c7d30b6
drivers/video: Support ioctl(VIDIOC_QUERYCAP)
...
Support ioctl(VIDIOC_QUERYCAP) to get driver's name.
2022-05-30 20:38:47 +03:00
Petro Karashchenko
d08fbca679
nuttx: unify FAR attribute usage across the code
...
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-04-04 21:32:58 +08:00
Petro Karashchenko
98ba65c422
c89: get rid of designated initializers in common code
...
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-28 13:39:27 +08:00
Petro Karashchenko
a743fed63d
file_operations: get back C89 compatible initializer
...
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-11 02:14:00 +08:00
SPRESENSE
ebd736240e
drivers/video: Replace error output macro to verr
...
Add video debug macros verr/vwarn/vinfo, and replace error output macro to verr.
2021-09-15 07:06:35 +02:00
SPRESENSE
74df4b70b3
drivers: video: Rearchitect video driver
...
Rearchitect video driver:
- Define two video I/F(struct imgsensor_ops_s and struct imgdata_ops_s),
and support them.
- CISIF driver supports new video I/F struct imgdata_ops_s.
- ISX012 driver supports new video I/F struct imgsensor_ops_s.
- Move ISX012 driver to general driver directory.
2021-09-15 07:06:35 +02:00
Alin Jerpelea
f22683a0a6
drivers: replace licenses with Apache 2.0
...
This change is a license change to Apache 2.0 license.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-01-26 05:11:58 -08:00
SPRESENSE
15be5e5e11
drivers/video: Store device operations table
...
Fix a bug which the device operation structure is not stored in
video_initialize().
2020-07-31 09:37:20 +02:00
SPRESENSE
3befe16f52
drivers/video: Support JPEG format in VIDEO_CAPTURE
...
Add support for the VIDEO stream with JPEG frames supported by ISX012.
2020-07-31 09:37:20 +02:00
Alin Jerpelea
c6c0214f9a
boards: arm: cxd56: initilize the video stream driver from the board
...
The video stream driver must be intialized from the board to comply with NuttX
NOTE:
Please remove the initalization from any camera example
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2020-06-15 08:10:49 +09:00
Alin Jerpelea
8fdfb745d6
drivers: video: fix uninitialized variables
...
Fix the build error by initializing the variables before we perform
th querry for the ext control.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2020-06-15 08:10:49 +09:00
Gregory Nutt
0e425584b8
include/nuttx/video/video.h: Move global variable declaration out of header file
...
Move global variable declaration out of include/nuttx/video/video.h and into the file where it is initialized. With some toolchains/environments, declaring globals in header files results in multiply defined symobl errors at link time. This corrects that build problem.
2020-06-01 20:22:40 +01:00