Commit graph

64 commits

Author SHA1 Message Date
Thiago Santos
eada1366bc audiodecoders: use default pad accept-caps handling
Avoids useless check of downstream caps when handling an
accept-caps query

Elements: dtsdec, faad, gsmdec, mpg123audiodec, opusdec,
          sbcdec, adpcmdec, sirendec
2015-08-15 13:51:16 -03:00
Carlos Rafael Giani
e5409361b8 opusdec: Fix PLC frame size calculations
Previously, PLC frames always had a length of 120ms, which caused audio
quality degradation and synchronization errors. Fix this by calculating an
appropriate length for the PLC frame.

The length must be a multiple of 2.5ms. Calculate a multiple of 2.5ms that
is nearest to the current PLC length. Any leftover PLC length that didn't
make it into this frame is accumulated for the next PLC frame.

https://bugzilla.gnome.org/show_bug.cgi?id=725167
2015-07-20 13:25:43 -04:00
Sebastian Dröge
0ea7a89c14 opusdec: If channel/rate negotiation fails, fall back to stereo and 48kHz 2015-06-04 11:54:24 +02:00
Sebastian Dröge
cecb83e590 opusdec: gst_structure_fixate_field_nearest_int() only works if the structure has this field
Just set the rate/channels directly if the caps don't have this field.
2015-06-04 11:45:05 +02:00
Mersad Jelacic
443cc3baab opus: don't use deprecated gst_buffer_new_and_alloc
Use the helper function available in the base class instead.

https://bugzilla.gnome.org/show_bug.cgi?id=748585
2015-04-28 16:36:02 +01:00
Sebastian Dröge
dd674942ba opusdec: Take channels and sample rate from the caps if we have no stream header 2015-03-23 12:09:25 +01:00
Sebastian Dröge
65662c8997 opusdec: Reset the decoder if the caps change 2015-03-23 12:09:09 +01:00
Sebastian Dröge
ef29b92990 opusdec: Take output sample rate from the stream headers too
This way we let opusdec do the resampling if needed and don't carry
around buffers with a too high sample rate if not required.

While Opus always uses 48kHz internally, this information from the
header specifies which frequencies are safe to drop.
2015-03-23 11:57:09 +01:00
Vincent Penquerc'h
b8565d3ab6 opusdec: fix latency query in FEC case
The max latency parameter is "the maximum time an element
synchronizing to the clock is allowed to wait for receiving all
data for the current running time" (docs/design/part-latency.txt).

https://bugzilla.gnome.org/show_bug.cgi?id=744338
2015-03-04 11:04:29 +00:00
Sebastian Dröge
111c831c08 Improve and fix LATENCY query handling
This now follows the design docs everywhere, especially the maximum latency
handling.

https://bugzilla.gnome.org/show_bug.cgi?id=744106
2015-02-11 14:16:21 +01:00
Tim-Philipp Müller
ebe01db234 Fix up one-element lists in template caps 2014-09-10 17:24:39 +01:00
Sebastian Dröge
0c301bfee7 opusdec: Require caps to be set before any data processing 2013-12-05 12:04:59 +01:00
Wim Taymans
70ac2717a9 opusdec: clear the state of the decoder
Set the channels and rate back to their default values in _stop because they
are used to renegotiate when needed.

See https://bugzilla.gnome.org/show_bug.cgi?id=692950
2013-02-11 11:12:35 +01:00
Thijs Vermeir
41412f08ec opus: use appropriate printf format for gsize 2012-12-18 16:56:28 +01:00
Tim-Philipp Müller
3e208df632 Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-04 00:09:59 +00:00
Carlos Rafael Giani
a01598c1f1 opusdec: fixed buffer unmapping bug
When the decoder received a NULL buffer, it tried to
unmap a not mapped buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=686829
2012-10-25 01:20:23 +01:00
Tim-Philipp Müller
942680d979 Use gst_element_class_set_static_metadata()
where possible. Avoids some string copies. Also re-indent
some stuff. Also some indent fixes here and there.
2012-10-17 17:46:34 +01:00
Mark Nauwelaerts
42024f70dc replace gst_element_class_set_details_simple with gst_element_class_set_metadata 2012-09-14 17:27:49 +02:00
Peter Korsgaard
331b660e65 opus + jpegformat: unbreak non-debug build
opus + jpegformat plugin builds fail when gstreamer is configured with
--disable-gst-debug as they are checking the GST_DISABLE_DEBUG symbol
instead of GST_DISABLE_GST_DEBUG.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>

