Commit graph

22 commits

Author SHA1 Message Date
Rob Clark
f19cfbda96 v4l2: Add v4l2sink element
This also does the following changes:
(1) pull the bufferpool code out into gstv4l2bufferpool.c, and make a
    bit more generic so it can be used both for v4l2src and v4l2sink
(2) move some of the device probing/configuration/caps stuff into
    gstv4l2object.c so it does not have to be duplicated between
    v4l2src and v4l2sink

Fixes bug #590280.
2009-08-04 09:16:56 +02:00
Jan Schmidt
38baf136e6 sys/v4l2/v4l2_calls.c: Treat ENOTTY (driver does not implement ioctl) the same as
Original commit message from CVS:
* sys/v4l2/v4l2_calls.c: (gst_v4l2_fill_lists):
Treat ENOTTY (driver does not implement ioctl) the same as
EINVAL since it implies there are no available standards.
* sys/v4l2/v4l2src_calls.c: (gst_v4l2src_probe_caps_for_format),
(gst_v4l2src_get_nearest_size):
Replace gst_v4l2src_get_size_limits with 2 calls to new function
gst_v4l2src_get_nearest_size, and get it to use VIDIOC_S_FMT to
probe if the driver does not support VIDIOC_TRY_FMT for whatever
reason, and if we aren't yet actively capturing.
* sys/v4l2/v4l2src_calls.h:
Remove replaced function declaration.
2008-01-31 16:12:28 +00:00
Alexander Eichner
e547bc5595 sys/v4l2/gstv4l2src.c: Use define here.
Original commit message from CVS:
Patch by: Alexander Eichner <alexeichi@yahoo.de>
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_init):
Use define here.
* sys/v4l2/gstv4l2tuner.c:
(gst_v4l2_tuner_set_frequency_and_notify):
Don't touch the property - its still disabled.
* sys/v4l2/v4l2src_calls.c: (gst_v4l2src_probe_caps_for_format),
(gst_v4l2src_grab_frame), (gst_v4l2src_get_size_limits):
* sys/v4l2/v4l2src_calls.h:
Improve fallback format negotionation. Fixes #451388
2007-07-18 11:42:33 +00:00
Andy Wingo
cde8c8bdc4 sys/v4l2/v4l2src_calls.c (gst_v4l2_buffer_finalize) (gst_v4l2_buffer_class_init, gst_v4l2_buffer_get_type)
Original commit message from CVS:
2007-06-12  Andy Wingo  <wingo@pobox.com>

* sys/v4l2/v4l2src_calls.c (gst_v4l2_buffer_finalize)
(gst_v4l2_buffer_class_init, gst_v4l2_buffer_get_type)
(gst_v4l2_buffer_new): Behave more like ximagesink's buffers, with
finalization and resuscitation. No longer public.
(gst_v4l2_buffer_pool_finalize, gst_v4l2_buffer_pool_init)
(gst_v4l2_buffer_pool_class_init, gst_v4l2_buffer_pool_get_type)
(gst_v4l2_buffer_pool_new, gst_v4l2_buffer_pool_activate)
(gst_v4l2_buffer_pool_destroy): Make the pool follow common
miniobject semantics, and be threadsafe.
(gst_v4l2src_queue_frame): Remove this function, as we just call
the ioctls directly in the two places where we queue buffers.
(gst_v4l2src_grab_frame): Return a flowreturn and fill the buffer
directly.
(gst_v4l2src_capture_init): Use the new buffer_pool_new function
to allocate the pool, which also preallocates the GstBuffers.
(gst_v4l2src_capture_start): Call buffer_pool_activate instead of
queueing the frames directly.

* sys/v4l2/gstv4l2src.h (struct _GstV4l2BufferPool): Make this a
real MiniObject instead of rolling our own refcounting and
finalizing. Give it a lock.
(struct _GstV4l2Buffer): Remove one intermediary object, having
the buffers hold the struct v4l2_buffer directly.

* sys/v4l2/gstv4l2src.c (gst_v4l2src_set_caps): Pass the caps to
capture_init so that it can set them on the buffers that it will
create.
(gst_v4l2src_get_read): For better or for worse, include the
timestamping and offsetting code here; really we should be using
bufferalloc though.
(gst_v4l2src_get_mmap): Just make grab_frame return one of our
preallocated, mmap'd buffers.
2007-06-12 11:23:01 +00:00
Andy Wingo
3b5f988239 sys/v4l2/v4l2src_calls.*: Store the format list in the order that the driver gives it to us.
Original commit message from CVS:
2007-05-30  Andy Wingo  <wingo@pobox.com>

