-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Video 4 Zephyr - Video API, Drivers and Samples #17194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
cd0651e
drivers: Add video API
dd617cd
drivers: video: Add MCUX CSI video driver
aa4fcb5
soc: nxp: rt: Add CSI video support
4f52f3d
boards: arm: nxp: mimxrt1064_evk: Enable CSI video support
5fdf0ac
CODEOWNERS: Add drivers/video path
30a3e23
drivers: video: Add Aptina MT9M114 driver
541dc70
boards: mimxrt1064_evk: Add MT9M114 digital image sensor node
981d56f
drivers: video: Add software video pattern generator
2b79c42
samples: video: Add video capture sample
391829e
samples: video: Add TCP server sink sample
adf2e66
drivers: video: Remove dedicated sensor dir
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,3 +22,4 @@ supported: | |
| - pwm | ||
| - usb_device | ||
| - counter | ||
| - video | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,3 +24,4 @@ Peripherals | |
| spi.rst | ||
| uart.rst | ||
| watchdog.rst | ||
| video.rst | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| .. _video: | ||
|
|
||
|
|
||
| Video | ||
| ##### | ||
|
|
||
| The video driver API offers a generic interface to video devices. | ||
|
|
||
| Basic Operation | ||
| *************** | ||
|
|
||
| Video Device | ||
| ============ | ||
|
|
||
| A video device is the abstraction of a hardware or software video function, | ||
| which can produce, process, consume or transform video data. The video API is | ||
| designed to offer flexible way to create, handle and combine various video | ||
| devices. | ||
|
|
||
| Endpoint | ||
| ======== | ||
|
|
||
| Each video device can have one or more endpoints. Output endpoints configure | ||
| video output function and generate data. Input endpoints configure video input | ||
| function and consume data. | ||
|
|
||
| Video Buffer | ||
| ============ | ||
|
|
||
| A video buffer provides the transport mechanism for the data. There is no | ||
| particular requirement on the content. The requirement for the content is | ||
| defined by the endpoint format. A video buffer can be queued to a device | ||
| endpoint for filling (input ep) or consuming (output ep) operation, once | ||
| the operation is achieved, buffer can be dequeued for post-processing, | ||
| release or reuse. | ||
|
|
||
| Controls | ||
| ======== | ||
|
|
||
| A video control is accessed and identified by a CID (control identifier). It | ||
| represents a video control property. Different devices will have different | ||
| controls available which can be generic, related to a device class or vendor | ||
| specific. The set/get control functions provide a generic scalable interface | ||
| to handle and create controls. | ||
|
|
||
| Configuration Options | ||
| ********************* | ||
|
|
||
| Related configuration options: | ||
|
|
||
| * :option:`CONFIG_VIDEO` | ||
|
|
||
| API Reference | ||
| ************* | ||
|
|
||
| .. doxygengroup:: video_interface | ||
| :project: Zephyr | ||
|
|
||
| .. doxygengroup:: video_controls | ||
| :project: Zephyr | ||
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -89,4 +89,6 @@ source "drivers/ps2/Kconfig" | |
|
|
||
| source "drivers/kscan/Kconfig" | ||
|
|
||
| source "drivers/video/Kconfig" | ||
|
|
||
| endmenu | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| zephyr_library() | ||
|
|
||
| zephyr_library_sources(video_common.c) | ||
|
|
||
| zephyr_library_sources_ifdef(CONFIG_VIDEO_MCUX_CSI video_mcux_csi.c) | ||
| zephyr_library_sources_ifdef(CONFIG_VIDEO_SW_GENERATOR video_sw_generator.c) | ||
| zephyr_library_sources_ifdef(CONFIG_VIDEO_MT9M114 mt9m114.c) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # Kconfig - VIDEO driver configuration options | ||
|
|
||
| # | ||
| # Copyright (c) 2019 Linaro Limited | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
|
|
||
| # | ||
| # VIDEO Drivers | ||
| # | ||
| menuconfig VIDEO | ||
| bool "VIDEO hardware support" | ||
| help | ||
| Enable support for the VIDEO. | ||
|
|
||
| if VIDEO | ||
|
|
||
| config VIDEO_BUFFER_POOL_SZ_MAX | ||
| int "Size of the largest buffer in the video pool" | ||
| default 1048576 | ||
|
|
||
| config VIDEO_BUFFER_POOL_NUM_MAX | ||
| int "Number of maximum sized buffer in the video pool" | ||
| default 2 | ||
|
|
||
| config VIDEO_BUFFER_POOL_ALIGN | ||
| int "Alignment of the video pool’s buffer" | ||
| default 64 | ||
|
|
||
| source "drivers/video/Kconfig.mcux_csi" | ||
|
|
||
| source "drivers/video/Kconfig.sw_generator" | ||
|
|
||
| source "drivers/video/Kconfig.mt9m114" | ||
|
|
||
| endif # VIDEO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Kconfig - NXP MCUX CSI driver configuration options | ||
|
|
||
| # | ||
| # Copyright (c) 2019, Linaro Limited | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
|
|
||
| menuconfig VIDEO_MCUX_CSI | ||
| bool "NXP MCUX CMOS Sensor Interface (CSI) driver" | ||
| depends on HAS_MCUX_CSI |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # Kconfig - MT9m114 | ||
|
|
||
| # | ||
| # Copyright (c) 2016 Linaro Limited | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
|
|
||
| menuconfig VIDEO_MT9M114 | ||
| bool "MT9M114 Aptina CMOS digital image sensor" | ||
| depends on I2C | ||
| help | ||
| Enable driver for MT9M114 CMOS digital image sensor device. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # Kconfig - MT9m114 | ||
|
|
||
| # | ||
| # Copyright (c) 2016 Linaro Limited | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
|
|
||
| menuconfig VIDEO_SW_GENERATOR | ||
| bool "Video Software Generator" | ||
| help | ||
| Enable video pattern generator (for testing purpose). |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks redundant, there is the same definition in CSI, is it necessary?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the 'official' way to link two devices though it's is currently not handled by the Zephyr devicetree parser, I expect it will be later...
FYI: example on linux: https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/media/video-interfaces.txt