Commit graph

163 commits

Author SHA1 Message Date
Alessandro Decina
90221c4a82 camerabin2: do proper EOS handling on send_event(eos)
We first let the inner camera EOS. Then we manually post EOS on the image and
video sinks if those are <= READY and so have ignored EOS events.
2011-05-16 18:08:40 -03:00
Alessandro Decina
9e9507b645 camerabin2: use encodebin to encode images 2011-05-16 18:08:40 -03:00
Thiago Santos
0b02e595f3 camerabin2: Changing how some properties work
Some properties (like viewfinder-filter) only are taken into use
on NULL->READY transitions and the get/set property was returning
the currently in use value, instead of the last set.

This is bad, as after setting 'a' to 'x', you expect that getting 'a'
will return 'x'. This patch fixes it.

If needed, later we could add current-* properties that are readonly
and get the current value in use.
2011-05-16 18:08:40 -03:00
Thiago Santos
56007404b6 camerabin2: Adding missing plugin error messages
Whenever a required plugin is missing, camerabin2 should post
a missing plugin message to the bus
2011-05-16 18:08:40 -03:00
Thiago Santos
1c8e1722eb camerabin2: encodebin might not have the requested pad
handle the case where encodebin doesn't have the pad
camerabin2 is requesting, either because of its current profile
or because of missing elements, making it fail to provide
the pad
2011-05-16 18:08:40 -03:00
Thiago Santos
dfdc6255f8 camerabin2: Fix tag handling for videos
In video mode the tags should be pushed after sending the start capture
to the source, this allows the video recording elements to be reset
and leave the flushing state they were at after a previous capture.

This fixes the problem where tags only work for the first video capture
2011-05-16 18:08:39 -03:00
Robert Swain
10b6765fba camerabin2: Fix debug print to show audio/video depending on pad type 2011-05-16 18:08:38 -03:00
Robert Swain
74d4030e3f camerabin2: Fix order of element state change
To change the state of elements in a pipeline, we should mirror the
behaviour of GstBin which starts at the sink element and works its way
upstream.
2011-05-16 18:08:38 -03:00
Thiago Santos
d2e1f1bdc6 camerabin2: Only mark video capture as finished after EOS
Instead of probing the videosink sinkpad for passing EOS, better
to wait for EOS from the bus.

This makes sure the filesink has already processed it and is
ready to close the file. This is used to notify applications
that camerabin2 is idle and can be shut down.
2011-03-23 16:50:12 -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
aa7b962891 camerabin2: Improve idle property usage
Use resource warning messages to notify camerabin2 that a capture
as aborted or couldn't be started, making it decrement the
processing counter and making the idle property more reliable.
2011-03-23 16:13:32 -03:00
Thiago Santos
6913db30f8 camerabin2: No need to force audiosrc to null on stop_capture
Setting the audio source to null isn't needed and it could
make the EOS that is still flowing be dropped if autoaudiosrc
is used because its pads go flushing before the EOS gets pushed
from the real source.
2011-03-23 16:13:32 -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
19628ec3f3 camerabin2: Adding properties for image capture settings
Adds properties for selecting image encoder and muxer for
image capture
2011-03-23 16:13:32 -03:00
Thiago Santos
223697c2b9 camerabin2: More debug log
Small refactoring and adding more debug log to encodebin related
paths
2011-03-23 16:13:32 -03:00
Thiago Santos
ba878f7427 camerabin2: Set queues to silent
Optimize a little by setting queues to silent
2011-03-11 18:41:16 -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
Thiago Santos
79bb475abe camerabin2: Some memleak fixes 2011-03-11 18:26:43 -03:00
Robert Swain
5fd15521e2 basecamerasrc: wrappercamerabinsrc: camerabin2: Expose/add floating point
zoom property
2011-03-11 18:26:43 -03:00
Tim-Philipp Müller
90c96fc17b camerabin2: don't leak element name strings
Don't leak string copy returned by gst_element_get_name(). Also, check
for certain elements by checking the plugin feature / factory name, not
the assigned object name.
2011-03-11 10:34:23 +00:00
Thiago Santos
3d1a7b0021 camerabin2: Force EOS on audio src
We can't rely on audio sources pushing EOS when going PAUSED->READY
because this is a basesrc bahavior and when used inside autoaudiosrc
the ghostpad goes flushing before the real source pushes the EOS,
so it is dropped.
2011-03-10 08:56:48 -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
fc9c9b0f24 camerabin2: Handle audio elements states
Audio elements are put into bin only when needed, so we need
to be careful with their states as camerabin2 won't manage
them if they are outside the bin.

Also we should reset their pad's flushing status before
starting a new capture.
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
992917b6aa camerabin2: Add logging for stop-capture signal 2011-03-10 08:42:01 -03:00
Thiago Santos
bcc6d99bbe camerabin2: Add viewfinder caps related properties
Adds properties to check what caps are supported on the
viewfinder (from the camerasrc viewfinder pad) and another
one to set a caps for the viewfinder.
2011-03-10 08:42:01 -03:00
Thiago Santos
d3a5058611 camerabin2: Set some queue's properties
Sets viewfinder queue to leaky and tell image branch
queue to don't care about durations
2011-03-10 08:42:01 -03:00
Thiago Santos
060611b060 camerabin2: Add viewfinder-sink property
Adds a property to set the viewfinder's sink of camerabin2
2011-03-10 08:42:00 -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
68bff61732 camerabin2: Do not forget to unref some stuff
Cleanup properly by unrefing the encoding profile and preview caps
2011-01-26 14:31:13 -03:00
Thiago Santos
6395b45908 camerabin2: Handle videosink states more carefully
When going to ready, camerabin2 could create an empty file
if the videosink was put to ready. This patch only puts videosink
to ready on the PAUSED_TO_READY state change if it is on PAUSED
or PLAYING.
2011-01-26 14:31:12 -03:00
Thiago Santos
bccae0f994 camerabin2: Add image-done message
Post an image-done message when a new image is saved to disk
2011-01-24 14:50:30 -03:00
Thiago Santos
a715b46c7f camerabin2: Implement tagsetter interface 2011-01-24 14:50:30 -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
203508079a camerabin2: Fix renegotiate event pushing
Use a hack to make the event upstream to reach the camera source
instead of going downstream and being useless.

This was already fixed this way for image srcpad renegotiate and
video srcpad was left unfixed.
2010-12-29 13:24:05 -03:00
Thiago Santos
58d4315965 camerabin2: more logs 2010-12-23 13:24:56 -03:00
Thiago Santos
1e6be5ec56 camerabin2: Use custom renegotiate event
Adds a custom renegotiate event that is pushed to the camerasrc pad
that needs renegotiation due to the user selecting a new capture
caps for that pad.

This is a way of notifying the source that it should update its caps, even
if it doesn't use pad allocs.
2010-12-23 13:24:55 -03:00
Thiago Santos
85bf8f2335 camerabin2: Adds properties for capture caps
Adds properties for selecting caps for video and image captures
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
Thiago Santos
4938c2e9ea camerabin2: Move basecamerasrc to gst-libs
Move the base camera src class to gst-libs/gst/basecamerabinsrc to
allow it to be included from the tests.
2010-12-23 13:20:31 -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
Thiago Santos
201e9ac221 camerabin2: Add properties for supported capture caps
Adds 2 property for getting the supported image/video capture
caps from the camera source.
2010-12-23 13:18:57 -03:00
Thiago Santos
014b8f97f8 viewfinderbin: Fixes to video-sink handling
Handle video-sink more carefully, checking if it should
be already added to the bin, and removing old ones when
replacing.
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
5776a17c86 camerabin2: More debug logs
Sprinkle some more debugging logs
2010-12-08 15:38:29 -03:00
Thiago Santos
122a7bd556 camerabin2: Various fixes
As video recording bin's state is locked, we should always
remember of setting it to NULL when camerabin2 goes to NULL

Be more careful when using elements that might not
have been created yet

And do not set location property recursively on videorecordingbin
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
5b3deecab9 camerabin2: Fix set/get property function names
Add more consistency to the function names by using
gst_camera_bin as the other functions.
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
0ae8df4312 camerabin2: Keep it under --enable-experimental
camerabin2 is still under heavy development, activate it only if
the --enable-experimental flag is on.

Also add a note to the docs.
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
6c7d7946f5 camerabin2: Keep mode definition at -enum file
Use 'mode' enum definition from gstcamerabin-enum file to avoid
conflicts between v4l2camerasrc and gstcamerabin2 modes.

For now there is a MODE_PREVIEW there that is only used on the
camerasrc, not sure if we are keeping it at the future, but for
now this works.
2010-12-08 15:38:27 -03:00
Thiago Santos
dee167edc8 camerabin2: Adding debug categories
Adding debug categories to v4l2camerasrc and camerabin2, also
removing generic category from camerabingeneral.
2010-12-08 15:38:27 -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
1887669d6e camerabin2: Adding basic elements
Instantiating and linking basic elements on camerabin2
so it at least shows the viewfinder when running.
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