Commit graph

2685 commits

Author SHA1 Message Date
Vincent Penquerc'h
625bd68da7 opus: fix mono<->stereo up/down-mixing
https://bugzilla.gnome.org/show_bug.cgi?id=761588
2016-02-26 16:15:20 +00:00
Tim-Philipp Müller
8b48fc1569 opusenc: remove deprecated "cbr", "audio", and "constrained-vbr" properties
They have been replaced by "audio-type" and "bitrate-type".

https://bugzilla.gnome.org/show_bug.cgi?id=756282
2016-02-26 06:51:17 +00:00
Tim-Philipp Müller
f331412a37 opus: move Opus audio decoder and encoder from -bad to -base
Hook into build system after moving history.

https://bugzilla.gnome.org/show_bug.cgi?id=756282
2016-02-26 00:20:10 +00:00
Tim-Philipp Müller
a2eb430010 Merge branch 'plugin-move-opus'
Move Opus decoder and encoder from -bad to -base.

https://bugzilla.gnome.org/show_bug.cgi?id=756282
2016-02-25 23:51:42 +00:00
Tim-Philipp Müller
a62c7bd54c Fix use of undeclared core debug category symbols
libgstreamer currently exports some debug category
symbols GST_CAT_*, but those are not declared in any
public headers.

Some plugins and libgstvideo just use GST_DEBUG_CATEGORY_EXTERN()
to declare and use those, but that's just not right at
all, and it won't work on Windows with MSVC. Instead look
up the categories via the API.
2016-02-20 11:31:43 +00:00
Lubosz Sarnecki
8e07203798 textoverlay: Expose rendering dimensions as properties.
In order to detect graphical user input on the
textoverlay, the resulting rendering properties
need to be exposed to applications.

Fixes delayx property declaration.

https://bugzilla.gnome.org/show_bug.cgi?id=761251
2016-02-04 13:25:48 +01:00
Lubosz Sarnecki
a48daf6dd8 textoverlay: Do not limit positioning to video area.
The current position property is limited to X,Y positions
in the range of [0, 1]. This patch allows full control
over the overlay position, including partially outside
of the video area.

https://bugzilla.gnome.org/show_bug.cgi?id=761251
2016-02-04 13:25:48 +01:00
Vincent Penquerc'h
1ef601e7d3 opus: fix FEC
FEC may only be used when PLC is enabled on the audio decoder,
as it relies on empty buffers to generate audio from the next
buffer. Hooking to the gap events doesn't work as the audio
decoder does not like more buffers output than it sends.

The length of data to generate using FEC from the next packet
is determined by rounding the gap duration to nearest. This
ensures that duration imprecision does not cause quantization
to 2.5 milliseconds less than available. Doing so causes the
Opus API to fail decoding. Such duration imprecision is common
in live cases.

The buffer to consider when determining the length of audio
to be decoded is the previous buffer when using FEC, and the
new buffer otherwise. In the FEC case, this means we determine
the amount of audio from the previous buffer, whether it was
missing or not (and get the data either from this buffer, or
the current one if the previous one was missing).
2016-02-03 16:36:10 +00:00
Vincent Penquerc'h
8e9345ec86 opusdec: fix wrong buffer being checked for missing data
This caused a decoding error if the resulting (wrong) buffer size
was passed to the Opus decoding API.

https://bugzilla.gnome.org/show_bug.cgi?id=758158
2016-02-02 15:22:55 +00:00
Arun Raghavan
af091928f3 alsa: Trivial doc update
alsasink now does more than just raw audio.
2016-01-25 18:31:17 +05:30
Vineeth TM
95bf0ae2ae plugins-bad: Fix example pipelines
rename gst-launch --> gst-launch-1.0
replace old elements with new elements(ffmpegcolorspace -> videoconvert, ffenc_** -> avenc_**)
fix caps in examples

https://bugzilla.gnome.org/show_bug.cgi?id=759432
2015-12-15 10:30:49 +00:00
Nicolas Dufresne
e7a59d2e08 Revert "alsasrc: Disable HW timestamp"
This reverts commit 3642e9a391.
2015-12-14 13:59:02 -05:00
Nicolas Dufresne
3642e9a391 alsasrc: Disable HW timestamp
This is a workaround for broken pulse module.
2015-12-14 13:39:02 -05:00
Reynaldo H. Verdejo Pinochet
71c2ddd07d Remove unnecessary NULL checks before g_free()
g_free() is NULL-safe
2015-11-18 16:05:42 -08:00
Luis de Bethencourt
6463ff198e opusenc: avoid potential overflow expression
The result of the two expressions will be promoted to guint64 anyway,
perform all the arithmetic in 64 bits to avoid potential overflows.

