Commit graph

199 commits

Author SHA1 Message Date
Wim Taymans
f8ef57ca48 Merge branch 'master' into 0.11 2011-11-10 17:26:12 +01:00
Vincent Penquerc'h
0d47c615ad baseaudiosink: make unsigned properties unsigned, not signed 2011-11-10 15:55:31 +00:00
Wim Taymans
57eaf388e0 audio: fix base class vmethods 2011-11-10 16:24:12 +01:00
Wim Taymans
1f8fe283f6 audioclock: remove _full version 2011-11-10 13:51:23 +01:00
Wim Taymans
d77c8cafee Merge branch 'master' into 0.11
Conflicts:
	common
	ext/pango/gsttextoverlay.c
	gst-libs/gst/video/video.c
2011-11-09 12:11:59 +01:00
Tim-Philipp Müller
d7fc45f42e docs: fix up some Since: markers 2011-11-07 23:05:44 +00:00
Wim Taymans
7ac25e9b26 Merge branch 'master' into 0.11
Conflicts:
	common
	configure.ac
	gst-libs/gst/audio/gstbaseaudiosink.c
	gst/playback/gstdecodebin2.c
	gst/playback/gstplaysinkaudioconvert.c
	gst/playback/gstplaysinkaudioconvert.h
	gst/playback/gstplaysinkvideoconvert.c
	gst/playback/gstplaysinkvideoconvert.h
2011-11-07 12:23:15 +01:00
Felipe Contreras
3df415d4c7 baseaudiosink: make discont-wait configurable
Now we can configure how much time to wait before deciding that a
discont has happened.

Also, adds getter and setter to allow derived implementations to set
this value upon construction.

Suggestions and several improvements by Havard Graff.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-11-07 11:58:46 +01:00
Felipe Contreras
0a111bf26e baseaudiosink: delay the resyncing of timestamp vs ringbuffertime
A common problem for audio-playback is that the timestamps might not
be completely linear. This is specially common when doing streaming over
a network, where you can have jittery and/or bursty packettransmission,
which again will often be reflected on the buffertimestamps.

Now, the current implementation have a threshold that says how far the
buffertimestamp is allowed o drift from the ideal aligned time in the
ringbuffer. This was an instant reaction, and ment that if one buffer
arrived with a timestamp that would breach the drift-tolerance, a resync
would take place, and the result would be an audible gap for the
listener.

The annoying thing would be that in the case of a "timestamp-outlier",
you would first resync one way, say +100ms, and then, if the next
timestamp was "back on track", you would end up resyncing the other way
(-100ms) So in fact, when you had only one buffer with slightly off
timestamping, you would end up with *two* audible gaps. This is the
problem this patch addresses.

The way to "fix" this problem with the previous implementation, would
have been to increase the "drift-tolerance" to a value that was greater
than the largest timestamp-outlier one would normally expect.  The big
problem with this approach, however, is that it will allow normal
operations with a huge offset timestamp vs running-time, which is
detrimental to lip-sync. If the drift-tolerance is set to 200ms, it
basically means that lip-sync can easily end up being off by that much.

This patch will basically start a timer when the first breach of
drift-tolerance is detected. If any following timestamp for the next n
nanoseconds gets "back on track" within the threshold, it has basically
eliminated the effect of an outlier, and the timer is stopped.  If,
however, all timestamps within this time-limit are breaching the
threshold, we are probably facing a more permanent offset in the
timestamps, and a resync is allowed to happen.

So basically this patch offers something as rare as both higher
accuracy, it terms of allowing smaller drift-tolerances, as well as much
smoother, less glitchy playback!

Commit message and improvments by Havard Graff.

Fixes bug #640859.
2011-11-07 11:33:32 +01:00
Felipe Contreras
3f1395afae baseaudiosink: rename some variables 2011-11-07 11:18:34 +01:00
Felipe Contreras
fbde258be6 baseaudiosink: use gst_util_uint64_scale_int when appropriate
It's probably safer this way.
2011-11-07 11:11:08 +01:00
Felipe Contreras
369cf3f14a baseaudiosink: split drift-tolerance into alignment-threshold
So that drift-tolerance is used for clock slaving resync, and
alignment-threshold is for timestamp drift.
2011-11-07 11:10:05 +01:00
Felipe Contreras
58b9818853 baseaudiosink: trivial comment fixes
Some found by Havard Graff.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2011-11-07 10:57:56 +01:00
Tim-Philipp Müller
b52c5819fb Update for pad API changes
GstProbeType, GstProbeReturn and GstActivateMode -> GstPad*
2011-11-01 00:34:28 +00:00
Wim Taymans
016d036137 Merge branch 'master' into 0.11
Conflicts:
	configure.ac
	gst-libs/gst/audio/gstbaseaudiosink.c
	gst/audioconvert/channelmixtest.c
	gst/playback/gstplaybasebin.c
	gst/playback/gstsubtitleoverlay.c
	tests/examples/Makefile.am
	tests/examples/audio/Makefile.am
2011-10-27 15:44:58 +02:00
Tim-Philipp Müller
4e59e63ff7 baseaudiosink: fix unused variable compiler warning if debugging in core is disabled
https://bugzilla.gnome.org/show_bug.cgi?id=660150
2011-10-19 00:32:13 +01:00
Wim Taymans
f1088ed647 update for UNEXPECTED -> EOS flowreturn 2011-10-10 11:39:52 +02:00
Wim Taymans
dae848818d audio: rework audio caps.
Rework the audio caps similar to the video caps. Remove
width/depth/endianness/signed fields and replace with a simple string
format and media type audio/x-raw.
Create a GstAudioInfo and some helper methods to parse caps.
Remove duplicate code from the ringbuffer and replace with audio info.
Use AudioInfo in the base audio filter class.
Port elements to new API.
2011-08-18 19:15:03 +02:00
Wim Taymans
33467d9629 Merge branch 'master' into 0.11
Conflicts:
	configure.ac
	ext/pango/gsttextoverlay.c
	ext/theora/gsttheoradec.c
	gst/adder/gstadder.c
	gst/adder/gstadder.h
	gst/audioresample/gstaudioresample.c
	gst/encoding/gstencodebin.c
	gst/playback/gstdecodebin.c
	gst/playback/gstdecodebin2.c
	tests/check/elements/decodebin2.c
	tests/check/elements/playbin-compressed.c
	win32/common/libgsttag.def
2011-08-16 18:01:14 +02:00
Josep Torra
5629ed74b3 Fix debug statements
Fixes build on MacOSX

Signed-off-by: Edward Hervey <edward.hervey@collabora.co.uk>
2011-08-10 11:15:41 +02:00
Stefan Sauer
264d91a502 baseaudiosink: fix latency calculation for live elements
Max_latency was computed on already adjusted min_latency. Introduce a new
variable for clarity. Spotted by Blaise Gassend.
Fixes #644284
2011-07-28 14:31:47 +02:00
Mark Nauwelaerts
68231a645a baseaudiosink: fix max latency calculation
... to allow infinite max, as also claimed by comment.
2011-07-28 12:05:06 +02:00
Mark Nauwelaerts
5d0f279fea baseaudiosink: drop samples that are too late
... rather than having all of them rendered at 0 or subsequently aligned,
likely inevitably leading to repeated resyncing.
2011-07-28 11:47:52 +02:00
Wim Taymans
a3971d2afe baseaudiosink: chain up to parent_class correctly 2011-07-26 12:42:22 +02:00
Wim Taymans
8aea5d34bd baseaudiosink: use new basesink query vmethod 2011-07-26 12:37:04 +02:00
Wim Taymans
a58805216a audio: clean up headers 2011-06-21 18:17:59 +02:00
Wim Taymans
a87c021237 Merge branch 'master' into 0.11
Conflicts:
	gst-libs/gst/video/convertframe.c
2011-05-24 09:47:15 +02:00
Thijs Vermeir
dad50ad1fe baseaudiosink: recalibrate clock on setcaps
Because the spec for the ringbuffer can change when changing
the caps, we must recalibrate the clock.

https://bugzilla.gnome.org/show_bug.cgi?id=610443
2011-05-23 17:02:03 +02:00
Sebastian Dröge
318ed07598 Revert "-base_port to new query API"
This reverts commit c9f4e0676b.
2011-05-17 11:25:31 +02:00
Sebastian Dröge
d0362c2b87 Merge branch 'master' into 0.11
Conflicts:
	configure.ac
	ext/alsa/gstalsasrc.c
	gst-libs/gst/audio/gstbaseaudiosink.c
	gst-libs/gst/tag/gstxmptag.c
	gst/playback/gstsubtitleoverlay.c
	gst/videorate/gstvideorate.c
	sys/xvimage/xvimagesink.c
