Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(224) |
Sep
(194) |
Oct
(222) |
Nov
(567) |
Dec
(190) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(304) |
Feb
(159) |
Mar
(31) |
Apr
(45) |
May
(112) |
Jun
(103) |
Jul
(114) |
Aug
(84) |
Sep
(134) |
Oct
(135) |
Nov
(37) |
Dec
(28) |
2004 |
Jan
(182) |
Feb
(44) |
Mar
(28) |
Apr
(45) |
May
(27) |
Jun
(18) |
Jul
(51) |
Aug
(59) |
Sep
(40) |
Oct
(33) |
Nov
(44) |
Dec
(56) |
2005 |
Jan
(117) |
Feb
(49) |
Mar
(111) |
Apr
(337) |
May
(103) |
Jun
(121) |
Jul
(52) |
Aug
(48) |
Sep
(31) |
Oct
(12) |
Nov
(26) |
Dec
(80) |
2006 |
Jan
(217) |
Feb
(43) |
Mar
(125) |
Apr
(80) |
May
(53) |
Jun
(171) |
Jul
(40) |
Aug
(79) |
Sep
(109) |
Oct
(133) |
Nov
(105) |
Dec
(332) |
2007 |
Jan
(112) |
Feb
(55) |
Mar
(43) |
Apr
(31) |
May
(247) |
Jun
(76) |
Jul
(89) |
Aug
(109) |
Sep
(137) |
Oct
(84) |
Nov
(33) |
Dec
(36) |
2008 |
Jan
(23) |
Feb
(29) |
Mar
(97) |
Apr
(53) |
May
(33) |
Jun
(43) |
Jul
(59) |
Aug
(42) |
Sep
(57) |
Oct
(154) |
Nov
(73) |
Dec
(64) |
2009 |
Jan
(138) |
Feb
(53) |
Mar
(77) |
Apr
(108) |
May
(104) |
Jun
(48) |
Jul
(170) |
Aug
(79) |
Sep
(47) |
Oct
(44) |
Nov
(18) |
Dec
(33) |
2010 |
Jan
(105) |
Feb
(48) |
Mar
(161) |
Apr
(160) |
May
(30) |
Jun
(42) |
Jul
(82) |
Aug
(99) |
Sep
(48) |
Oct
(29) |
Nov
(43) |
Dec
(54) |
2011 |
Jan
(34) |
Feb
(48) |
Mar
(24) |
Apr
(47) |
May
(20) |
Jun
(15) |
Jul
(15) |
Aug
(19) |
Sep
(57) |
Oct
(10) |
Nov
(23) |
Dec
(41) |
2012 |
Jan
(27) |
Feb
(44) |
Mar
(60) |
Apr
(59) |
May
(15) |
Jun
(14) |
Jul
(32) |
Aug
(20) |
Sep
(25) |
Oct
(14) |
Nov
(12) |
Dec
(25) |
2013 |
Jan
(56) |
Feb
(46) |
Mar
(36) |
Apr
(66) |
May
(71) |
Jun
(46) |
Jul
(15) |
Aug
(30) |
Sep
(23) |
Oct
(32) |
Nov
(5) |
Dec
(20) |
2014 |
Jan
(129) |
Feb
(72) |
Mar
(64) |
Apr
(52) |
May
(42) |
Jun
(83) |
Jul
(70) |
Aug
(50) |
Sep
(29) |
Oct
(26) |
Nov
(32) |
Dec
(48) |
2015 |
Jan
(46) |
Feb
(23) |
Mar
(40) |
Apr
(15) |
May
(17) |
Jun
(29) |
Jul
(40) |
Aug
(3) |
Sep
|
Oct
|
Nov
(3) |
Dec
(1) |
2016 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2017 |
Jan
(3) |
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
(6) |
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
1
|
2
(11) |
3
(13) |
4
|
5
|
6
(5) |
7
(1) |
8
(4) |
9
|
10
(14) |
11
(2) |
12
(2) |
13
(2) |
14
(2) |
15
(4) |
16
(1) |
17
(2) |
18
(3) |
19
(9) |
20
(2) |
21
(7) |
22
(3) |
23
|
24
(5) |
25
(2) |
26
|
27
|
28
(1) |
29
(4) |
30
(1) |
31
(12) |
|
|
|
From: <marcusmeissner@us...> - 2007-01-15 21:54:31
|
Revision: 9887 http://svn.sourceforge.net/gphoto/?rev=9887&view=rev Author: marcusmeissner Date: 2007-01-14 13:43:02 -0800 (Sun, 14 Jan 2007) Log Message: ----------- remove objectinfos and handle from internal structres on delete and rmdir. Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/ChangeLog trunk/libgphoto2/camlibs/ptp2/library.c Modified: trunk/libgphoto2/camlibs/ptp2/ChangeLog =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ChangeLog 2007-01-14 18:52:11 UTC (rev 9886) +++ trunk/libgphoto2/camlibs/ptp2/ChangeLog 2007-01-14 21:43:02 UTC (rev 9887) @@ -3,6 +3,11 @@ * usb.c: read in 64kb blobs again (512 bytes read are ineffecient). + * library.c: On delete and rmdir also remove the + information from the internal handles and objectinfos. + Otherwise remove, upload, remove, upload cycles + will not work ... and gphotofs needs them. + 2007-01-10 Marcus Meissner <marcus@...> * library.c: Added NULL check in MTP objlist reader. Modified: trunk/libgphoto2/camlibs/ptp2/library.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/library.c 2007-01-14 18:52:11 UTC (rev 9886) +++ trunk/libgphoto2/camlibs/ptp2/library.c 2007-01-14 21:43:02 UTC (rev 9887) @@ -2973,6 +2973,7 @@ memset(&oi, 0, sizeof (PTPObjectInfo)); gp_file_get_name (file, &filename); gp_file_get_type (file, &type); + gp_log ( GP_LOG_DEBUG, "ptp2/put_file_func", "folder=%s, filename=%s", folder, filename); if (type == GP_FILE_TYPE_METADATA) { if ((params->deviceinfo.VendorExtensionID==PTP_VENDOR_MICROSOFT) && @@ -3015,10 +3016,11 @@ /* We don't really want a file to exist with the same name twice. */ handle = folder_to_handle (filename, storage, parent, camera); - if (handle != PTP_HANDLER_SPECIAL) + if (handle != PTP_HANDLER_SPECIAL) { + gp_log ( GP_LOG_DEBUG, "ptp2/put_file_func", "%s/%s exists.", folder, filename); return GP_ERROR_FILE_EXISTS; + } - oi.Filename=(char *)filename; oi.ObjectFormat = get_mimetype(camera, file, params->deviceinfo.VendorExtensionID); oi.ParentObject = parent; @@ -3097,6 +3099,17 @@ CPR (context, ptp_deleteobject(params, params->handles.Handler[object_id],0)); + /* Remove it from the internal structures. */ + memcpy (params->handles.Handler+object_id, + params->handles.Handler+object_id+1, + (params->handles.n-object_id-1)*sizeof(params->handles.Handler[0]) + ); + memcpy (params->objectinfo+object_id, + params->objectinfo+object_id+1, + (params->handles.n-object_id-1)*sizeof(params->objectinfo[0]) + ); + params->handles.n--; + /* On some Canon firmwares, a DeleteObject causes a ObjectRemoved event * to be sent. At least on Digital IXUS II and PowerShot A85. But * not on 350D. @@ -3141,6 +3154,17 @@ return (GP_ERROR_BAD_PARAMETERS); CPR (context, ptp_deleteobject(params, params->handles.Handler[object_id],0)); + + /* Remove it from the internal structures. */ + memcpy (params->handles.Handler+object_id, + params->handles.Handler+object_id+1, + (params->handles.n-object_id-1)*sizeof(params->handles.Handler[0]) + ); + memcpy (params->objectinfo+object_id, + params->objectinfo+object_id+1, + (params->handles.n-object_id-1)*sizeof(params->objectinfo[0]) + ); + params->handles.n--; return (GP_OK); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <marcusmeissner@us...> - 2007-01-15 21:27:14
|
Revision: 9885 http://svn.sourceforge.net/gphoto/?rev=9885&view=rev Author: marcusmeissner Date: 2007-01-14 10:33:32 -0800 (Sun, 14 Jan 2007) Log Message: ----------- make reading faster again Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/ChangeLog trunk/libgphoto2/camlibs/ptp2/usb.c Modified: trunk/libgphoto2/camlibs/ptp2/ChangeLog =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ChangeLog 2007-01-14 09:36:12 UTC (rev 9884) +++ trunk/libgphoto2/camlibs/ptp2/ChangeLog 2007-01-14 18:33:32 UTC (rev 9885) @@ -1,3 +1,8 @@ +2007-01-14 Marcus Meissner <marcus@...> + + * usb.c: read in 64kb blobs again (512 bytes read are + ineffecient). + 2007-01-10 Marcus Meissner <marcus@...> * library.c: Added NULL check in MTP objlist reader. Modified: trunk/libgphoto2/camlibs/ptp2/usb.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/usb.c 2007-01-14 09:36:12 UTC (rev 9884) +++ trunk/libgphoto2/camlibs/ptp2/usb.c 2007-01-14 18:33:32 UTC (rev 9885) @@ -216,6 +216,8 @@ return PTP_ERROR_IO; } +#define READLEN 64*1024 /* read blob size */ + uint16_t ptp_usb_getdata (PTPParams* params, PTPContainer* ptp, PTPDataHandler *handler) { @@ -309,7 +311,8 @@ /* If not read the rest of it. */ retry: - data = malloc(PTP_USB_BULK_HS_MAX_PACKET_LEN); + oldsize = 0; + data = malloc(READLEN); bytes_to_read = len - (rlen - PTP_USB_BULK_HDR_LEN); usecontext = (bytes_to_read > CONTEXT_BLOCK_SIZE); ret = PTP_RC_OK; @@ -320,8 +323,14 @@ unsigned long toread = bytes_to_read; int res; - if (toread > PTP_USB_BULK_HS_MAX_PACKET_LEN) - toread = PTP_USB_BULK_HS_MAX_PACKET_LEN; + /* read in large blobs. + * if smaller than large blob, read all but the last short packet + * depending on EP packetsize. + */ + if (toread > READLEN) + toread = READLEN; + else if (toread > params->maxpacketsize) + toread = toread - (toread % params->maxpacketsize); res = gp_port_read (camera->port, (char*)data, toread); if (res < 0) { ret = PTP_ERROR_IO; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <marcusmeissner@us...> - 2007-01-15 16:24:55
|
Revision: 9888 http://svn.sourceforge.net/gphoto/?rev=9888&view=rev Author: marcusmeissner Date: 2007-01-14 14:03:25 -0800 (Sun, 14 Jan 2007) Log Message: ----------- merged write branch. rewrote large parts of it to make it work. => Upload now possible. Modified Paths: -------------- trunk/gphotofs/AUTHORS trunk/gphotofs/ChangeLog trunk/gphotofs/gphotofs.c Modified: trunk/gphotofs/AUTHORS =================================================================== --- trunk/gphotofs/AUTHORS 2007-01-14 21:43:02 UTC (rev 9887) +++ trunk/gphotofs/AUTHORS 2007-01-14 22:03:25 UTC (rev 9888) @@ -1 +1,2 @@ Philip Langdale <philipl@...> +Marcus Meissner <marcus@...> Modified: trunk/gphotofs/ChangeLog =================================================================== --- trunk/gphotofs/ChangeLog 2007-01-14 21:43:02 UTC (rev 9887) +++ trunk/gphotofs/ChangeLog 2007-01-14 22:03:25 UTC (rev 9888) @@ -1,3 +1,15 @@ +2007-01-14 Marcus Meissner <marcus@...> + + * gphotofs.c: Fixed the bugs in the upload code. + + Upload is working now (needs latest libgphoto2 SVN + trunk for working PTP2 driver). + +2007-01-14 Philip Langdale <philipl@...> + + (merged by Marcus) + * gphotofs.c: Merged the write code. + 2007-01-10 Philip Langdale <philipl@...> (merged by Marcus) Modified: trunk/gphotofs/gphotofs.c =================================================================== --- trunk/gphotofs/gphotofs.c 2007-01-14 21:43:02 UTC (rev 9887) +++ trunk/gphotofs/gphotofs.c 2007-01-14 22:03:25 UTC (rev 9888) @@ -1,6 +1,7 @@ /* FUSE Filesystem for libgphoto2. Copyright (C) 2005 Philip Langdale <philipl@...> + Copyright (C) 2007 Marcus Meissner <marcus@...> This program can be distributed under the terms of the GNU GPL. See the file COPYING. @@ -23,8 +24,8 @@ #include <string.h> #include <errno.h> #include <fcntl.h> +#include <sys/time.h> - /* * Static variables set by command line arguments. */ @@ -32,8 +33,10 @@ static gchar *sModel = NULL; static gchar *sUsbid = NULL; static gint sSpeed = 0; -static gboolean sHelp, sDebug; +static gboolean sHelp; +struct timeval glob_tv_zero; + /* * The OpenFile struct encapsulates a CameraFile and an open count. * This allows us to track multiple overlapping open/release calls @@ -42,7 +45,13 @@ struct OpenFile { CameraFile *file; - guint count; + unsigned long count; + + void *buf; + unsigned long size; + int writing; + gchar *destdir; + gchar *destname; }; typedef struct OpenFile OpenFile; @@ -123,11 +132,13 @@ Camera *camera; GPContext *context; CameraAbilitiesList *abilities; + int debug_func_id; gchar *directory; GHashTable *files; GHashTable *dirs; GHashTable *reads; + GHashTable *writes; }; typedef struct GPCtx GPCtx; @@ -162,7 +173,7 @@ gchar *key; stbuf = g_new0(struct stat, 1); - stbuf->st_mode = S_IFDIR | 0555; + stbuf->st_mode = S_IFDIR | 0755; /* This is not a correct number in general. */ stbuf->st_nlink = 2; stbuf->st_uid = getuid(); @@ -200,7 +211,7 @@ } stbuf = g_new0(struct stat, 1); - stbuf->st_mode = S_IFREG | 0444; + stbuf->st_mode = S_IFREG | 0644; stbuf->st_nlink = 1; stbuf->st_uid = getuid(); stbuf->st_gid = getgid(); @@ -227,11 +238,10 @@ goto exit; } -static int dummyfiller(void *buf, - const char *name, - const struct stat *stbuf, - off_t off) -{ +static int +dummyfiller(void *buf, const char *name, + const struct stat *stbuf, off_t off +) { return 0; } @@ -242,57 +252,56 @@ { int ret = 0; GPCtx *p = (GPCtx *)fuse_get_context()->private_data; + struct stat *mystbuf = NULL; + gpointer value; + guint i; memset(stbuf, 0, sizeof(struct stat)); - if(strcmp(path, "/") == 0) { - stbuf->st_mode = S_IFDIR | 0555; + stbuf->st_mode = S_IFDIR | 0755; stbuf->st_nlink = 2; stbuf->st_uid = getuid(); stbuf->st_gid = getgid(); - } else { - struct stat *mystbuf = NULL; - gpointer value; - guint i; + return 0; + } - /* - * Due to the libgphoto2 api, the best way of verifying - * if a file exists is to iterate the contents of that - * directory; so if we don't know about the file already, - * turn around and call readdir on the directory and try - * again. - */ - for (i = 2; i > 0; i--) { - gchar *dir; - value = g_hash_table_lookup(p->files, path); - if (!value) { - value = g_hash_table_lookup(p->dirs, path); - } - if (value) { - mystbuf = (struct stat *)value; - break; - } - - dir = g_path_get_dirname(path); - ret = gphotofs_readdir(dir, NULL, dummyfiller, 0, NULL); - g_free(dir); - if (ret != 0) { - return ret; - } + /* + * Due to the libgphoto2 api, the best way of verifying + * if a file exists is to iterate the contents of that + * directory; so if we don't know about the file already, + * turn around and call readdir on the directory and try + * again. + */ + for (i = 2; i > 0; i--) { + gchar *dir; + value = g_hash_table_lookup(p->files, path); + if (!value) { + value = g_hash_table_lookup(p->dirs, path); } + if (value) { + mystbuf = (struct stat *)value; + break; + } - if (mystbuf) { - stbuf->st_mode = mystbuf->st_mode; - stbuf->st_nlink = mystbuf->st_nlink; - stbuf->st_uid = mystbuf->st_uid; - stbuf->st_gid = mystbuf->st_gid; - stbuf->st_size = mystbuf->st_size; - stbuf->st_blocks = mystbuf->st_blocks; - stbuf->st_mtime = mystbuf->st_mtime; - } else { - ret = -ENOENT; + dir = g_path_get_dirname(path); + ret = gphotofs_readdir(dir, NULL, dummyfiller, 0, NULL); + g_free(dir); + if (ret != 0) { + return ret; } } + + if (mystbuf) { + stbuf->st_mode = mystbuf->st_mode; + stbuf->st_nlink = mystbuf->st_nlink; + stbuf->st_uid = mystbuf->st_uid; + stbuf->st_gid = mystbuf->st_gid; + stbuf->st_size = mystbuf->st_size; + stbuf->st_blocks = mystbuf->st_blocks; + stbuf->st_mtime = mystbuf->st_mtime; + } else { + ret = -ENOENT; + } return ret; } @@ -303,35 +312,59 @@ GPCtx *p = (GPCtx *)fuse_get_context()->private_data; OpenFile *openFile; - if((fi->flags & 3) != O_RDONLY) { - return -EACCES; - } - openFile = g_hash_table_lookup(p->reads, path); - if (!openFile) { - gchar *dir = g_path_get_dirname(path); - gchar *file = g_path_get_basename(path); - CameraFile *cFile; - int ret; + if ((fi->flags & 3) == O_RDONLY) { + openFile = g_hash_table_lookup(p->reads, path); + if (!openFile) { + gchar *dir = g_path_get_dirname(path); + gchar *file = g_path_get_basename(path); + CameraFile *cFile; + int ret; - gp_file_new(&cFile); - ret = gp_camera_file_get(p->camera, dir, file, GP_FILE_TYPE_NORMAL, - cFile, p->context); - g_free(file); - g_free(dir); + gp_file_new(&cFile); + ret = gp_camera_file_get(p->camera, dir, file, GP_FILE_TYPE_NORMAL, + cFile, p->context); + g_free(file); + g_free(dir); - if (ret != 0) { - return gpresultToErrno(ret); + if (ret != 0) { + gp_file_unref (cFile); + return gpresultToErrno(ret); + } + + openFile = g_new0(OpenFile, 1); + openFile->file = cFile; + openFile->count = 1; + g_hash_table_replace(p->reads, g_strdup(path), openFile); + } else { + openFile->count++; } + } else if ((fi->flags & 3) == O_WRONLY) { + openFile = g_hash_table_lookup(p->writes, path); + if (!openFile) { + gchar *dir = g_path_get_dirname(path); + gchar *file = g_path_get_basename(path); - openFile = g_new0(OpenFile, 1); - openFile->file = cFile; - openFile->count = 1; - g_hash_table_replace(p->reads, g_strdup(path), openFile); + openFile = g_new0(OpenFile, 1); + openFile->file = NULL; + openFile->count = 1; + openFile->size = 0; + openFile->writing = 1; + openFile->destdir = g_strdup(dir); + openFile->destname = g_strdup(file); + + openFile->buf = malloc(1); + if (!openFile->buf) return -1; + g_hash_table_replace(p->writes, g_strdup(path), openFile); + + g_free(dir); + g_free(file); + } else { + openFile->count++; + } } else { - openFile->count++; + return -1; } - return 0; } @@ -367,57 +400,31 @@ return ret; } -static int -gphotofs_release(const char *path, - struct fuse_file_info *fi) -{ - GPCtx *p = (GPCtx *)fuse_get_context()->private_data; - OpenFile *openFile = g_hash_table_lookup(p->reads, path); - if (openFile) { - openFile->count--; - if (openFile->count == 0) { - g_hash_table_remove(p->reads, path); - } - } +/* ================================================================================== */ - return 0; -} static int -gphotofs_unlink(const char *path) +gphotofs_write(const char *path, const char *wbuf, size_t size, + off_t offset, struct fuse_file_info *fi) { GPCtx *p = (GPCtx *)fuse_get_context()->private_data; - gchar *dir = g_path_get_dirname(path); - gchar *file = g_path_get_basename(path); - int ret = 0; + OpenFile *openFile = g_hash_table_lookup (p->writes, path); - /* Don't allow deletion of open files. */ - if (g_hash_table_lookup(p->reads, path)) { - ret = -EBUSY; - goto exit; + if (!openFile) + return -1; + if (offset + size > openFile->size) { + openFile->size = offset + size; + openFile->buf = realloc (openFile->buf, openFile->size); } - - ret = gp_camera_file_delete(p->camera, dir, file, p->context); - if (ret != 0) { - ret = gpresultToErrno(ret); - goto exit; - } - - g_hash_table_remove(p->files, path); - - exit: - g_free(dir); - g_free(file); - - return ret; - + memcpy(openFile->buf+offset, wbuf, size); + return size; } -static int gphotofs_mkdir(const char *path, mode_t mode) +static int +gphotofs_mkdir(const char *path, mode_t mode) { int ret = 0; - GPCtx *p = (GPCtx *)fuse_get_context()->private_data; gchar *dir = g_path_get_dirname(path); gchar *file = g_path_get_basename(path); @@ -443,7 +450,8 @@ return ret; } -static int gphotofs_rmdir(const char *path) +static int +gphotofs_rmdir(const char *path) { int ret = 0; @@ -455,26 +463,196 @@ if (ret != 0) { ret = gpresultToErrno(ret); } - g_hash_table_remove(p->dirs, path); - g_free(dir); g_free(file); - return ret; } +static int +gphotofs_mknod(const char *path, mode_t mode, dev_t rdev) +{ + GPCtx *p = (GPCtx *)fuse_get_context()->private_data; + gchar *dir = g_path_get_dirname(path); + gchar *file = g_path_get_basename(path); + char *data; + int res; + CameraFile *cfile; + gp_file_new (&cfile); + data = malloc(1); + data[0] = 'c'; + res = gp_file_set_data_and_size (cfile, data, 1); + if (res < 0) { + gp_file_unref (cfile); + return -1; + } + res = gp_file_set_name (cfile, file); + if (res < 0) { + gp_file_unref (cfile); + return -1; + } + res = gp_camera_folder_put_file (p->camera, dir, cfile, + p->context); + gp_file_unref (cfile); + g_free(dir); + g_free(file); + return 0; +} + + +static int gphotofs_flush(const char *path, struct fuse_file_info *fi) +{ + GPCtx *p = (GPCtx *)fuse_get_context()->private_data; + OpenFile *openFile = g_hash_table_lookup(p->writes, path); + + if (!openFile) + return 0; + if (openFile->writing) { + int res; + CameraFile *file; + char *data; + gp_file_new (&file); + data = malloc (openFile->size); + if (!data) + return -ENOMEM; + memcpy (data, openFile->buf, openFile->size); + /* The call below takes over responsbility of freeing data. */ + res = gp_file_set_data_and_size (file, data, openFile->size); + if (res < 0) { + gp_file_unref (file); + return -1; + } + res = gp_file_set_name (file, openFile->destname); + if (res < 0) { + gp_file_unref (file); + return -1; + } + res = gp_camera_file_delete(p->camera, openFile->destdir, openFile->destname, p->context); + res = gp_camera_folder_put_file (p->camera, openFile->destdir, file, p->context); + if (res < 0) + return -ENOSPC; + gp_file_unref (file); + } + return 0; +} + +static int gphotofs_fsync(const char *path, int isdatasync, + struct fuse_file_info *fi) +{ + (void) isdatasync; + return gphotofs_flush(path, fi); +} + + + +static int gphotofs_chmod(const char *path, mode_t mode) +{ + return 0; +} + +static int gphotofs_chown(const char *path, uid_t uid, gid_t gid) +{ + return 0; +} + +static int +gphotofs_release(const char *path, + struct fuse_file_info *fi) +{ + GPCtx *p = (GPCtx *)fuse_get_context()->private_data; + OpenFile *openFile = g_hash_table_lookup(p->reads, path); + + if (!openFile) openFile = g_hash_table_lookup(p->writes, path); + + if (openFile) { + openFile->count--; + if (openFile->count == 0) { + if (openFile->writing) { + free (openFile->buf); + g_hash_table_remove(p->writes, path); + } else { + g_hash_table_remove(p->reads, path); + } + } + } + + return 0; +} + +static int +gphotofs_unlink(const char *path) +{ + GPCtx *p = (GPCtx *)fuse_get_context()->private_data; + gchar *dir = g_path_get_dirname(path); + gchar *file = g_path_get_basename(path); + int ret = 0; + + /* Don't allow deletion of open files. */ + if (g_hash_table_lookup(p->reads, path)) { + ret = -EBUSY; + goto exit; + } + + ret = gp_camera_file_delete(p->camera, dir, file, p->context); + if (ret != 0) { + ret = gpresultToErrno(ret); + goto exit; + } + + g_hash_table_remove(p->files, path); + + exit: + g_free(dir); + g_free(file); + + return ret; + +} + +static void +#ifdef __GNUC__ + __attribute__((__format__(printf,3,0))) +#endif +debug_func (GPLogLevel level, const char *domain, const char *format, + va_list args, void *data) +{ + struct timeval tv; + long sec, usec; + FILE *logfile = data; + + gettimeofday (&tv,NULL); + sec = tv.tv_sec - glob_tv_zero.tv_sec; + usec = tv.tv_usec - glob_tv_zero.tv_usec; + if (usec < 0) {sec--; usec += 1000000L;} + fprintf (logfile, "%li.%06li %s(%i): ", sec, usec, domain, level); + vfprintf (logfile, format, args); + fputc ('\n', logfile); +} + static void * gphotofs_init(void) { int ret = GP_OK; GPCtx *p = g_new0(GPCtx, 1); +#if 0 /* enable for debugging */ + int fd = -1; + FILE *f = NULL; + + fd = open("/tmp/gpfs.log",O_WRONLY|O_CREAT|O_EXCL,0600); + if (fd != -1) { + f = fdopen(fd,"a"); + if (f) + p->debug_func_id = gp_log_add_func (GP_LOG_ALL, debug_func, (void *) f); + } +#endif + p->context = gp_context_new(); + gettimeofday (&glob_tv_zero, NULL); - gp_camera_new(&p->camera); + gp_camera_new (&p->camera); gp_abilities_list_new(&p->abilities); gp_abilities_list_load(p->abilities, p->context); @@ -576,6 +754,8 @@ g_free, g_free); p->reads = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GDestroyNotify)freeOpenFile); + p->writes = g_hash_table_new_full(g_str_hash, g_str_equal, + g_free, (GDestroyNotify)freeOpenFile); return p; @@ -630,13 +810,19 @@ .release = gphotofs_release, .unlink = gphotofs_unlink, + .write = gphotofs_write, .mkdir = gphotofs_mkdir, .rmdir = gphotofs_rmdir, + .mknod = gphotofs_mknod, + .flush = gphotofs_flush, + .fsync = gphotofs_fsync, + + .chmod = gphotofs_chmod, + .chown = gphotofs_chown, }; static GOptionEntry options[] = { - { "debug", 0, 0, G_OPTION_ARG_NONE, &sDebug, N_("Enable debug"), NULL }, { "port", 0, 0, G_OPTION_ARG_STRING, &sPort, N_("Specify port device"), "path" }, { "speed", 0, 0, G_OPTION_ARG_INT, &sSpeed, N_("Specify serial transfer speed"), "speed" }, { "camera", 0, 0, G_OPTION_ARG_STRING, &sModel, N_("Specify camera model"), "model" }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <marcusmeissner@us...> - 2007-01-15 14:34:23
|
Revision: 9884 http://svn.sourceforge.net/gphoto/?rev=9884&view=rev Author: marcusmeissner Date: 2007-01-14 01:36:12 -0800 (Sun, 14 Jan 2007) Log Message: ----------- added some Nikon D80 specific. Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/config.c trunk/libgphoto2/camlibs/ptp2/ptp.h Modified: trunk/libgphoto2/camlibs/ptp2/config.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/config.c 2007-01-13 17:26:41 UTC (rev 9883) +++ trunk/libgphoto2/camlibs/ptp2/config.c 2007-01-14 09:36:12 UTC (rev 9884) @@ -586,11 +586,13 @@ /* Everything is camera specific. */ static struct deviceproptableu8 compression[] = { - { N_("JPEG Basic"), 0x00, PTP_VENDOR_NIKON }, - { N_("JPEG Normal"), 0x01, PTP_VENDOR_NIKON }, - { N_("JPEG Fine"), 0x02, PTP_VENDOR_NIKON }, - { N_("NEF (Raw)"), 0x04, PTP_VENDOR_NIKON }, - { N_("NEF+BASIC"), 0x05, PTP_VENDOR_NIKON }, + { N_("JPEG Basic"), 0x00, PTP_VENDOR_NIKON }, + { N_("JPEG Normal"), 0x01, PTP_VENDOR_NIKON }, + { N_("JPEG Fine"), 0x02, PTP_VENDOR_NIKON }, + { N_("NEF (Raw)"), 0x03, PTP_VENDOR_NIKON }, + { N_("NEF+Basic"), 0x04, PTP_VENDOR_NIKON }, + { N_("NEF+Normal"), 0x05, PTP_VENDOR_NIKON }, + { N_("NEF+Fine"), 0x06, PTP_VENDOR_NIKON }, }; GENERIC8TABLE(Compression,compression) @@ -1375,6 +1377,7 @@ { N_("Automatic Macro"),0x0003, 0 }, { N_("AF-S"), 0x8010, PTP_VENDOR_NIKON }, { N_("AF-C"), 0x8011, PTP_VENDOR_NIKON }, + { N_("AF-A"), 0x8012, PTP_VENDOR_NIKON }, }; GENERIC16TABLE(FocusMode,focusmodes) Modified: trunk/libgphoto2/camlibs/ptp2/ptp.h =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.h 2007-01-13 17:26:41 UTC (rev 9883) +++ trunk/libgphoto2/camlibs/ptp2/ptp.h 2007-01-14 09:36:12 UTC (rev 9884) @@ -57,6 +57,9 @@ * implementations seem to have chosen this value, which also * happens to be the size of an USB 2.0 HS endpoint, even though * this is not necessary. + * + * Previously we had this as 4096 for MTP devices. We have found + * and fixed the bugs that made this necessary and it can be 512 again. */ #define PTP_USB_BULK_HS_MAX_PACKET_LEN 512 #define PTP_USB_BULK_HDR_LEN (2*sizeof(uint32_t)+2*sizeof(uint16_t)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |