Commit graph

339 commits

Author SHA1 Message Date
Sebastian Dröge b297490b2a imagecapturebin: Don't leak pad and sink 2010-12-19 12:09:41 +01:00
Sebastian Dröge 9605ff9aa8 imagecapturebin: Don't leak pad template created from static pad template 2010-12-19 12:05:11 +01:00
Sebastian Dröge 073916c9fb imagecapturebin: Don't leak location string 2010-12-19 12:03:03 +01:00
Thiago Santos b6d5763e05 basecamerasrc: Remove ghostpads
Remove ghost pads from basecamerasrc. Different implementations
of camera sources might not use ghostpads and use default pads.
2010-12-08 15:38:30 -03:00
Thiago Santos 91d8bbd8a1 basecamerasrc: Removing ununsed methods
Remove one unused method _finish_image_capture()
2010-12-08 15:38:30 -03:00
Thiago Santos db72d691ca camerabin2: Cleanup
Removing commented code
2010-12-08 15:38:30 -03:00
Thiago Santos 24bc280806 basecamerasrc: Move start/stop capture signals to basecamerasrc
Move start/stop signals and ready-for-capture to basecamerasrc
as this should be present on all camera sources
2010-12-08 15:38:30 -03:00
Thiago Santos 87eddd54d5 basecamerasrc: Add mode property
Move mode property from v4l2camerasrc to basecamerasrc, as all
camera sources should handle it.
2010-12-08 15:38:29 -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 0685b8921e viewfinderbin: Improve elements creation
Be more careful with cleanup of elements. Also add some logs and
improve docs a little.
2010-12-08 15:38:29 -03:00
Thiago Santos 19e52f35ee camerabin2: remove unused code
General cleanup, removing unused bits
2010-12-08 15:38:28 -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 5be441adff v4l2camerasrc: Add ready-for-capture property
Adds property that informs if v4l2camerasrc is available
for starting a new capture.

It is useful for applications to know (via deep-notify) when the
property changes and a new capture is possible. Note, however, that
starting a new capture from the notify callback will cause a deadlock.
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 9df40915d6 v4l2camerasrc: Remove unnecessary padding 2010-12-08 15:38:28 -03:00
Thiago Santos 91b7f2d99e v4l2camerasrc: Implement video capture
Implements video capture on v4l2camerasrc by using the mode property,
when mode is set to video, the pad probe pushes a new segment
and starts pushing buffers on the pad, when it the property is
sent back to preview, the pad probe pushes an EOS and stops
pushing buffers.

This is controlled by a Recording State variable, that is protected
by the GST_OBJECT_LOCK. I don't think locking for every buffer is
nice, so we could find an alternative lockless way here.
2010-12-08 15:38:28 -03:00
Thiago Santos 596422d19c v4l2camerasrc: Fix image capture
Once a image is captured, v4l2camerasrc should return to the
preview mode and stop capturing.
2010-12-08 15:38:27 -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 9095ee429a v4l2camerasrc: Adds mode property
Adds mode property to v4l2camerasrc
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 a938fd9192 camerabin2: Set filesink's async to FALSE
In order to preroll, camerabin2 should have its filesinks in
the imagecapturebin and videorecordingbin with async=FALSE.
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
Thiago Santos 39093d2199 camerabin2: v4l2camerasrc: Remove platform specific code
Remove platform specific code
2010-12-08 15:38:27 -03:00
Thiago Santos 7f41c2594d camerabin2: Removing uneeded properties
Removing uneeded and unregistered properties.
2010-12-08 15:38:26 -03:00
Thiago Santos 3afa2c3a25 camerabin2: v4l2camerasrc: Fix property warning
Avoid setting a property that doesn't exist.
2010-12-08 15:38:26 -03:00
Thiago Santos fcf80d0253 camerabin2: v4l2camerasrc: Remove unused variable
Removed unused leftover variable
2010-12-08 15:38:26 -03:00
Thiago Santos 0dce17a4e8 camerabin2: Adds video recording bin
Adds an bin that is responsible for encoding and saving video
streams to files.

For now it is simply a ffmpegcolorspace ! theoraenc ! oggmux !
 filesink bin.

Still uncapable of recording audio.
2010-12-08 15:38:26 -03:00
Thiago Santos 94da473ba7 camerabin2: Adding v4l2camerasrc from robclark's branch
Adds 3-pad v4l2 camera source from Rob Clark's camerabin
branch on http://gitorious.org/robclark-gstreamer/gst-plugins-bad
2010-12-08 15:38:26 -03:00
Thiago Santos 12245366d8 camerabin2: Adds new imagecapturebin
Adds an bin that is responsible for image captures.

It is a simple ffmpegcolorspace ! jpegenc ! jifmux ! multifilesink
for now.
2010-12-08 15:38:26 -03:00
Thiago Santos 3a8ec18f96 camerabin2: Move plugin init to a separate file
Moves plugin init to gstplugin.c to allow multiple
elements to register themselves.
2010-12-08 15:38:26 -03:00
Thiago Santos 67415fc412 camerabin2: viewfinderbin: Adds viewfinderbin element
Adds viewfinder bin element, one of the modules of camerabin2
that is responsible for displaying the video from the camera.

For now it is only a bin with ffmpegcolorspace ! videoscale !
 autovideosink
2010-12-08 15:38:26 -03:00