Commit graph

672 commits

Author SHA1 Message Date
Wim Taymans b81af23992 audio: rename internal audio ringbuffer 2011-11-11 10:54:39 +01:00
Wim Taymans ad8f694ec6 remove bogus files
They got somehow commited in 7012e88090
2011-11-11 10:39:52 +01:00
Wim Taymans e338792ab0 update for adapter api changes 2011-11-10 18:32:39 +01:00
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 ea9bc40bf9 audiosrc: avoid deadlock 2011-11-10 16:05:19 +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
Wim Taymans 372b9329b9 remove query types 2011-11-09 11:47:54 +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
Wim Taymans 2f8292b495 ringbuffer: store bpf in the right variable 2011-11-04 13:21:24 +01:00
Wim Taymans a5fa136c0b update for tag API removal 2011-11-02 12:11:16 +01:00
Wim Taymans 5bdfd6d899 structure: fix for api update 2011-11-02 09:04:27 +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
Tim-Philipp Müller 220ccdf275 audioencoder: save audio info parsed in setcaps in encoder context
Otherwise we'll just error out when the first buffer gets pushed.
This is a porting artefact, in 0.10 the infos were allocated on the
heap, now we're doing everything with stack-allocated structs.
2011-10-31 14:22:39 +00:00
Tim-Philipp Müller 5ee51e47a1 ext, gst, gst-libs, tests: update for tag list API changes 2011-10-31 14:22:39 +00:00
René Stadler 7eb0985282 audio: remove old C file generated from template
Not sure how this one got pulled into a merge. In 0.10, it was moved away to
gst-template a long time ago. gstaudiofilterexample.c got generated from
gstaudiofiltertemplate.c.
2011-10-31 15:19:54 +01:00
Wim Taymans 95281cc306 Merge branch 'master' into 0.11 2011-10-28 16:24:44 +02:00
Mersad Jelacic d430eb65c5 audiosink: avoid deadlocking audioringbuffer thread
... when it goes into wait for ringbuffer starting just after such
having been signalled.

Fixes #661738.
2011-10-28 14:07:40 +02:00
Wim Taymans b70275fa10 audiofilter: use BPF for unit_size 2011-10-28 11:37:31 +02:00
René Stadler 9beff28579 audiofilter: fix get_unit_size 2011-10-28 11:24:00 +02:00
René Stadler 5d2154ff4b audiofilter: init audio info sooner 2011-10-28 11:24:00 +02:00
René Stadler 372cf41a6d audio, video: init audio/video format info to UNKNOWN format
This is to prevent e.g. GST_AUDIO_INFO_FORMAT() from crashing on a NULL pointer
dereference when used with an unset info.
2011-10-28 11:24:00 +02: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
Stefan Sauer 53d7d2e966 interfaces: clean up the use of iface and class/klass 2011-10-21 14:46:48 +02:00
Mark Nauwelaerts 981070eb44 audiodecoder: having gather queue contents implies some draining is in order
... which ensures e.g. processing and sending last fragment of reverse playback
downstream at EOS.
2011-10-19 16:51:09 +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
Edward Hervey 12a8fff8ac audio: Add some default channel positions 2011-10-17 12:00:55 +02:00
Edward Hervey b4858253dc audio: Properly handle signedness in gst_audio_format_build_integer() 2011-10-17 12:00:16 +02:00
Edward Hervey 45c4a19472 audio: Indent and doc fixes 2011-10-17 11:45:39 +02:00
Wim Taymans f1088ed647 update for UNEXPECTED -> EOS flowreturn 2011-10-10 11:39:52 +02:00
Tim-Philipp Müller ab949eebbd audiodecoder: update to 0.11 API after merge 2011-10-09 16:15:54 +01:00
Tim-Philipp Müller 303dbaf84b Merge remote-tracking branch 'origin/master' into 0.11
Conflicts:
	tests/check/pipelines/vorbisdec.c
	tests/check/pipelines/vorbisenc.c
2011-10-09 16:08:36 +01:00
Alessandro Decina bc6f00becb audioencoder: fix compile warning 2011-10-09 16:48:18 +02:00
Mark Nauwelaerts 871b1584c9 audioencoder: only resync to upstream upon discont in perfect ts mode
... as documented, where discont is marked here if tolerance has been
exceeded.
2011-10-08 20:20:10 +02:00
Mark Nauwelaerts a7ce550d04 audiodecoder: fix timestamp tolerance handling 2011-10-08 20:20:06 +02:00
Mark Nauwelaerts d8312994aa audiodecoder: handle empty input by discarding 2011-10-08 20:20:03 +02:00
Wim Taymans 73b894107a Merge branch 'master' into 0.11
Conflicts:
	ext/vorbis/gstvorbisdec.c
	ext/vorbis/gstvorbisenc.c
	ext/vorbis/gstvorbisenc.h
	gst/audiotestsrc/gstaudiotestsrc.c
2011-10-08 10:19:06 +02:00
Mark Nauwelaerts 37c629fcc6 audioencoder: make upstream queries MT-safe 2011-10-07 14:52:50 +02:00
Mark Nauwelaerts 77069f01b1 audiodecoder: make upstream queries and events MT-safe 2011-10-07 14:52:48 +02:00
Edward Hervey b8219faa90 audio: Make sure 'channels' and 'channel-positions' are coherent
If channel-positions are present, check they match the reported
'channels' value.
2011-10-05 11:57:54 +02:00
Edward Hervey 70d967da7c audio: Fix overread in channel positions
The array we're writing to is limited to 64 ... but the amount of
input positions might be lower than 64. Therefore use MIN and not
MAX to know how many values to read from the array.
2011-10-05 11:51:07 +02:00