Commit graph

4273 commits

Author SHA1 Message Date
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
Wim Taymans
9bbfc3c848 videotestsrc: add all colors mode 2015-03-10 12:27:03 +01:00
Tim-Philipp Müller
c53ba4beeb Fix double semicolons 2015-03-10 09:27:08 +00:00
Olivier Crete
124b6ee03c videorate: Accept any capsfeatures 2015-03-09 21:39:02 -04:00
Sebastian Dröge
40f4daffd1 volume: Explicitly cast integers to doubles and then back to integers after multiplication
gcc 4.9.1 on ARM seems to have a bug that causes it to cast the float to an
integer first, resulting in a 0 scale factor for volume < 1.0.

As a side effect this change here will also improve accuracy of the result a
bit because we go via doubles instead of floats.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65325
https://bugzilla.gnome.org/show_bug.cgi?id=745667
2015-03-05 14:22:12 +01:00
Arun Raghavan
dfdbc1c379 adder: Drop custom latency querying logic
The default latency query handler now implements the same logic already.
2015-02-27 00:52:05 +05:30
Edward Hervey
7813315a4c playback: Fix broken GList modification
When we modify a GList (via g_list_delete_link), always reassign the
new head to the original GList. Otherwise we end up with
filtered_errors being corrupt (the head might have been the element
removed)
2015-02-26 12:08:49 +01:00
Vincent Penquerc'h
561ddabd97 decodebin: fix deadlock when resetting buffering
This function is static, and only ever called with the expose lock
taken. It thus has no reason to take this lock itself.

This was introduced by one of my locking fixes from 741355.

https://bugzilla.gnome.org/show_bug.cgi?id=741355
2015-02-24 16:07:26 +00:00
Vincent Penquerc'h
a2ca6459a6 playbin: forward template and ring buffer settings to existing decodebins
https://bugzilla.gnome.org/show_bug.cgi?id=744844
2015-02-24 10:02:19 +00:00
Luis de Bethencourt
8703d93bbf decodebin: move null check
Check if dbin->decode_chain is NULL before running drain_and_switch_chains()
because if it is, we shouldn't run that function or it will segfault.

CID #1271074
2015-02-23 17:24:56 +00:00
Sebastian Dröge
1dcd1a7479 decodebin: Only consider non-parser factories for generating the post-parser capsfilter caps
Otherwise if there are multiple parsers we would most likely break negotiation
of the stream-format/alignment wanted by the decoders as parsers generally
support all possible stream-formats and alignments.
2015-02-20 12:35:19 +02:00
Vincent Penquerc'h
a2ee84fa80 decodebin: fix deadlock between downward state change and pad addition
If caps on a newly added pad are NULL, analyze_new_pad will try to
acquire the chain lock to add a probe to the pad so the chain can
be built later. This comes from the streaming thread, in response
to headers or other buffers causing this pad to be added, so the
stream lock is taken.

Meanwhile, another thread might be destroying the chain from a
downward state change. This will cause the chain to be freed with
the chain lock taken, and some elements are set to NULL here, which
can include the parser. This causes pad deactivation, which tries
to take the element's pad's stream lock, deadlocking.

Fix this by keeping track of which elements need setting to NULL,
and only do this after the chain lock is released. Only the chain
manipulation needs to be locked, not the elements' state changes.

https://bugzilla.gnome.org/show_bug.cgi?id=741355
2015-02-19 13:38:35 +00:00
Vincent Penquerc'h
a848ac7abe decodebin: guard against the decode chain going while a pad is added
https://bugzilla.gnome.org/show_bug.cgi?id=741355
2015-02-19 13:38:35 +00:00
Vincent Penquerc'h
9036dc8594 decodebin: possible fix for deadlock when spamming "next song"
There was a deadlock between a thread changing decodebin/demuxer
state from PAUSED to READY, and another thread pushing data
when starting.

From the stack trace at
https://bug741355.bugzilla-attachments.gnome.org/attachment.cgi?id=292471,
I deduce the following is happening, though I did not reproduce the
problem so I'm not sure this patch fixes it.

The streaming thread (thread 2 in that stack trace) takes the demuxer's
sink pad's stream lock in gst_ogg_demux_perform_seek_pull and will
activate a new chain. This ends up causing the expose lock being taken
in _pad_added_cb in decodebin.

Meanwhile, a state changed is triggered on thread 1, which takes the
expose lock in decodebin in gst_decode_bin_change_state, then frees
the previous chain, which ends up calling gst_pad_stop_task on the
demuxer's task, which in turn takes the demuxer's sink pad's stream
lock, deadlocking as both threads are now waiting for each other.

https://bugzilla.gnome.org/show_bug.cgi?id=741355
2015-02-19 13:38:29 +00:00
Sebastian Dröge
2813e08210 uridecodebin: Reset the default query return value when the iterator has to resync 2015-02-19 01:30:05 +02:00
Sebastian Dröge
5da04ca3c7 uridecodebin: Let the latency query fail if one of the source queries fails 2015-02-19 01:22:26 +02:00
Olivier Crête
0487e1548d uridecodebin: Pass object, not GValue to debug print 2015-02-17 18:39:03 -05:00
Song Bing
fb9ca25f7f streamsynchronizer: Use the same waiting function for EOS and stream switches
Also improve the waiting condition for stream switches, which was assuming
before that the condition variable will only stop waiting once when it is
signaled. But the documentation says that there might be spurious wakeups.

