Commit graph

160 commits

Author SHA1 Message Date
Carlos Rafael Giani
a595874aac 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
Mersad Jelacic
a573cc4004 opusenc: Add bitrate to the tags
https://bugzilla.gnome.org/show_bug.cgi?id=750992
2015-06-22 13:49:34 +02:00
Sebastian Dröge
1ba8f82b94 opusdec: If channel/rate negotiation fails, fall back to stereo and 48kHz 2015-06-04 11:54:24 +02:00
Sebastian Dröge
bd8b25f08b opusparse: Set up default header with 48kHz sample rate instead of 0 2015-06-04 11:52:40 +02:00
Sebastian Dröge
96ee9b274c 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
Sebastian Dröge
c7d92b6cf5 opusdepay: Set multistream=FALSE on the Opus caps
The RTP Opus mapping only allows mono/stereo, and not multistream Opus
streams.
2015-05-04 11:23:16 +02:00
Jose Antonio Santos Cadenas
de827c792d opusheader: Do not include rate in caps if it is 0
As expressed in gst_opus_header_create_caps, value 0 means unset.
Setting rate value to 0 make negotiation with decoder fail.

https://bugzilla.gnome.org/show_bug.cgi?id=748875
2015-05-04 10:50:42 +02:00
Tim-Philipp Müller
35808c27fa opus: fix includes and compilation against opus in non-standard prefix
https://bugzilla.gnome.org/show_bug.cgi?id=748594
2015-04-28 17:24:04 +01:00
Mersad Jelacic
036f07e087 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
Arun Raghavan
f092c9cb3d opus: Fix incorrect fall-through condition in property getter 2015-04-03 11:47:09 +05:30
Olivier Crête
45422791f7 rtpopuspay: Forward stereo preferences from caps upstream
https://bugzilla.gnome.org/show_bug.cgi?id=746617
2015-03-25 15:26:55 -04:00
Olivier Crête
c82a2d4aa0 rtpopuspay: Set the number of channels to 2 as per RFC draft
https://bugzilla.gnome.org/show_bug.cgi?id=746617
2015-03-25 15:25:29 -04:00
Luis de Bethencourt
fb758d019c opusenc: fall through switch statement
Adding a comment makes coverity happy and quells the issue.

CID 1291629
2015-03-24 15:14:05 +00:00
Sebastian Dröge
9dd671abe3 opusenc: Set output format immediately after creating the encoder instance
We know the caps by then, there's no need to wait until we actually receive
the first buffer.
2015-03-23 13:15:30 +01:00
Sebastian Dröge
948fbe154f opusenc: Remove another unused variable 2015-03-23 13:13:35 +01:00
Sebastian Dröge
42b5cc8938 opusenc: Remove useless headers and header_sent variables from the instance struct
They are only used inside a single function.
2015-03-23 13:12:25 +01:00
Sebastian Dröge
856bb027f9 opus: Handle sprop-stereo and sprop-maxcapturerate RTP caps fields
https://bugzilla.gnome.org/show_bug.cgi?id=746617
2015-03-23 12:24:55 +01:00
Sebastian Dröge
a128502221 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
c2f38cd054 opusdec: Reset the decoder if the caps change 2015-03-23 12:09:09 +01:00
Sebastian Dröge
bb5b0f2d12 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
Sebastian Dröge
716eaf765b opusheader: Put number of channels and sample rate into the caps
https://bugzilla.gnome.org/show_bug.cgi?id=746617
2015-03-23 11:56:09 +01:00
Vincent Penquerc'h
22d9c9f763 opusenc: replace cbr and constrained-vbr properties with an enum
It was deemed confusing before.

https://bugzilla.gnome.org/show_bug.cgi?id=744909
2015-03-12 14:04:20 +00:00
Vincent Penquerc'h
b9c521c0ec 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
Vincent Penquerc'h
0e809604f5 rtpopuspay: default encoding name to OPUS
https://bugzilla.gnome.org/show_bug.cgi?id=737810
2015-02-19 14:30:10 +00:00
Vincent Penquerc'h
e05135aae5 rtpopuspay: make caps writable before truncating them
https://bugzilla.gnome.org/show_bug.cgi?id=737810
2015-02-19 14:05:06 +00:00
Vincent Penquerc'h
3be7d0748a rtpopuspay: negotiate the encoding name
Chrome uses a different encoding name that gstreamer.