* sys/v4l2/v4l2src_calls.h:
* sys/v4l2/v4l2src_calls.c (gst_v4l2src_fill_format_list): Store
the format list in the order that the driver gives it to us.
(gst_v4l2src_probe_caps_for_format_and_size)
(gst_v4l2src_probe_caps_for_format): New functions, fill GstCaps
based on the capabilities of the device.
(gst_v4l2src_grab_frame): Update for object variable renaming.
(gst_v4l2src_set_capture): Update to be strict in its parameters,
as in the set_caps below.
(gst_v4l2src_capture_init): Update for object variable renaming,
and reflow.
(gst_v4l2src_capture_start, gst_v4l2src_capture_stop)
(gst_v4l2src_capture_deinit): Update for object variable renaming.
(gst_v4l2src_update_fps, gst_v4l2src_set_fps)
(gst_v4l2src_get_fps): Remove; these functions don't have much
meaning outside of an atomic set_caps method.
(gst_v4l2src_buffer_new): Don't set buffer duration, it is not
known.

* sys/v4l2/gstv4l2tuner.c (gst_v4l2_tuner_set_channel): Remove
call to update_fps; not sure about this change.
(gst_v4l2_tuner_set_norm): Work around the fact that for the
moment we don't have an update_fps_func.

* sys/v4l2/gstv4l2src.h (struct _GstV4l2Src): Don't put v4l2
structures in the object, just store what we need. Do store the
probed caps of the device. Don't store the current frame rate.

* sys/v4l2/gstv4l2src.c (gst_v4l2src_init): Remove the
update_fps_function, for now. Update for new object variable
naming.
(gst_v4l2src_set_property, gst_v4l2src_get_property): Update for
new object variable naming.
(gst_v4l2src_v4l2fourcc_to_structure): Rename from ..._to_caps.
(gst_v4l2_structure_to_v4l2fourcc): Rename from ...caps_to_....
(gst_v4l2src_get_caps): Rework to probe the device for supported
frame sizes and frame rates.
(gst_v4l2src_set_caps): Rework to be strict in the given
parameters: if someone asks us to have a certain size and rate,
that is what we configure.
(gst_v4l2src_get_read): Update for object variable naming. Don't
leak buffers on short reads.
(gst_v4l2src_get_mmap): Update for object variable naming, and add
comments.
(gst_v4l2src_create): Update for object variable naming.
2007-05-30 14:40:53 +00:00
Wim Taymans
27bde5b96e sys/v4l2/Makefile.am: Fix makefile, list libs in stack order.
Original commit message from CVS:
* sys/v4l2/Makefile.am:
Fix makefile, list libs in stack order.
* sys/v4l2/gstv4l2colorbalance.c:
* sys/v4l2/gstv4l2colorbalance.h:
* sys/v4l2/gstv4l2object.c: (gst_v4l2_device_get_type),
(gst_v4l2_object_install_properties_helper):
* sys/v4l2/gstv4l2object.h:
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_get_read),
(gst_v4l2src_get_mmap), (gst_v4l2src_create):
* sys/v4l2/gstv4l2src.h:
* sys/v4l2/gstv4l2tuner.h:
* sys/v4l2/gstv4l2vidorient.h:
* sys/v4l2/gstv4l2xoverlay.h:
* sys/v4l2/v4l2_calls.h:
* sys/v4l2/v4l2src_calls.h:
Fix coding style:
- Remove extern from functions.
- Fix header indentation.
Fix Flags, add defaults for properties.
Remove unused enums.
Fix TOO_LAZY in error messages.
2006-09-26 13:18:06 +00:00
Stefan Kost
074e7b0d53 sys/v4l2/: Cleanup error messages and unify header comments
Original commit message from CVS:
* sys/v4l2/gstv4l2.c:
* sys/v4l2/gstv4l2colorbalance.c:
* sys/v4l2/gstv4l2colorbalance.h:
* sys/v4l2/gstv4l2object.c:
* sys/v4l2/gstv4l2object.h:
* sys/v4l2/gstv4l2src.c:
* sys/v4l2/gstv4l2src.h:
* sys/v4l2/gstv4l2tuner.c:
* sys/v4l2/gstv4l2tuner.h:
* sys/v4l2/gstv4l2xoverlay.c: (gst_v4l2_xoverlay_open):
* sys/v4l2/gstv4l2xoverlay.h:
* sys/v4l2/v4l2_calls.c: (gst_v4l2_get_capabilities),
(gst_v4l2_open):
* sys/v4l2/v4l2_calls.h:
* sys/v4l2/v4l2src_calls.c: (gst_v4l2src_queue_frame),
(gst_v4l2src_capture_init):
* sys/v4l2/v4l2src_calls.h:
Cleanup error messages and unify header comments
2006-09-02 14:28:55 +00:00
Edgard Lima
4a30124701 Fixed framerate negotiation.
Original commit message from CVS:
Fixed framerate negotiation.
2006-08-29 20:59:47 +00:00
Edgard Lima
d7ef60b0c4 Fix set_caps to set width and height to the values the driver is really working with.
Original commit message from CVS:
Fix set_caps to set width and height to the values the driver is really working with.
2006-08-24 00:40:07 +00:00
Edgard Lima
9edc0c0365 Changes proposed by Wingo in bug #338818.
Original commit message from CVS:
Changes proposed by Wingo in bug #338818.
2006-05-11 17:59:59 +00:00
Martin Rubli
59bc24d738 Some changes proposed by wingo in bug #338818 (but not everything yet). Patch from Martin Rubli to fix framerate dete...
Original commit message from CVS:
Some changes proposed by wingo in bug #338818 (but not everything yet). Patch from Martin Rubli to fix framerate detection.
2006-05-05 20:12:59 +00:00
Edgard Lima
51b1537e45 Just make few things more robust and also some identation.
Original commit message from CVS:
Just make few things more robust and also some identation.
2006-03-25 05:31:28 +00:00
Edgard Lima
2dd8010618 V4L2 ported to 0.10.
Original commit message from CVS:
V4L2 ported to 0.10.
2006-03-11 22:50:03 +00:00
Thomas Vander Stichele
b6540959e6 expand tabs
Original commit message from CVS:
expand tabs
2005-12-06 19:55:58 +00:00
Johan Dahlin
5acffea623 *.h: Revert indenting
Original commit message from CVS:
* *.h: Revert indenting
2004-03-15 16:32:54 +00:00
Thomas Vander Stichele
5d25c00e4b gst-indent
Original commit message from CVS:
gst-indent
2004-03-14 22:34:33 +00:00
Benjamin Otte
409384e0d8 sys/v4l2/: add norm, channel and frequency properties.
Original commit message from CVS:
2004-01-12  Benjamin Otte  <in7y118@public.uni-hamburg.de>

