Commit graph

4309 commits

Author SHA1 Message Date
Wim Taymans 9fbe0386d0 channelmix: simplify API a little
Remove the format and layout from the mix_samples function and use the
format when creating the channel mixer object. Also use a flag to handle
the unlikely case of non-interleaved samples like we do elsewhere.
2015-11-06 16:03:20 +01:00
Wim Taymans 7f5104f52f channelmix: GstChannel -> GstAudioChannel
Rename GstChannel to GstAudioChannel
2015-11-06 15:50:34 +01:00
Wim Taymans 1635bc0a45 audioconvert: cleanups and add some docs
Add docs for the internal audioconvert object before moving it to the
audio library.
Remove get_sizes and implement the trivial logic in the element.
Remove some unused orc functions
2015-11-06 12:46:36 +01:00
Wim Taymans c36ac3ce45 audioconvert: move audio quantize code to libs
Move the audio quantize code from audioconvert to the audio library.
work on making an audio converter helper function similar to the video
converter.
Fold fastrandom directly into the quantizer, add some ORC code to
optimize this later.
2015-11-06 12:10:48 +01:00
Wim Taymans a7789854d5 audio-channels: rename get_default_mask
Rename _get_default_mask() to _get_fallback_mask() to make it more
clear that the function only provides a fallback if nothing else can be
done. Also clarify this in the documentation.

API: gst_audio_channel_get_fallback_mask()
2015-11-05 12:50:18 +01:00
Thibault Saunier 9c7d3c8ab2 volume: Do not try to get binding value array if we are not processing any sample
In some conditions we might process empty buffers, calling
gst_control_binding_get_value_array in that case will lead
to the assertion:

  (lt-ges-launch-1.0:18859): GStreamer-CRITICAL **: gst_control_binding_get_value_array: assertion 'values' failed
2015-11-05 11:44:31 +01:00
Wim Taymans f86ed8cdf6 audio-channels: make method to get default channel-mask
Add a new method to get the default channel-mask.
Use the new method on audiodecoder and audioconvert.

API: gst_audio_channel_get_default_mask()
2015-11-05 10:52:53 +01:00
Wim Taymans 801f7ca464 audio-format: add TRUNCATE_RANGE flag
Add a TRUNCATE_RANGE flag for unpack functions to fill the least
significate bits with 0 (as did the old code). Also add functions
that don't truncate. Use the TRUNC flag in audioconvert for
backwards compatibility for now.
2015-11-03 12:12:08 +01:00
Wim Taymans 9e15c89564 audioconvert: change multiplier for int<->float conversion
Use (1 << 31) as the multiplier for int<->float conversions. This makes
sure that int->float conversions always end up with floats between
[-1.0, 1.0].
For the conversion from float to int, this multiplier will give the complete
int range after we perform clipping.
Change the unit test to take this into consideration.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=755301
2015-11-03 12:12:08 +01:00
Wim Taymans bd89f2430b audiotestsrc: increase freq limit
Raise the frequency limit and try to negotiate to a samplerate of 4*freq
when larger then the default samplerate.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=754450
2015-11-02 15:54:19 +01:00
Wim Taymans c688eb0d88 audiotestsrc: add support for unlimited number of channels
Raise the channel limit and set the channel-mask for > 2 channels.
2015-11-02 15:46:22 +01:00
Wim Taymans b0bf294a62 audiotestsrc: add support for all formats
Use the pack functions to also support the other audio formats we
have.
2015-11-02 13:22:18 +01:00
Sebastian Dröge e51c9a3dad audioresample: Clip input buffers to the segment before handling them
https://bugzilla.gnome.org/show_bug.cgi?id=757068
2015-11-02 10:20:37 +02:00
Sebastian Dröge 000c424835 audioconvert: Clip input buffers to the segment before handling them
https://bugzilla.gnome.org/show_bug.cgi?id=757068
2015-11-02 10:20:37 +02:00
Tim-Philipp Müller 3dd26bb9e8 audioconvert: update orc backup code to fix build without orc 2015-11-01 23:06:11 +00:00
Csaba Toth 3159501002 multisocketsink: fix "client-removed" signal on 64-bit platforms and with bindings
The client-removed signal used G_INT_TYPE instead of G_SOCKET_TYPE
in its definition leading to problems on platforms where the size
of a pointer is larger than the size of an integer, It would also
not work at all with dynamic language bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=757155
2015-10-31 11:12:38 +00:00
Joan Pau Beltran a95a900c21 videotestsrc: fix handling of Bayer format 'gbrg'
Due to a typo, videotestsrc did not handle the Bayer
format 'gbrg' properly and reported it as invalid,
causing negotiation errors.

https://bugzilla.gnome.org/show_bug.cgi?id=757264
2015-10-30 20:29:04 +00:00
Wim Taymans 5cf367ae57 audioconvert: rework audioconvert
Rewrite audioconvert to try to make it more clear what steps are
executed during conversion.
Add passthrough step that just does a memcpy when possible.
Add ORC optimized dither and quantization functions.
Implement noise-shaping on S32 samples only and allow for arbitrary
noise shaping coefficients if we want this later.
2015-10-30 17:51:47 +01:00
Wim Taymans e1569ce76a channelmix: fix up API a little
don't use gpointer * for something that should be gpointer.
2015-10-30 17:51:47 +01:00
Wim Taymans 26d469a04b audioquantize: make helper for add with saturation 2015-10-30 17:51:47 +01:00
Wim Taymans cd6c29e071 audioconvert: make the quantizer a reusable object
Turn the quantizer into a reusable object.
2015-10-28 11:36:18 +01:00
Wim Taymans 8fc2569328 audioconvert: make the channel mixer a separate reusable object
A first attempt at making the channel mixer a separate object.
2015-10-28 11:36:18 +01:00
Wim Taymans 8d4cd51e59 audioquantize: fix 8-pole noise shaping
Fix the 8-pole noise shaping error update. We were mixing errors from
different channels.
2015-10-28 11:36:18 +01:00
Sebastian Dröge 36b80edb72 decodebin: Send SEEK events directly to adaptive streaming demuxers
This makes sure that they will always get SEEK events, even if we're currently
in the middle of a group switch (i.e. switching to another
representation/bitrate/etc).

