2023-05-11 05:46 AM
Hello everyone
Does anyone have example code for Azure RTOS USBX device class video (UVC)?
I was able to add Video to my USBX demo application on Nucleo H7A3
There was sample code for CDC_ACM and MSC (mass storage), this worked fine. But for device class video, I was not able to find any example code.
CubeIDE 1.12.1 generated two files
ux_device_video.c
ux_device_video.h
But both files only contain prototypes of callback functions which need to be filled
Like this:
/**
* @brief USBD_VIDEO_StreamRequest
* This function is invoked to manage the UVC class requests.
* @param video_stream: Pointer to video class stream instance.
* @param transfer: Pointer to the transfer request.
* @retval status
*/
UINT USBD_VIDEO_StreamRequest(UX_DEVICE_CLASS_VIDEO_STREAM *video_stream,
UX_SLAVE_TRANSFER *transfer)
{
UINT status = UX_SUCCESS;
/* USER CODE BEGIN USBD_VIDEO_StreamRequest */
UX_PARAMETER_NOT_USED(video_stream);
UX_PARAMETER_NOT_USED(transfer);
/* USER CODE END USBD_VIDEO_StreamRequest */
return status;
}
How to fill it, that it works?
Thanks
Johannes
Solved! Go to Solution.
2023-05-31 07:38 AM - edited 2023-11-20 05:42 AM
Thank you mohamed. That was helpful. I was able to build my own video.
Is there an example project to use an uncompressed video stream?
CubeIDE allows for a setting "uncompressed"
is there an example for that?
2023-05-31 08:13 AM
Hi Johannes,
It's mentioned in readme file
if you you open ioc of application (download https://www.st.com/en/embedded-software/x-cube-azrtos-h7.html) change VIDEO_STREAMING_FORMAT to MJPEG and change video width and height finally generate code and include stream2.h in project instead of stream1.h
- stream2 FORMAT : UNCOMPRESSED and Width = 176, Height = 144 and the descriptor shall be updated.
2023-05-31 11:43 PM - edited 2023-11-20 05:42 AM
Hello muhamad
Sorry, but I am still confused.
Stream2.h is an uncompressed stream. You say; i still should set the stream format to MJPEG?
I used MJPEG for "stream1.h" (compressed stream) This works.
For stream2.h don't I need to switch to "uncompressed"?
What about all the other parameters for the stream of "stream2.h"?
Bits per Pixel?
Format YUV2 or NV12?
Color Primaire?
TRF Characteristics?
Matrix Coefficients?
Thanky you very much for your help
Johannes
2023-06-13 04:36 AM
Hello Mohamed
Can you explain how the uncompressed video stream is composed? Are these individual images as well? Which format are they and how are they generated?
Johannes