CID 1338690, CID 1338691
2015-11-12 12:29:33 +00:00
Jan Schmidt
797a0ca376 vorbisdec: Re-init on new caps
If we get new input caps, then reset the decoder
ready for new headers and fresh data. Makes
chained oggs work when reusing the decoder.
2015-11-11 01:33:55 +11:00
Sebastian Dröge
dd741e6412 opusdec: Update sink pad templates
We always require the channel-mapping-field. If it's 0 we require nothing
else, otherwise we need channels, stream-count and coupled count to be
available.
2015-11-05 12:11:19 +01:00
Sebastian Dröge
85984fa946 opusenc: Create an empty taglist if there is none
There always have to be 2 buffers in the streamheaders, even if
the comment buffer is basically empty.
2015-11-04 00:14:13 +02:00
Sebastian Dröge
4ca84a9b1a opus: Add proper support for multichannel audio
https://bugzilla.gnome.org/show_bug.cgi?id=757152
2015-11-03 20:35:41 +02:00
Sebastian Dröge
fc475ce01a opusdec: Handle GstAudioClippingMeta instead of the pre-skip field in the OpusHead
oggdemux is outputting the meta now, and only outputs if it should really
apply to the current buffer. Previously we would skip N samples also if we
started the decoder in the middle of the stream.

https://bugzilla.gnome.org/show_bug.cgi?id=757153
2015-11-03 20:35:41 +02:00
Sebastian Dröge
328f9088f3 opusenc: Add GstAudioClippingMeta to buffers that need to be clipped
https://bugzilla.gnome.org/show_bug.cgi?id=757153
2015-11-03 20:35:41 +02:00
Sebastian Dröge
6b751360ae opusenc: Disable granule position calculations by the base class
It is doing the wrong thing because of the Opus pre-skip: while the timestamps
are shifted by the pre-skip, the granule positions are not shifted.

oggmux is doing the right thing here already.

https://bugzilla.gnome.org/show_bug.cgi?id=757153
2015-11-03 20:35:41 +02:00
Sebastian Dröge
7773e1eb58 opusenc: Add some FIXME comments about calculating padding with LPC
https://bugzilla.gnome.org/show_bug.cgi?id=757153
2015-11-03 20:35:41 +02:00
Sebastian Dröge
4df2ffaad6 opusenc: Encode exactly the amount of samples we got as input and put correct timestamps on it
The first frame has lookahead less samples, the last frame might have some
padding or we might have to encode another frame of silence to get all our
input into the encoded data.

This is because of a) the lookahead at the beginning of the encoding, which
shifts all data by that amount of samples and b) the padding needed to fill
the very last frame completely.

Ideally we would use LPC to calculate something better than silence for the
padding to make the encoding as smooth as possible.

With this we get exactly the same amount of samples again in an
opusenc ! opusdec pipeline.

https://bugzilla.gnome.org/show_bug.cgi?id=757153
2015-11-03 20:35:41 +02:00
Sebastian Dröge
6ffb90e037 opusenc: Put lookahead/pre-skip into the OpusHead header
https://bugzilla.gnome.org/show_bug.cgi?id=757153
2015-11-03 20:35:41 +02:00
Sebastian Dröge
cab8671f0c oggdemux: Create full Opus caps with all fields
https://bugzilla.gnome.org/show_bug.cgi?id=757152
2015-11-03 20:35:33 +02:00
Sebastian Dröge
0fa8d284c7 oggmux: Use GstAudioClippingMeta for Opus for accurate end clipping
... instead of relying on the segment. For the clipping at the start we assume
a proper value in the OpusHead, as generated by opusparse or opusenc.

Transmuxing in general is not guaranteed to produce the correct values, or
even have a OpusHead (e.g. when having RTP input).

https://bugzilla.gnome.org/show_bug.cgi?id=757153
2015-11-03 20:35:33 +02:00
Sebastian Dröge
a135868262 oggdemux: Add GstAudioClippingMeta for Opus for accurate start/end clipping
https://bugzilla.gnome.org/show_bug.cgi?id=757153
2015-11-03 20:35:33 +02:00
Sebastian Dröge
8a3be7323a oggdemux: Allow start clipping for Opus
The granulepos does not have the pre-skip subtracted while timestamps do,
and the last granulepos will be shorter by the number of samples that should
be dropped because of padding in the end.

As such, extrapolating the granule of the beginning of the first frame will
lead to a negative value, which is not a problem but intentional.

https://bugzilla.gnome.org/show_bug.cgi?id=757153
2015-11-03 20:35:33 +02:00
Luis de Bethencourt
2206ba473f oggmux: Print GstClockTimeDiff as a signed integer in debug logs 2015-11-02 16:36:35 +00:00
Luis de Bethencourt
799020804f oggdemux: Use GstClockTimeDiff and print signed integer in debug logs
Use GstClockTimeDiff and Clock macros to print signed integer time
differences in the debug logs.