https://bugzilla.gnome.org/show_bug.cgi?id=736655
2015-02-16 14:34:35 +02:00
Song Bing
2614f80309 streamsynchronizer: Send GAP events from the pads' streaming threads
Change the GAP events that are currently sent from the chain function of
the current pad to all other EOS pads. They should instead be sent from
their own streaming threads.

https://bugzilla.gnome.org/show_bug.cgi?id=736655
2015-02-16 14:12:28 +02:00
Song Bing
9f81931716 streamsynchronizer: Send GAP event to finish preroll when change state from PLAYING to PAUSED
Wait in the event function when EOS is received until all pads are EOS
and then forward the EOS event from each pads own event function.

Also send a new GAP event for EOS pads from the event function whenever
going from PLAYING->PAUSED by shortly waking up the GCond. This is needed
to allow sinks to pre-roll again, as they did not receive EOS yet because
we blocked that, but also will never get data again.

https://bugzilla.gnome.org/show_bug.cgi?id=736655
2015-02-16 14:09:43 +02:00
Stefan Sauer
c51bf98af4 playbin: improve debug log
Log the human readable pad_link_return desc as well.
2015-02-11 22:16:53 -08:00
Sebastian Dröge
8547594727 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 17:53:49 +02:00
Luis de Bethencourt
f85212ed4b videoscale: fix memory leak
In gst_video_scale_fixate_caps () it can goto done without freeing the memory
of the tmp GstStructure. This makes it go out of scope and leak.

CID #1265766
2015-02-04 12:09:45 +00:00
Wim Taymans
47bd6a138c videoscale: don't do dithering 2015-01-28 17:30:53 +01:00
Luis de Bethencourt
783204824d orc: update orc files 2015-01-27 13:39:14 +00:00
Wim Taymans
3db8879f25 videoscale: disable chroma and matrix operations
Ignore chroma subsampling and color matrix transformations like the
old videoscale used to do. This is to make the performance like it was
before.

See https://bugzilla.gnome.org/show_bug.cgi?id=741987
2015-01-27 10:52:29 +01:00
Sebastian Dröge
2bd4ea6e8e Constify some static arrays everywhere 2015-01-21 09:49:47 +01:00
Vincent Penquerc'h
661588b150 dcodebin2: fix lock/unlock mismatch on multiqueue overrun 2015-01-20 15:09:13 +00:00
Jan Alexander Steffens (heftig)
a636c39638 audioresample: Try to prevent endless looping
Speex may decide not to consume any samples because it can't write any. I've
seen a hang during draining caused by the resample loop never terminating.
In that case, resampling happened as normal until olen was 0 but ilen was
still 1. _process_native then reduced ichunk to 0, so ilen never decreased
below 1 and the loop never terminated.

Instead of reverting 684cf44 ({audioresample: don't skip input samples),
break only if all output samples have been produced and speex refuses
to consume any more input samples.

https://bugzilla.gnome.org/show_bug.cgi?id=732908
2015-01-19 19:36:13 +01:00
Sebastian Dröge
63afbce6be videorate: Add $(GST_PLUGINS_BASE_CFLAGS) to be able to find gst/video/video.h 2015-01-19 11:17:18 +01:00
Nicolas Dufresne
e60158c98f videorate: Implement allocation query
The videorate element keeps 1 buffer internally. This buffer need
to be requested during allocation query otherwise the pipeline may
stall.

https://bugzilla.gnome.org/show_bug.cgi?id=738302
2015-01-18 14:58:36 -05:00
Nicolas Dufresne
2e264103e1 Revert "videorate: Implement allocation query"
This reverts commit 3c04db4a30.
2015-01-18 14:17:07 -05:00
Nicolas Dufresne
3c04db4a30 videorate: Implement allocation query
VideRate keeps 1 buffer in order to duplicate base on closest buffer
relative to targeted time. This extra buffer need to be request
otherwise the pipeline may stall when fixed size buffer pool is used.

https://bugzilla.gnome.org/show_bug.cgi?id=738302
2015-01-18 11:02:00 -05:00
Sebastian Dröge
2228d9f22b decodebin: Fix compilation 2015-01-17 14:51:48 +01:00
Branislav Katreniak
d16df7f70d decodebin: do call set_queue_size in no_more_pads_cb
Consider pipeline: gst-launch-1.0 playbin uri=http://example.com/a.ogg
Consider 128kbit audio stream.

As soon as uridecodebin detects the bitrate, it configures its input
queue2 max-size to 32000 bytes.
The 2MB buffer in multiqueue is nearly 2 orders of magnitude bigger.
This non-deterministically drives queue2 buffer anywhere from
100% to 0% until multiqueue is filled.

This patch sets multiqueue size to 5 buffers early in no_more_pads_cb.

Partly reverts commit db771185ed.

https://bugzilla.gnome.org/show_bug.cgi?id=740689
2015-01-16 20:58:40 +01:00
Vincent Penquerc'h
6ab711f3f1 decodebin: free old groups when switching groups
Old groups are freed with one switch's delay when switching groups.
They're freed in a scratch thread to avoid delaying the switch.
2015-01-16 15:55:10 +00:00
Thiago Santos
a5ed7afb4c decodebin: disable pad link checks as it has already been done
Decodebin has already added the element to the bin and should only
select caps compatible pads. It should disable the pad link checks
to avoid doing those again.

https://bugzilla.gnome.org/show_bug.cgi?id=742885
2015-01-14 10:33:52 -03:00