https://bugzilla.gnome.org/show_bug.cgi?id=606382
2015-10-27 15:50:45 +02:00
Guillaume Desmottes 7d6b6b0313 decodebin: fix event leak
As stated in GST_PAD_PROBE_HANDLED's documentation, we are
supposed to unref the event before returning.

Fixes an event leak in the validate.hls.playback.play_15s.hls_bibbop
validate scenario.

https://bugzilla.gnome.org/show_bug.cgi?id=754459
2015-10-25 11:18:29 +00:00
Sebastian Dröge b4afaee8c0 audioconvert: Update disted orc files 2015-10-23 19:13:05 +03:00
Wim Taymans 2b626a5adf audioconvert: use pack/unpack functions
Rework the converter to use the pack/unpack functions
Because the unpack functions can only unpack to 1 format, add a separate
conversion step for doubles when the unpack function produces int.
Do conversion to S32 in the quantize function directly.
Tweak the conversion factor for doing float->int conversion slightly to
get the full range of negative samples, use clamp to make sure we don't
exceed our int range on the positive axis (see also #755301)
2015-10-23 16:58:17 +02:00
Sebastian Dröge 53f135cec7 playbin: Send upstream events directly to playsink
Send event directly to playsink instead of letting GstBin iterate
over all sink elements. The latter might send the event multiple times
in case the SEEK causes a reconfiguration of the pipeline, as can easily
happen with adaptive streaming demuxers.

What would then happen is that the iterator would be reset, we send the
event again, and on the second time it will fail in the majority of cases
because the pipeline is still being reconfigured
2015-10-23 12:02:28 +03:00
Thibault Saunier ab6b536a66 videotestsrc: Force alpha downstream if foreground color contains alpha
Otherwise the foreground color won't be fully represented in the
outputted frames.

https://bugzilla.gnome.org/show_bug.cgi?id=755482
2015-10-22 11:12:23 +02:00
Matthew Waters 44871680f0 decodebin: track the exposable pads through connect_pad
The logic introduced by
[d50b713: decodebin: set the decode pad target before setting elements to PAUSED]
to expose pads would only ever be able to possibly expose one (the last) pad per element.

Make it so that any exposable pads are able to be exposed rather than just the
last pad returned by connect_element.

https://bugzilla.gnome.org/show_bug.cgi?id=742924
2015-10-20 10:48:05 +03:00
Matthew Waters 94d81fc713 decodebin: return the possibly new chain in analyze_new_pad
In the case of analyzing a demuxer chain, analyze_new_pad may create
a new GstDecodeChain.  This was not propagated to the calling function which as
of [d50b713f decodebin: set the decode pad target before setting elements to PAUSED]
is now required to be able to expose the correct pad.

https://bugzilla.gnome.org/show_bug.cgi?id=742924
2015-10-20 10:47:45 +03:00
Rajat Verma 68ec631db7 playsink: relink text_pad in case of reconfiguration
In case of reconfiguration, text_pad should be re-connected with
stream synchronizer sink pad. Otherwise we'll leave an unlinked pad around if
there always was a streamsynchronizer text pad.

https://bugzilla.gnome.org/show_bug.cgi?id=756804
2015-10-20 10:37:04 +03:00
Sebastian Dröge 4d6aa0f831 decodebin/playbin/playsink/subtitleoverlay: Post async-done on state change failures
https://bugzilla.gnome.org/show_bug.cgi?id=756611
2015-10-19 11:06:25 +03:00
Sebastian Dröge 87dbe54797 playsink: Immediately error out if state change fails
Otherwise we chain up to the parent class' change_state function and might
override the failure with SUCCESS.

https://bugzilla.gnome.org/show_bug.cgi?id=756611
2015-10-19 11:06:25 +03:00
Sebastian Dröge 92061cb19e playbin/uridecodebin: Always post async-done immediately if we're a live pipeline
Not only if the base class told us, but also if one of our own elements did.

https://bugzilla.gnome.org/show_bug.cgi?id=756611
2015-10-19 11:06:25 +03:00
Matthew Waters d50b713f44 decodebin: set the decode pad target before setting elements to PAUSED
Otherwise caps and context queries will disappear into nothing and therefore
fail.  With autoplug-query now actually working, users (such as playbin) can
proxy these queries to the selected video sink and be able to select an
more appropriate configuration.

https://bugzilla.gnome.org/show_bug.cgi?id=731204
2015-10-19 11:55:04 +11:00
Vineeth TM b424bc2e4f playsink: Fix volume element leak
In case sink implements a streamvolume interface, volume element is being got
from the sink. But this is transfer full. So the memory should be freed before
setting it to NULL. This was resulting in major memory leaks

https://bugzilla.gnome.org/show_bug.cgi?id=755867
2015-10-15 09:42:21 +03:00
Vineeth T M a1d84edd16 videorate: remove unnecessary break statement
Trivial patch to remove unncessary break statement used after
goto statement.

https://bugzilla.gnome.org/show_bug.cgi?id=754054
2015-10-02 17:27:13 +03:00
Mathieu Duponchelle 0c0f803488 encodebin: Fix special case
Allows to run such a command line :

gst-launch-1.0 uridecodebin uri=file:///home/meh/Music/sthg.mp4 ! \
encodebin profile-string="audio/x-wav|1" ! filesink location=sthg.wav

Previously the code failed because wavenc is considered as a muxer.
We still want encodebin to audio/x-wav as an AudioEncodingProfile,
so this simple fix allows that.

Ability to mux raw streams in containers such as matroskamux
is a different issue.

https://bugzilla.gnome.org/show_bug.cgi?id=751470
2015-10-02 17:25:48 +03:00
Rajat Verma 267f4c2bad decodebin: free hidden groups at time of switching groups
hidden groups should be freed at time of switching groups to avoid memory use
from balloning up.

https://bugzilla.gnome.org/show_bug.cgi?id=755770
2015-10-02 17:02:21 +03:00
Jan Schmidt 3f7138a6e4 videotestsrc: Don't fixate framerate if downstream didn't provide one
intersection with a downstream that accepts any video/x-raw caps
with no further detail won't create a framerate field. If it's
not in the caps, don't fixate it, just set it to 30/1
2015-10-02 15:05:26 +10:00
Tim-Philipp Müller fb30c04145 typefinding: minor clean-up
Remove unnecessary brackets from IS_MPEGTS_HEADER macro.
2015-10-01 12:49:59 +01:00
Pankaj Darak eaf4ce01d3 typefinding: mpeg-ts detection improvement
Allow AFC to be 0 for null pid packets.

https://bugzilla.gnome.org/show_bug.cgi?id=726117
2015-10-01 12:32:33 +01:00
Tim-Philipp Müller 7fb9cd453b subparse: detect closing tags even if there's a space after the slash
</ i> should be handled like </i>

https://bugzilla.gnome.org/show_bug.cgi?id=755875
2015-09-30 18:17:13 +01:00
Vineeth T M 060f0c21f2 audiosink, multisocketsink: Fix error leak during failures
https://bugzilla.gnome.org/show_bug.cgi?id=755143
2015-09-17 11:59:35 +02:00
Sebastian Dröge 2a1e046dd9 uridecodebin: Use the correct caps name for MS Smooth Streaming manifests
Thanks to John Chang <r97922153@gmail.com> for reporting.

https://bugzilla.gnome.org/show_bug.cgi?id=755098
2015-09-16 19:54:43 +02:00
Sebastian Dröge 35cb3b0c57 playback: Add POINTER_TO_ULONG() macro for consistency 2015-09-11 23:29:57 +02:00
Kouhei Sutou ab64b00b48 playback: fix build error for 64bit Windows build by MinGW
Casting to gpointer from gulong generates the following warning with
64bit Windows target MinGW:

    gstplaybin2.c: In function 'pad_added_cb':
    gstplaybin2.c:3476:7: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
           (gpointer) group_id_probe_handler);
           ^
    cc1: all warnings being treated as errors

We should cast to guintptr from gulong before we cast to gpointer.

https://bugzilla.gnome.org/show_bug.cgi?id=754755
2015-09-11 23:28:07 +02:00
Wim Taymans 3d733ad09f videoscale: fix gamma-decode option
We need to use the enum to configure the option now.
2015-09-03 17:56:05 +02:00
Thiago Santos 76d26a60bd playsinkconvertbin: implement accept-caps handler
The default one will just go through the internal elements which might
just be identity when it is in passthrough which will lead to the query
being handled by the downstream sink, ignoring all that playsinkconvertbin
could actually handle and convert.

https://bugzilla.gnome.org/show_bug.cgi?id=754235
2015-08-28 09:44:10 -03:00
Eunhae Choi b1f78b5d23 subparse: use g_clear_error instead of g_error_free
To avoid invalid pointer accees the err pointer should be set to NULL.
By using g_clear_error() it calls free and clear the pointer.

https://bugzilla.gnome.org/show_bug.cgi?id=753817
2015-08-19 16:21:25 +03:00
Sebastian Dröge 2727ca01f5 Revert "decodebin: Handle the preroll multi-queue size"
This reverts commit 5c8ef0ea05.
2015-08-18 18:47:22 +03:00
Sebastian Dröge 4fe4357188 Revert "decodebin: Store extra_buffer_required per group, not globally"
This reverts commit 1ea81114ea.
2015-08-18 18:47:21 +03:00
Sebastian Dröge 970bc16bf8 Revert "decodebin: If extra buffers are going to be required, we're still prerolling"
This reverts commit a3b24f0241.
2015-08-18 18:47:18 +03:00
Sebastian Dröge a3b24f0241 decodebin: If extra buffers are going to be required, we're still prerolling 2015-08-18 15:19:03 +03:00
Sebastian Dröge 1ea81114ea decodebin: Store extra_buffer_required per group, not globally
It's only relevant for each group, and by storing it in the group
we have locking and everything else like for the other buffering-related
variables. Locking looks a bit fishy still, but it was like that for a long
time already so shouldn't be worse than before.
2015-08-18 15:19:03 +03:00
Myoungsun Lee 5c8ef0ea05 decodebin: Handle the preroll multi-queue size
Overview:
There are some of interleaved streams which has long-term location of audio data.
It mean the audio data is located far away more than multiqueue size.
In this case, because of multiqueue overrun, the pipeline is stopped.
To prevent hanging-like state, the decodebin needs to handle the queue size.

Caused:
The multiqueue size is not enough, the pipeline will stay being stalled status
and decodebin cannot complete to build decode chain.
In this issue file, decodebin did not receive no_more_pads signal or audio data yet.

Steps to Reproduce:
play the high-resolution(4K file) files or some streaming media(push mode).

Actual Results:
There is no audio or subtitle.
We can see only video or infinite loading.

Resolution:
Decodebin detect this problem, and add extra buffer size to multiqueue.
The multiqueue is larger than before, the next data can be pushed the downstream element.

Additional Information:
The max-preroll extra buffer size is set 8MB.
We can use total pre-roll buffer 10MB.
Only first overrun callback can handle multiqueue size.

https://bugzilla.gnome.org/show_bug.cgi?id=733235
2015-08-18 15:19:02 +03:00
Sebastian Dröge 8a736f6e98 typefindfunctions: Add typefinder for TTML+XML
Used in DASH among other things, as SMPTE Timed Text.
2015-08-18 12:56:33 +03:00
Edward Hervey 7fc856ff5c decodebin: Fix list iteration
We were using the wrong variable ...

CID #1316477
2015-08-16 12:53:23 +02:00
Edward Hervey eaf9ca90c7 decodebin2: Handle flushing with multiple decode groups
When an upstream element wants to flush downstream, we need to take
all chains/groups into consideration.

To that effect, when a FLUSH_START event is seen, after having it
sent downstream we mark all those chains/groups as "drained" (as if
they had seen a EOS event on the endpads).

When a FLUSH_STOP event is received, we check if we need to switch groups.
This is done by checking if there are next groups. If so, we will switch
over to the latest next_group. The actual switch will be done when
that group is blocked.

https://bugzilla.gnome.org/show_bug.cgi?id=606382
2015-08-15 18:50:06 +02:00
Edward Hervey 2d3743e37d decodebin2: Forward event/queries for unlinked groups
When upstream events/queries reach sinkpads of unlinked groups (i.e.
no longer linked to the upstream demuxer), this patch attempts to find
the linked group and forward it upstream of that group.

This is done by adding upstream event/query probes on new group sinkpads
and then:
* Checking if the pad is linked or not (has a peer or not)
* If there is a peer, just let the event/query follow through normally
* If there is no peer, we find a pad to which to proxy it and return
  GST_PROBE_HANDLED if it succeeded (allowing the event/query to be properly
  returned to the initial called)

Note that this is definitely not thread-safe for the time being

https://bugzilla.gnome.org/show_bug.cgi?id=606382
2015-08-15 18:50:06 +02:00
Jan Schmidt f188a023c7 typefind: Make the H.264 typefind a tiny bit more lenient.
When we see prefix NALs before a Subset SPS has been spotted,
it might just be because the stream was truncated at the
start, so don't count those as either 'bad' or 'good' packets.
2015-08-15 12:14:56 +10:00
Thiago Santos 052d1c7b8b playsinkconvertbin: remove accept-caps handling
Just let the internal element of the bin do it instead of forcing a
caps query to do it.
2015-08-14 05:48:31 -03:00
Thiago Santos 909f494a5a videorate: fixate the pixel-aspect-ratio
If the pixel-aspect-ratio is not fixed, try to get it as close
to 1/1 as possible

https://bugzilla.gnome.org/show_bug.cgi?id=748635
2015-08-13 14:11:37 -03:00
Joan Pau Beltran 5070d6367e videorate: add support for bayer formats
Since the videorate element just duplicates or drops frames
to achieve the desired framerate, it can accept video/x-bayer media
(in any format), which are not present in the current caps.
Just add "video/x-bayer(ANY);" to the caps of the static pad template
(fixing line style to pass the indent commit hook).

https://bugzilla.gnome.org/show_bug.cgi?id=753483
2015-08-10 17:21:03 -04:00
Vineeth TM 0a3fe31f26 decodebin: fix deadend_details string leak
deadend_details need not be returned when the pad is not a deadend.
Hence checking if res value is TRUE and clearing the string instead of
passing it on

https://bugzilla.gnome.org/show_bug.cgi?id=753088
2015-08-05 14:33:35 -03:00
Nicolas Dufresne 7db376d05e videotestsrc: Don't set DTS on buffer
DTS is for encoded data and have no meaning for raw. It better to not
set it, as it's confusing.

https://bugzilla.gnome.org/show_bug.cgi?id=752791
2015-08-04 18:00:35 -04:00
Ville Skyttä 04e3fc3f33 typefind: Treat *.umx (Unreal Music Package) as audio/x-mod
https://bugzilla.gnome.org//show_bug.cgi?id=752436
2015-07-22 12:59:03 +01:00
Tim-Philipp Müller 39576545b7 typefindfunctions: add DASH MPD typefinder
Moved from dashdemux plugin in -bad.
2015-07-16 21:26:30 +01:00
Tim-Philipp Müller 6020b0cf2b Update mailing list address from sourceforge to freedesktop 2015-07-16 17:17:16 +01:00
Wim Taymans 14083178b8 video: improve logging
Add logging categories for most video objects.
Remove some useless debug lines in video-info and videotestsrc.
Add a performance debug line in the video scaler.
2015-07-15 12:47:42 +02:00
Wim Taymans 2b2766494b socketsrc: add caps property
Add caps property that allows the src to easily negotiate a format.
2015-07-14 16:01:10 +02:00
Thiago Santos 9c2e08c54d decodebin: only try to expose complete groups
When switching to a new chain it might be that this new chain
is not yet ready to be exposed so check it before exposing.

Can happen with mpegts that might delay adding pads or pushing data
until it has found the PMT/PAT/PCR and that may take a while depending
on the stream.

It happened frequently with HLS:
http://vevoplaylist-live.hls.adaptive.level3.net/vevo/ch1/appleman.m3u8
2015-07-14 00:11:59 -03:00
Thiago Santos 1d1bebd769 decodebin: fix typo
Hided -> hid
2015-07-14 00:11:59 -03:00
Sebastian Dröge f99a24f8b3 playsink: Require the streamvolume interface on the sink when using the sink's volume/mute properties
If the sink has properties named volume and mute, we have no idea about their
meaning. The streamvolume interface standardizes the meaning.

In the case of osxaudiosink for example, the current volume property has a
range of 0.0 to 1.0, but we need 0.0 to 10.0 or similar. Also osxaudiosink
has no mute property. As such, the volume element should be used here instead.

https://bugzilla.gnome.org/show_bug.cgi?id=752156
2015-07-10 11:55:23 +03:00
Thiago Santos 822b1d4511 typefind: also check moof to recognize video/quicktime
Helps recognizing fragmented files with the right type
2015-07-06 10:07:38 -03: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 68c5adec38 videoscale: fix debug categories
Use a local category for the default category and fix the import for the
performance category.
2015-07-03 21:08:03 +02:00
danny song 49d0083456 playbin: remove unnecessary break
https://bugzilla.gnome.org/show_bug.cgi?id=751690
2015-06-29 19:55:34 -03:00
Sebastian Dröge c5dbee33b0 audioresample: Also copy metas if their API has no tags attached to it
This is the default basetransform behaviour, being more strict than that
is not really useful.
2015-06-29 13:06:59 +02:00
Sebastian Dröge 010e35afa7 audioconvert: Also copy metas if their API has no tags attached to it
This is the default basetransform behaviour, being more strict than that
is not really useful.
2015-06-29 13:06:49 +02:00
Song Bing d2e942ac02 streamsynchronizer: Unblock EOS wait when track switching.
sink_event () will blocked on EOS event. which will cause can't
send event when switch EOS track to non-EOS one.

https://bugzilla.gnome.org/show_bug.cgi?id=750761
2015-06-23 15:28:49 +02:00
Sebastian Dröge bd508a343f streamsynchronizer: Don't wait for sparse streams when doing stream switches
Their stream-start event might come a bit later, like just before the first
buffer... and queues might run full before that happens.
2015-06-22 20:54:18 +02:00
Sebastian Dröge 152534611d streamsynchronizer: Add some more debug output 2015-06-22 20:29:52 +02:00
Sebastian Dröge 203b635d0c streamsynchronizer: Reset group start time when flushing
We reset the group start time to the running time of the start of the other
streams that are not flushed. This fixes seeking in gapless mode after the
first track has played.

https://bugzilla.gnome.org/show_bug.cgi?id=750013
2015-06-22 20:17:56 +02:00
Sebastian Dröge ab79e50510 playbin: Reset suburi also when receiving an error message from the sub uridecodebin
http://bugzilla.gnome.org/show_bug.cgi?id=751118
2015-06-22 14:51:07 +02:00
Brijesh Singh bcc9021071 playbin: free group->suburi on failure
If suburidecodebin is failed to negotiate (e.g file does not exist)
then free internal suburi variable so that 'current-suburi' property
returns correct status.

https://bugzilla.gnome.org/show_bug.cgi?id=751118
2015-06-22 14:48:42 +02:00
Tim-Philipp Müller f5ad17871c typefinding: check for full UTF-8 BOM in MSS typefinder
https://bugzilla.gnome.org/show_bug.cgi?id=750802
2015-06-11 23:33:30 +01:00
Philippe Normand d182e66bce typefindfunctions: UTF-8 MSS Manifest detection support
Check if the first bytes of data contain an UTF-8 BOM.

https://bugzilla.gnome.org/show_bug.cgi?id=750802
2015-06-11 19:46:02 +02:00
Sebastian Dröge 9c47e7d5e6 playbin: Check in autoplug_continue against the subtitle factory caps correctly
6a2f017bfa changed it to check the subtitle
factory caps if there is a text-sink but we fail to get its sinkpad. What
actually should be done here is to use the factory caps if there is no
text-sink at all.

https://bugzilla.gnome.org/show_bug.cgi?id=750785
2015-06-11 16:18:51 +02:00
Jan Schmidt ca864ce46e playbin: Fix some warnings with clang around multiview enums
There is the GstVideoMultiviewMode enum and the
GstVideoMultiviewFramePacking, which is a subset of the
multiview modes, with the same values as the corresponding
types from the full enum. Do some casts and use the right
times to avoid implicitly using/passing GstVideoMultiviewFramePacking
when a GstVideoMultiviewMode is needed.
2015-06-11 23:01:48 +10:00
Jan Schmidt 383d8f02be playbin: Implement multiview frame-packing overrides
Add GstVideoMultiviewFramePacking enum, and the
video-multiview-mode and video-multiview-flags
properties on playbin.

Use a pad probe to replace the multiview information in
video caps sent out from uridecodebin.

This is a part implementation only - for full
correctness, it should also modify caps in caps events,
accept-caps and allocation queries.

https://bugzilla.gnome.org/show_bug.cgi?id=611157
2015-06-11 12:05:00 +10:00
Víctor Manuel Jáquez Leal 7b78a33dc6 playsink: fix the channel of color balance element
When traversing the color balance element channel list to find the one that
matches with the playsink proxy, the assignation was set to iterator of the
playsink proxy, not the balance element. Thus, the mapping to the values of
the balance element channel was wrong.

This patch fixes the assignation of the color balance element channel, so the
mapping to the channel of the color balance element is fixed.

https://bugzilla.gnome.org/show_bug.cgi?id=750691
2015-06-10 13:12:31 +02:00
Vineeth TM 50beddd474 playsink: cannot enable text flag while playing
when text playbin is not enabled in the beginning, then
video_srcpad_stream_synchronizer gets linked to videochain->sinkpad
and when we try to enable text bin during play, since it is already linked to videochain,
text chain does not get linked properly. Hence unlinking the same
before linking to text chain

https://bugzilla.gnome.org/show_bug.cgi?id=748908
2015-06-10 10:38:45 +02:00
Sreerenj Balachandran 90bbb830d9 playback: Skip 'ANY' capsfeature while finding the count of common capsfeatures
https://bugzilla.gnome.org/show_bug.cgi?id=687182
2015-06-09 10:13:08 +02:00
Sreerenj Balachandran 16378a7de3 playback: Add gstplaybackutils.{h,c} to deploy the common subroutines
Bring some of the helper functions in gstplaybin2.c to new files
gstplaybackutils.{h,c} which can be utilized by other files
in gst/playback too.

https://bugzilla.gnome.org/show_bug.cgi?id=687182
2015-06-09 10:13:08 +02:00
Mathieu Duponchelle 2ad27e4c13 audioresample: copy metadata that only has the "audio" tag.
https://bugzilla.gnome.org/show_bug.cgi?id=750406
2015-06-04 19:16:40 +02:00
Mathieu Duponchelle 88484399c5 audioconvert: copy metadata that only has the "audio" tag.
https://bugzilla.gnome.org/show_bug.cgi?id=750406
2015-06-04 19:16:40 +02:00
Thibault Saunier dcfb8a83a5 encodebin: Add a way to enable/disabled a GstEncodingProfile
Summary:
So that the user can easily use the same encoding profile to render
with/without audio/video stream.

API:
  gst_encoding_profile_is_disabled
  gst_encoding_pofile_set_enabled