https://bugzilla.gnome.org/show_bug.cgi?id=757480
2015-11-02 16:10:07 +00:00
Sebastian Dröge
9c195e37da opusdec: Assume 48kHz if no sample rate is given in the header 2015-11-02 09:36:46 +02:00
Sebastian Dröge
7cadfcb0b0 opusenc: Place 48kHz first in the caps
For all the other sample rates the encoder will have to resample internally.
2015-11-02 09:36:43 +02:00
Sebastian Dröge
4fe12c1b09 alsa: Use 8 bit pointer type for byte-based pointer arithmetic
Usually these loops only run once, so there's no problem here. But sometimes
they run twice, and by adding the number of bytes to a 16 bit pointer type we
would advance twice as much as we should.

Also use snd_pcm_frames_to_bytes() in alsasrc to calculate
the number of bytes to skip, same as we do in alsasink.

Thanks to Lucio A. Hernandez <lucio.a.hernandez@gmail.com> for reporting.
2015-10-14 00:33:49 +03:00
Antonio Ospite
2c7ed42292 midi: add an ALSA MIDI sequencer source
The alsamidisrc element allows to get input event from ALSA MIDI
sequencer devices, and possibly convert them to sound using some
downstream element like fluiddec.

Fixes #738687
2015-10-01 21:43:21 +02:00
Luis de Bethencourt
8ae0fd3990 visual: merge audiovisalizer base classes
Move the audiovisualizer base class to pbutils, so it can be used by plugins
from other modules

https://bugzilla.gnome.org/show_bug.cgi?id=742875
2015-10-01 16:05:58 +01:00
Prashant Gotarne
e58ad7a2b4 basetextoverlay: fix typo in debug log message
https://bugzilla.gnome.org/show_bug.cgi?id=755198
2015-09-18 08:50:52 +01:00
Thiago Santos
54a5859960 opusdec: remove check for number of channels
opus decoder can convert from different number of channels, no
need to check, just let it negotiate and create a new decoder if
needed.

https://bugzilla.gnome.org/show_bug.cgi?id=755059
2015-09-15 16:00:43 -03:00
Miguel París Díaz
a4ffb14c55 opusenc: improve deprecated properties docs
https://bugzilla.gnome.org/show_bug.cgi?id=754819
2015-09-11 23:33:19 +02:00
Miguel París Díaz
16e93d206f opusenc: do not throw g_warning when getting deprecated properties
https://bugzilla.gnome.org/show_bug.cgi?id=754819
2015-09-11 23:33:19 +02:00
Prashant Gotarne
7447736be9 basetextoverlay: FIX crash if padding greater than video size
Skipping rendering of textimage if overlay is completely
outside video frame.

https://bugzilla.gnome.org/show_bug.cgi?id=754429
2015-09-03 10:15:39 -04:00
Thiago Santos
f1cbca9480 audioencoders: use template subset check for accept-caps
It is faster than doing a query that propagates downstream and
should be enough

Elements: faac, gsmenc, opusenc, sbcenc, voamrwbenc, adpcmenc, sirenenc
2015-08-17 10:07:54 -03:00
Thiago Santos
14867e4ebb vorbisenc: use template subset check for accept-caps
It is faster than doing a query that propagates downstream and
should be enough
2015-08-16 12:30:30 -03:00
Thiago Santos
6a26a42ffd vorbisenc: use more accurate sink pad template caps
Removes the need for custom caps query handling and makes it more
correct from the beginning on the template. It is a bit uglier
to read because there is 1 entry per channel but makes code easier
to maintain.
2015-08-16 12:30:30 -03:00
Thiago Santos
cd7c7dba70 theoraenc: use template subset check for accept-caps
It is faster than doing a query that propagates downstream and
should be enough
2015-08-16 12:30:30 -03:00
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
Thiago Santos
065968c3fc vorbisdec: use default pad accept-caps handling
Avoids useless check of downstream caps when handling an
accept-caps query
2015-08-15 13:44:35 -03:00
Thiago Santos
0ea4430522 theoradec: use default pad accept-caps handling
Avoids useless check of downstream caps when handling an
accept-caps query
2015-08-15 13:44:35 -03:00
Tim-Philipp Müller
741d23f06c theoraenc: mention videorate is often needed in docs
https://bugzilla.gnome.org/show_bug.cgi?id=748877
2015-08-11 15:10:19 +01:00
Olivier Crête
4665c0802a oggdemux: Set chain pointers to NULL
Otherwise, they will refer to freed memory

https://bugzilla.gnome.org/show_bug.cgi?id=753078
2015-08-06 17:40:40 +01:00
Olivier Crête
315857dce6 oggdemux: Return FLUSHING if pad if flushing
If the initial seek fails because the pad is
flushing, then return GST_FLOW_FLUSHING instead
of an error.
2015-07-30 18:43:19 -04:00
Sebastian Dröge
5830db7050 textoverlay: Query downstream caps for checking if caps features are supported, not just accept-caps
accept-caps is not recursive and might stop at the next downstream element,
while caps queries are generally recursive. The next element might accept any
capsfeatures we want, but that doesn't mean that further downstream it will
also work.

