[Bug 174586] New: Loading video from camera consumes ll memory

classic Classic list List threaded Threaded
31 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[Bug 174586] Loading video from camera consumes ll memory

Gilles Caulier-4
https://bugs.kde.org/show_bug.cgi?id=174586





--- Comment #20 from Gilles Caulier <caulier gilles gmail com>  2009-05-13 11:59:42 ---
Well, no, because i never use PTP driver with my camera : it's too limited (No
RAW preview). I always use UMS mode.

So, we need a Canon user here to confirm...

Gilles Caulier

--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 174586] Loading video from camera consumes ll memory

Marcel Wiesweg
In reply to this post by Bugzilla from sgh@sgh.dk
https://bugs.kde.org/show_bug.cgi?id=174586





--- Comment #21 from Marcel Wiesweg <marcel wiesweg gmx de>  2009-07-05 18:15:52 ---
So, Marcus, as I understand this, to have downloading with gphoto2 scale well
with large files, we need to use the "filedescriptor based method".

What is this? Is it advisable to use? Any problems or drawbacks?

--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 174586] Loading video from camera consumes ll memory

Marcus Meissner-4
In reply to this post by Bugzilla from sgh@sgh.dk
https://bugs.kde.org/show_bug.cgi?id=174586





--- Comment #22 from Marcus Meissner <marcus jet franken de>  2009-07-05 19:04:22 ---
instead of doing

gp_file_new(&file);
... get file ...
gp_file_get_data_and_size(file,...)
gp_file_unref (file);
you do:

... open fd writeable ...
gp_file_new_from_fd(&file, fd);
... get file same as before
gp_file_unref (file);
 (no gp_file_get_data_and_size() )

The "get file" part will already write it to "fd" on the disk.

--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 174586] Loading video from camera consumes ll memory

Marcus Meissner-4
In reply to this post by Bugzilla from sgh@sgh.dk
https://bugs.kde.org/show_bug.cgi?id=174586





--- Comment #23 from Marcus Meissner <marcus jet franken de>  2009-07-05 19:05:15 ---
drawbacks ... hmm, not so much. needs libgphoto2 2.4.0 or newer, but this is
the case for all distros these days.

--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 174586] Loading video from camera consumes ll memory

Marcel Wiesweg
In reply to this post by Bugzilla from sgh@sgh.dk
https://bugs.kde.org/show_bug.cgi?id=174586





--- Comment #24 from Marcel Wiesweg <marcel wiesweg gmx de>  2009-07-12 17:59:00 ---
We are currently using gp_file_save but reading the header file this is
considered deprecated. I guess new_from_fd is the best choice then.

--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 174586] Loading video from camera consumes ll memory

Marcel Wiesweg
In reply to this post by Bugzilla from sgh@sgh.dk
https://bugs.kde.org/show_bug.cgi?id=174586





--- Comment #25 from Marcel Wiesweg <marcel wiesweg gmx de>  2009-07-12 18:50:42 ---
Created an attachment (id=35254)
 --> (http://bugs.kde.org/attachment.cgi?id=35254)
gp_file_new_from_fd

See the attached patch. I switched my camera to PTP mode and managed to load
the a few pictures but I get errors for about every second image (see error
printout below). I dont know if this is due to my patch or any other problem
because I never used the PTP mode of my camera.
Anyone here to test the patch with an established testing environment for
gphoto2?
Marcus, do you know what may cause this error in my patch from
gp_camera_file_get()?

printGphotoErrorDescription: Libgphoto2 error:  I/O-Problem  ( -7 )

--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 174586] Loading video from camera consumes ll memory

Marcus Meissner-4
In reply to this post by Bugzilla from sgh@sgh.dk
https://bugs.kde.org/show_bug.cgi?id=174586





--- Comment #26 from Marcus Meissner <marcus jet franken de>  2009-07-12 21:51:38 ---
from patch:
+    errorCode = gp_file_new_from_fd(&cfile, file.handle());
+
+    if (errorCode != GP_OK)
+    {
+        kDebug(50003) << "Failed to get camera item!" << file.handle();
+        printGphotoErrorDescription(errorCode);
+        gp_file_unref(cfile);

remove the gp_file_unref(cfile) here, cfile is not initialized when errorCode
!= GP_OK.

Also QFile:handle() ... does it return the fd QFile still continues to own?

Then try using
+    errorCode = gp_file_new_from_fd(&cfile, dup(file.handle()));
instead since this call hands lifetime control of "fd" over to libgphoto2 (and
we would close fd twic otherwise).

--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 174586] Loading video from camera consumes ll memory

Marcel Wiesweg
In reply to this post by Bugzilla from sgh@sgh.dk
https://bugs.kde.org/show_bug.cgi?id=174586





--- Comment #27 from Marcel Wiesweg <marcel wiesweg gmx de>  2009-07-13 17:27:14 ---
Thanks Marcus, I was indeed messing around with file descriptors!
Now everything works with my camera.

--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 174586] Loading video from camera consumes ll memory

Marcel Wiesweg
In reply to this post by Bugzilla from sgh@sgh.dk
https://bugs.kde.org/show_bug.cgi?id=174586


Marcel Wiesweg <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED




--- Comment #28 from Marcel Wiesweg <marcel wiesweg gmx de>  2009-07-13 17:29:18 ---
SVN commit 995957 by mwiesweg:

Use the file descriptor based method to download a file with gphoto2.
This should solve problems with very large files because they can directly be
written to disk.

BUG: 174586

 M  +4 -1      NEWS  
 M  +25 -11    utilities/cameragui/gpcamera.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=995957

--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 174586] Loading video from camera consumes ll memory

Gilles Caulier-4
In reply to this post by Bugzilla from sgh@sgh.dk
https://bugs.kde.org/show_bug.cgi?id=174586


Gilles Caulier <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|0.10.0-beta1                |0.10.0




--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

[Bug 174586] Loading video from camera consumes ll memory

Gilles Caulier-4
In reply to this post by Bugzilla from sgh@sgh.dk
https://bugs.kde.org/show_bug.cgi?id=174586


Gilles Caulier <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|Camera GUI                  |Import




--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
12