Skip to content

Conversation

@embedded-ideas
Copy link

On smaller devices, there isn’t enough RAM to store an entire high-resolution frame. I haven’t found a way to use the video device without such a buffer, so I added a callback mechanism that allows the code to request payload data on the fly. This makes it possible to generate or forward data without storing a whole frame at once.

  • The code has been tested on a NanoCH32V305 board.
  • I added demo code to the video device example.
  • I tried to stay consistent with the existing code and used weak linking for the callback.

Tobi added 2 commits October 30, 2025 12:21
…me data on the fly

- If buffer is set to NULL, the callback will request payload data from a user function. This allows to work with dynamic content on platforms which are not able to hold a whole frame in memory.
- Callback uses the same "weak" linking as other callbacks for this class.
…d with e.g. nanoCH32V305 board with the following settings:

- tusb_config.h
  - #define CFG_TUD_VIDEO_STREAMING_EP_BUFSIZE  1024
  - #define CFG_TUD_VIDEO_STREAMING_BULK 1
  - #define CFG_EXAMPLE_VIDEO_DISABLE_MJPEG
  - #define CFG_EXAMPLE_VIDEO_BUFFERLESS

and

- usb_descriptor.h
  - #define FRAME_RATE    60
codescene-delta-analysis[bot]

This comment was marked as outdated.

…tructure in order to meet coding guideliness
@HiFiPhile HiFiPhile requested a review from kkitayam October 31, 2025 15:39
@HiFiPhile
Copy link
Collaborator

Thank you, tested on STM32U5, please fix pre-commit whitespace issue as I can't push to your branch (got permission denied).
@kkitayam @lijunru-hub what do you think ?

@embedded-ideas
Copy link
Author

Sorry for the whitespaces, should have looked a bit deeper into the logs. Did some experiments with a new Editor and didn't had my settings right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants