Commit graph

1599 commits

Author SHA1 Message Date
Ilya Konstantinov
f33954ae1d osxaudiosrc: avoid get_channel_layout
This only produces a warning and serves no purpose.

https://bugzilla.gnome.org/show_bug.cgi?id=743758
2015-07-14 17:49:50 +05:30
Arun Raghavan
8f0f976375 osxaudio: Avoid making a duplicate structure in caps for mono/stereo case
For 1ch or 2ch devices, we just need to set the caps to allow both
options since CoreAudio will up/downmix appropriately.

Also fixes the condition for the 2ch case to be exact, rather than at
least 2 channels since the downmix will not take place in the >stereo
case.
2015-07-14 17:49:50 +05:30
Arun Raghavan
691ecebe22 osxaudio: Don't set the format on an initialized AudioUnit
We need to initialize the AudioUnit early to be able to probe the
underlying device, but according to the AudioUnitInitialize() and
AudioUnitUninitialize() documentation, format changes should be done
while the AudioUnit is uninitialized. So we explicitly uninitialize the
AudioUnit during a format change and reinitialize it when we're done.
2015-07-14 17:49:50 +05:30
Arun Raghavan
22f6d62796 osxaudio: Minor spelling fix (unitialize -> uninitialize) 2015-07-14 17:49:50 +05:30
Ilya Konstantinov
f107f7306b osxaudio: Fix lockup in _audio_unit_property_listener
_audio_unit_property_listener is called either from a Core Audio thread
or as a result of a Core Audio API (e.g. AudioUnitInitialize)
from our own thread. In the latter case, osxbuf can be already locked
(GStreamer's mutex is not recursive).

We introduce the flag cached_caps_valid and use it instead of nullifying
cached_caps when we cannot lock on osxbuf.

https://bugzilla.gnome.org/show_bug.cgi?id=743758
2015-07-14 17:49:50 +05:30
Ilya Konstantinov
a8b2666aa7 osxaudio: Invalidate cached caps on format change
Listen for changes in hardware stream format and channel layout, and
invalidate cached caps (since they contain the preferred caps).

https://bugzilla.gnome.org/show_bug.cgi?id=743758
2015-07-14 17:49:50 +05:30
Ilya Konstantinov
0e5d698c6f osxaudio: Overhaul of probing caps
- Probing caps is unified between source and sink
- Hardware stream format is now reported as preferred capabilities
  (dynamically updated when hardware configuration changes)
- Get hardware channel layout from Remote IO just like from HAL
- More comprehensive mapping between AudioChannelLabel and
  GstAudioChannelPosition
- Support for unpositioned channel layouts
- Announce stereo-mono upmixing/downmixing in caps

https://bugzilla.gnome.org/show_bug.cgi?id=743758
2015-07-14 17:49:50 +05:30
Ilya Konstantinov
8a8884e150 osxaudio: AudioUnitInitialize on open
Call AudioUnitInitialize upon open. Otherwise, we cannot get
(hardware) stream format nor channel layout from the outer scope.
2015-07-14 17:49:50 +05:30
Hyunjun Ko
c5c7e7e084 ximagesrc: add meta transform function
ximage metadata can't be transformed or copied, but provide an empty
transformation function instead of NULL to allow unconditional calling
of metas' transform functions.

https://bugzilla.gnome.org/show_bug.cgi?id=751778
2015-07-06 14:49:50 +03:00
Luis de Bethencourt
911f7b38b9 v4l2transform: fix memory leak
tmp needs to be freed before going out of scope in 'done'.

CID #1308954
2015-07-02 14:37:41 +01:00
Luis de Bethencourt
600942788d v4l2: document fallthrough cases
Pacify coverity and document fallthrough cases in switch statements.

CID #1308948, #1308947, #1308946
2015-06-29 16:05:48 +01:00
Ilya Konstantinov
f676079e95 osxaudio: fix latency property query on RemoteIO
AudioUnitGetProperty would fail with kParamErr (-50) every time,
simply because size wasn't initialized.

Now it returns zero latency, but at least it doesn't fail.

https://bugzilla.gnome.org/show_bug.cgi?id=750868
2015-06-12 22:43:59 +02:00
Philipp Zabel
95bab88225 gstv4l2bufferpool: handle -EPIPE from DQBUF to signal EOS
The V4L2 decoder signals EOS by returning -EPIPE from DQBUF after the
last buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=743338
2015-06-09 21:56:40 -04:00
Enrico Jorns
3067a60d8e v4l2: Allow scaling in the v4l2*convert element
This is inspired of videoscale and videoconvert elements.

https://bugzilla.gnome.org/show_bug.cgi?id=742917
2015-06-09 18:50:25 -04:00
Nicolas Dufresne
0f81b2e99c v4l2: Also set colorimetry on output devices
This completes the code that set the colorimetry on output
device.
2015-06-08 19:14:41 -04:00
Nicolas Dufresne
87a4884acd v4l2: Add missing SMTP240M matrix
This is missing in the doc, but was in the header.
2015-06-08 19:14:41 -04:00
Nicolas Dufresne
b5d66d68ce v4l2object: Fully implement colorimetry support
This fixes wrong mapping for sRGB as in GStreamer sRGB correctly
apply to RGB formats, while in V4L2 it's an alias for sYCC. Also
add support for the new quantization (range), ycbcr_encoding (matrix)
and xfer_func (transfer) enumeration.
2015-06-08 17:56:48 -04:00
Nicolas Dufresne
70e98a1a68 v4l2: Update kernel headers to latest from media tree
This is the latest from media tree. This should enable more development
of the v4l2 elements. This includes new flags requires to fix draining
path in decoder, colorimetry and much more.
2015-06-08 17:56:48 -04:00
Nicolas Dufresne
0196fdb5ec v4l2: Don't warn when optional CID are not implement
gst_v4l2_get_attributre() shall only be used when the CID is expected
to be supported. Otherwise, we get unwanted warning posted to the bus.
2015-06-05 15:34:12 -04:00
Wim Taymans
8c116cfcd8 v4l2: don't add the same interlace mode twice
Some drivers modify the interlace mode to progressive, no matter what
input you give them, make sure that we don't add the same interlace mode
twice.
2015-04-22 18:05:24 +02:00
Luis de Bethencourt
dad26043c3 v4l2: cast unused return to void
Quell unchecked return value defect by casting the return value to void and
making it explicit it is going to be ignored.

CID #206031
2015-04-21 15:21:37 +01:00
Ilya Konstantinov
36decd3b39 osxaudio: fix spelling in debug message
https://bugzilla.gnome.org//show_bug.cgi?id=747936
2015-04-17 00:36:04 +01:00
Peter Seiderer
f160625ea6 v4l2src: device sequence/offset correction in case of renegotiation
The v4l2 device restarts the sequence counter in case of streamoff/streamon,
the GST offset values are supposed to increment strictly monotonic, so
adjust the sequence counter/offset values in case of caps
renegotiation.

https://bugzilla.gnome.org/show_bug.cgi?id=745441
2015-04-02 17:40:20 -04:00
Peter Seiderer
866d97fa2c v4l2src: add frame loss detection
In case of v4l2 driver filled offset/sequence values add frame
loss detection (and write a warning message).

Move offset meta data setting and frame loss checking after the
timestamp adjustment code to get proper timestamps for the
warning message.

https://bugzilla.gnome.org/show_bug.cgi?id=745441
2015-04-02 17:40:19 -04:00
Peter Seiderer
f16fe891fb v4l2: use v4l2 capture device sequence counter
Use the v4l2 capture device sequence counter for
setting the GstBuffer offset/offset_end values.

https://bugzilla.gnome.org/show_bug.cgi?id=745441
2015-04-02 17:40:19 -04:00
Tobias Modschiedler
8390288a6e v4l2: Ask the driver about its requirements for min_buffers before initiating buffer pool.
If propose_allocation() had not been called yet, it was possible that the driver was not asked at all.
In buffer pool: Consider minimum number of buffers requested by driver when setting config.

https://bugzilla.gnome.org/show_bug.cgi?id=746834
2015-04-02 17:29:19 -04:00
Julien Isorce
d63c163335 osxvideosink: check for deprecated constants prior to OSX 10.10
cocoawindow.m:339:5: error: 'NSOpenGLPFAWindow'
is deprecated: first deprecated in OS X 10.9

cocoawindow.m:576:7: error: 'NSOpenGLPFAFullScreen'
is deprecated: first deprecated in OS X 10.6

cocoawindow.m:605:24: error: 'setFullScreen'
is deprecated: first deprecated in OS X 10.7
2015-03-24 23:16:26 +00:00
Ilya Konstantinov
6af516b21f osxaudio: Fix string format warning on 32-bit
UInt32 (Darwin, not C99's uint32_t) is 'unsigned long' on 32-bit
platforms.
2015-03-23 19:48:43 +05:30
Thiago Santos
0a945e7099 v4l2src: delay renegotiation until it is likely buffers were reclaimed
Allow renegotiation to happen when buffers have returned after an allocation
query. As the allocation query is serialized, all buffers from the pool
should have returned and we can stop it to create a new one for the
new format

https://bugzilla.gnome.org/show_bug.cgi?id=682770
2015-03-13 18:48:03 +00:00
Thiago Santos
6cfa6c0da8 v4l2object: add gst_v4l2_object_try_format
Similar to set_format but it uses TRY_FMT instead of S_FMT

https://bugzilla.gnome.org/show_bug.cgi?id=682770
2015-03-13 18:47:55 +00:00
Jan Schmidt
c809bcd394 Remove a couple of superfluous trailing semi-colons 2015-03-12 01:37:08 +11:00
Tim-Philipp Müller
c4fa54da17 Fix double semicolons 2015-03-10 09:31:20 +00:00
Ilya Konstantinov
b528c527b7 osxaudio: stream format is an SPDIF-only field 2015-03-10 09:14:57 +05:30
Ilya Konstantinov
7b365042f0 osxaudio: fix spaces 2015-03-10 09:14:57 +05:30
Ilya Konstantinov
8f62f50a98 osxaudio: add type check macro 2015-03-10 09:14:57 +05:30
Ilya Konstantinov
d450b1cac1 osxaudio: rename gst_core_audio_set_channels_layout()
to gst_core_audio_get_channel_layout().
2015-03-10 09:14:57 +05:30
Ilya Konstantinov
4637b3eb82 osxaudio: remove unused finalize 2015-03-10 09:14:57 +05:30
Nicolas Dufresne
eeb4d2e8b1 v4l2bufferpool: Don't update buffer for OUTPUT
For output device, we should not update the buffer with flags and
timestamp when we dequeue. The information in the v4l2_buffer is not
meaningful and it breaks the case where the buffer is rendered at
multiple places.

https://bugzilla.gnome.org/show_bug.cgi?id=745438
2015-03-08 21:15:53 +00:00
Thiago Santos
c194f2de12 directsoundsink: fix modulo math with ringbuffer parameters
To get a multiple of bpf use a subtraction and not an addition

https://bugzilla.gnome.org/show_bug.cgi?id=745684
2015-03-06 11:27:41 -03:00
Arun Raghavan
995ba701b7 osxaudiosrc: Allow caps renegotiation
The ringbuffer does allow renegotiation, so we do not have to report
fixed caps once it is acquired (based on a similar patch for the sink
side by Ilya Konstantinov <ilya.konstantinov@gmail.com>).
2015-03-03 23:26:58 +05:30
Ilya Konstantinov
fd25ef137e osxaudiosink: Allow renegotiating caps
Once osxaudiosink's device is open, it fixates on the initial caps and
refuses to accept new caps. This is erroneous since the Audio Unit is
can accept a new ASBD, and GstAudioRingBuffer supports reconfiguration
as well.

https://bugzilla.gnome.org/show_bug.cgi?id=743925
2015-03-03 23:26:58 +05:30
Gwenole Beauchesne
8cd40e77b7 v4l2allocator: fix fd leak in DMABUF import mode.
Ensure gst_v4l2_buffer_pool_release_buffer() releases the associated
GstV4l2MemoryGroup. In particular, this allows for closing the DMABUF
handles prior to instantiating new ones.

https://bugzilla.gnome.org/show_bug.cgi?id=745443
2015-03-02 15:10:51 -05:00
Nicolas Dufresne
8e75acc7b7 v4l2bufferpool: Add missing break
This is cosmetic change.
2015-03-01 14:03:04 -05:00
Nicolas Dufresne
76775efe71 v4l2: Workaround driver not setting field correctly
As it's very common, handle driver not setting field in buffers
by using the field value from the format. This workaround a long time
bug in UVC driver. For even buggier driver, we simply assume
progressive as before. We also only warn once, to avoid spamming.
2015-03-01 14:03:04 -05:00
Aurélien Zanelli
88703ae585 v4l2: query crop configuration after each call of S_CROP
S_CROP ioctl is write-only and the device can adjust crop rectangle so
we query back the crop configuration after each S_CROP to know what has
been done.

https://bugzilla.gnome.org/show_bug.cgi?id=736133
2015-02-26 08:38:32 -05:00
Aleix Conchillo Flaqué
63746c4131 v4l2bufferpool: Check corruption flag on the right buffer
We where checking the buffer we are copying to instead of the buffer we
are copying from.

https://bugzilla.gnome.org/show_bug.cgi?id=740040
2015-02-25 20:53:19 -05:00
Aurélien Zanelli
7a1613b9e1 v4l2object: set colorspace in caps for capture devices
This information is set by the driver for a capture device, and so could
be forwarded to pipeline by setting the colorimetry in caps.

https://bugzilla.gnome.org/show_bug.cgi?id=743186
2015-02-25 14:48:20 -05:00
Aurélien Zanelli
600027a1ee v4l2bufferpool: fix import_userptr() in single-planar API when n_planes > 1
In the V4L2 single-planar API, when format is semi-planar/planar,
drivers expect the planes to be contiguous in memory.
So this commit change the way we handle semi-planar/planar format
(n_planes > 1) when we use the single-planar API (group->n_mem == 1).

To check that planes are contiguous and have expected size, ie: no
padding. We test the fact that plane 'i' start address + plane 'i'
expected size equals to plane 'i + 1' start address. If not, we return
in error.

Math are done in bufferpool rather than in allocator because the
former is aware of video info.

https://bugzilla.gnome.org/show_bug.cgi?id=738013
2015-02-25 14:25:01 -05:00
Aurélien Zanelli
ac3cb8817e v4l2allocator: let bufferpool calculate image size when importing userptr
Offset are relative to the buffer and there is no guarantee substracting
them will give us the plane size. So we let bufferpool make the math as
it is more aware of video info than allocator and pass a size array to
allocator import function.

Pointed out by Nicolas Dufresne <nicolas.dufresne@collabora.com>

https://bugzilla.gnome.org/show_bug.cgi?id=738013
2015-02-25 14:24:49 -05:00
Philippe De Muyter
61a5e5af95 v4l2object: recognize and distinguish all bayer arrangements
Up to now, v4l2src recognized only "bggr" amongst the bayer arrangements.
Recognize now also the "rggb", "gbrg" and "grbg" arrangements.

https://bugzilla.gnome.org/show_bug.cgi?id=742363
2015-02-25 14:14:59 -05:00
Aurélien Zanelli
e57bc43862 v4l2bufferpool: set v4l2_buffer.field when queuing buffer in an output device
According to the current specification, application must set this field
for an output device.

https://bugzilla.gnome.org/show_bug.cgi?id=743013
2015-02-25 10:27:30 -05:00
Ilya Konstantinov
8ca40fa86f osxaudiosrc: iOS resampling causes stuttering
Fixes stuttering audio when iOS AU is resampling. To make AU resample,
one has to request a rate that differs from AVAudioSession's
sampleRate. The resampling itself is not the culprit, but rather our
API misuse.

AudioUnitRender modifies the mDataByteSize members with the
actual read bytes count. Therefore, they must be reinitialized
before each AudioUnitRender. (The buffers themselves can be
preallocated.)

The "stutter" was caused by one AudioUnitRender making the buffer
too small for other AudioUnitRender invocations, making them fail
with -50 (paramErr). By way of luck, when AU didn't resample, all
AudioUnitRender invocations read the same number of bytes.

(This patch addresses some non-interleaved audio concerns, but
at this moment the elements do not support non-interleaved audio
and non-interleaved is untested.)

https://bugzilla.gnome.org/show_bug.cgi?id=744922
2015-02-24 16:21:11 +05:30
Tim-Philipp Müller
ba0eeaf8f4 ximagesrc: remove pointless g_return_val_if_fail()
ximage won't ever be NULL here because the dispose
function is called via ximage->dispose().
2015-02-23 20:06:25 +00:00
Nicolas Dufresne
6afd1c5d57 v4l2: Enable copy when no known allocation params
When there is no allocation parameters in the query, enable copy
threshold. When this threshold is reached, the buffer pool will start
copying when the pool reaches a critical level. If the driver supports
CREATE_BUFS, this will be used instead.
2015-02-19 23:16:00 -05:00
Nicolas Dufresne
dfb0ec6d4d v4l2bufferpool: Update allocator flags
When we hit emulated formats, we disable CREATE_BUFS since libv4l2
cope very badly with it. Also clear the allocator flags so we will
never try to allocate more buffers. This fixes failure when the copy
threshold is reached as we where calling CREATE_BUFS, which lead to
libv4l2 instability.
2015-02-19 23:16:00 -05:00
Nicolas Dufresne
7dc475f141 v4l2bufferpool: Use specific debug category
The pool has grown enough that it is now handy to seperate v4l2object
trace from v4l2bufferpool trace.
2015-02-19 23:16:00 -05:00
Luis de Bethencourt
7ca7b1cd9a Revert "v4l2: fraction is reversed"
This reverts commit b91fe36644.
2015-02-18 19:18:00 +00:00
Luis de Bethencourt
b91fe36644 v4l2: fraction is reversed
In the fraction 1 / 2. 1 is the numerator and 2 is the denominator.
The arguments of fraction gst_value_set_fractions() are value,
numerator and denominator.
Also, gst_value_set_fraction() fails if denominator is 0 for obvious
reasons.
2015-02-18 17:49:31 +00:00
Nicolas Dufresne
171bfeccdf v4l2pool: Deactivate other pool
When importing buffers from a downstream pool, we need to deactivate
that pool to ensure it will be usable again later. Relying on the
refcount to reach zero does not work, since elements like xvimagesink
keeps a reference on their proposed pool.
2015-02-18 09:05:37 -05:00
Nicolas Dufresne
f5ef99fe5e v4l2allocator: Fix freeing of shared memory
When memory (that has been shared using gst_memory_share()) are freed,
the memory (or the DMABUF FD) should not bee freed. These memories have
a parent. This also removes the extra _v4l2mem_free function and avoid
calling close twice on the DMABUF FD.

https://bugzilla.gnome.org/show_bug.cgi?id=744573
2015-02-15 16:21:55 -05:00
Peter Seiderer
c88e042458 v4l2object: reuse caps framerate if not overwritten by v4l2 device
Enables duration setting in v4l2src.

https://bugzilla.gnome.org/show_bug.cgi?id=740403
2015-01-22 18:52:44 -05:00
Nicolas Dufresne
f3f4bdd676 v4l2videodec: Proxy getcaps
Replace the sink_query with new getcaps() virtual and use the proxy
helper with the probed caps. This allow upstream element taking decision
base on what is supported downstream.
2015-01-13 16:55:43 -05:00
Sebastian Dröge
81e15d22c0 osxvideosink: Disable hack for NSApp iteration with a special #define
The hack causes deadlocks and other interesting problems and it really
can only be fixed properly inside GLib. We will include a patch for
GLib in our builds for now that handles this, and hopefully at some
point GLib will also merge a proper solution.

A proper solution would first require to refactor the polling in
GMainContext to only provide a single fd, e.g. via epoll/kqueue
or a thread like the one added by our patch. Then this single
fd could be retrieved from the GMainContext and directly integrated
into a NSRunLoop.

https://bugzilla.gnome.org/show_bug.cgi?id=741450
https://bugzilla.gnome.org/show_bug.cgi?id=704374
2015-01-10 15:54:22 +01:00
Nicolas Dufresne
5c67ba7f88 v4l2videodec: Prevent renegotiation
Renegotiation isn't supported, simply prevent it the way we do in
v4l2src.
2015-01-09 16:59:53 -05:00
Nicolas Dufresne
c4aaff5c92 v4l2videodec: Don't unlock the stream lock twice 2015-01-09 16:55:55 -05:00
Nicolas Dufresne
f7c682f802 v4l2allocator: Add protection against driver bug
v4l2loopback driver has a this nasty bug that if the queue is larger
then 2 buffers, it returns random index on dqbuf. So far we assumed
that the index was always right, which would lead to memory being
unref twice, and eventually crash.
2015-01-08 23:55:28 -05:00
Nicolas Dufresne
3e876215b7 v4l2: Don't use allocator size to iterate
As the buffer array is fixed size and small, it's safer to simply
use this static size to cleanup the buffers. This is also more
consistent with the rest. The associated method is no longer
required and can be dropped.
2015-01-08 23:55:28 -05:00
Nicolas Dufresne
e47a5708f0 v4l2bufferpool: Don't clean buffer array in dispose
This should already have been done, plus this code is incorrect
and may lead to crash.

https://bugzilla.gnome.org/show_bug.cgi?id=742074
2015-01-08 23:55:28 -05:00
Nicolas Dufresne
bbcfd594e4 v4l2bufferpool: Don't ref queued output buffer
This partly revert to the old 1.2 behavior. Instead of keeping a
reference to the output buffer queued, we simply release them but
don't forward it to GstBufferPool. This way, the buffer pool don't
need to be flushed to be stopped.

https://bugzilla.gnome.org/show_bug.cgi?id=742074
2015-01-08 23:55:28 -05:00
Nicolas Dufresne
a4b961e275 v4l2bufferpool: Never fail on streamoff
Failing streamoff prevents allocator from being disposed hence
lead to device FD leak. There is no known cases where streamoff
may fails for which we'd still be streaming. streamoff is known
to fail when a device is being unplugged (in which case errno
19/ENODEV is set).

https://bugzilla.gnome.org/show_bug.cgi?id=732734
2015-01-08 11:37:23 -05:00
Sebastian Dröge
11d6be2dcb osxaudio: Directly return the ringbuffer's caps if it is acquired 2014-12-22 15:33:51 +01:00
Sebastian Dröge
fc1670b75d osxaudio: Put all audio formats into the template caps
We report the proper caps later from the get_caps() vfunc implementation after
probing the selected device.
2014-12-22 12:56:19 +01:00
Sebastian Dröge
b83cd14a12 osxaudio: Also set the big endian flag for floating point samples 2014-12-22 12:56:05 +01:00
Sebastian Dröge
e7b10a107d osxaudio: Fix deadlock and property change notification in device selection code
After creating the ringbuffer we have to set the device on the ringbuffer as
it defaults to kAudioDeviceUnknown. At this point it can't have changed to
anything else yet and we don't have to notify about changes to the sink/src
"device" property. It's also not a good idea because GstAudioBaseSrc has the
object lock taken while the ringbuffer is created, which might cause a
deadlock if something calls back into the element from "notify::device".

Once the base class is done with the NULL_TO_READY state change, it has opened
the device via the ringbuffer and this might have chosen a different device.
Especially if we initially used kAudioDeviceUnknown. Also notify about this
property change as initially intended by this code.
2014-12-22 10:29:01 +01:00
Nicolas Dufresne
2a1459c88f v4l2pool: Update configuration size
We already update our copy of VideoInfo.size to proper size, now also
the configuration so the size matches on release.

https://bugzilla.gnome.org/show_bug.cgi?id=741420
2014-12-19 12:32:06 -05:00
Nicolas Dufresne
f6259e96c7 v4l2bufferpool: Disable create_buf with libv4l2
Libv4l2 does not work with CREATE_BUFS. Instead of failing on random
error caused by libv4l2, disable CREATE_BUFS when an emulated format is
detected.
2014-12-16 15:00:22 -05:00
Nicolas Dufresne
1fe4a19dc2 v4l2allocator: Add protection against broken libv4l2
It looks like libv4l2 support for CREATE_BUF is incomplete. That
combine with existing bugs may lead to crash in GStreamer. These
check will make it robust by:

- Checking create buf index isn't an already in used index
- Checking that the index out of QUERYBUF matches the requested
  index
2014-12-16 13:42:22 -05:00
Wim Taymans
0b881ab2ce osxvideosink: clear rectangle structures before use 2014-12-16 13:25:01 +01:00
Nicolas Dufresne
3dae65ede8 v4l2object: Always set format
Right now we try to be clever by detecting if device format have
changed or not, and skip setting format in this case. This is valid
behaviour with V4L2, but it's also very error prone. The rational
for not setting these all the time is for speed, though I can't
measure any noticeable gain on any HW I own. Also, until recently,
we where doing get/set on the format for each format we where
probing, making it near to impossible that the format would match.
This also fixes bug where we where skipping frame-rate setting if
format didn't change.

https://bugzilla.gnome.org/show_bug.cgi?id=740636
2014-12-15 18:38:00 -05:00
Arun Raghavan
db91486aa8 osxaudiosink: Prefer filter caps order while getting caps
https://bugzilla.gnome.org/show_bug.cgi?id=740987
2014-12-15 11:22:44 +05:30
Arun Raghavan
f573f028d2 osxaudiosink: Add some error handling around channel layout parsing
For now we just spit a warning and ignore the channel layout if we can't
support it.

https://bugzilla.gnome.org/show_bug.cgi?id=740987
2014-12-15 11:19:52 +05:30
Arun Raghavan
d18a6b0a2c osxaudio: Take lock around sink/source before accessing the ringbuffer
https://bugzilla.gnome.org/show_bug.cgi?id=740987
2014-12-15 11:19:52 +05:30
Arun Raghavan
4a58ebf487 osxaudiosrc: Probe channel layout too
https://bugzilla.gnome.org/show_bug.cgi?id=740987
2014-12-15 11:19:52 +05:30
Arun Raghavan
df610a7c18 osxaudiosink: Only fix up channels/layout for PCM caps while probing
It's unlikely that setting a channel layout will do much for AC3/DTS
streams. If we find at some point that it does make sense, we can
perform the structure copying unconditionally (i.e., the current code is
wrong, since AC3/DTS will get two structures now - one with the channel
layout, one without).

https://bugzilla.gnome.org/show_bug.cgi?id=740987
2014-12-15 11:19:52 +05:30
Arun Raghavan
bd1502862c osxaudiosrc: Implement caps probing
https://bugzilla.gnome.org/show_bug.cgi?id=740987
2014-12-15 11:19:52 +05:30
Arun Raghavan
48872dbc56 osxaudio: Bind audio device to audio unit early
We want to bind the device during open so that subsequent format queries
on the audio unit are as specific as possible from that point onwards.

https://bugzilla.gnome.org/show_bug.cgi?id=740987
2014-12-15 11:19:52 +05:30
Arun Raghavan
2d0391c6e1 osxaudiosink: Fix up caps querying a bit
This should make caps queries correct in PAUSED and higher as well.

https://bugzilla.gnome.org/show_bug.cgi?id=740987
2014-12-15 11:19:51 +05:30
Arun Raghavan
f967f0742f osxaudio: Move osxaudiosrc-specific code out of the generic path
Avoids one layering violation (GstCoreAudio referring to
GstOsxAudioSrc).

https://bugzilla.gnome.org/show_bug.cgi?id=740987
2014-12-15 11:19:51 +05:30
Arun Raghavan
ffcb1577fa osxaudio: Clean up a GstCoreAudio -> GstOsxAudioSrc/Sink reference
Now that device selection has no sink/source-specific bits, we can have
generic device selection for this path. We do need to now track state
changes so we can look up the final device_id once the device is open,
though.

https://bugzilla.gnome.org/show_bug.cgi?id=740987
2014-12-15 11:19:51 +05:30
Arun Raghavan
5c2f041286 osxaudiosink: Move device caps probing to get_caps()
This should be preferred to running the probe at device open time.

https://bugzilla.gnome.org/show_bug.cgi?id=740987
2014-12-15 11:19:51 +05:30
Arun Raghavan
945aaa0a35 osxaudio: Make some debug code compile conditionally
https://bugzilla.gnome.org/show_bug.cgi?id=740987
2014-12-15 11:19:51 +05:30
Arun Raghavan
b06ae28061 osxaudio: Move device selection to ringbuffer->open_device()
This is conceptually the right thing to do, and allows us to correctly
catch errors in device selection as well, which we could not do while
creating the ringbuffer.

https://bugzilla.gnome.org/show_bug.cgi?id=740987
2014-12-15 11:19:51 +05:30
Arun Raghavan
199461bb2e osxaudio: Consolidate input and output code paths a bit
https://bugzilla.gnome.org/show_bug.cgi?id=740987
2014-12-15 11:19:51 +05:30
Aurélien Zanelli
62193129c5 v4l2bufferpool: set buffer interlace flags when field is V4L2_FIELD_INTERLACED
If v4l2_buffer.field is V4L2_FIELD_INTERLACED, we set corresponding
GstVideoBuffer flags depending on the video standard.
According to V4L2 specification, M/NTSC transmits the bottom field
first, all other standards the top field first.

https://bugzilla.gnome.org/show_bug.cgi?id=737603
2014-12-09 11:00:28 -05:00
Nicolas Dufresne
eb1dcd841a v4l2: Workaround libv4l2 RW emulation bug
When libv4l2 emulates RW mode on top of MMAP devices, the queues are
only initialized on first read. The problem is that poll() will fail
if called before the queues are initialized and streaming. Workaround
this by doing a zero size read when pool is started in that IO mode.

https://bugzilla.gnome.org/show_bug.cgi?id=740633
2014-12-07 17:43:01 -05:00
Nicolas Dufresne
0e05faf91a v4l2: Fix RW io mode
In RW, allocator can be null, max_buffers can be zero, and we need not
to wait while the queue is empty since there is no queue.

https://bugzilla.gnome.org/show_bug.cgi?id=740633
2014-12-07 17:42:48 -05:00
Nicolas Dufresne
d328eea5f2 v4l2bufferpool: Cleanup uneeded check and cases
There is nothing in between the break and the "done:" anymore, plus
USERPTR and DMABUF_IMPORT case is exactly the same.
2014-12-04 17:00:25 -05:00
Nicolas Dufresne
319efc3e20 v4l2pool: Fix CREATE_BUFS support for capture
This patch fixes CREATE_BUFS support for capture devices. Initially we
would only try and allocate more buffers when the copy threshold
is reached. When the threshold was not set (needed) it would never
happen. Another problem is that on capture side, acquire returns
filled buffer, hence need to pool. We need to set a special flag to
force allocation to happen.

https://bugzilla.gnome.org/show_bug.cgi?id=741134
2014-12-04 17:00:25 -05:00
Nicolas Dufresne
b80edd2ee2 v4l2allocator: Fix CREATE_BUF probing
Current for every memory type we where probing MMAP CREATE_BUFS ioct.

https://bugzilla.gnome.org/show_bug.cgi?id=741134
2014-12-04 17:00:25 -05:00
Aurélien Zanelli
114b84c1a3 v4l2allocator: fix gst_v4l2_allocator_stop prototype
gst_v4l2_allocator_stop returns a GstV4l2Return, not a gboolean.

https://bugzilla.gnome.org/show_bug.cgi?id=739792
2014-12-01 10:08:54 -05:00