After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 641918 - [Camerabin2] Allow previewing without capture
[Camerabin2] Allow previewing without capture
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal enhancement
: 0.10.23
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on: 641530
Blocks:
 
 
Reported: 2011-02-09 11:57 UTC by Thiago Sousa Santos
Modified: 2011-07-25 13:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
camerabin2: if location='' skip writting to file (1.04 KB, patch)
2011-07-22 09:23 UTC, Raluca-Elena Podiuc
needs-work Details | Review
camerabin2: add location="" docs to PORTING (843 bytes, patch)
2011-07-22 09:29 UTC, Raluca-Elena Podiuc
none Details | Review
camerabin2: If location is "" do not encode images (2.26 KB, patch)
2011-07-23 07:11 UTC, Thiago Sousa Santos
none Details | Review
camerabin2: If location is "" do not encode images (2.26 KB, patch)
2011-07-23 07:12 UTC, Thiago Sousa Santos
needs-work Details | Review
camerabin2: add location="" docs to PORTING (949 bytes, patch)
2011-07-23 07:12 UTC, Thiago Sousa Santos
none Details | Review
camerabin2: If location is NULL do not encode images (3.33 KB, patch)
2011-07-23 15:21 UTC, Thiago Sousa Santos
committed Details | Review
camerabin2: add location=NULL docs to PORTING (955 bytes, patch)
2011-07-24 15:20 UTC, Raluca-Elena Podiuc
committed Details | Review

Description Thiago Sousa Santos 2011-02-09 11:57:53 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.
Comment 1 Raluca-Elena Podiuc 2011-07-22 09:23:47 UTC
Created attachment 192440 [details] [review]
camerabin2: if location='' skip writting to file
Comment 2 Raluca-Elena Podiuc 2011-07-22 09:29:13 UTC
Created attachment 192441 [details] [review]
camerabin2: add location="" docs to PORTING
Comment 3 Thiago Sousa Santos 2011-07-23 05:02:37 UTC
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.
Comment 4 Raluca-Elena Podiuc 2011-07-23 06:42:35 UTC
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?
Comment 5 Raluca-Elena Podiuc 2011-07-23 06:43:19 UTC
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?
Comment 6 Thiago Sousa Santos 2011-07-23 07:11:55 UTC
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.
Comment 7 Thiago Sousa Santos 2011-07-23 07:12:39 UTC
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?
Comment 8 Thiago Sousa Santos 2011-07-23 07:12:51 UTC
Created attachment 192520 [details] [review]
camerabin2: add location="" docs to PORTING

Updated docs a little as well
Comment 9 Raluca-Elena Podiuc 2011-07-23 08:21:52 UTC
Yep, works for me!
Thanks thiagos!
Comment 10 Stefan Sauer (gstreamer, gtkdoc dev) 2011-07-23 10:47:42 UTC
For some reason my review comment got lost. But please use NULL instead of "".
Comment 11 Stefan Sauer (gstreamer, gtkdoc dev) 2011-07-23 10:49:13 UTC
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).
Comment 12 Thiago Sousa Santos 2011-07-23 14:44:49 UTC
(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.
Comment 13 Thiago Sousa Santos 2011-07-23 15:21:34 UTC
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 ""
Comment 14 Raluca-Elena Podiuc 2011-07-24 15:17:38 UTC
Yep, cheese/libcheese works with the new patch both when taking a picture with location==NULL and location!=NULL.
Comment 15 Raluca-Elena Podiuc 2011-07-24 15:20:39 UTC
Created attachment 192558 [details] [review]
camerabin2: add location=NULL docs to PORTING
Comment 16 Thiago Sousa Santos 2011-07-25 13:36:37 UTC
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