Additionally for the future:
We should probably check if downstream *prefers* the
overlay meta, and only enforce usage of it if we can't handle
the format ourselves and thus would have to drop the overlays.
Otherwise we should prefer what downstream wants here.
2015-07-28 14:14:50 +03:00
Nirbheek Chauhan
f04d4dd7c8 opuscommon: Use GString instead of snprintf for concating
Safer, easier to understand, and more portable. Also, skip
all this if the log level is too low.
2015-07-27 15:24:19 +01:00
Nicolas Dufresne
d4759f05f1 basetextoverlay: Use the extents rectangle for positioning
the extents rectangle is what you need to know to properly position
a buffer that has been rendered in a surface of the ink rectangle
size. This patch make the placement on par with the placement we had
before without having to over allocate.

This patch also enable placement for vertical rendering. Note that
the halginement, valighment and line-alignment default are set to
the previous default when this property is set. This is for backward
compatibility, you can change the value after setting vertical render.

https://bugzilla.gnome.org/show_bug.cgi?id=728636
2015-07-24 16:43:59 -04:00
Nicolas Dufresne
7569a2e932 basetextoverlay: Fix clipping issues
This patch uses the ink rectangle in order to compute the size
of the surface require to render. It also correctly compute the
transformation matrix as the ink_rect position might not be at
0, 0. Additionally, shadow_offset and outline_offset (which is
in fact the diameter of a dot, not a really an offset) is now
taken into account. Redundant matrix operation has been removed
for the vertical rendering.

Take note that the matrix operation in cairo are excuted in
reverse order.

https://bugzilla.gnome.org/show_bug.cgi?id=728636
2015-07-24 16:43:59 -04:00
Nicolas Dufresne
f9e6d38bf9 basetextoverlay: Improve further the negotiation function
* Only send the caps event once if the query had support for the
  overlay composition meta.
* Only do the allocation query if it is supported through caps.
* Send overlay_caps before doing allocation query rather then normal
  caps

https://bugzilla.gnome.org/show_bug.cgi?id=751157
2015-07-22 17:01:03 -04:00
Rico Tzschichholz
c549523e7b basetextoverlay: Add missing linking against -lm 2015-07-22 14:51:29 -04:00
Nicolas Dufresne
48f877ea91 basetextoverlay: Ensure meta coordinate are in stream scale
The GstVideoOverlayComposition meta coordinates should always be
in stream scale, regardless of the window size downstream. This
way the sink can always scale the composition if the window size
have changed after a buffer (with his meta) was rendered before.

https://bugzilla.gnome.org/show_bug.cgi?id=751157
2015-07-22 13:24:04 -04:00
Nicolas Dufresne
db81a73dba basetextoverlay: Reorder and cleanup class attribute
Also add a minimum amount of comment so we can understand what
is doing what.

https://bugzilla.gnome.org/show_bug.cgi?id=751157
2015-07-22 13:24:04 -04:00
Nicolas Dufresne
a2e4ccc38b basetextoverlay: Fix upstream composition handling
We need to update the render when upstream composition changes
or if it was removed.

http://bugzilla.gnome.org/show_bug.cgi?id=751157
2015-07-20 16:26:39 -04:00
Nicolas Dufresne
d10959fd36 basetextoverlay: Clear reconfigure flags before negotation
This avoids negotiating twice. Current the _setcaps() patch does
not clear the initial reconfigure flags, which lead to systematic
double renegotiation.

http://bugzilla.gnome.org/show_bug.cgi?id=751157
2015-07-20 16:26:33 -04:00
Nicolas Dufresne
2308014963 basetestoverlay: Always query window dimension
Remove the optimization to skip allocation query so we can
always have the latest window size information. Also, correctly
deal with the case where there is no window size information.

http://bugzilla.gnome.org/show_bug.cgi?id=751157
2015-07-20 16:26:19 -04:00
Nicolas Dufresne
a64a343077 basetextoverlay: Send caps before doing allocation query
This is currently a limitation of BaseTransform base class. Which means
pretty much every filters out there.

http://bugzilla.gnome.org/show_bug.cgi?id=751157
2015-07-20 15:11:06 -04:00
Lubosz Sarnecki
d1808a5dbf basetextoverlay: Log GstVideoOverlayComposition negotiation
https://bugzilla.gnome.org/show_bug.cgi?id=751157
2015-07-20 15:09:22 -04:00
Lubosz Sarnecki
91a615fa89 basetextoverlay: Receive window size event and adjust rendering
* cache window size event and update handle ratio
* init width with 1, don't use 0
* don't update overlay when receiving same window size
* receive window size from allocation query