* sys/v4l2/gstv4l2element.c: (gst_v4l2element_class_init),
(gst_v4l2element_dispose), (gst_v4l2element_set_property),
(gst_v4l2element_get_property):
* sys/v4l2/v4l2_calls.c: (gst_v4l2_set_defaults), (gst_v4l2_open):
add norm, channel and frequency properties.
* sys/v4l2/gstv4l2tuner.c:
fixes for tuner interface changes
* sys/v4l2/gstv4l2element.h:
* sys/v4l2/gstv4l2src.c:
* sys/v4l2/gstv4l2src.h:
* sys/v4l2/v4l2src_calls.c:
* sys/v4l2/v4l2src_calls.h:
rework v4l2src to work with saa1734 cards and allow mmaped buffers.
2004-01-12 02:19:57 +00:00
Ronald S. Bultje
e767ac4c48 Some final fixes for the v4lsrc elements. remove software sync thread (use GST_ELEMENT_THREAD_SUGGESTED instead) make...
Original commit message from CVS:
Some final fixes for the v4lsrc elements.

* remove software sync thread (use GST_ELEMENT_THREAD_SUGGESTED instead)
* make all src elements threadsafe
* fix num_buffer argument setting in v4l2src (VIDIOC_S_PARM)
* re-add bufsize (RO) for v4lmjpegsrc
* fix the A/V sync calculation in all elements (spvf=GST_SECOND/fps, not GST_SECOND*fps)
* probably some more crap....

With all this, it actually works quite well. The TODO files describes the
next steps in order to make a full-featured video recorder based on these
elements and GStreamer (bottom). Making a simple recorder should be fairly
easy now, btw.
2003-05-21 06:33:18 +00:00
Ronald S. Bultje
a3a051705a This implements filtered-caps negotiation for all the v4l*src elements, and removes the accompanying properties since...
Original commit message from CVS:
This implements filtered-caps negotiation for all the v4l*src elements, and removes the accompanying properties since they're no longer needed
2003-05-10 14:36:34 +00:00
Ronald S. Bultje
1a8a2ef6e4 Unification of the way to speak to v4l2 and v4l elements... Also fix a segfautl when doing gst-inspect v4l2src
Original commit message from CVS:
Unification of the way to speak to v4l2 and v4l elements... Also fix a segfautl when doing gst-inspect v4l2src
2003-03-02 21:58:52 +00:00
Ronald S. Bultje
bcf4679ab3 v4l plugins: add open/close signals v4l2 plugins: add open/close signals move source format enumeration from v4l2elem...
Original commit message from CVS:
v4l plugins:
* add open/close signals

v4l2 plugins:
* add open/close signals
* move source format enumeration from v4l2element to v4l2src
* adapt to the final v4l2 API in kernel 2.5 (patches for 2.4 on http://bytesex.org/patches)
* small tweaks
2002-11-13 12:35:56 +00:00
Ronald S. Bultje
9413402bc6 this adds video4linux2 source and element plugins. The division in v4l2* plugins is the same as for v4l1 - i.e. an el...
Original commit message from CVS:
this adds video4linux2 source and element plugins. The division in v4l2* plugins is the same as for v4l1 - i.e. an element, a src and a sink, but there won't be separate encoding plugins (like v4lmjpegsrc) - all functionality is (thanks to video4linux2) integrated in one plugin: v4l2src. v4l2sink is still to be done, that'll come later.
2002-09-09 07:14:35 +00:00