Commit graph

20 commits

Author SHA1 Message Date
Thiago Santos 5e0e02553d wrappercamerabinsrc: use digitalzoom element
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.
2015-04-27 21:14:09 -03:00
Thiago Santos c6f4e4cfd8 wrappercamerabinsrc: Rework cropping for zoom and dimension reduction
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.
2015-04-24 15:12:47 -03:00
Thiago Santos b74770bd05 wrappercamerabinsrc: Refactor internal pipeline
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.
2015-04-21 10:00:44 -03:00
Thiago Santos 5a1c73a105 wrappercamerabinsrc: remove unused attribute and related pad probe
The variable was never set to true and can be removed along
with the probe in which it used to act
2015-04-10 16:23:25 -03:00
Oleksij Rempel e8a3973b8f camerabin2: check negotiated caps avoid reseting of the pipe
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
2015-03-04 07:56:51 -03:00
Tim-Philipp Müller 95c211dc49 Add some missing G_END_DECLS 2014-10-28 21:42:31 +00:00
Tim-Philipp Müller 9e1b75fda3 Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-04 00:09:59 +00:00
Thiago Santos 8c8d1a0b6b wrappercamerabinsrc: change video-source if the user requested
When going from null to ready, check if the user requested to
use a new source and replace the current one.

Fixes #681562
2012-09-28 00:13:32 -03:00
Thiago Santos c6fd3b070b wrappercamerabinsrc: pad probe ids are gulong
Change variable to the correct type
2012-09-27 23:22:37 -03:00
Robert Swain 955e50449e wrappercamerabinsrc: Save image/video reconfiguration until capturing
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.
2012-08-02 22:46:21 +02:00
Luciana Fujii Pontello 23576af52a camerabin2: Adding a filter to wrappercamerabinsrc
Camerabin2 allows setting a filter for image, video or viewfinder, but
not one filter for all three at the same time. I added a filter to
wrappercamerabinsrc to allow setting a global filter when using this
source.

https://bugzilla.gnome.org/show_bug.cgi?id=649822
2011-06-02 16:24:03 -03:00
Thiago Santos b3abf91232 camerabin2: Moving preview image properties to basecamerasrc
Moves preview image related properties to basecamerasrc as that
should be present on all camerasrcs
2011-03-10 08:42:00 -03:00
Thiago Santos 0255584d90 camerabin2: Move preview helper functions to basecamerabinsrc
Move preview helper functions to baseacamerabinsrc so they can
be reused by multiple camerabin2 sources.
2011-03-10 08:42:00 -03:00
Thiago Santos 1a62d9374b wrappercamerabinsrc: Handle src state change to avoid losing timestamps
Camerabin2 uses state changes to force the source to renegotiate its
caps to the capture formats. The state changes makes the source lose
its clock and base_time, causing it to stop timestamping the buffers.

We still need a proper way to make sources renegotiate its caps, so this
patch is a hack to make the source continue timestamping buffers even
after changing state. The patch works by getting the clock and base
time before doing the state change to NULL and setting them back
after putting it to PLAYING again. It also cares to drop the first
new segment after this state change.
2011-02-03 19:09:20 -03:00
Thiago Santos 869a61343c camerabin2: Add preview-filter property
Adds a property to select a custom element for preview pipeline
buffers processing
2011-02-03 19:09:20 -03:00
Thiago Santos 9863feb328 camerabin2: Implement previewing
Implement previewing functionality using 2 properties. A boolean
(post-previews) that indicates if previews should be posted, and a
GstCaps (preview-caps) to provide the desired preview caps.

wrappercamerabinsrc implements previewing by supplying the captured
image to a pipeline to adapt it to the required caps before posting.
2011-01-24 14:50:29 -03:00
Thiago Santos 1c761196f7 wrappercamerabinsrc: Refactor internal pipeline
Instead of linking 3 src pads from tee to the ghostpads, use 2
srcpads and add an output-selector to completely split caps
negotiation of video/image modes. I don't think there is an
use case that would require image and video pads to be used
at the same time.
2010-12-29 13:24:05 -03:00
Thiago Santos e94c5b3b9b wrappercamerabinsrc: Handle camerabin2 custom renegotiate events 2010-12-23 13:24:55 -03:00
Thiago Santos b1a361b566 wrappercamerabinsrc: Add local mode 2010-12-23 13:24:55 -03:00
Thiago Santos 99210b0a3a camerabin2: Rename v4l2camerasrc to wrappercamerabinsrc
Use a better name for the element that wraps single pad src element
into a 3pad source required by camerabin2.
2010-12-23 13:24:43 -03:00
Renamed from gst/camerabin2/gstv4l2camerasrc.h (Browse further)