https://bugzilla.gnome.org/show_bug.cgi?id=683850
2012-09-12 09:13:30 +01:00
Vincent Penquerc'h
ad4da8dd0e opus: set author to myself, and update copyright notices
because as slomo noted, in fact pretty much all the code in there is mine.
2012-06-15 10:39:41 +01:00
Vincent Penquerc'h
3dc1ef35b1 opusdec: read gain from the right place in the header
It's at byte offset 16, not 14.
2012-05-29 17:24:33 +01:00
Vincent Penquerc'h
209e3c5e39 opusdec: do not assert on bad header, error out instead 2012-05-27 23:45:53 +01:00
Vincent Penquerc'h
7d731ac155 opusdec: fix lost packet handling for FEC/PLC
The base audio decoder sends zero size packets, not NULL buffers,
to signal dropped packets.
2012-05-24 22:56:41 +01:00
Mark Nauwelaerts
5bb216046e opusdec: tweak caps negotiation
... so as to avoid leaking caps or manipulating NULL caps.
2012-04-10 17:29:11 +02:00
Wim Taymans
0d84de3fa9 opusdec: fix for caps api change 2012-03-12 17:06:11 +01:00
Mark Nauwelaerts
fa02111b7c opus: port to updated 0.11 2012-03-07 17:18:48 +01:00
Edward Hervey
d5b34263cd Merge remote-tracking branch 'origin/master' into 0.11-premerge
Conflicts:
	docs/libs/Makefile.am
	ext/kate/gstkatetiger.c
	ext/opus/gstopusdec.c
	ext/xvid/gstxvidenc.c
	gst-libs/gst/basecamerabinsrc/Makefile.am
	gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c
	gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.h
	gst-libs/gst/video/gstbasevideocodec.c
	gst-libs/gst/video/gstbasevideocodec.h
	gst-libs/gst/video/gstbasevideodecoder.c
	gst-libs/gst/video/gstbasevideoencoder.c
	gst/asfmux/gstasfmux.c
	gst/audiovisualizers/gstwavescope.c
	gst/camerabin2/gstcamerabin2.c
	gst/debugutils/gstcompare.c
	gst/frei0r/gstfrei0rmixer.c
	gst/mpegpsmux/mpegpsmux.c
	gst/mpegtsmux/mpegtsmux.c
	gst/mxf/mxfmux.c
	gst/videomeasure/gstvideomeasure_ssim.c
	gst/videoparsers/gsth264parse.c
	gst/videoparsers/gstmpeg4videoparse.c
2011-12-30 11:41:17 +01:00
Vincent Penquerc'h
f807905786 opus: properly create channel mapping tables
There are two of them, unintuitively enough; the one passed
to the encoder should not be the one that gets written to the
file. The former maps the input to an ordering which puts
paired channels first, while the latter moves the channels
to Vorbis order. So add code to calculate both, and we now
have properly paired channels where appropriate.

https://bugzilla.gnome.org/show_bug.cgi?id=665078
2011-12-09 15:04:20 +00:00
Olivier Crête
16bb45d64a opusdec: header cleanup
https://bugzilla.gnome.org/show_bug.cgi?id=665078
2011-12-07 14:03:02 +00:00
Olivier Crête
b7d53c866b opusdec: Truncate caps first
https://bugzilla.gnome.org/show_bug.cgi?id=665078
2011-12-07 14:03:00 +00:00
Vincent Penquerc'h
f6ebc2de8e opusdec: default to stereo 48000 Hz if possible when no headers seen
https://bugzilla.gnome.org/show_bug.cgi?id=665078
2011-12-07 13:57:38 +00:00
Vincent Penquerc'h
51b02f61fc opusdec: guard against decoding 0 samples
https://bugzilla.gnome.org/show_bug.cgi?id=665078
2011-12-02 15:19:52 +00:00
Vincent Penquerc'h
b8431a03a7 various: fix pad template ref leaks
https://bugzilla.gnome.org/show_bug.cgi?id=662664
2011-11-28 13:08:27 +00:00
Tim-Philipp Müller
619915ea74 Merge remote-tracking branch 'origin/master' into 0.11
Conflicts:
	ext/opus/gstopusdec.c
	ext/opus/gstopusparse.c
	gst-libs/gst/video/gstbasevideodecoder.c
	gst-libs/gst/video/gstbasevideodecoder.h
