Commit graph

43 commits

Author SHA1 Message Date
Tim-Philipp Müller
2f50ad435b camerabin2: rename to "camerabin"
But leave source code intact for now, for easier patch merging.
2012-04-30 17:56:17 +01:00
Wim Taymans
27ee60a27b port to new gthread API 2012-01-19 11:34:26 +01:00
Thiago Santos
0ce5021058 camerabin2: Fix A/V sync for captures
Audio src was pushing newsegments starting from 0, even when its buffers
were not starting with 0 as their timestamps. Add a buffer probe that
checks the ts of the first buffer and uses that to push a newsegment,
just like we do for video on wrappercamerabinsrc.
2011-12-20 15:05:27 -03:00
Thiago Santos
54351a0129 camerabin2: Remove video elements' state clearing from start-capture
Reduce start-capture workload by moving the elements' state reseting to the
finishing steps of the capture. This reduces the time start-capture takes to
actually start a capture and return to its caller, improving user experience.

As the elements' state reset is now triggered from the message handling
function, it needs to spawn a new thread, changing state from the pad's
task would cause a deadlock.
2011-11-14 13:06:29 -03:00
Thiago Santos
c635e4bc3b camerabin2: keep track of video recording state
Adds a new variable to keep track of the state of the video
recording in camerabin2. This allows start-capture to reject
new video recording requests when one is already ongoing. This
fixes one of check tests.
2011-11-14 13:06:28 -03:00
Thiago Santos
c7db5db632 camerabin2: protect image location list with mutex
Rename the image taglists' mutex into image capture mutex and
use it also for the image capture list to prevent concurrent
access from different threads (application and capture threads).
2011-11-09 12:30:58 -03:00
Lasse Laukkanen
5ca3c9477e camerabin2: Avoid blocking in start-capture and send application tags later
Tags are currently sent from start-capture, which is run in the
application thread. For images we can delay the tags pushing to the
buffer probe and push the tags with the location event and reduce
start-capture time.
2011-11-09 11:45:55 -03:00
Thiago Santos
e90e041e52 camerabin2: Add a mutex to avoid concurrent access of preview filename lists
The preview filename list is acessed whenever a new capture is started, when
camera-source posts a new preview message or on state changes. All of those can
occur simultaneously, so add a mutex to prevent concurrent access.
2011-10-11 23:13:00 -03:00
Thiago Santos
379670e036 camerabin2: add location to preview image messages
Makes camerabin2 intercept preview-image messages and add
the filename corresponding to the message structure in the
'location' field.

Makes easier for applications to track preview images
2011-09-29 18:21:06 -03:00
Robert Swain
db0739e54f camerabin2: Add a flag to disable image conversion elements
If we know that our camera source element produces buffers at the same
resolution and appropriate colourspace for the output, we don't need any
of the generic conversion elements in encodebin. This reduces caps
negotiation overheads among other things.
2011-09-01 15:57:50 +02:00
Thiago Santos
5c662ec0c7 camerabin2: Add new entry to flags property
Adds a new entry to camerabin2 flags to disable viewfinder
conversion elements.
2011-08-23 11:58:33 -03:00
Thiago Santos
6c272aafa7 camerabin2: Prevent audiosrc from sending undesired eos
Basesrc derived classes send an eos when they change state
from paused to ready and that breaks video recordings on camerabin2
as it makes the whole audio branch pads flushing.

Prevent it by using a pad probe that only allows the eos to pass
when it is caused by a stop-capture action.
2011-08-21 18:23:16 -03:00
Thiago Santos
19e5736acd camerabin2: Add audio-filter property
Adds a property to add a custom GstElement to the audio
branch of the pipeline. This allows the user to do custom audio
processing/analysis when recording videos.
2011-08-13 11:42:07 -03:00
Thiago Santos
a68b1f049c camerabin2: Remove redundant image-queue
Encodebin is used for image encoding and it already contains
a queue, so we can remove camerabin2 image queue.
2011-08-03 13:58:26 -03:00
Robert Swain
2609427ada camerabin2: Add flags prop to toggle encodebin conversion elements
A flags property has been added to encodebin to toggle whether the
conversion elements (ffmpegcolorspace, videoscale, audioconvert,
audioresample, audiorate) are created and linked into the appropriate
branches of encodebin.

Not including these elements avoids some slow caps negotiation and
allows the first buffers to flow through encodebin much more quickly.
However, it imposes that the uncompressed input is appropriate for the
target profile and elements selected to meet that profile.
2011-08-02 13:39:17 -03:00
Robert Swain
afee3b0301 camerabin2: Remove redundant elements
Since camerabin2 has switched to encodebin and encodebin has its own
queues and conversion elements, those preceding encodebin are no longer
necessary and as such can be removed.
2011-08-02 13:39:17 -03:00
Stefan Kost
1b103d259d camerabin2: don't mess with camerabin (1) namespace
Use an extra '2' to stay out of the old namespace.
2011-07-08 00:11:37 -07:00
Thiago Santos
f1fa6c6531 camerabin2: Use a single location for both modes
Implement the location property just like it works in camerabin, the
same location is used for both images and videos
2011-06-23 00:05:13 -03:00
Thiago Santos
f31554bc4f camerabin2: Send serialized custom events for filename changes in image sink
Using serialized custom events for switching image capture saving
location makes camerabin2 save each capture correctly to the location
that was set during the moment start-capture was called, and not
the moment the filesink was writing to disk.

