Hi guys
I have a question about adding a frame your mjpeg code. Specifically from line 99 in function
void mjpeg_add_frame(FIL *fp, uint32_t *frames, uint32_t *bytes, image_t *img, int quality)
I am confused about the line
write_data(fp, img->pixels, img->bpp + pad); // reading past okay".
Hoping you could shed some insight.
My understanding is as follows
fp - fatfs file pointer. so you are writing directly to SD card
img->pixels- the jpeg pixel data
img->bpp +pad …assuming bpp =2, this comes to be 2 + 4 = 6
now the 3rd argument for function write_data() is the size of data to be written for the new frame. Why are you only writing 6 bytes. Shouldn’t this be the size of the entire jpeg file or jpeg frame ? What am I missing here?