summaryrefslogtreecommitdiff
path: root/gst/camerabin2/gstwrappercamerabinsrc.c
Commit message (Collapse)AuthorAgeFilesLines
* Use gst_element_request_pad_simple...François Laignel2021-05-051-2/+2
| | | | | | Instead of the deprecated gst_element_get_request_pad. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2180>
* gst-plugins: allow per feature registrationStéphane Cerveau2021-04-111-7/+2
| | | | | | | | | | | | | Split plugin into features including dynamic types which can be indiviually registered during a static build. More details here: https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/199 https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/661 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2110>
* documentation: fixed a heap o' typosAaron Boxer2019-11-051-4/+4
|
* docs: Port all docstring to gtk-doc markdownThibault Saunier2017-04-121-0/+1
|
* bad: use new gst_element_class_add_static_pad_template()Vineeth TM2016-03-241-6/+5
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=763081
* camerabin2: Fix string typoAnders Jonsson2015-08-051-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=753241
* wrappercamerabinsrc: handle when source creation failThiago Santos2015-05-011-3/+8
| | | | | Remember to set the source to NULL state as adding it to the pipeline will set it to the READY state.
* wrappercamerabinsrc: fix element linking orderThiago Santos2015-05-011-6/+3
| | | | | Video source should be linked to videocrop and not to videoconvert as it is done in the main linking path
* wrappercamerabinsrc: remove unused codeThiago Santos2015-04-271-23/+1
| | | | The structure is created and never used anymore. Remove it.
* wrappercamerabinsrc: use digitalzoom elementThiago Santos2015-04-271-84/+13
| | | | | | | Replace videocrop ! videoscale ! capsfilter with the digitalzoom bin that has the same pipeline internally and already updates the capsfilter automatically when caps change, removing this code from wrappercamerabinsrc and making it cleaner.
* wrappercamerabinsrc: Rework cropping for zoom and dimension reductionThiago Santos2015-04-241-37/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wrappercamerabinsrc has a videocrop element to be used for zooming and for cropping when input caps is different when used with the GstPhotography interface. The zooming part needs the following elements: capsfilter ! videocrop ! videoscale ! capsfilter The capsfilters should always have the same caps to ensure the zooming is done and preserves dimensions, unless when it is needed to do more cropping due to input dimensions those caps need to be modified accordingly to preserve the output dimensions. This, however, makes it hard to get caps negotiation to work properly as we need to have different caps in the capsfilters to account for the extra cropping needed. It could be simple for fixed caps but it gets tricky with unfixed ones. To solve this, this patch splits the zooming and dimension reduction cropping into 2 separate videocrop elements. The first one does the dimension cropping, which is only needed when the GstPhotography API is used and the source provides a caps that is different than what is requested, while the second is dedicated to zoom crop only. The first part of the pipeline goes from: src ! videoconvert ! capsfilter ! videocrop ! videoscale ! capsfilter to src ! videocrop ! videoconvert ! capsfilter ! videocrop ! videoscale ! capsfilter It might add an extra overhead in the image capture as the image might need to be cropped twice but this can be solved by enabling videocrop to use crop metas so only the later one does the real cropping. It also makes the code a bit simpler.
* wrappercamerabinsrc: remove obsolete commentThiago Santos2015-04-241-3/+0
| | | | | This is already handled in another place and doesn't make sense in the function context anymore
* wrappercamerabinsrc: error out if source fails to prepare for captureThiago Santos2015-04-241-3/+6
| | | | | Post an error when preparing the image capture through photography interface fails
* wrappercamerabinsrc: intersect instead of compare for equalityThiago Santos2015-04-241-1/+1
| | | | | Intersect is enough to check if the requested caps are compatible with what the source is going to provide. Equality will be too strict.
* wrappercamerabinsrc: fix typoThiago Santos2015-04-241-1/+1
|
* wrappercamerabinsrc: Reset zoom element caps to go to viewfinder modeThiago Santos2015-04-211-0/+5
| | | | | Avoids not-negotiated failures related to using image capture caps still when adjusting to go back to viewfinder.
* wrappercamerabinsrc: fix leak of drain queryThiago Santos2015-04-211-1/+4
| | | | gst_pad_peer_query doesn't take ownership of the query object
* wrappercamerabinsrc: Refactor internal pipelineThiago Santos2015-04-211-151/+124
| | | | | | | | | | | Remove tee and output-selector and just link the source pad to the outputs we want as needed. The way we need to prioritize caps negotiation and allocation queries depending on the mode enabled is too custom to be handled using tee and output-selector. This provides more flexibility and doesn't get in the way of proper handling of negotiation and allocation queries.
* wrappercamerabinsrc: remove unused attribute and related pad probeThiago Santos2015-04-101-32/+0
| | | | | The variable was never set to true and can be removed along with the probe in which it used to act
* wrappercamerabinsrc: fix pad leakThiago Santos2015-03-141-2/+2
| | | | | Only get the pad if it is really going to be used to avoid leaking it
* camerabin2: check negotiated caps avoid reseting of the pipeOleksij Rempel2015-03-041-15/+39
| | | | | | | | | | To avoid useless renegotiation of the pipe we can check for negotiated caps on src_filter and compare it with requested filter. If the caps intersect, avoid restart. Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net> https://bugzilla.gnome.org/show_bug.cgi?id=672610
* wrappercamerabinsrc: fix deadlock with pad object lockThiago Santos2015-01-051-1/+1
| | | | | | | | The image capture mutex and the pad object lock would cause a race if the pad query was made right when the image probe was running. The image probe needs the capture mutex and the querying would need the pad object lock.
* wrappercamerabinsrc: simplify weird if/else clauseThiago Santos2015-01-051-13/+12
| | | | | It is not an if/else situation but an if error abort otherwise just continue. Remove else to make it more readable
* wrappercamerabinsrc: do not set source state with lockThiago Santos2014-12-261-3/+6
| | | | | | | | | It might be racy with the image probe thread as it uses the capture mutex just like the start-capture handler from camerabin. The start-capture would be waiting for the source's streaming thread to stop to be able to set the source state to ready while the probe would be blocked waiting to acquire the capture mutex. It causes a deadlock.
* wrappercamerabinsrc: use the drain query instead of flushThiago Santos2014-12-261-6/+4
| | | | | | The flush might clear any pending captures that are still in queues being processed while the drain query will wait for those to be properly done
* gst: remove unnecessary GLIB_DISABLE_DEPRECATION_WARNINGSVineeth T M2014-10-021-4/+0
| | | | | | | | There are unnecessary definitions for disabling deprecation warnings. Since GLIB_DISABLE_DEPRECATION_WARNINGS is not needed anymore in these files, removing the same. https://bugzilla.gnome.org/show_bug.cgi?id=737559
* camerabin2: removed redundant initializationSanjay NM2014-09-181-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=736853
* wrappercamerabinsrc: Unref elements after usageSebastian Rasmussen2014-08-101-1/+10
| | | | | | | gst_bin_get_by_name() and gst_bin_get_by_interface() both return references to elements that need to be unreferenced after usage. https://bugzilla.gnome.org/show_bug.cgi?id=734524
* wrappercamerabinsrc: do not give references to probesThiago Santos2014-07-261-6/+3
| | | | | | | | | | They are kept until the probes are removed but they will never be removed as the refcount of the element won't get to 0 because the probes own references (cyclic refs). As the probes should only be running as long as the element is running there is no need to secure a ref for them. Removes 3 leaked refs of wrappercamerabinsrc
* wrappercamerabinsrc: unref request padsThiago Santos2014-07-261-0/+8
| | | | Do not forget to unref output-selector requested pads
* wrappercamerabinsrc: only flush buffers if renegotiation is neededThiago Santos2014-07-231-7/+8
| | | | | This avoid extra overhead when taking sequential pictures that woudln't need renegotiation
* camerabin: handle EOS on the pipelineThiago Santos2014-07-231-4/+0
| | | | | Make camerabin handle EOS to the pipeline to allow standard pipeline close where an EOS is sent to the whole pipeline before setting it to NULL.
* wrappercamerabinsrc: set src to ready when there are no pending buffersThiago Santos2014-07-171-1/+1
| | | | | | | Setting to ready will block waiting for buffers to be reclaimed, so flush before setting to null to make sure no buffers are pending https://bugzilla.gnome.org/show_bug.cgi?id=733072
* wrappercamerabinsrc: Fix caps filter caps proxyingNicolas Dufresne2014-07-111-15/+14
| | | | | | | | | | | | The notify signal is triggered when caps is changed. But instead of proxying the fixed caps, we query for the caps. Hence, when we go to READY state, we endup setting template caps on the proxied caps filter instead of NULL, which leads to negoitation failure. Correctly proxy NULL caps if this is the new caps. Fixes not negotiated error when running in cheese. Also fix a leak of caps string in one of the trace. https://bugzilla.gnome.org/show_bug.cgi?id=732741
* camerabin2: Flush downstream after setting src to READYNicolas Dufresne2014-07-101-0/+12
| | | | | | | | v4l2src requires all buffers to come back in order to cleanly stop streaming. Flushing the pipline should force all buffers to come back. https://bugzilla.gnome.org/show_bug.cgi?id=732741
* wrappercamerabinsrc: stop source to do internal reconfiguration safelyThiago Santos2014-02-041-0/+3
| | | | | | | | | | | | | | | | | | | | In order to be able to change the caps on multiple capsfilters the source element needs to be stopped, otherwise it will get a few reconfigure events and might try to renegotiate while the bin is still transitioning its caps, leading to a not-negotiated failure and the image capture won't happen because the source will be unusable. The solution is to keep the source in paused while the caps are being changed in the bin, and then bring the element back to playing once it is done. Unfortunately this increases the image capture latency, but it should always work. A possible improvement to reduce the latency is to add another signal to be called before 'start-capture': 'prepare-capture'. At this step the camera source should set all caps it needs and get the source ready for doing the capture as soon as 'start-capture' is called. This can be done on a future commit
* wrappercamerabinsrc: Add video-source-filter during constructionHans de Goede2013-06-111-0/+10
| | | | | | | | | | | | | | | | | | By adding the video-source-filter during construction time, rather then patching it in later (*), we can greatly reduce the amount of caps involved in negotation, speeding up pipeline creation. I wrote this while working on speeding up the startup of cheese. My cheese has been modified to add a capsfilter, filtering for only the configured resolution, with that cheese patch + this patch, the pipeline creation time goes from aprox 1.1 seconds to aprox 350ms. This is with a Logitech 9000 pro camera, which supports lots of different resolutions at many different framerates per resolution, causing a caps "explosion" if not filtered. *) Note the code for this is left in, as it is still necessary if the video-source-filter is changed between a stop + re-start. https://bugzilla.gnome.org/show_bug.cgi?id=701953
* wrappercamerabinsrc: Don't unset the video-source property on pipeline startHans de Goede2013-06-101-2/+0
| | | | | | | | | | | | | | | check_and_replace_src() was setting self->app_vid_src to NULL, which means that an app setting the video-source property, and then starting, stopping and re-starting the pipeline (ie to make changes to the video-source-filter property) would after the restart no longer have a video-source. This patch fixes this by making gst_camerabin_setup_default_element return a ref to the passed in user_element, rather then returning the user_element as is, so that that ref can be passed on to the bin, and the app_vid_src ref stays valid. https://bugzilla.gnome.org/show_bug.cgi?id=701915
* Fix FSF addressTim-Philipp Müller2012-11-041-2/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=687520
* Use gst_element_class_set_static_metadata()Tim-Philipp Müller2012-10-171-1/+1
| | | | | where possible. Avoids some string copies. Also re-indent some stuff. Also some indent fixes here and there.
* wrappercamerabinsrc: change video-source if the user requestedThiago Santos2012-09-281-33/+87
| | | | | | | When going from null to ready, check if the user requested to use a new source and replace the current one. Fixes #681562
* camerabin: use correct element name when replacing the video filterThiago Santos2012-09-271-1/+1
| | | | | | | | The name was updated on the 0.10 -> 1.0 transition, but the gst_bin_remove was still using the old name, causing an assertion when replacing video-source-filter https://bugzilla.gnome.org/show_bug.cgi?id=681564
* replace gst_element_class_set_details_simple with gst_element_class_set_metadataMark Nauwelaerts2012-09-141-1/+1
|
* camerabin: no need to send extra reconfigureThiago Santos2012-08-291-4/+0
| | | | | Setting capsfilters already sends reconfigure events when a new caps is set, no need to resend them.
* wrappercamerabinsrc: rework video recording eos pushThiago Santos2012-08-291-1/+12
| | | | | | Push EOS outside of wrappercamerabinsrc so that none of the internal elements gets its pads into eos state, preventing any further data from passing
* wrappercamerabinsrc: Save image/video reconfiguration until capturingRobert Swain2012-08-021-1/+62
| | | | | | | | Add a src pad event handler function that filters reconfigure events to trigger the renegotiation code paths in the mode-specific start-capture phase. This is to work towards fixing unit tests but more work is needed.
* camerabin: update preview buffer pushingThiago Santos2012-07-291-2/+14
| | | | | | | need to pass a GstSample to the utilitary preview buffer post functions as a GstBuffer doesn't have caps anymore. The GstSample has the GstCaps and it is used to inform the preview's pipeline about the format of the input, before it gets converted to the user's requested output format.
* photography: Add GstPhotography prefix and fix spelling colour->colorLasse Laukkanen2012-07-111-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=622482
* Fix printf format compiler warnings on mingw-w64Raimo Järvi2012-05-051-2/+3
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=675520
* camerabin: remove unnecessary codeThiago Santos2012-05-041-54/+0
|