Update of /cvsroot/gphoto/libgphoto2/camlibs/spca50x In directory sc8-pr-cvs1:/tmp/cvs-serv12859 Modified Files: spca50x-avi-header.h spca50x-flash.c spca50x-flash.h spca50x-jpeg-header.h spca50x-sdram.c spca50x-sdram.h spca50x.c spca50x.h Log Message: u_int* -> uint* Index: spca50x-avi-header.h =================================================================== RCS file: /cvsroot/gphoto/libgphoto2/camlibs/spca50x/spca50x-avi-header.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- spca50x-avi-header.h 1 May 2003 15:03:23 -0000 1.1 +++ spca50x-avi-header.h 29 May 2003 07:37:44 -0000 1.2 @@ -2,13 +2,13 @@ #define __SPCA50X_AVI_HEADER_H #define SPCA50X_AVI_FRAME_HEADER_LENGTH 8 -u_int8_t SPCA50xAviFrameHeader[SPCA50X_AVI_FRAME_HEADER_LENGTH] = { +uint8_t SPCA50xAviFrameHeader[SPCA50X_AVI_FRAME_HEADER_LENGTH] = { 0x30, 0x30, 0x64, 0x63, // 00dc 0x00, 0x00, 0x00, 0x00 // size of frame }; #define SPCA50X_AVI_HEADER_LENGTH 224 -u_int8_t SPCA50xAviHeader[SPCA50X_AVI_HEADER_LENGTH] = { +uint8_t SPCA50xAviHeader[SPCA50X_AVI_HEADER_LENGTH] = { /* -- RIFF HEADER -- */ 0x52, 0x49, 0x46, 0x46, // 0x00; RIFF 0x00, 0x00, 0x00, 0x00, // 0x04; number of bytes following Index: spca50x-flash.c =================================================================== RCS file: /cvsroot/gphoto/libgphoto2/camlibs/spca50x/spca50x-flash.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- spca50x-flash.c 4 May 2003 06:54:17 -0000 1.3 +++ spca50x-flash.c 29 May 2003 07:37:44 -0000 1.4 @@ -45,7 +45,7 @@ { /* FIXME tweak this. What is reasonable? 30 s seems a bit long */ int timeout = 30; - u_int8_t ready = 0; + uint8_t ready = 0; while (timeout--) { sleep(1); if (pl->fw_rev == 1) { @@ -64,7 +64,7 @@ int spca50x_flash_get_TOC(CameraPrivateLibrary *pl, int *filecount) { - u_int16_t n_toc_entries; + uint16_t n_toc_entries; int toc_size = 0; if (pl->fw_rev == 1) { @@ -114,7 +114,7 @@ int spca50x_flash_get_filecount (CameraPrivateLibrary *pl, int *filecount) { - u_int16_t response = 0; + uint16_t response = 0; if (pl->fw_rev == 1) { CHECK (gp_port_usb_msg_read (pl->gpdev, 0x0b, 0x0000, 0x0000, @@ -147,7 +147,7 @@ int spca50x_flash_get_file_name (CameraPrivateLibrary *pl, int index, char *name) { - u_int8_t *p; + uint8_t *p; if (pl->fw_rev == 1) { p = pl->flash_toc + index*2*32; @@ -164,7 +164,7 @@ int spca50x_flash_get_file_dimensions (CameraPrivateLibrary *pl, int index, int *w, int *h) { - u_int8_t *p; + uint8_t *p; if (pl->fw_rev == 1) { p = pl->flash_toc + index*2*32; @@ -180,7 +180,7 @@ int spca50x_flash_get_file_size (CameraPrivateLibrary *pl, int index, int *size) { - u_int8_t *p; + uint8_t *p; if (pl->fw_rev == 1) { p = pl->flash_toc + index*2*32; @@ -198,11 +198,11 @@ int spca50x_flash_get_file (CameraPrivateLibrary *lib, GPContext *context, - u_int8_t ** data, unsigned int *len, int index, int thumbnail) + uint8_t ** data, unsigned int *len, int index, int thumbnail) { - u_int32_t file_size = 0, aligned_size = 0; - u_int8_t *p, *buf; - u_int8_t *tmp, *rgb_p, *yuv_p; + uint32_t file_size = 0, aligned_size = 0; + uint8_t *p, *buf; + uint8_t *tmp, *rgb_p, *yuv_p; if (lib->fw_rev != 1 && thumbnail) return GP_ERROR_NOT_SUPPORTED; @@ -249,7 +249,7 @@ * yuv to rgb and a pbm header added. */ if (thumbnail) { int alloc_size, true_size, w, h, hdrlen; - u_int8_t *p2 = lib->flash_toc + index*2*32; + uint8_t *p2 = lib->flash_toc + index*2*32; /* thumbnails are generated from dc coefficients and are * therefor w/8 x h/8 @@ -407,7 +407,7 @@ }; int len = sizeof (jpReg) / sizeof (jpReg[0]); - u_int8_t bytes[4]; + uint8_t bytes[4]; int i; if (pl->fw_rev == 1) { @@ -450,7 +450,7 @@ } else { - u_int8_t bytes[7]; + uint8_t bytes[7]; time_t t; struct tm *ftm; int i; Index: spca50x-flash.h =================================================================== RCS file: /cvsroot/gphoto/libgphoto2/camlibs/spca50x/spca50x-flash.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- spca50x-flash.h 1 May 2003 15:03:23 -0000 1.1 +++ spca50x-flash.h 29 May 2003 07:37:44 -0000 1.2 @@ -30,7 +30,7 @@ int spca50x_flash_get_file_dimensions(CameraPrivateLibrary *pl, int index, int *w, int *h); int spca50x_flash_get_file (CameraPrivateLibrary *pl, GPContext *context, - u_int8_t **buf, unsigned int *len, int index, int thumbnail); + uint8_t **buf, unsigned int *len, int index, int thumbnail); int spca50x_flash_get_file_size(CameraPrivateLibrary *pl, int index, int *size); int spca50x_flash_get_filecount(CameraPrivateLibrary *pl, int *filecount); int spca50x_flash_delete_all (CameraPrivateLibrary *pl, GPContext *context); Index: spca50x-jpeg-header.h =================================================================== RCS file: /cvsroot/gphoto/libgphoto2/camlibs/spca50x/spca50x-jpeg-header.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- spca50x-jpeg-header.h 1 May 2003 15:03:23 -0000 1.1 +++ spca50x-jpeg-header.h 29 May 2003 07:37:44 -0000 1.2 @@ -11,7 +11,7 @@ #define SPCA50X_JPG_DEFAULT_HEADER_PART3_LENGTH 33 #define SPCA50X_JPG_DEFAULT_HEADER_LENGTH 589 -u_int8_t SPCA50xJPGDefaultHeaderPart1[SPCA50X_JPG_DEFAULT_HEADER_PART1_LENGTH] = { +uint8_t SPCA50xJPGDefaultHeaderPart1[SPCA50X_JPG_DEFAULT_HEADER_PART1_LENGTH] = { //SOI(Start of Image) 0xFF,0xD8, //DQT(Define Quantization Table) @@ -28,7 +28,7 @@ 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22, 0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22 }; -u_int8_t SPCA50xJPGDefaultHeaderPart2[SPCA50X_JPG_DEFAULT_HEADER_PART2_LENGTH] = { +uint8_t SPCA50xJPGDefaultHeaderPart2[SPCA50X_JPG_DEFAULT_HEADER_PART2_LENGTH] = { //DHT(Define Huffman Table) 0xFF,0xC4, 0x01,0xA2, @@ -63,7 +63,7 @@ * 5 - 6 : Image Height(H Byte,L Byte) * 7 - 8 : Image Width(H Byte,L Byte) */ -u_int8_t SPCA50xJPGDefaultHeaderPart3[SPCA50X_JPG_DEFAULT_HEADER_PART3_LENGTH] = { +uint8_t SPCA50xJPGDefaultHeaderPart3[SPCA50X_JPG_DEFAULT_HEADER_PART3_LENGTH] = { //SOFn(Start of Frame) 0xFF,0xC0, 0x00,0x11, @@ -74,7 +74,7 @@ 0x03,0x01,0x00,0x02,0x11,0x03,0x11,0x00,0x3F,0x00 }; -u_int8_t SPCA50xQTable[20][64]= +uint8_t SPCA50xQTable[20][64]= { // index 0, Q50 { 16, 11, 12, 14, 12, 10, 16, 14, 13, 14, 18, 17, 16, 19, 24, 40, @@ -177,7 +177,7 @@ 124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124 } }; -u_int8_t SPCA50xOriginal_QTable_4NF_M[18][64]= //not Z-Z +uint8_t SPCA50xOriginal_QTable_4NF_M[18][64]= //not Z-Z { // index 0, Q50 { 16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, Index: spca50x-sdram.c =================================================================== RCS file: /cvsroot/gphoto/libgphoto2/camlibs/spca50x/spca50x-sdram.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- spca50x-sdram.c 17 May 2003 07:58:39 -0000 1.3 +++ spca50x-sdram.c 29 May 2003 07:37:44 -0000 1.4 @@ -60,31 +60,31 @@ static int spca50x_mode_set_idle (CameraPrivateLibrary * lib); static int spca50x_is_idle (CameraPrivateLibrary * lib); static int spca50x_mode_set_download (CameraPrivateLibrary * lib); -static int spca50x_download_data (CameraPrivateLibrary * lib, u_int32_t start, - unsigned int size, u_int8_t * buf); +static int spca50x_download_data (CameraPrivateLibrary * lib, uint32_t start, + unsigned int size, uint8_t * buf); static int spca50x_get_FATs (CameraPrivateLibrary * lib, int dramtype); static int spca50x_sdram_get_file_count_and_fat_count (CameraPrivateLibrary * lib, int dramtype); -static void create_jpeg_from_data (u_int8_t * dst, u_int8_t * src, int qIndex, - int w, int h, u_int8_t format, +static void create_jpeg_from_data (uint8_t * dst, uint8_t * src, int qIndex, + int w, int h, uint8_t format, int original_size, int *size, int omit_huffman_table, int omit_escape); static int spca50x_get_avi_thumbnail (CameraPrivateLibrary * lib, - u_int8_t ** buf, unsigned int *len, + uint8_t ** buf, unsigned int *len, struct SPCA50xFile *g_file); static int spca50x_get_image_thumbnail (CameraPrivateLibrary * lib, - u_int8_t ** buf, unsigned int *len, + uint8_t ** buf, unsigned int *len, struct SPCA50xFile *g_file); -static int spca50x_get_avi (CameraPrivateLibrary * lib, u_int8_t ** buf, +static int spca50x_get_avi (CameraPrivateLibrary * lib, uint8_t ** buf, unsigned int *len, struct SPCA50xFile *g_file); -static int spca50x_get_image (CameraPrivateLibrary * lib, u_int8_t ** buf, +static int spca50x_get_image (CameraPrivateLibrary * lib, uint8_t ** buf, unsigned int *len, struct SPCA50xFile *g_file); -static inline u_int8_t *put_dword (u_int8_t * ptr, u_int32_t value); +static inline uint8_t *put_dword (uint8_t * ptr, uint32_t value); static int spca50x_sdram_get_fat_page (CameraPrivateLibrary * lib, int index, - int dramtype, u_int8_t *p) + int dramtype, uint8_t *p) { switch (dramtype) { case 4: /* 128 Mbit */ @@ -110,19 +110,19 @@ spca50x_sdram_get_file_count_and_fat_count (CameraPrivateLibrary * lib, int dramtype) { - u_int8_t theFat[256]; + uint8_t theFat[256]; lib->num_fats = 0; lib->num_files = 0; if (lib->bridge == BRIDGE_SPCA500){ - u_int8_t lower, upper; + uint8_t lower, upper; CHECK (gp_port_usb_msg_write (lib->gpdev, 0x5, 0, 0, NULL, 0)); sleep (1); CHECK (gp_port_usb_msg_read (lib->gpdev, 0, 0, 0xe15, - (u_int8_t *) & lib->num_files, 1)); + (uint8_t *) & lib->num_files, 1)); LE32TOH (lib->num_files); // get fatscount @@ -131,10 +131,10 @@ sleep (1); CHECK (gp_port_usb_msg_read (lib->gpdev, 0, 0, 0x0e19, - (u_int8_t *) & lower, 1)); + (uint8_t *) & lower, 1)); CHECK (gp_port_usb_msg_read (lib->gpdev, 0, 0, 0x0e20, - (u_int8_t *) & upper, 1)); + (uint8_t *) & upper, 1)); lib->num_fats = ((upper & 0xFF << 8) | (lower & 0xFF)); } else { @@ -157,7 +157,7 @@ spca50x_sdram_delete_file (CameraPrivateLibrary * lib, unsigned int index) { struct SPCA50xFile *g_file; - u_int16_t fat_index; + uint16_t fat_index; CHECK (spca50x_sdram_get_file_info (lib, index, &g_file)); @@ -195,7 +195,7 @@ } int -spca50x_sdram_request_file (CameraPrivateLibrary * lib, u_int8_t ** buf, +spca50x_sdram_request_file (CameraPrivateLibrary * lib, uint8_t ** buf, unsigned int *len, unsigned int number, int *type) { struct SPCA50xFile *g_file; @@ -210,13 +210,13 @@ } static int -spca50x_get_image (CameraPrivateLibrary * lib, u_int8_t ** buf, +spca50x_get_image (CameraPrivateLibrary * lib, uint8_t ** buf, unsigned int *len, struct SPCA50xFile *g_file) { - u_int8_t *p, *lp_jpg; - u_int8_t qIndex = 0, format; - u_int32_t start; - u_int8_t *mybuf; + uint8_t *p, *lp_jpg; + uint8_t qIndex = 0, format; + uint32_t start; + uint8_t *mybuf; int size, o_size, file_size; int omit_escape = 0; @@ -290,7 +290,7 @@ } static int -spca50x_get_avi (CameraPrivateLibrary * lib, u_int8_t ** buf, +spca50x_get_avi (CameraPrivateLibrary * lib, uint8_t ** buf, unsigned int *len, struct SPCA50xFile *g_file) { int i, j, length; @@ -298,13 +298,13 @@ int size = 0; int file_size; int index_size; - u_int32_t frame_size = 0, frame_width = 0, frame_height = 0; - u_int32_t total_frame_size = 0; - u_int32_t start = 0; - u_int8_t *p, *mybuf, *avi, *start_of_file, *start_of_frame, *data; - u_int8_t qIndex; - u_int8_t *avi_index, *avi_index_ptr; - u_int8_t index_item[16]; + uint32_t frame_size = 0, frame_width = 0, frame_height = 0; + uint32_t total_frame_size = 0; + uint32_t start = 0; + uint8_t *p, *mybuf, *avi, *start_of_file, *start_of_frame, *data; + uint8_t qIndex; + uint8_t *avi_index, *avi_index_ptr; + uint8_t index_item[16]; /* FIXME */ if (lib->bridge == BRIDGE_SPCA500) @@ -463,7 +463,7 @@ } int -spca50x_sdram_request_thumbnail (CameraPrivateLibrary * lib, u_int8_t ** buf, +spca50x_sdram_request_thumbnail (CameraPrivateLibrary * lib, uint8_t ** buf, unsigned int *len, unsigned int number, int *type) { struct SPCA50xFile *g_file; @@ -495,13 +495,13 @@ static int -spca50x_get_avi_thumbnail (CameraPrivateLibrary * lib, u_int8_t ** buf, +spca50x_get_avi_thumbnail (CameraPrivateLibrary * lib, uint8_t ** buf, unsigned int *len, struct SPCA50xFile *g_file) { - u_int8_t *p, *lp_jpg; - u_int8_t qIndex; - u_int32_t start; - u_int8_t *mybuf; + uint8_t *p, *lp_jpg; + uint8_t qIndex; + uint32_t start; + uint8_t *mybuf; int size, o_size, file_size; int w, h; @@ -553,17 +553,17 @@ static int -spca50x_get_image_thumbnail (CameraPrivateLibrary * lib, u_int8_t ** buf, +spca50x_get_image_thumbnail (CameraPrivateLibrary * lib, uint8_t ** buf, unsigned int *len, struct SPCA50xFile *g_file) { unsigned int size; - u_int8_t *p; - u_int32_t start; - u_int8_t *mybuf = NULL; - u_int8_t *tmp; + uint8_t *p; + uint32_t start; + uint8_t *mybuf = NULL; + uint8_t *tmp; unsigned int t_width, t_height; - u_int8_t *yuv_p; - u_int8_t *rgb_p; + uint8_t *yuv_p; + uint8_t *rgb_p; int headerlength; p = g_file->fat; @@ -641,10 +641,10 @@ spca50x_sdram_get_info (CameraPrivateLibrary * lib) { unsigned int index; - u_int8_t dramtype = 0; - u_int8_t *p; - u_int32_t start_page, end_page; - u_int8_t file_type; + uint8_t dramtype = 0; + uint8_t *p; + uint32_t start_page, end_page; + uint8_t file_type; GP_DEBUG ("* spca50x_sdram_get_info"); @@ -660,7 +660,7 @@ CHECK (gp_port_usb_msg_read (lib->gpdev, 0, 0, SPCA50X_REG_DramType, - (u_int8_t *) & dramtype, 1)); + (uint8_t *) & dramtype, 1)); dramtype &= 0xFF; } @@ -714,7 +714,7 @@ int mode; CHECK (gp_port_usb_msg_read - (lib->gpdev, 0, 0, SPCA50X_REG_CamMode, (u_int8_t *) & mode, 1)); + (lib->gpdev, 0, 0, SPCA50X_REG_CamMode, (uint8_t *) & mode, 1)); return mode == SPCA50X_CamMode_Idle ? 1 : 0; } @@ -729,12 +729,12 @@ } static int -spca50x_download_data (CameraPrivateLibrary * lib, u_int32_t start, - unsigned int size, u_int8_t * buf) +spca50x_download_data (CameraPrivateLibrary * lib, uint32_t start, + unsigned int size, uint8_t * buf) { - u_int8_t foo; - u_int8_t vlcAddressL, vlcAddressM, vlcAddressH; + uint8_t foo; + uint8_t vlcAddressL, vlcAddressM, vlcAddressH; if (!spca50x_is_idle (lib)) spca50x_mode_set_idle (lib); @@ -753,13 +753,13 @@ CHECK (gp_port_usb_msg_read (lib->gpdev, 0, 0, SPCA50X_REG_VlcAddressL, - (u_int8_t *) & vlcAddressL, 1)); + (uint8_t *) & vlcAddressL, 1)); CHECK (gp_port_usb_msg_read (lib->gpdev, 0, 0, SPCA50X_REG_VlcAddressM, - (u_int8_t *) & vlcAddressM, 1)); + (uint8_t *) & vlcAddressM, 1)); CHECK (gp_port_usb_msg_read (lib->gpdev, 0, 0, SPCA50X_REG_VlcAddressH, - (u_int8_t *) & vlcAddressH, 1)); + (uint8_t *) & vlcAddressH, 1)); foo = start & 0xFF; CHECK (gp_port_usb_msg_write @@ -795,11 +795,11 @@ static int spca50x_get_FATs (CameraPrivateLibrary * lib, int dramtype) { - u_int8_t type; + uint8_t type; unsigned int index = 0; unsigned int file_index = 0; - u_int8_t *p = NULL; - u_int8_t buf[14]; + uint8_t *p = NULL; + uint8_t buf[14]; /* Reset image and movie counter */ lib->num_images = lib->num_movies = 0; @@ -897,14 +897,14 @@ } static void -create_jpeg_from_data (u_int8_t * dst, u_int8_t * src, int qIndex, int w, - int h, u_int8_t format, int o_size, int *size, +create_jpeg_from_data (uint8_t * dst, uint8_t * src, int qIndex, int w, + int h, uint8_t format, int o_size, int *size, int omit_huffman_table, int omit_escape) { int i = 0; - u_int8_t *start; - u_int8_t value; + uint8_t *start; + uint8_t value; start = dst; /* copy the header from the template */ @@ -955,8 +955,8 @@ *size = dst - start; } -static inline u_int8_t * -put_dword (u_int8_t * ptr, u_int32_t value) +static inline uint8_t * +put_dword (uint8_t * ptr, uint32_t value) { ptr[0] = (value & 0xff); ptr[1] = (value & 0xff00) >> 8; Index: spca50x-sdram.h =================================================================== RCS file: /cvsroot/gphoto/libgphoto2/camlibs/spca50x/spca50x-sdram.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- spca50x-sdram.h 1 May 2003 15:03:24 -0000 1.1 +++ spca50x-sdram.h 29 May 2003 07:37:44 -0000 1.2 @@ -33,10 +33,10 @@ int spca50x_sdram_delete_all (CameraPrivateLibrary * lib); int spca50x_sdram_get_file_info (CameraPrivateLibrary * lib, unsigned int index, struct SPCA50xFile **file); -int spca50x_sdram_request_file (CameraPrivateLibrary * lib, u_int8_t ** buf, +int spca50x_sdram_request_file (CameraPrivateLibrary * lib, uint8_t ** buf, unsigned int *len, unsigned int number, int *type); int spca50x_sdram_request_thumbnail (CameraPrivateLibrary * lib, - u_int8_t ** buf, unsigned int *len, + uint8_t ** buf, unsigned int *len, unsigned int number, int *type); #endif /* __SPCA50X_SDRAM_H__ */ Index: spca50x.c =================================================================== RCS file: /cvsroot/gphoto/libgphoto2/camlibs/spca50x/spca50x.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- spca50x.c 1 May 2003 15:03:24 -0000 1.1 +++ spca50x.c 29 May 2003 07:37:44 -0000 1.2 @@ -68,7 +68,7 @@ spca50x_detect_storage_type (CameraPrivateLibrary *lib) { int i; - u_int8_t buf[3]; + uint8_t buf[3]; for (i=0;i<3;i++) { Index: spca50x.h =================================================================== RCS file: /cvsroot/gphoto/libgphoto2/camlibs/spca50x/spca50x.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- spca50x.h 1 May 2003 15:03:24 -0000 1.1 +++ spca50x.h 29 May 2003 07:37:44 -0000 1.2 @@ -26,6 +26,7 @@ #ifndef __SPCA50X_H__ #define __SPCA50X_H__ +#include <_stdint.h> #include <gphoto2-camera.h> #define SPCA50X_FAT_PAGE_SIZE 0x100 @@ -41,7 +42,7 @@ int height; int fat_start; int fat_end; - u_int8_t *fat; + uint8_t *fat; int mime_type; }; @@ -55,7 +56,7 @@ GPPort *gpdev; int dirty:1; int storage_media_mask; - u_int8_t fw_rev; + uint8_t fw_rev; SPCA50xBridgeChip bridge; int num_files; int num_images; @@ -63,8 +64,8 @@ int num_fats; int size_used; int size_free; - u_int8_t *flash_toc; - u_int8_t *fats; + uint8_t *flash_toc; + uint8_t *fats; struct SPCA50xFile *files; }; |