Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
Assuming I have a 1920x1080 camera sensor connected to CX3, could it be possible to have a 1920x1081 UVC video streaming interface reported to PC by creating a faked line in start of every video frame in CX3 firmware?
Apart from modifying VS Frame Descriptor, what else should I do in CX3 firmware to make it work? Many thanks!
const uint8_t CyCx3USBSSConfigDscr =
/* Class specific Uncompressed VS Frame Descriptor 1 - 1080p@30fps */
0x1E, /* Descriptor size */
CX3_CS_INTRFC_DESCR, /* Descriptor type*/
0x05, /* Subtype: Uncompressed frame interface*/
0x01, /* Frame Descriptor Index: 1 */
0x00, /* No Still image capture supported */
0x80, 0x07, /* Width in pixel: 1920 */
0x38, 0x39, 0x04, /* Height in pixel: 1080 1081 */
0x00, 0x80, 0x53, 0x90, 0x61, 0x3B, /* Min bit rate (bits/s): 1080 1081 x 1920 x 2 x 30 x 8 = 995328000 996249600*/
0x00, 0x80, 0x53, 0x90, 0x61, 0x3B, /* Max bit rate (bits/s): Fixed rate so same as Min */
0x00, 0x48, 0x57, 0x3F, 0x00, /* Maximum video or still frame size in bytes(Deprecated): 1920 x 1080 1081 x 2 */
Yes, you have to adjust the DMA Buffer size that meets your requirement - dmaBuffer.size > dmaBuffer.count + sizeof (fake_line). This is the only working case for you.
In other case ( dmaBuffer.size < dmaBuffer.count + sizeof (fake_line)), buffer over flow occurs. Therefore, avoid this case.
And in dmaBuffer.size = dmaBuffer.count + sizeof (fake_line) case, the host does not know when the frame ends for particular resolutions.
Becasue host expects a partial packet (less than 1024 bytes) to know that the transfer has ended. If the total frame including the fake line is exactly multiple of 1024, the host does not know the end of transfer. Hence, avoid this case too.