https://bugzilla.gnome.org/show_bug.cgi?id=749056
2015-06-01 10:22:31 +02:00
Jan Schmidt db86cff74d videotestsrc: Document the solid-color pattern 2015-05-30 01:11:47 +10:00
Jan Schmidt b14ede9332 playback: Document GST_PLAY_FLAG_SOFT_COLORBALANCE 2015-05-30 01:11:47 +10:00
George Kiagiadakis c84f911cee videorate: update the caps framerate only in the GST_PAD_SINK transform_caps direction
When a stream has a variable framerate, videorate calculates it and
forces it on the output caps. However, the code in _transform_caps()
currently also does that if the transform is going in the opposite
direction (GST_PAD_SRC), so during a renegotiation it tries to force
upstream to use the calculated framerate and it fails.

https://bugzilla.gnome.org/show_bug.cgi?id=750032
2015-05-29 15:03:05 +02:00
Thiago Santos 12ac087807 playsink: use queue to avoid lock in audiotee audio branches
This part of pipeline is:

tee name=t ! visualizationbin ! streamsynchronizer name=s
t. ! s.

streamsynchronizer might block and it could starve the visualization
branch of the pipeline when it is enabled.

The visualization bin has queues internally but the other branch
that links the audiotee directly to the synchronizer is vulnerable
to block. Adding a queue between "t. ! s." fixes deadlocks.

https://bugzilla.gnome.org/show_bug.cgi?id=749676
2015-05-28 04:56:16 -03:00
Tim-Philipp Müller 39cbe25df7 gio: don't use soon-to-be-deprecated g_cancellable_reset()
From the API documentation: "Note that it is generally not
a good idea to reuse an existing cancellable for more
operations after it has been cancelled once, as this
function might tempt you to do. The recommended practice
is to drop the reference to a cancellable after cancelling
it, and let it die with the outstanding async operations.
You should create a fresh cancellable for further async
operations."

https://bugzilla.gnome.org/show_bug.cgi?id=739132
2015-05-19 18:52:41 +01:00
Tim-Philipp Müller 37aa31379f tcp: don't use soon-to-be-deprecated g_cancellable_reset()
From the API documentation: "Note that it is generally not
a good idea to reuse an existing cancellable for more
operations after it has been cancelled once, as this
function might tempt you to do. The recommended practice
is to drop the reference to a cancellable after cancelling
it, and let it die with the outstanding async operations.
You should create a fresh cancellable for further async
operations."

https://bugzilla.gnome.org/show_bug.cgi?id=739132
2015-05-19 18:50:41 +01:00
Stefan Sauer 9b9d1a6119 Revert "doc: Workaround gtkdoc issue"
This reverts commit df7ef3c35d.

This is fixed by the gtk-doc 1.23 release.
2015-05-18 20:01:49 +02:00
eunhae choi 1b755eb272 playbin: check the flags before set again
check the previous flags of playsink to avoid the reconfigure of playsink repeatedly

https://bugzilla.gnome.org/show_bug.cgi?id=749528
2015-05-18 10:01:04 +03:00
Nicolas Dufresne df7ef3c35d doc: Workaround gtkdoc issue
With gtkdoc 1.22, the XML generator fails when a itemizedlist is
followed by a refsect2. Workaround the issue by wrapping the refsect2
into para.
2015-05-16 23:33:55 -04:00
Stefan Sauer 015bd9285a playback: use the new gst_object api
Use gst_object_has_as_anchestor instead of the now deprecated _has_ancestor.
2015-05-15 14:49:47 +02: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
Vivia Nikolaidou 327efa9805 videoconvert: Expose some properties from the videoconverter API
Expose chroma resampler, alpha mode, alpha value, chroma mode, matrix mode,
gamma mode and primaries mode from the videoconverter API.

https://bugzilla.gnome.org/show_bug.cgi?id=749105
2015-05-08 15:17:06 +02:00
Vivia Nikolaidou c9cfd0196f video-converter: Change some implicit string enums to real enums
GST_VIDEO_CONVERTER_OPT_ALPHA_MODE, GST_VIDEO_CONVERTER_OPT_CHROMA_MODE,
GST_VIDEO_CONVERTER_OPT_MATRIX_MODE, GST_VIDEO_CONVERTER_OPT_GAMMA_MODE and
GST_VIDEO_CONVERTER_OPT_PRIMARIES_MODE were G_TYPE_STRING with only a few valid
options. Changed those to real enums.

https://bugzilla.gnome.org/show_bug.cgi?id=749104
2015-05-08 15:13:54 +02:00
Sebastian Dröge a73631a29d streamsynchronizer: Don't override segment.base from upstream with 0
Upstream might want to use it to properly map timestamps to running/stream
times, if we just override it with 0 synchronization will be just wrong.

For this we remove some old 0.10 code related to segment accumulation, and
remove some more code that is useless now, and accumulate the group start time
(aka segment.base offset) manually now.

https://bugzilla.gnome.org/show_bug.cgi?id=635701
2015-05-05 15:35:46 +02:00
Luis de Bethencourt 69f66aff9e Rename property enums from ARG_ to PROP_
Property enum items should be named PROP_ for consistency and readability.
2015-04-27 11:27:00 +01:00
Matthieu Bouron 9dfe40d740 videoconvert: Keep colorimetry and chroma-site fields if passthrough
https://bugzilla.gnome.org/show_bug.cgi?id=748141
2015-04-27 11:20:36 +02: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
Tim-Philipp Müller 1638859627 typefinding: don't read more data than needed in MSS typefinder 2015-04-26 14:45:44 +01:00
Tim-Philipp Müller 9ef16721ed typefinding: detect MSS manifests without using g_convert()
Embedded systems often have limited charset conversion
functionality, so don't rely on g_convert() (i.e. iconv)
for UTF-16 to UTF-8 conversions, we can easily enough do
that ourselves by converting to native endianness and
then using GLib's helper functions.
2015-04-26 14:41:30 +01:00
Luis de Bethencourt df08f5eabe remove unused enum items PROP_LAST
This were probably added to the enums due to cargo cult programming and are
unused. Removing them.
2015-04-24 17:11:01 +01:00
Bernhard Miller 1c01b50ada audioconvert: fix mixed usage of gint and gint32 in int matrix
This is a fixup for b2db18cda2
audioconvert: avoid float calculations when mixing integer-formatted channels

