Esempio n. 1
0
/**
	process image read
*/
static void imageProcess(const void* p)
{
	unsigned char* src = (unsigned char*)p;
	unsigned char* dst = malloc(width*height*3*sizeof(char));

	YUV420toYUV444(width, height, src, dst);

	// write jpeg
	jpegWrite(dst);

	// free temporary image
	free(dst);
}
Esempio n. 2
0
/**
	process image read
*/
static void imageProcess(const void* p, struct timeval timestamp)
{
    //timestamp.tv_sec
    //timestamp.tv_usec
    unsigned char* src = (unsigned char*)p;
    unsigned char* dst = malloc(width*height*3*sizeof(char));

    YUV420toYUV444(width, height, src, dst);

    if(continuous==1) {
        static uint32_t img_ind = 0;
        int64_t timestamp_long;
        timestamp_long = timestamp.tv_sec*1e6 + timestamp.tv_usec;
        sprintf(jpegFilename,continuousFilenameFmt,jpegFilenamePart,img_ind++,timestamp_long);

    }
    // write jpeg
    jpegWrite(dst,jpegFilename);

    // free temporary image
    free(dst);
}