https://bugzilla.gnome.org/show_bug.cgi?id=737810
2015-02-19 13:53:54 +00:00
Sebastian Dröge
0a20954769 opusenc: Remove g_warnings() for the deprecated audio property
Otherwise there are g_warnings() already when just using gst-inspect or
dumping a pipeline graph.
2015-02-18 17:47:50 +02:00
Sebastian Dröge
037928dcf6 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
Vincent Penquerc'h
5c44bceeb3 opusenc: change audio property to audio-type
This is now an enum with values generic (default) and voice.

https://bugzilla.gnome.org/show_bug.cgi?id=740891
2015-01-29 13:23:57 +00:00
Thiago Santos
4c883e4ad2 opusenc: plug ref leak of template caps
the pad template caps is already a new ref. No need to copy.
2014-12-17 22:13:17 -03:00
Vincent Penquerc'h
79b56ebcc9 opusparse: fix frame size determination
https://bugzilla.gnome.org/show_bug.cgi?id=741321
2014-12-15 15:23:35 +00:00
Nicolas Dufresne
54602c04f6 rtpopus: Use OPUS encoding name
Both Firefox and Chrome uses OPUS as the encoding in their SDP.
Adding this now defacto standard name remove the need for special
case in SDP parsing code.

https://bugzilla.gnome.org/show_bug.cgi?id=737810
2014-11-01 10:10:27 -04:00
Vincent Penquerc'h
23029acf46 opusenc: update output segment stop time to match clipped samples
This will let oggmux generate a granpos on the last page that properly
represents the clipped samples at the end of the stream.
2014-10-30 14:41:44 +00:00
Tim-Philipp Müller
7b8bd35d18 Fix up one-element lists in template caps 2014-09-10 17:24:39 +01:00
Sebastian Rasmussen
a9493a3985 opusenc: Unref pad template caps after usage
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=734517
2014-08-11 15:31:45 +03:00
Sebastian Rasmussen
e30f4a2851 opus: Improve annotation of internal function
https://bugzilla.gnome.org/show_bug.cgi?id=734543
2014-08-10 11:26:17 +01:00
Philip Withnall
c57500a7f4 opus: Fix a double-unref in the Opus header code
The headers were never getting reffed when being added to the headers
list, which is later unreffed-and-freed by the caller (e.g.
gst_opus_parse_parse_frame()).

https://bugzilla.gnome.org/show_bug.cgi?id=733013
2014-07-11 09:05:32 +02:00
Miguel París Díaz
93ba600ba9 opusenc: Use aux vars to minimize critical region
This avoid dead lock between gst_audio_encoder_finish_frame() and
gst_opus_enc_get_property().
Also, now bytes var is set into protected section.

https://bugzilla.gnome.org/show_bug.cgi?id=729882
2014-05-26 09:23:42 +02:00
Vincent Penquerc'h
25d4ca70c9 opus: add missing va_end in variadic function
Coverity 1139944
2014-04-09 11:03:17 +01:00
Sebastian Dröge
fd803921c9 opusparse: Don't send caps in GstBaseParse::start()
This is too early and will confuse the event order. The other
code that sets the caps is at the right position and does it
properly already.
2013-12-28 12:39:25 +01:00
Vincent Penquerc'h
585a6c4add opusenc: increase max payload size to 4000 bytes
1275 is the maximum size of a frame, but the encoder may return
up to 3 frames, and we need a few extra bytes for TOC, etc. We
use 4000, which is a bit more, and suggested in the libopus docs.
2013-12-27 14:29:46 +00:00
Sebastian Dröge
2e80c88129 opusdec: Require caps to be set before any data processing 2013-12-05 12:04:59 +01:00
Sebastian Dröge
e51cd4fe2f gst: Add better support for static plugins 2013-04-15 15:59:22 +02:00
Wim Taymans
6c4029357c 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
Wim Taymans
de648b8832 opuspay: fix timestamps
Copy timestamps to payloaded buffer.
Avoid input buffer memory leak.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=692929
2013-01-31 12:33:23 +01:00
Tim-Philipp Müller
32893dd95e opusenc: fix crash when setting "cbr" property when encoder is not running yet
https://bugzilla.gnome.org/show_bug.cgi?id=692698
2013-01-28 14:12:56 +00:00
Thijs Vermeir
05dfea2689 opus: use appropriate printf format for gsize 2012-12-18 16:56:28 +01:00
Tim-Philipp Müller
9e1b75fda3 Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-04 00:09:59 +00:00
Carlos Rafael Giani
e6b05111d3 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
Wim Taymans
50140388d2 opuspay: remove pointless caps serialization
Remove the caps serialization in the rtp caps. the spec nor the receiver
does anything with it.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=686547
2012-10-22 12:11:02 +02:00