The int matrix was using gint and gint32 synonymously, which can theoretically
cause problems if gint and gint32 are actually different types.

https://bugzilla.gnome.org/show_bug.cgi?id=747005
2015-04-15 12:18:03 +02:00
Tim-Philipp Müller dc4e517dc6 gio: fix gvfs plugin dependencies
Try harder to look for gvfs backend changes in the right
place, to make sure the plugin gets reloaded when backends
are removed or installed. We watch the gvfs mounts directory
because the files there contain absolute paths to the
backend executables, and those may not be in the usual gio
path.

https://bugzilla.gnome.org/show_bug.cgi?id=747841
2015-04-14 16:00:42 +01:00
Tim-Philipp Müller d4f9ea8499 app, videorate: fix CFLAGS and LIBADD order
Make sure local headers are included before installed -base.
2015-04-11 00:03:29 +01:00
Sebastian Dröge 3570100b66 decodebin: Also log the pointer value of sticky events in debug output
Makes it easier to follow them in the debug logs.
2015-04-08 20:49:39 -07:00
Tim-Philipp Müller 6db2ee56b6 tcpserversink: don't error out if clients send us something, just ignore it
We don't expect clients to send us any data, but if they do, just
ignore it. Web browsers might send us an HTTP request for example,
but some will still be happy if we just send them data without
a proper HTTP response.

There was a bug in the reading code path. We only have a small
read buffer and would provoke an EWOULDBLOCK trying to read
because we don't bail out of the loop early enough.

https://bugzilla.gnome.org/show_bug.cgi?id=743834
2015-04-04 21:38:40 +01:00
Tim-Philipp Müller 609d021f96 videorate: downgrade left-over ERROR debug message 2015-04-04 00:49:23 +01:00
Tim-Philipp Müller 413fc30235 videorate: fix a couple of memory leaks
tests: videorate: fix leak in unit test
2015-04-04 00:49:21 +01:00
Vincent Penquerc'h 77dc09c3a9 decodebin2: fix deadlock on chain shutdown
When shutting down the chain, we can get a deadlock when removing
a pad, if that chain was being busy streaming but blocked (eg, while
waiting for a queue to have free space).

https://bugzilla.gnome.org/show_bug.cgi?id=746480
2015-04-03 15:42:49 +01:00
Thibault Saunier ae86dec9ca videorate: Detect framerate if not forced to variable downstream
In case upstream does not provide videorate with framerate information,
it will detect the current framerate from the buffer it received,
but if downstream forces the use of variable framerate (most probably
through the use of a caps filter with framerate = 0 / 1), videorate will
respect that.

And add some unit tests

https://bugzilla.gnome.org/show_bug.cgi?id=734424
2015-04-02 17:13:24 -04:00
Thibault Saunier 1cda538e00 videorate: Do not loop forever pushing first buffer when variable framerate
In the case the framerate is variable (represented by framerate=0/1),
we currently end up loop pushing the first buffer and then recompute
diff1 and diff2 without updating the videorate->next_ts at all
leading to infinitely looping pushing that first buffer.

In the case of variable framerate, we should just compute the next_ts
as previous_pts + previous_duration.

https://bugzilla.gnome.org/show_bug.cgi?id=734424
2015-04-02 17:13:24 -04:00
Bernhard Miller b2db18cda2 audioconvert: avoid float calculations when mixing integer-formatted channels
The patch calculates a second channel mixing matrix from the current one. The
matrix contains the original values * (2^10) as integers. This matrix is used
when integer-formatted channels are mixed.

On a ARM Cortex-A8, single core, 800MHz this improves performance in a
testcase from 29s to 9s for downmixing 6 channels to stereo.

https://bugzilla.gnome.org/show_bug.cgi?id=747005
2015-04-01 07:31:37 -07:00
Luis de Bethencourt 985ed4847f playbin: avoid possible deference of null pointer
For safety, check the pointer playbin->curr_group is valid before
reading parameters of the structure.

CID #1291624
2015-03-30 10:50:48 +01:00
Thiago Santos ceb26dd93d decodebin: improve debug message by printing the object
Print the pad object that EOS'd too early
2015-03-27 09:21:59 -03:00
Thiago Santos d54d51d0d2 playbin: ignore new pads if it is shutting down
If a new pad is added after playbin has been put to READY/NULL it
should ignore new pads as it is shutting down.

This can happen when the pipeline fails to preroll (is still in READY)
and the user gives up on waiting or an error that doesn't reach
the demuxer occurs (on some event handling) and it will continue to
work and exposing pads while playbin has been put to NULL.

Without this check an input-selector is created and set to PAUSED
state, preventing playbin from properly shutting down in case it
has data blocked inside it.
2015-03-25 08:32:33 -03:00
Nicolas Dufresne 9695222b0f videorate: Don't leak the pools
gst_query_set_nth_alloction_pool() is transfer none on the pool, so we must
unref the pool when done.
2015-03-24 15:23:34 -04:00
Ilya Konstantinov 3dc3aa4e3b audioconvert: Eliminate unsigned quantizers
audio_convert_convert unpacks to default format (signed) before calling
quantize, and the unsigned variants were equivalent to signed anyway,
so we just get rid of them.
2015-03-24 16:52:07 +01:00
Ilya Konstantinov 7b398701cf audioconvert: Avoid int division in quantization
Since range size is always 2^n, we can simply use modulo (implemented
with a bitmask).

The previous implementation used 64-bit integer division, which is
done in software on ARMv7. Although the divisor was constant, the
division could not be transformed into "multiplication by magic number"
since the dividend was 64-bit.

The now-unused and not-so-fast gst_fast_random_(u)int32_range functions
were removed.

Also, implementing bug fixes:

1) ADD_DITHER_TPDF_HF_I no longer discards bias.

2) We change TPDF's noise range to be the same as RPDF's. Previously,
RPDF's noise ranged:
  { bias - dither, bias + dither }
while TPDF's noise ranged:
  { bias/2 - dither/2, bias/2 + dither/2 - 1 } +
  { bias/2 - dither/2, bias/2 + dither/2 - 1 } =
  { bias - dither, bias + dither - 2 }