https://bugzilla.gnome.org/show_bug.cgi?id=751157
2015-07-20 15:09:22 -04:00
Lubosz Sarnecki
f128666834 basetestoverlay: Pass down meta buffers from upstream that supports GstVideoOverlayComposition
This makes pipelines with multiple textoverlay elements possible.
The meta data is collected from the upstream textoverlay element,
merged into a new GstVideoOverlayComposition and passed down downstream.

https://bugzilla.gnome.org/show_bug.cgi?id=751157
2015-07-20 15:09:22 -04: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
Tim-Philipp Müller
6020b0cf2b Update mailing list address from sourceforge to freedesktop 2015-07-16 17:17:16 +01:00
Stefan Sauer
75cc08d451 docs: order and canonicalize the -sections.txt file
Have all sections in alphabetical order. Also make the macro order consistent.
This is a preparation for generating the file. Remove GET_CLASS macro for
some elements, since it is not used and the header is not installed.
2015-07-03 21:16:27 +02:00
Stefan Sauer
26f7fb9697 cdparanoiasrc: remove unused defines 2015-07-03 21:09:29 +02:00
Nicolas Dufresne
91f2f1874c basetextoverlay: Fix bug with unused upstream_has_meta
The intention was to skip the allocation query if upstream has decided
to use the overlay meta feature in the caps. We can safely assume that
upstream have done that query already before making this decision. This
is an optimization since doing allocation queries is relatively
expensive.

CID #1308943
2015-07-02 10:47:45 -04:00
Nicolas Dufresne
828f0291bf Revert "basetextoverlay: remove dead code"
This reverts commit e863e5f8a9.
2015-07-02 10:27:39 -04:00
Luis de Bethencourt
e863e5f8a9 basetextoverlay: remove dead code
upstream_has_meta is set to FALSE and never changed. The two checks for if
upstream_has_meta will never go to the true branch. Removing the boolean
and the true branches of these checks.

CID #1308943
2015-07-02 14:58:38 +01:00
Guillaume Desmottes
a5dcce98aa oggdemux: set building_chain to NULL when deactivating chain
The chain is about to be invalidated so we shouldn't keep it around.
Prevent a double free crash when the demuxer is being finalized.

https://bugzilla.gnome.org/show_bug.cgi?id=751000
2015-06-22 14:09:51 +02:00
Mersad Jelacic
de5500b6a9 opusenc: Add bitrate to the tags
https://bugzilla.gnome.org/show_bug.cgi?id=750992
2015-06-22 13:49:34 +02:00
Lazar Claudiu
f5906122fb basetextoverlay: add "draw-shadow" and "draw-outline" properties
https://bugzilla.gnome.org/show_bug.cgi?id=749823
2015-06-14 17:56:29 +01:00
Nicolas Dufresne
7e47aaf1b9 basetextoverlay: Rewrite negotiation method
This cleanup the negotiation function by properly splitting the probe
and the decisions. This allow handling correctly pipeline where upstream
caps have special memory type. An example pipeline is:

  gltestsrc ! textoverlay text=bla ! fakesink

The upstream caps will be memory:GLMemory, which isn't supported by the
blitter.

https://bugzilla.gnome.org/show_bug.cgi?id=749243
2015-06-12 19:58:39 -04:00
Carlos Rafael Giani
8f339c0932 alsa: report recoverable device failures to base class
This gives custom slave methods in the base class a chance to
resynchronize themselves

Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>

https://bugzilla.gnome.org/show_bug.cgi?id=708362
2015-06-09 21:51:05 +10:00
Luis de Bethencourt
7423eafa85 libvisual: clean dereferences of private structures
https://bugzilla.gnome.org/show_bug.cgi?id=742875
2015-06-07 18:49:48 +01:00
Luis de Bethencourt
380d68fbe5 libvisual: make private all variable subclasses don't need
https://bugzilla.gnome.org/show_bug.cgi?id=742875
2015-06-07 18:23:23 +01: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
Claudiu Florin Lazar
af7a311c1c basetextoverlay: make deltax and deltay properties controllable
This will be more useful once we have absolute direct
control bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=749824
2015-05-26 09:24:16 +01:00
Guillaume Desmottes
1c10b58cce oggdemux: fix chain leak
Don't leak the building_chain when destroying.

Fix leaks with the validate.http.playback.reverse_playback.vorbis_theora_1_ogg
scenario.

https://bugzilla.gnome.org/show_bug.cgi?id=748964
2015-05-26 08:28:23 +01:00
Tim-Philipp Müller
0a3b584aa0 Revert "oggdemux: Prevent seeks when _SCHEDULING_FLAG_SEQUENTIAL is set"
This reverts commit 76647f2710.

Avoiding pull mode activation is a feature regression, and
demuxers should always use pull mode where that is possible,
e.g. if there's an upstream queue2 with a ring buffer or
a download buffer.

This patch made reverse playback no longer possible over http.

