summaryrefslogtreecommitdiff
path: root/libcheese
AgeCommit message (Collapse)AuthorFilesLines
2013-09-17cheese_camera_get_camera_devices: Allow calling before cheese_camera_setup()Hans de Goede1-4/+5
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-09-16Fix video recording with GStreamer >= 1.1.4Hans de Goede1-3/+11
GStreamer >= 1.1.4 requires fully specifying the video-capture-source caps, otherwise Cheese prints this: (cheese:22606): cheese-WARNING **: Filter caps do not completely specify the output format: gstcapsfilter.c(348): gst_capsfilter_prepare_buf (): /GstCameraBin:camerabin/GstCapsFilter:videobin-capsfilter: Output caps are unfixed: video/x-raw, framerate=(fraction)30/1, width=(int)640, height=(int)480, format=(string){ YUY2, YV12, BGR, RGB, I420 }, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive and video-recording is broken. Fixes bug 707391. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-09-02Fix memory leak when freeing video formatsHans de Goede1-3/+2
Free the GList, as well as the video formats in the list. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-09-02Improve cheese_camera_device_get_best_format()Hans de Goede1-7/+27
If a camera device which can do 1600x900 at 10 FPS and 1280x800 @ 25 FPS, then 1600x900 is not really the best format, as 10 FPS leads to a bad user experience. Improve the situation by constraining cheese_camera_device_get_best_format() to return the format with the highest resolution with a width greater than 640 pixels and a framerate of greater the 15 FPS. If no mode matching the widh >= 640 && frame_rate >= 15 criteria is found, get_best_format will behave as before as simply return the highest resolution mode. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-09-02Limit caps to the maximum framerateHans de Goede1-13/+37
Limit the caps returned by cheese_camera_device_get_caps_for_format() to the maximum framerate supported at the requested resolution. This is necessary because GStreamer first selects a format and then a framerate, resulting in it picking for 1280x720 as an example, YUYV @ 15 FPS, instead of MJPEG @ 30 FPS (which will be converted to i420 by the videoconvert element in camerabin2), or at 1600x1200 YUYV @ 5 fps instead of MJPEG @ 10 fps. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-09-02Add cheese_camera_device_find_full_format() helperHans de Goede1-11/+35
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-09-02Keep track of highest available camera frameratesHans de Goede1-20/+155
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-06-30Mark cheese_[gtk_]init() arguments as allow-noneDavid King2-4/+4
It is reasonable to pass NULL for argc and argv.
2013-06-30um-crop-area.c: Relicense to GPLv2+Matthias Clasen1-1/+1
This makes the file fit in better with the rest of Cheese, license-wise. https://bugzilla.gnome.org/show_bug.cgi?id=703239
2013-06-27Handle NULL state errors in CheeseAvatarChooserDavid King1-2/+29
Fixes remainder of bug 703123.
2013-06-26Show an error message if the camera state is NULLDavid King1-2/+5
If there is a GST_MESSAGE_ERROR, stop the stream and emit ::state-flags-changed on the CheeseCamera. Handle the state change in CheeseWindow by showing a generic error message. This message can easily occur if the video device is busy, such as when another application is using the webcam. Fixes bug 703123.
2013-06-24Fix being paused when effect valves are closedHans de Goede1-1/+2
The move to autocluttersink in 3.9 causes a regression compared to 3.8, where if an effect's control valve is closed the pipeline will never transition from paused to playing since the cluttersink is stuck in paused. This regression can be triggered the following way: 1) Go the effect selector 2) Go to the next page in the effect selector, so that the now connected effects from the first page get their control valve set to closed 3) Change resolution or device, so that the pipeline gets stopped and started again After 3) the pipeline will be stuck in pause, as the cluttersinks of the effect previews are stuck in pause. The cause for this is that with the move to autocluttersink we are no longer setting the sink's "async" property, see commit 424afdaa 'Use "autocluttersink" instead of "cluttersink"'. Setting the "async" property is no longer (easily) doable, since autocluttersink is a gstbin derived object which has the actual sink embedded. Instead this patch fixes the stuck in pause problem by locking the autocluttersinks of the effect previews into the playing state. Note that no longer setting of the async property on the sink is also the root cause of the issue fixed by my patch titled: "Set all valves open on play". The opening of the main valve is still necessary, since locking the viewfinder sink's state to PLAYING does not seem a good idea, the opening of the effects-valve on play OTOH is no longer necessary. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-06-24Set all valves open on playHans de Goede1-0/+8
If some valves are closed on play, GStreamer will wait for the valves to open before moving from paused to playing, and a frozen image is shown. This does not happen on startup since on startup all valves are open, nor does it happen when changing video-format directly after startup, since all valves will still be open. As soon as cheese_camera_toggle_effects_pipeline() has been called once, any subsequent attempt to change the video format (and thus stopping and re-starting the pipeline) will result in a frozen image. This patch fixes this by opening all valves on play, and calling cheese_camera_toggle_effects_pipeline() with the last active value after the pipeline transitions to the playing state. This has the added advantage that unlike before the effects valve will be closed on startup, rather then staying open till the first call to cheese_camera_toggle_effects_pipeline(). Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-06-24Avoid setting the same effect againHans de Goede1-1/+17
Check for the current effect being the same as the one set and if so, ignore the change. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-06-17Add documentation for CheeseCamera signalsDavid King1-0/+2
Add documentation for extra parameters on CheeseCamera signals to avoid a warning.
2013-06-16Make the flash background whiteHans de Goede1-19/+5
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-06-16Downscale image for effects-preview pipelineHans de Goede1-8/+35
Having the whole effects-preview bin deal with ie 1280x800 images is not very useful, especially since even when fullscreen on a full-HD monitor, the preview images are smaller then 640xXXX. This useless high-res processing for 9 preview images in parallel brings my 2nd gen core i5 @ 3.1 GHz to its knees, resulting in a non fluid preview panel. Also after clicking through all effect preview pages, so that all effect preview textures are connected, cheese will use 1 GB of *resident* RAM with the example 1280x800 capture resolution. This patch improves this by downscaling the images from the video-source to 640xXXX where XXX is determined by the original resolution aspect-ratio. After this patch the effects preview framerate is much smoother, and the latency is noticably less. As a bonus the maximal resident size of Cheese in this example is reduced to 350 MB. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-06-16Do not block the main valve while recordingHans de Goede1-1/+2
Otherwise frames intended for the recording are dropped. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-06-16Only add videoconvert elements where necessaryHans de Goede1-1/+4
The "no effect" effect is our default value, and thus worth optimizing a bit. Clearly in the "no effect" effect case adding a videoconvert element both before and after the element is not needed. Note we also don't add the videoconvert elements when creating the initial pipeline, so this also keeps the way the pipeline looks initially and when "no-effect" is selected consistent. When starting Cheese with "no-effect" selected, this shaves off another 130 ms of the initial pipeline creation time. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-06-16Drop unused preview_caps variableHans de Goede1-2/+0
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-06-16Simplify returned GstCapsHans de Goede1-0/+1
In cheese_camera_device_get_caps_for_format, simplify the returned caps. This results in much simpler caps, which as main advantage that they are way easier to read when trawling to debug logs. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-06-16Fix cheese_camera_device_get_best_format memleakHans de Goede1-3/+4
cheese_camera_device_get_best_format() calls cheese_camera_device_get_format_list(), which returns a sorted copy of the format lists, then takes the first element of that list, and returns a copy of that element. While never freeing the list copy. This patch fixes this leak by simply making the priv->formats list sorted so that cheese_camera_device_get_best_format can use it directly without the need to make (and then later free) a copy. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-06-16Fix cheese_camera_device_filter_caps warningHans de Goede1-1/+1
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-06-16Remove unused GstCameraBinFlags enumHans de Goede1-12/+0
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-06-16Fix video-source memleak when switching camerasHans de Goede1-0/+3
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-06-16Improve error handling in CheeseCameraHans de Goede1-6/+2
Simplify error cleanup in cheese_camera_set_camera_source(). Do not call g_error_free() on a possible NULL error in cheese_camera_element_from_effect(). Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-06-16Fix no-video-after-switching-resolution problemHans de Goede1-2/+2
There is a bug in wrappercamerabinsrc which causes it to lose its video-source setting after the pipeline has started, so on a stop/re-start, as when changing resolution, its video-source has become NULL, and there is no longer video. This patch works around this by moving the setting of the video-source property to cheese_camera_play(), so that it gets (re)set each time before starting the pipeline. I've also written a patch fixing the underlying cause, but since the workaround is simple, and has no adverse effects when the underlying issue is fixed, it seems a good idea to have this workaround in Cheese, see here for the gst-plugins-bad fix: https://bugzilla.gnome.org/show_bug.cgi?id=701915 Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-06-16Remove extranous csp_post_balance elementHans de Goede1-12/+7
camerabin2 already has a videoconvert element both before and after its video-source-filter element, so ending the video-source-filter bin with a videoconvert element puts 2 videoconvert elements behind each other, which is not really useful. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-06-16Add a capsfilter to the video-source binHans de Goede1-2/+4
This serves 2 purposes. Firstly, it forces GStreamer to actually run the video source at the configured resolution, rather then say run it at 1600x1200 @ 5 fps and downscale that to 800x600 (still at 5 fps), as GStreamer opts to do with my Logitech Webcam Pro 9000, when left to its own auto negotiate code. Secondly, by greatly reducing the amount of advertised caps (this cam supports lots of different resolutions at many different framerates per resolution), it avoids a caps intersect "explosion", reducing the pipeline caps negotiation. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-05-29Avoid assert when taking avatar photos too quicklyDavid King1-0/+2
If the take photo button was pressed while a photo was being taken, an assert would be triggered by the failed call to cheese_camera_take_photo_pixbuf(). Avoid this by setting the take photo button insensitive while a photo is being taken, and setting it sensitive after the photo has been taken. Fixes bug 699596.
2013-04-20Use "autocluttersink" instead of "cluttersink"David King1-6/+12
2013-04-20Use clutter_actor_set_background_colorDavid King1-1/+1
Instead of the deprecated cltuter_stage_set_color, use clutter_actor_set_background_color.
2013-04-20Use clutter_actor_add_childDavid King1-1/+1
Instead of using the deprecated clutter_container_add_actor, use clutter_actor_add_child.
2013-04-09cheese-camera: Fix creation of effects previewsLuciana Fujii Pontello1-1/+1
Since many previews are created, with many cluttersinks, we can't name the cluttersinks all the same. Passing NULL as the name of the element will let gstreamer choose the name.
2013-04-09libcheese: Fix deprecated clutter sink creationLuciana Fujii Pontello1-3/+4
Create cluttersink with element_factory_make.
2013-03-11Improve more translatable strings, bug 695459David King1-2/+2
Disambiguate the "Take a photo" string further.
2012-10-30Return NULL rather than a const empty stringDavid King1-1/+1
Fix bug 687042 and bug 687123 by returning NULL from cheese_camera_get_recorded_time() rather than a const empty string. The returned NULL can be safely freed with g_free(), whereas freeing the const string is undefined and leads to a crash with glibc.
2012-09-03Move variable declarations before code in C sourceDavid King1-2/+2
This allows compilation to succeed with ‘-Werror=declaration-after-statement’ passed to GCC.
2012-09-03Fix comment about preset locationsBastien Nocera1-1/+1
Update for new location in GStreamer 1.0. https://bugzilla.gnome.org/show_bug.cgi?id=680422
2012-09-03Update to the new pad template nameThiago Santos1-1/+1
2012-09-03Rename ffmpegcolorspace to videoconvertThiago Santos1-4/+4
The element was renamed in GStreamer 1.0.
2012-09-03Update raw caps to new formatThiago Santos2-5/+3
There is no video/x-raw-yuv or -rgb, they are both now video/x-raw with a format field.
2012-09-03Update to GStreamer 1.0 APIThiago Santos2-17/+22
2012-09-03Rename camerabin2 to camerabinThiago Santos1-5/+5
camerabin2 was renamed to camerabin in GStreamer 1.0.
2012-09-03Do not set filter-caps property on camerabin2Luciana Fujii Pontello1-5/+1
The "filter-caps" property doesn't exist on camerabin2.
2012-09-03Re-add GstCaps variable in CheeseCameraLuciana Fujii Pontello1-0/+1
caps variable was removed during rebase, but it is still used.
2012-09-03Fix CheeseCamera recording time reportingThiago Santos1-29/+30
Camerabin2 maintains its pipeline clock continuously running, this makes the time reporting for video recording actually report the time since camerabin2 was initialized. This patch fixes it by querying the video filesink for the correct recording time.
2012-09-03Encode WebM/VP8 instead of OGG/TheoraOleksij Rempel (Alexey Fisher)1-27/+54
Create WebM profile and use it with camereabin2. Also use presets for vp8enc.
2012-09-03Stop-capture is asynchronous in camerabin2Thiago Santos1-2/+5
Wait for video-done message to signal that capture is over.
2012-09-03Image-done message is posted by camerabin2Thiago Santos1-0/+4
Camerabin2 is the element to post the image-done message, not the camera source.