2011-05-16 17:06:22 +02:00
Wim Taymans
94dfe80f71 -base: port to new SEGMENT API 2011-05-16 13:48:11 +02:00
Arun Raghavan
824e643ec9 baseaudiosink: Fix trivial indentation problems 2011-05-14 18:53:12 +05:30
Arun Raghavan
643e5f586c baseaudiosink: Allow subclasses to provide payloaders
This allows subclasses to provide a "payload" function to prepare
buffers for consumption. The immediate use for this is for sinks that
can handle compressed formats - parsers are directly connected to the
sink, and for formats such as AC3, DTS, and MPEG, IEC 61937 patyloading
might be used.

API: GstBaseAudioSinkClass:payload()

https://bugzilla.gnome.org/show_bug.cgi?id=642730
2011-05-14 18:23:18 +05:30
Wim Taymans
c9f4e0676b -base_port to new query API 2011-05-10 18:39:07 +02:00
Wim Taymans
816f4e791d segment: fix for new core API
Fix for gst_*_segment_full rename.
2011-05-09 18:16:46 +02:00
Sebastian Dröge
f50b3af5d7 audio: Use G_DEFINE_TYPE instead of GST_BOILERPLATE 2011-04-19 10:52:00 +02:00
Wim Taymans
da1c863711 Merge branch 'master' into 0.11
Conflicts:
	gst-libs/gst/tag/gstvorbistag.c
2011-04-04 11:31:33 +02:00
Havard Graff
588ac0ae6f baseaudiosink: don't allow aligning behind the read-segment
Given a large enough drift-tolerance, one could end up in a situation
where one would keep aligning the written buffers behind the current
read-segment position. The result for the reader would be complete
silence, possible preceded by very choppy audio.

By checking the available headroom, one can determine if there is
room to do alignment, or if one should resort to a resync instead to get
the pointers back on track.

Also refactor the alignment-logic out of the render function for cleaner
code.
2011-04-04 09:31:26 +02:00
Wim Taymans
d96a8c1aa7 Merge branch 'master' into 0.11 2011-03-31 17:53:12 +02:00
Mark Nauwelaerts
e73f293ee5 baseaudiosink: arrange for running clock when rendering eos
Commit ba2e500bd9 ensured to provide
a running clock when EOS had finished rendering.  However,
other measures are needed (and were in place before) to ensure a
running clock when EOS still needs rendering (i.e. waiting).

So, specifically, re-introduce eos_rendering removed in aforementioned commit,
this time as a public variable so subclasses can be aware of the situation.

Fixes (part of) #645961.

API: GstBaseAudioSink:eos_rendering
2011-03-31 13:18:53 +02:00
Wim Taymans
d10602fbde audiosink: improve comment 2011-03-28 10:25:38 +02:00
Wim Taymans
3d25a4b470 libs: port to new data API 2011-03-27 13:55:15 +02:00
Wim Taymans
8a786d10be baseaudiosink: use sink preroll lock 2011-03-04 17:25:46 +01:00
Wim Taymans
6aa22111a1 Merge branch 'master' into 0.11 2011-03-04 16:21:13 +01:00
Mark Nauwelaerts
ba2e500bd9 baseaudiosink: start ringbuffer upon going to PLAYING and already EOS
... otherwise we may end up without running clock in PLAYING.

Fixes #636886.
2011-03-04 14:10:30 +01:00
Wim Taymans
65ba216b8c baseaudiosink: remove deprecated method 2011-02-28 11:50:03 +01:00
Felipe Contreras
21d1e2ded0 baseaudiosink: trivial cleanups
It seems these stuff was neglected from commmit d8942e2.

Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
2011-01-30 15:40:53 +02:00
Tim-Philipp Müller
9c9afee1cf baseaudiosink: default to enable-last-buffer=FALSE for audio sinks
There isn't really any good reason to get the last buffer from an
audio sink, so don't make the sink keep it around unnecessarily.
2011-01-02 17:21:54 +00:00
Havard Graff
60ff7c0eb4 baseaudiosink: protect against ringbuffer disappearing while in a query
Observed a case where the sink went to null-state during the query,
hence the ringbuffer-pointer was NULL, causing a crash.

Moving the ringbuffer-check code until after the query, and hold the
lock during the check and while using the spec-values. It should not matter
to the query wether the ringbuffer is present or not, and it actually
gets a time bit more time to get the ringbuffer set up in this case!

Fixes #635231
2010-12-29 12:29:40 +01:00
Tim-Philipp Müller
751c34bffc audio: make public get_type() functions thread-safe 2010-10-08 11:34:58 +01:00