If the goal is to minimise seeks, then that can still be done
by making the demuxer behave differently in pull mode if
the SEQUENTIAL flag is set. If there are bugs, like the demuxer
needlessly scanning the entire file on start-up in pull mode,
then those should be fixed instead.

https://bugzilla.gnome.org/show_bug.cgi?id=746010
2015-05-20 10:28:30 +01:00
Tim-Philipp Müller
4343c3bff8 docs: fix up example pipeline 2015-05-10 11:42:21 +01:00
Tim-Philipp Müller
ec5c93f169 docs: update element example pipelines
- gst-launch -> gst-launch-1.0
- use autoaudiosink and audiovideosink more often
- review pipeline examples and descriptions
2015-05-10 11:38:19 +01:00
Jose Antonio Santos Cadenas
8dde6b170b 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
Young Han Lee
bd40d2e33f oggdemux: remove unused code
These lines have done nothing for about 10 years.

https://bugzilla.gnome.org/show_bug.cgi?id=748820
2015-05-03 13:33:01 +01:00
Tim-Philipp Müller
97c3e548d6 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
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
Tim-Philipp Müller
c680e324bc Remove obsolete Android build cruft
This is not needed any longer.
2015-04-26 18:42:34 +01:00
Stefan Sauer
7e8e020cfd audiovisualizer: fix the license from GPL to LGPL
This was a copy'n'paste buf in the initial commit done by myself.
2015-04-25 18:45:50 +02:00
Guillaume Desmottes
d31472fde7 oggdemux: fix event leaks
gst_event_replace() takes its own reference on the event so we should drop
ours after creating and storing an event using it.

This fix leaks which can be reproduced using the
validate.http.media_check.vorbis_theora_1_ogg scenario.

https://bugzilla.gnome.org/show_bug.cgi?id=748247
2015-04-23 11:02:45 +01:00
Guillaume Desmottes
e9a6cafa13 basetextoverlay: fix buffer leak in chain function
If we don't consume the buffer by passing its reference to
overlay->text_buffer then we need to unref it.

Fix a leak with validate.file.playback.fast_forward.test5_mkv
when running inside Valgrind.

https://bugzilla.gnome.org/show_bug.cgi?id=747602
2015-04-10 10:12:19 +01:00
Vincent Penquerc'h
a44258dbe8 oggdemux: fix wrong duration on partial streams with a skeleton index
When a stream has a skeleton index, the stream time is taken from that
index. However, when part of the stream is captured, the index is
invalid as its offsets are now wrong. To avoid this, we ignore the index
when the last offset points beyond the end of the stream (when its
byte length is known).

https://bugzilla.gnome.org/show_bug.cgi?id=744070
2015-04-03 16:40:04 +01:00
Vincent Penquerc'h
b247001aa9 textoverlay: fix disappearing text with high deltax
When deltax is large enough to cause the text to push past the
width of the frame, it would disappear due to a bug in setting
the layout width.

While there, fix a log printing an incorrect width to set.

https://bugzilla.gnome.org/show_bug.cgi?id=739689
2015-04-03 16:14:23 +01:00
Vincent Penquerc'h
b590a843f4 oggmux: fix deadlock when not pulling a buffer from collectpads
oggmux keeps a cached buffer per pad, and pulls buffers from
collectpads to this cached buffer for all pads before processing
the best pad. In some cases, the move from collectpads buffer
to cached buffer is delayed till next call. However, when there
is only one pad, this can't be delayed till next call as there
will be a deadlock since collectpads has no other pad to push to.

https://bugzilla.gnome.org/show_bug.cgi?id=740565
2015-04-03 15:52:54 +01:00
Arun Raghavan
20af81edb5 opus: Fix incorrect fall-through condition in property getter 2015-04-03 11:47:09 +05:30
Guillaume Desmottes
452d7b04e3 oggdemux: don't use GST_ERROR() for debug messages
Fix https://bugzilla.gnome.org/show_bug.cgi?id=746457
2015-04-01 16:06:42 +01:00
Mark Nauwelaerts
d1f91723be oggdemux: resurrect some flow return handling
https://bugzilla.gnome.org/show_bug.cgi?id=744572
2015-03-29 13:51:05 +02:00
Nicolas Dufresne
6ba8d385e3 Revert "theoradec: Disable usage of crop meta"
This reverts commit da52868f46.
2015-03-24 15:47:20 -04:00
Nicolas Dufresne
da52868f46 theoradec: Disable usage of crop meta
This is a temporary workaround that simply disables usage of crop
meta for now.

https://bugzilla.gnome.org/show_bug.cgi?id=741030
2015-03-24 14:36:12 -04:00
Luis de Bethencourt
56485e3b14 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
6f33c20b00 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
78634dc2c3 opusenc: Remove another unused variable 2015-03-23 13:13:35 +01:00
Sebastian Dröge
37d87bf352 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
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
Sebastian Dröge
e252b13dd0 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
Wonchul Lee
b45941219e oggdemux: Fix compiler warning
gstoggdemux.c:1233:11: error: format specifies type 'long' but the argument has type 'ogg_int64_t' (aka 'long long') [-Werror,-Wformat]
          granule);
          ^~~~~~~

