GNOME Bugzilla – Bug 641918
[Camerabin2] Allow previewing without capture
Last modified: 2011-07-25 13:37:05 UTC
+++ This bug was initially created as a clone of Bug #641530 +++ camerabin2 should allow previewing images to be posted on the bus without encoding the captured image ( is this useful for video? ) Useful for applications that want the captures in memory instead of in disk. Cheese uses this and camerabin now supports it.
Created attachment 192440 [details] [review] camerabin2: if location='' skip writting to file
Created attachment 192441 [details] [review] camerabin2: add location="" docs to PORTING
Review of attachment 192440 [details] [review]: This patch isn't quite correct as it will cause an wrong-state error for the source element when it pushes its buffer on the image source pad.
I don't see any errors while running this through cheese-tests-chooser. You can compile cheese from git@github.com:raluca-elena/cheese.git branch "camerabin2". Run tests/cheese-test-chooser which uses location="". When I run it I don't see anything bad happening. Could you tell me how to trigger the wrong-state error?
Another approach I'm thinking of (didn't actually write it yet) is adding a valve somewhere in the image pipeline and: - when the location=="" set the valve's drop=true - when the location!="" set the valve's drop=false Do you think this is better?
Created attachment 192518 [details] [review] camerabin2: If location is "" do not encode images Using an empty string for location means that the application doesn't want the image to be encoded, but wants to receive the preview image. Useful for application that want the capture in memory only, like displaying to the user before it choses to encode or take another picture in avatar capturing scenarios.
Created attachment 192519 [details] [review] camerabin2: If location is "" do not encode images Raluca, could you please check that this improved patch works for you?
Created attachment 192520 [details] [review] camerabin2: add location="" docs to PORTING Updated docs a little as well
Yep, works for me! Thanks thiagos!
For some reason my review comment got lost. But please use NULL instead of "".
Review of attachment 192519 [details] [review]: ::: gst/camerabin2/gstcamerabin2.c @@ +997,3 @@ } + if (strcmp ("", location) == 0) { if (!location) { Setting the location to an empty string is weird (it would even to a strcpy).
(In reply to comment #10) > For some reason my review comment got lost. But please use NULL instead of "". I thought about this, but for some reason we used "" in camerabin1, so I decided to go with that here as well. But for me it is ok, I'll update the patch and push.
Created attachment 192528 [details] [review] camerabin2: If location is NULL do not encode images Could you please test this again? Now it uses NULL instead of ""
Yep, cheese/libcheese works with the new patch both when taking a picture with location==NULL and location!=NULL.
Created attachment 192558 [details] [review] camerabin2: add location=NULL docs to PORTING
Thanks, just pushed them. commit b50d50a9c2e4061e027a7e476801319940e3c915 Author: Raluca Elena Podiuc <ralucaelena1985@gmail.com> Date: Fri Jul 22 12:26:07 2011 +0300 commit a34ea4aaae4e4df5535b8327c7d26e732e6769f5 Author: Thiago Santos <thiago.sousa.santos@collabora.co.uk> Date: Fri Jul 22 11:38:30 2011 +0300