This prevents captures to be overwriten by racyness among start-capture
and setting location for images.
2011-06-23 00:05:13 -03:00
Thiago Santos
e23e5380d3 camerabin2: Remove unused variable 2011-06-23 00:05:13 -03:00
Alessandro Decina
9e9507b645 camerabin2: use encodebin to encode images 2011-05-16 18:08:40 -03:00
Robert Swain
6a686316d5 basecamerasrc: camerabin2: wrappercamerabinsrc: Add read-only max-zoom prop
This is not implemented in any of our real sources to which wrappercamerabinsrc
might connect but this is optional and can be implemented at any time. A
limit on the software zoom level using video{crop,scale} would be arbitrary.
2011-03-23 16:48:11 -03:00
Thiago Santos
3dc9a0e9c6 camerabin2: Adds new idle property
Adds idle property (just like camerabin1), a boolean that
is true when camerabin2 isn't processing and can be shut down
without losing data.
2011-03-23 16:13:32 -03:00
Thiago Santos
b2f39d1844 camerabin2: Refactoring encodebin usage
Refactor some common code regarding encodebin usage in camerabin2
2011-03-11 18:40:52 -03:00
Robert Swain
5fd15521e2 basecamerasrc: wrappercamerabinsrc: camerabin2: Expose/add floating point
zoom property
2011-03-11 18:26:43 -03:00
Thiago Santos
ba16894da3 gstcamerabin2: Set encodebin's videorate and audiorate properties
Listen to encodebin's element-added signal to be able to set
skip-to-first on both audiorates and videorates.
2011-03-10 08:56:48 -03:00
Thiago Santos
8fe75f8067 camerabin: adding audio related properties
Adds 4 audio properties related to audio recording
* audio-src
* mute
* audio-supported-capture-caps
* audio-capture-caps
2011-03-10 08:56:48 -03:00
Thiago Santos
abdb0bbfa6 camerabin2: Adding audio support for video recordings
Adds an audio source and audio capsfilter/queue/convert, creating
a new branch on camerabin2 that is used to feed encodebin with
audio buffers for video recording.
2011-03-10 08:56:47 -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
675632b382 camerabin2: Add custom filter properties
Adds custom filter properties for camerabin2. Custom filters
can be added to video/image/preview branches.
2011-02-03 19:09:20 -03:00
Thiago Santos
ccb1960a42 camerabin2: Add a property to select the encoding profile
Adds a video-profile to allow selecting which encoding profile
to use for video recordings
2011-01-24 14:50:29 -03:00
Thiago Santos
f1d02cf0c0 camerabin2: Move to encodebin 2011-01-24 14:50:29 -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
59c48d3443 camerabin2: Add camera-src property
Adds a property to select the camera source element to be used.
Changing only happens on the next NULL->READY transition
2010-12-23 13:18:57 -03:00
Thiago Santos
adc3cdc6aa camerabin2: Rename variables
Use better name for the variables, making the code clearer. Also
keep a ref for some internal elements to avoid fetching them
by name when needed later.
2010-12-23 13:18:57 -03:00
André Dieb Martins
7c47fc497f camerabin2: implement viewfinderbin::video-sink property to override default video output 2010-12-23 13:18:56 -03:00
Thiago Santos
b11342d325 camerabin2: Reset all elements on video recording branch before capture
We need to reset the elements from the video recording branch, including
the queue and capsfilter in order to clear the eos state and activate
the pads.

This makes it possible to record multiple videos with camerabin2 in a
sequence, otherwise the source would get a unexpected return and
push EOS, stopping the whole pipeline.
2010-12-08 15:38:29 -03:00
Thiago Santos
ba878c95b2 camerabin2: adds location property
Adds a location property to enable applications to select
the captured files names. Locations are handled just like
multifilesink ones

Also disables -Wformat-nonliteral to allow to use non-literals
on g_strdup_printf on camerabin and generate a sequence of
locations for captures.
2010-12-08 15:38:28 -03:00
Thiago Santos
cb915196e2 camerabin2: Handle vidbin state change individually
Keep vidbin state locked to avoid it going to playing without
being used and leaving an empty file created.

Check the docs on the code for details on the handling.
2010-12-08 15:38:28 -03:00
Thiago Santos
bd89d22da9 camerabin2: Update v4l2camerasrc to use start/stop signals
Removes the old logic for v4l2camerasrc that used the mode
property switching to start/stop captures to make it identical
to camerabin2 behavior and to allow the future addition of
pausing a video recording.

This also removes the MODE_PREVIEW as it became useless.
2010-12-08 15:38:28 -03:00
Thiago Santos
b4d73cb9a8 camerabin2: Cleanup capturing flag
Cleanup capturing flag when the source switches back to the
viewfinder mode
2010-12-08 15:38:28 -03:00
Thiago Santos
6c72fed8b4 camerabin2: Adding basic property and signals
Adds mode property to camerabin2, allowing users to
select between video and stills capture. Also adds
start/stop capture actions to trigger and stop
capturing
2010-12-08 15:38:27 -03:00
Thiago Santos
3db90e1d43 camerabin2: Adds a stub element for camerabin2
Adds camerabin2 element, it is now a pile of stubs.
2010-12-08 15:38:27 -03:00