https://bugzilla.gnome.org/show_bug.cgi?id=746512
2015-03-23 09:15:02 +01:00
Vincent Penquerc'h
1ee2fccfdf oggdemux: fix playback regression on streams with clipped data at start
The code that was calculating the start granule from packet durations
was interpreting a negative value as an error, but this is actually a
valid case, to indicate clipping of data at start.

https://bugzilla.gnome.org/show_bug.cgi?id=743900
2015-03-16 11:59:19 +00:00
Vincent Penquerc'h
c47004d3db oggdemux: recover from EOS when searching for chain in push mode
If we get EOS when we're trying to build a chain, we disable seeking
and continue instead of posting an error. This can happen for corner
cases such as a stream with a video that stops before the end, for
instance.

https://bugzilla.gnome.org/show_bug.cgi?id=745980
2015-03-12 14:53:32 +00:00
Vincent Penquerc'h
87fd62811d oggdemux: fix seeking in files with a "missing" stream
When looking for pages when seeking, we stop looking for non sparse
streams if we don't find one within a given threshold. This fixes
seeking filling up queues and blocking in corner cases such as an
audio file with a pathological 1 frame video stream (yes, I saw one).

https://bugzilla.gnome.org/show_bug.cgi?id=745980
2015-03-12 14:53:27 +00:00
Vincent Penquerc'h
fcce2fe059 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
Jan Schmidt
9a541157cf theoradec: Fix decoding in the presence of GstVideoCropMeta
Store the video info of the internal frame decode width/height
separate to the exposed (cropped) frame info, so that it can be
used for mapping the downstream allocated video frame buffer correctly
when using GstVideoCropMeta.

Fixes playback of files with sizes that aren't a multiple of 16-pixels
width or height.

https://bugzilla.gnome.org/show_bug.cgi?id=741030
2015-03-12 22:38:37 +11:00
Vincent Penquerc'h
e77b60a73f oggdemux: do not send seek events from the streaming thread
This will usually deadlock, despite this patch being in master for
quite some time and working fine. Nevertheless, we deem it to be
not working, disregarding facts.

As such, we fix it by keeping track of seek events, and sending
them upstream from a separate thread. Buffers are then discarded
till we get a new segment with the expected seqnum.
2015-03-11 14:40:49 +00:00
Vincent Penquerc'h
5f3fc5db05 oggdemux: set correct seqnum on segment events after a seek in push mode
There is already a seqnum field for this, which was used to overwrite
the seqnum that was set by the push specific code.
2015-03-11 12:04:23 +00:00
Vincent Penquerc'h
acaf534714 oggdemux: try harder to query duration from upstream
READY->PAUSED can be too early as souphttpsrc can get the HTTP
headers after this. Try again in the chain function.

Also use seeking query to disable seeking if upstream reports
being unseekable.
2015-03-11 12:04:23 +00:00
Vincent Penquerc'h
969cf47a82 oggdemux: add non flushing time seeking in push mode
Some resetting code has to be done in the NEW_SEGMENT
event handler, instead of the missing FLUSH_STOP one.

Segment base was also wrongly accounted for. This was hidden
by the fact that flushing resets the base.

A discontinuity is now also signalled on seeking. We have to
also ensure that the discontinuity "sticks" till a buffer
with a valid timestamp goes out, or the audio decoder base
class will ignore the discontinuity for purposes of keeping
track of the current time.

This allows using non flushing segment seeks for looping
HTML audio in particular, and more generally non flushing seeks.

https://bugzilla.gnome.org/show_bug.cgi?id=729198
2015-03-11 12:04:23 +00:00
Vincent Penquerc'h
ca136e3648 oggdemux: fix wrong first granule
The code was using the first nonnegative granulepos to seed the
granule tracking, which appeared to work since headers have zero
granulepos. However, this does not work for files with a hole at
start, which are common in live streaming.

The correct behavior is to look for the first granule, and subtract
the duration of all the packets finishing on this page.