Now, both range:
  { bias - dither, bias + dither - 1 }

https://bugzilla.gnome.org/show_bug.cgi?id=746661
2015-03-24 16:52:07 +01:00
Duncan Palmer bf3e35a598 decodebin2: Set multiqueue sizes before use-buffering.
This fixes a race where the use-buffering property on a multiqueue was
set before the queue depth was changed from it's high preroll limits to
lower playback limits. This resulted in buffering messages being emitted
by the multiqueue in the short window between use-buffering being
set and the queue depth being reset.

https://bugzilla.gnome.org/show_bug.cgi?id=744308
2015-03-24 08:17:47 -03:00
Thiago Santos b0b0ae1f24 streamsynchronizer: fix deadlock condition
The variables could have changed when the lock was released
to push a gap event. Streamsynchronizer needs to check them
again before going to sleep.

Bonus: fix a comment typo
2015-03-14 18:14:07 +00:00
Ramiro Polla 33b9535d97 playsink: remove redundant else statements 2015-03-14 14:21:32 +00:00
Ramiro Polla b636fe29f3 playbin: don't escape percent sign in documentation code sample 2015-03-14 14:20:17 +00:00
William Manley 8328eab2de socketsrc: Add support for GstNetControlMessageMeta
multisocketsink now understands the new GstNetControlMessageMeta to allow
sending control messages (ancillary data) with data when writing to Unix
domain sockets.

Thanks to glib's `GSocketControlMessage` abstraction the code introduced
in this commit is entirely portable and doesn't introduce and additional
dependencies or conditionally compiled code, even if it is unlikely to be
of much use on non-UNIX systems.
2015-03-14 13:23:28 +01:00
William Manley e63e023e30 multisocketsink: Add support for GstNetControlMessageMeta
multisocketsink now understands the new GstNetControlMessageMeta to allow
sending control messages (ancillary data) with data when writing to Unix
domain sockets.

A later commit will introduce a new socketsrc element which will similarly
understand `GstNetControlMessageMeta`.  This, when used with a
`GSocketControlMessage` of type `GUnixFDMessage` will allow GStreamer to
send and receive file-descriptions in ancillary data, the first step to
using memfds to implement zero-copy video IPC.

Thanks to glib's `GSocketControlMessage` abstraction the code introduced
in this commit is entirely portable and doesn't introduce and additional
dependencies or conditionally compiled code, even if it is unlikely to be
of much use on non-UNIX systems.
2015-03-14 13:23:20 +01:00
William Manley a297b0545f socketsrc: Add connection-closed-by-peer signal
This provides notification that the socket in use was closed by the peer
and gives an opportunity to replace it with a new one which is not
closed, allowing reading from many sockets in order.

I use this in pulsevideo to implement reconnection logic to handle the
pulsevideo service dieing, such that is can be restarted without
disrupting downstream.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=739546
2015-03-13 20:05:00 +01:00
William Manley a19ac4b85c socketsrc: Tidy up usage of g_object_unref/g_clear_object and locking
This is clearer, and should make future changes safer.  No functional
change intended.

See https://bugzilla.gnome.org/show_bug.cgi?id=739546
2015-03-13 20:05:00 +01:00
William Manley 0c054aa00d socketsrc: Refactor to simplify
* Don't bother polling, just do a blocking read, the `GCancellable` will
  take care of unlocking.  This should also be faster on MS Windows where
  the GIO documentation for `g_socket_get_available_bytes` states: "Note
  that on Windows, this function is rather inefficient in the UDP case".

* Implement `GstPushSrc.fill` rather than `GstPushSrc.create`.  This means
  that we will be using the downstream allocator which may be more
  efficient.  It also means that socketsrc is likely to respect its
  "blocksize" property (assuming that there is enough data available).

See https://bugzilla.gnome.org/show_bug.cgi?id=739546
2015-03-13 20:05:00 +01:00
William Manley 7c10499ecd tcp: Add element socketsrc
`socketsrc` can be considered a source counterpart to `multisocketsink`.
It can be considered a generalization of `tcpclientsrc` and
`tcpserversrc`:  it contains all the logic required to communicate over
the socket but none of the logic for creating the sockets/establishing
the connection in the first place, allowing the user to accomplish this
externally in whatever manner they wish making it applicable to other
types of sockets besides TCP.

This commit essentially copies the implementation directly from
tcpserversrc.  Later patches will tidy the implementation up and
re-implement `tcpclientsrc` and `tcpserversrc` in terms of `socketsrc`.

See https://bugzilla.gnome.org/show_bug.cgi?id=739546
2015-03-13 20:05:00 +01:00
William Manley b8232a7467 multisocketsink: Map GstMemorys individually when sending
If a buffer is made up of non-contiguous `GstMemory`s `gst_buffer_map`
has to copy all the data into a new `GstMemory` which is contiguous.  By
mapping all the `GstMemory`s individually and then using scatter-gather
IO we avoid this situation.

This is a preparatory step for adding support to multisocketsink for
sending file descriptors, where a GstBuffer may be made up of several
`GstMemory`s, some of which are backed by a memfd or file, but I think this
patch is valid and useful on its own.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=746150
2015-03-13 16:20:50 +01:00
Jan Schmidt 3d60fb654b docs: Add new video functions and objects. Cleanup a little.
Add GstVideoChroma, GstVideoDither, GstVideoScaler and friends to the docs.

Remove and clean up a few obsolete/deleted refs and typos
2015-03-13 01:08:25 +11:00
Sebastian Dröge 8093e3ba94 playbin: Disconnect signals and invalidate group if it fails to activate
Otherwise playbin might move to the group directly after EOS of the next
group, and then error out again.
2015-03-12 12:18:30 +00:00
Song Bing 7ce97c723c streamsynchronizer: Remove unnecessary ERROR message.
Remove unnecessary ERROR message.
Push GAP will fail as flushing. Needn't ERROR message.

https://bugzilla.gnome.org/show_bug.cgi?id=736655
2015-03-11 15:48:42 +00:00