The base class may have set the DISCONT flag on the first buffer pushed
out. We need to clear that when recycling buffers back into the buffer
pool, otherwise we constantly push out buffers with the discont flag
set, which might upset downstream elements, esp. for compressed
formats like mpeg-ts.
Make sure we always call munmap() with the same size we called mmap()
with before.
Current v4l2src uses the same structure for VIDIOC_QUERYBUF, VIDIOC_QBUF
and v4l2_munmap calls. The problem is that the video buffer size (length)
may vary for compressed or emulated bufs. VIDIOC_QBUF will change it if
we pass the pointer of a v4l2_buffer. This is why we should avoid using
same variable for mmap and video buffers.
https://bugzilla.gnome.org/show_bug.cgi?id=671126
Don't post a (fatal) error message on the bus just because we
failed to query some control. Fixes issue with built-in
Suyin Corp webcam for HP notebook (usbid 064e:e28a) on
OpenSuse 12.1, where querying red/blue balance fails.
https://bugzilla.gnome.org/show_bug.cgi?id=670197
Add private replacements for deprecated functions such as
g_mutex_new(), g_mutex_free(), g_cond_new() etc., mostly
to avoid the deprecation warnings. We'll change these
over to the new API once we depend on glib >= 2.32.
We don't currently support setting the pixel-aspect-ratio from V4L2. So
simply set it to be 1/1 in the caps to prevent negotiation failures when
fixating to weird values (e.g. when the downstream caps has
pixel-aspect-ratio = [ MIN, MAX ] )
https://bugzilla.gnome.org/show_bug.cgi?id=663580
A particular window may be selected using the new xid (X-Window
XID, eg a pointer) and xname (window title) properties. If both
are specified, the XID is used in preference, falling back to
xname if not found.
Default (if none of xid and xname are specified, or if no such
window is found) is to capture the root window.
https://bugzilla.gnome.org/show_bug.cgi?id=546932
We used to skip frame rate setup if the camera was already setup
with the requested frame rate. This breaks some cameras though,
causing them to not output data (several models of Thinkpad cameras
have this problem at least).
So, don't skip.
https://bugzilla.gnome.org/show_bug.cgi?id=638300
This will ensure a logically new buffer does not keep flags from
a previous use of that buffer (eg, DISCONT would be set on the first
buffer, and mistakenly kept when reused).
https://bugzilla.gnome.org/show_bug.cgi?id=653709
Some drivers are buggy are will change the current format when
processing VIDIOC_TRY_FMT. Save and restore the current format
to ensure the format is kept unchanged.
https://bugzilla.gnome.org/show_bug.cgi?id=649067
Use the fraction compare utility to compare function, not the
handcrafted one. The handcrafted one is buggy as it doesn't take into
account rounding error. For example comparing a framerate of 20/1 on a
camera configured as 30/1 fps would yield true: 1 == (1 * 20)/30 and not
re-configure the camera. Fixes#656104
Pretending to handle 8-bit signed causes distorted audio when
actually given such audio, which you will get if passing 8-bit
unsigned through audioconvert ! audioresample, as audioresample
only handles 8-bit signed. Fixes#605834.
Signed-off-by: David Schleef <ds@schleef.org>
Based on a patch by Guennadi Liakhovetski.
v2: updates because I forgot to add GstTuner interface to v4l2sink
v3: update to add all possible values to norm enum
GCC 4.6.x complains about such variable usage. Unused but set variables
were removed except that gst_oss4_mixer_slider_set_mute () now returns
the value from the call to gst_oss4_mixer_set_control_val ().
Commit 6c8268dbfd broke recording
from interlaced v4l2 source (e.g. typical tv capture card) since
V4L2_FIELD_SEQ_TB (with fields stored separately) does not map
to currently defined interlaced format (fields stored interleaved).
Besides this mismatch, hardware might quite likely not support or
appreciate this field value, since querying supported formats mapped
_INTERLACED field formats to interlaced=true caps (so the latter should
not be mapped to field value that is not known to be supported).
gstdirectsoundsink.c: In function 'gst_directsound_sink_write':
gstdirectsoundsink.c:557: error: implicit declaration of function '_swab'
gstdirectsoundsink.c:557: error: nested extern declaration of '_swab'
Older kernels don't have these, and there's no easy way to check for the
existance of enums that doesn't involve a configure check, so just define
these if the V4L2_CAP_VIDEO_OUTPUT_OVERLAY define is not there, which was
added in the same commit as the TB/BT enum. Fixes compilation on CentOS 5.
https://bugzilla.gnome.org/show_bug.cgi?id=639339
These macros will expand to NOOPs given the right defines. Also,
g_return_if_fail() and friends are meant to be used to catch programming
errors (like invalid input to functions), not runtime error handling.
Looks like this got enabled by accident when adding it to v4l2sink,
so undo this for now. Not sure it makes much sense in a GStreamer
context with current hardware.