The function which does this relies on the fact that the ogg_stream
structure can be duplicated by shallow copy, in order to pull the
packets from the first page(s) on the copy without affecting the
original stream state.
2015-03-11 12:04:23 +00:00
Tim-Philipp Müller
c53ba4beeb Fix double semicolons 2015-03-10 09:27:08 +00: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
Nicolas Dufresne
ace35b78ee textoverlay: Re-render if video size changed
https://bugzilla.gnome.org/show_bug.cgi?id=745554
2015-03-03 16:38:33 -05:00
Sebastian Dröge
db20b21a51 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
Tim-Philipp Müller
725906bb71 audiovisualizer: don't use private GMutex implementation details
Don't use private GMutex implementation details to check
whether it has been freed already or not. Just turn dispose
function into finalize function which will only be called
once, that way we can just clear the mutex unconditionally.
2015-02-16 23:54:28 +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
Jan Schmidt
f04afa938f oggmux: Don't pass GstCollectData as a GstObject to GST_DEBUG 2015-02-07 04:08:38 +11:00
Jan Schmidt
d3f6d2b887 oggdemux: Add a little timestamping debug output 2015-02-06 04:05:27 +11:00
Jan Schmidt
f852f3bc75 theora: If no header packets in stream, look for them in the caps
Makes theora work in cases where the header packets are only in the caps
(because theoradec was connected to oggdemux late and missed the
beginning of the stream)
2015-02-06 04:05:27 +11:00
Jan Schmidt
615118dea8 theora: Remove FIXME and return GST_CUSTOM_FLOW_DROP for header packet handling
This FIXME is easily fixed :)
2015-02-06 04:05:27 +11:00
Vincent Penquerc'h
9491157f1a oggdemux: do not throw a flow error on flushing
If the streaming task attempts to read a chain while the pipeline
is stopping (which can happen if the pipeline stops shortly after
start or a new URI being setup in gapless playback case), it will
see a flushing return from upstream, and should then also return
flushing to the caller, rather than emit a flow error.

https://bugzilla.gnome.org/show_bug.cgi?id=722442
2015-01-29 17:58:27 +00:00
Vincent Penquerc'h
da4f7e5387 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
Luis de Bethencourt
945afe6cc4 visual: fix caps leak
Fix leak of caps event and of caps objects when setting caps on sink and src
pads. Sync audiovisualizer class implementation to the one in gst-plugins-bad.
This commit matches c5ef1bee73 in that module.

https://bugzilla.gnome.org/show_bug.cgi?id=742875
2015-01-21 15:22:15 +00:00
Luis de Bethencourt
684e5e0c87 visual: post QoS messages when dropping frames due to QoS
https://bugzilla.gnome.org/show_bug.cgi?id=742875
2015-01-21 14:47:19 +00:00
Sebastian Dröge
2bd4ea6e8e Constify some static arrays everywhere 2015-01-21 09:49:47 +01:00
Sebastian Dröge
69e338d7dd alsa: Constify channel position table 2015-01-21 09:42:35 +01:00
Sebastian Dröge
8e6fb92886 alsa: Fix indention 2015-01-21 09:42:35 +01:00
Thomas Roos
485ad66a11 alsa: Allow to use 8 bit samples with ALSA
8 bit samples have no (0) as endianness, not the native endianness.

https://bugzilla.gnome.org/show_bug.cgi?id=739446
2015-01-21 09:42:35 +01:00
Vincent Penquerc'h
fbff44711a oggmux: fix clipped duration determination for non 0 based segments
https://bugzilla.gnome.org/show_bug.cgi?id=740422
2015-01-16 15:55:10 +00:00
Luis de Bethencourt
4d6f318fc9 visual: cleanup
Shameful fix to a silly mistake in the previous commit. Above email address for
any mockery
2015-01-13 16:58:34 +00:00
Luis de Bethencourt
1bb169410e visual: handle the return of the setup function
Make the baseclass future proof by handling the gboolean return of the setup
function. So if/when a child class uses this the base class is ready.
2015-01-13 16:36:09 +00:00
Luis de Bethencourt
d3a73827e0 Revert "visual: remove unnecessary variable"
This reverts commit a91d521a36.

Being a base class it is better to check the value instead of ignoring it since
a child class could be created that returns valuable information.
2015-01-13 16:09:49 +00:00
Luis de Bethencourt
a91d521a36 visual: remove unnecessary variable
klass->setup (scope) will always return TRUE since all children of this class
do so, no need to store the return. Besides, the value is overwritten a few
lines down before it is ever used. Save the unnecessary memory and instructions.

CID #1226467
2015-01-13 15:14:38 +00:00
Luis de Bethencourt
7cc048f4df visual: use unused value
ret is assigned but not used and in the next cycle of the loop it is overwritten
with default_prepare_output_buffer (). If there is a flow error the function
should return instead.

CID #1226475
2015-01-12 15:27:18 +00:00
Tim-Philipp Müller
cd45983e86 oggmux: remove unused enum 2015-01-02 15:27:23 +00:00
Tim-Philipp Müller
a4f0be6e33 oggmux: fix silly GQueue iteration code 2015-01-02 15:17:58 +00:00
Thiago Santos
68fcf7ef52 oggmux: only clip by duration if end of buffer is ahead of segment
It might happen that the timestamp is before the segment and the
check would succeed. In this case reducing the duration makes no
sense and would lead to broken results.
2014-12-26 18:56:09 -03:00
Thiago Santos
fb29483259 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