2011-11-26 15:37:25 +00:00
Danilo Cesar Lemes de Paula
64c3d73642 opusenc: Fixing "Unused var" compiling error for opus codec
https://bugzilla.gnome.org/show_bug.cgi?id=664815
2011-11-25 15:32:12 +00:00
Vincent Penquerc'h
287a0c646e opus: add some more debug information about channel mapping 2011-11-25 15:31:59 +00:00
Vincent Penquerc'h
1e00fbdacb opusdec: fix bogus assertion 2011-11-25 15:31:59 +00:00
Edward Hervey
a8024bb698 Merge remote-tracking branch 'origin/master' into 0.11
Conflicts:
	ext/faac/gstfaac.c
	ext/opus/gstopusdec.c
	ext/opus/gstopusenc.c
	gst/audiovisualizers/gstspacescope.c
	gst/colorspace/colorspace.c
2011-11-25 12:48:58 +01:00
Vincent Penquerc'h
d38f4b8a09 opus: multichannel support 2011-11-24 13:40:34 +00:00
Vincent Penquerc'h
670c365400 opus: switch to multistream API
It's very similar to the basic API, and is a superset ot it,
which will allow encoding and decoding more than 2 channels.
2011-11-24 13:40:34 +00:00
Vincent Penquerc'h
e4ae3e89fa opusdec: shuffle supported sample rates to favor 48000 2011-11-24 13:40:34 +00:00
Vincent Penquerc'h
5c8812f58c opusdec: implement replay gain
It would ideally be better to leave this to a rgvolume element,
but we don't control the pipeline. So do it by default, and allow
disabling it via a property, so the correct volume should always
be output.
2011-11-23 14:03:30 +00:00
Vincent Penquerc'h
bfdda8e09a opusdec: add in-band FEC support
This allows reconstruction of lost packets if FEC info is included
in the next packet, at the cost of extra latency. Since we do not
know if the stream has FEC (and this can change at runtime), we
always incur the latency, even if we never lose any frame, or see
any FEC information. Off by default.
2011-11-23 12:08:01 +00:00
Wim Taymans
296786c011 Merge branch 'master' into 0.11
Conflicts:
	ext/opus/gstopusdec.c
	ext/opus/gstopusenc.c
	ext/opus/gstopusparse.c
	gst/audiovisualizers/gstwavescope.c
	gst/filter/Makefile.am
	gst/filter/gstfilter.c
	gst/filter/gstiir.c
	gst/playondemand/gstplayondemand.c
2011-11-23 11:08:39 +01:00
Vincent Penquerc'h
5be77031ca opus: move header magic testing to gstopusheader 2011-11-22 13:20:31 +00:00
Vincent Penquerc'h
354c7824aa opusdec: skip pre-skip samples 2011-11-22 13:20:31 +00:00
Vincent Penquerc'h
1e81bc4b64 opusdec: read pre-skip from first header if available 2011-11-22 13:20:31 +00:00
Vincent Penquerc'h
a6ca3673b4 opusdec: handle NULL packets (used for PLC) 2011-11-21 11:51:21 +00:00
Vincent Penquerc'h
de87d061fc opusdec: light cleanup 2011-11-21 11:51:21 +00:00
Wim Taymans
f566dae7dc Merge branch 'master' into 0.11
Conflicts:
	ext/celt/gstceltdec.c
	ext/opus/gstopusdec.c
	ext/opus/gstopusdec.h
	ext/opus/gstopusenc.c
	ext/opus/gstopusenc.h
	ext/opus/gstopusparse.c
2011-11-17 17:32:42 +01:00