sim/camera: add AVFoundation backend and multi-cam support#18745
sim/camera: add AVFoundation backend and multi-cam support#18745PeterBee97 wants to merge 6 commits intoapache:masterfrom
Conversation
acassis
left a comment
There was a problem hiding this comment.
@PeterBee97 WOW! Amazing! Please update the nxcamera Documentation/ to include this new parameter: https://nuttx.apache.org/docs/latest/applications/system/nxcamera/index.html
|
@PeterBee97 please include this picture in the Documentation page, it is funny :-) |
d0fdb9c to
1131750
Compare
As u wish :) |
1131750 to
f1c856b
Compare
| char resolved_path[PATH_MAX]; | ||
| int ret; | ||
|
|
||
| ret = host_video_resolve_device_path(host_video_dev_path, resolved_path, |
There was a problem hiding this comment.
why not call host_video_is_capture_device directly
There was a problem hiding this comment.
Because I wanted to filter-out non-capture video device. For now I have two cameras connected, but 4 video devices under /dev in host. I intentionally mapped /dev/video0 and /dev/video2 on host to /dev/video0 and /dev/video1 in NuttX. Is this behavior desired or do you prefer mapping directly without changing numbers?
|
|
||
| fd = open(host_video_dev_path, O_RDWR | O_NONBLOCK); | ||
| if (fd < 0) | ||
| ret = host_video_resolve_device_path(host_video_dev_path, resolved_path, |
There was a problem hiding this comment.
why not call open with host_video_dev_path directly
There was a problem hiding this comment.
Same reason as above. I wanted to map dev numbers without "holes".
acassis
left a comment
There was a problem hiding this comment.
@PeterBee97 Amazing! Thank you very much!
f1c856b to
c2ea6da
Compare
|
Hi @PeterBee97 please fix |
6b24b6b to
6ae23c9
Compare
Add dummy.c so video can build an archive even when there are no other objects (e.g. on macOS). Signed-off-by: bijunda <bijunda@bytedance.com>
6ae23c9 to
c07e073
Compare
| # Keep the simulator executable from exporting NuttX symbols. Otherwise dyld | ||
| # may resolve host libc references against NuttX's internal libc implementation | ||
| # during process initialization, which can crash before main() runs. | ||
| LDFLAGS += -Wl,-exported_symbol,__mh_execute_header |
There was a problem hiding this comment.
do you need move macOS specific section
There was a problem hiding this comment.
it is macOS-specific section
c07e073 to
18260b8
Compare
Move common v4l2 capture framework changes to a standalone commit. Signed-off-by: bijunda <bijunda@bytedance.com>
Allow the SIM camera/V4L2 capture framework to manage multiple imgdata instances with dynamic mounting. This avoids cross-talk between camera streams when multiple devices are used. Signed-off-by: Peter Bee <bijunda@bytedance.com>
Adapt the macOS AVFoundation backend for multi-device discovery, camera index mapping and capture startup compatibility. This enables reliable use of multiple cameras through the SIM camera framework. Signed-off-by: Peter Bee <bijunda@bytedance.com>
/Library/Developer/CommandLineTools/usr/bin/c++filt: error: unknown argument '-[' Signed-off-by: Peter Bee <bijunda@bytedance.com>
Document the nxcamera command usage, including device selection, resolution, and pixel format options. Also mention recent support for multi-instance camera mounting and the macOS AVFoundation backend on the SIM platform. Signed-off-by: Peter Bee <bijunda@bytedance.com>
18260b8 to
bd705d1
Compare
Summary
Add AVFoundation backend and multi-cam support, enabling macOS users as well as Linux users to use multiple cameras on Simulator.
Impact
mkallsymshost-tool behavior for Objective-C symbols on macOSTesting
Tested on:
sim:nxcamera