Commit graph

3116 commits

Author SHA1 Message Date
Philippe Normand
e35adf5b6a baseparse: avg_bitrate calculation critical warning fix
The avg_bitrate is an unsigned int, so the gst_util_uin64_scale() function can't
be used for it, as it expects signed integers for the fraction parts arguments.

https://bugzilla.gnome.org/show_bug.cgi?id=797054
2018-08-31 15:51:47 +01:00
Sebastian Dröge
a42ab58588 typefindhelper: Mark gst_type_find_helper_get_range_full() as Since 1.14.3 2018-08-02 10:55:40 +03:00
Sebastian Dröge
bb3fbfbe7f typefind: Add new gst_type_find_helper_get_range_full() that returns flow return
And make use of it in the typefind element. It's useful to distinguish
between the different errors why typefinding can fail, and especially to
not consider GST_FLOW_FLUSHING as an actual error.

https://bugzilla.gnome.org/show_bug.cgi?id=796894
2018-08-02 10:54:35 +03:00
Mathieu Duponchelle
5c8d2f6258 aggregator: annotate GstAggregatorClass::update_src_caps 2018-07-30 14:43:32 +02:00
Sebastian Dröge
a2145fd681 aggregator: Don't leak peer pad of inactive pads when (not) forwarding QoS events to them 2018-07-26 02:33:30 +03:00
Thibault Saunier
07af74b946 basetransform: Do not check if NULL is an emtpy caps
gst_base_transform_transform_caps can return NULL in various conditions
thus we should not treat its result as valid caps.

In all other places NULL is properly handled.
2018-07-19 09:11:22 +03:00
Christoph Reiter
7cbbdf3a90 meson: Fix detection of glib-mkenums under MSYS2
Under MSYS2 glib-mkenums is an executable and has a .exe extension and
the path does not end with "glib-mkenums".

Make the script compare the path without the file extension instead.

https://bugzilla.gnome.org/show_bug.cgi?id=796273
2018-05-20 16:41:06 +01:00
Edward Hervey
fbf6e28747 gst: Use memcpy() instead of strncpy() where appropriate
strncpy() is assumed to be for strings so the compiler assumes that
it will need an extra byte for the string-terminaning NULL.

For cases where we know it's actually "binary" data, just copy it
with memcpy.

Fixes compiler warnings with gcc 8.

https://bugzilla.gnome.org/show_bug.cgi?id=795756
2018-05-08 16:42:37 +01:00
Tim-Philipp Müller
c97c95fc60 aggregator: fix exports and since marker for new API
https://bugzilla.gnome.org/show_bug.cgi?id=795332
2018-05-05 11:32:12 +02:00
Olivier Crête
2821126d60 aggregator: Add API to check if a pad has a new buffer
https://bugzilla.gnome.org/show_bug.cgi?id=795332
2018-05-04 13:48:17 +02:00
Mark Nauwelaerts
e7ccd58171 base: fix some GIR annotations
Mostly related to out parameters and their transfer
2018-04-16 11:11:36 +03:00
Sebastian Dröge
0ca5957342 net: Include gstnetcontrolmessagemeta.h in net.h 2018-03-25 12:32:42 +03:00
Tim-Philipp Müller
d86a90550b net: GST_EXPORT -> GST_NET_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 00:57:37 +00:00
Tim-Philipp Müller
6b286fb7dd controller: GST_EXPORT -> GST_CONTROLLER_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 00:57:37 +00:00
Tim-Philipp Müller
357e7c7b02 check: GST_EXPORT -> GST_CHECK_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 00:57:36 +00:00
Tim-Philipp Müller
7e2ace8618 base: GST_EXPORT -> GST_BASE_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 00:46:00 +00:00
Nicolas Dufresne
cbd03e26ce basesrc: Balance unlock/unlock_stop in _src_stop()
Otherwise it's possible that we won't be able to start again
depending the implementation. We do start/stop in normal use cases
whenever GST_QUERY_SCHEDULING happens before we are started.

https://bugzilla.gnome.org/show_bug.cgi?id=794149
2018-03-07 20:03:56 -05:00
Nicolas Dufresne
12c5d903c9 basesrc: No need to stop flushing in start_complete
The flushing state is handled a bit differently, there is no need
to stop flushing in start_complete. This would other result in
unlock_stop being called without unlock_start.

Unlike what the old comment says, there is no need to take the live
lock here, we are still single threaded at this point (app thread
or the state change thread). Also, we will wait for playing state
in create/getrange, no need to do that twice.

https://bugzilla.gnome.org/show_bug.cgi?id=794149
2018-03-07 20:03:56 -05:00
Sebastian Dröge
89eac59e92 queuearray: Implement pop_tail_struct() for completeness
All other variants of {peek,pop}_{head,tail}_{,struct} were already
implemented.

https://bugzilla.gnome.org/show_bug.cgi?id=794035
2018-03-05 09:39:57 +02:00
Olivier Crête
23b32d5600 queue: Ignore thresholds if a query is queued
The queue gets filled by the tail, so a query will always be the tail
object, not the head object. Also add a _peek_tail_struct() method to the
GstQueueArray to enable looking at the tail.

With unit test to prevent future regression.

https://bugzilla.gnome.org/show_bug.cgi?id=762875
2018-03-01 16:31:57 -05:00
Mathieu Duponchelle
d67623c7a9 meson: enable more warnings
Modeled on the autotools build, -W flags are only
added if the compiler supports them.

https://bugzilla.gnome.org/show_bug.cgi?id=793958
2018-03-01 17:20:48 +01:00
Mathieu Duponchelle
8c10f1e2b4 gstaggregator: pads must inherit from #GstAggregatorPad
Document this, and take advantage of that fact to use
GstAggregator.srcpad.segment instead of GstAggregator.segment

https://bugzilla.gnome.org/show_bug.cgi?id=793942
2018-03-01 15:25:53 +01:00
Mathieu Duponchelle
a567cc13a5 Revert "gstaggregator: pads must inherit from #GstAggregatorPad"
This reverts commit 9774b3775d.

Pushed by mistake
2018-03-01 01:15:34 +01:00
Mathieu Duponchelle
9774b3775d gstaggregator: pads must inherit from #GstAggregatorPad
Document this, and take advantage of that fact to use
GstAggregator.srcpad.segment instead of GstAggregator.segment

https://bugzilla.gnome.org/show_bug.cgi?id=793942
2018-03-01 00:39:50 +01:00
Mathieu Duponchelle
f1aba33090 aggregator: allow src GstAggregatorPads
See https://bugzilla.gnome.org/show_bug.cgi?id=793917

https://bugzilla.gnome.org/show_bug.cgi?id=793934
2018-03-01 00:39:08 +01:00
Nicolas Dufresne
91798e16cc baseparse: Fix integer overflow in bitrate calculation
https://bugzilla.gnome.org/show_bug.cgi?id=793284
2018-02-22 16:14:57 -05:00
Nicolas Dufresne
a84b886a7d baseparse: Avoid overflow in update_interval calculation
https://bugzilla.gnome.org/show_bug.cgi?id=793284
2018-02-22 16:14:57 -05:00
Nicolas Dufresne
25aed8c7ff baseparse: Fix check for update_interval
update_interval may be -1

https://bugzilla.gnome.org/show_bug.cgi?id=793284
2018-02-22 16:14:57 -05:00
Tim-Philipp Müller
bbf8f50cde queuearray: add _peek_tail() and _pop_tail()
API: gst_queue_array_pop_tail()
API: gst_queue_array_peek_tail()

These will be needed later for appsrc.
2018-02-19 15:44:04 +00:00
Alicia Boya García
65dcb2adbf gstbasesink: Include segment.offset in the computation of position
Position queries with GST_FORMAT_TIME are supposed to return stream
time.

gst_base_sink_get_position() estimates the current stream time on its
own instead of using gst_segment_to_stream_time(), but the algorithm
used was not taking segment.offset into account, resulting in invalid
values when this field was set to a non-zero value.

https://bugzilla.gnome.org/show_bug.cgi?id=792434
2018-02-16 10:35:14 -03:00
Mathieu Duponchelle
5ce6487fa9 basetransform: annotate virtual methods 2018-01-31 13:36:15 +01:00
Mathieu Duponchelle
117200faeb aggregator: delegate buffer skipping to the aggregate thread
As we do that for serialized events as well, and the subclass will
most likely need to access pad->segment to make its decisions,
doing that from the sinkpad's streaming threads was racy.
2018-01-23 22:49:52 +01:00
Mathieu Duponchelle
9f69034d41 API: GstAggregatorPad.skip_buffer virtual method
Allows subclasses to prevent buffers from being queued.

https://bugzilla.gnome.org/show_bug.cgi?id=781928
2018-01-23 20:17:44 +01:00
Mathieu Duponchelle
ac7434088e basesrc: Annotate some of the virtual methods 2018-01-23 20:06:52 +01:00
Tim-Philipp Müller
bce246f39f aggregator: rename _get_buffer() -> _peek_buffer() and _steal -> _pop
https://bugzilla.gnome.org/show_bug.cgi?id=791204
2018-01-23 09:44:44 +00:00
Michele Dionisio
0af74cb599 ptp: fix build failure with #undef USE_MEASUREMENT_FILTERING
"Label ‘out’ used but not defined", since it's also used by
the USE_MEDIAN_PRE_FILTERING branch.

https://bugzilla.gnome.org/show_bug.cgi?id=785631
2018-01-18 17:45:28 +00:00
Jun Xie
33e7269c37 typefindhelper: fix confusing debug log message
In case of a short buffer, the debug log is quite confusing.
Distinguish the two types of failure cases to make it clearer.

https://bugzilla.gnome.org/show_bug.cgi?id=792486
2018-01-15 16:31:44 +00:00
Tim-Philipp Müller
88dfd9ee48 libs: check: print stacktrace on unexpected criticals 2018-01-11 12:27:18 +00:00
Håvard Graff
fbbe6c646e meson: make check and tests build on Windows with msvc 2018-01-11 09:50:24 +00:00
Edward Hervey
9d335a80d0 gstharness: Remove double free 2018-01-02 10:02:45 +01:00
Stefan Sauer
ce00ec8bce aggregator: remove DEBUG_FUNCPTR
The new gst_element_do_foreach_pad() does not print the functions anymore.
2017-12-26 12:53:25 +01:00
Jan Alexander Steffens (heftig)
4636477d81 aggregator: Avoid a maybe-uninitialized warning
Arch Linux x86_64, gcc 7.2.1-2, -Og -g3
2017-12-24 11:39:14 +01:00
Nicolas Dufresne
443221c661 basetransform: Allow going passthrough inside decide_allocation
Sub-class may want to decide to go passthrough/in-place by inspecting
the support meta APIs. This patch duplicates the check for this mode,
so we still don't do uneeded allocation query while we allow sub-classes
to switch the behaviour during it's own decide_allocation call.

Notice that such sub-class need to reset the class to non-passthrough in
set_caps() in order for decide_allocation to be called again. This is
needed otherwise we'd be doing an allocation query in element in which
it make no sense (notably capsfilter).

https://bugzilla.gnome.org/show_bug.cgi?id=791453
2017-12-17 15:39:51 -05:00
Matthew Waters
fa302587dd check/harness: fix transfer annotations on buffer passing functions 2017-12-13 11:23:03 +11:00
Tim-Philipp Müller
18fe36a286 basesrc: add buffer list support
Add a gst_base_src_submit_buffer_list() function that allows subclasses
to produce a bufferlist containing multiple buffers in the ::create()
function. The buffers in the buffer list will then also be pushed out
in one go as a GstBufferList. This can reduce push overhead
significantly for sources with packetised inputs (such as udpsrc)
in high-throughput scenarios.

The _submit_buffer_list() approach was chosen because it is fairly
straight-forward, backwards-compatible, bindings-friendly (as opposed
to e.g. making the create function return a mini object instead),
and it allows the subclass maximum control: the subclass can decide
dynamically at runtime whether to return a list or a single buffer
(which would be messier if we added a create_list virtual method).

https://bugzilla.gnome.org/show_bug.cgi?id=750241
2017-12-07 12:17:09 +00:00
Tim-Philipp Müller
880c573e8d basesrc: minor code readability improvement 2017-12-07 12:17:09 +00:00
Tim-Philipp Müller
16d9954dd5 harness: make bindings use the GBytes variant for _take_all_data() 2017-12-05 16:42:57 +00:00
Havard Graff
e08834bff3 harness: use new take_all_data() function in _dump_to_file(). 2017-12-05 15:37:14 +00:00
Tim-Philipp Müller
d8e7fc40b1 harness: add gst_harness_take_all_data() + _take_all_data_as_{bytes,buffer}()
Convenience function to just grab all pending data
from the harness, e.g. if we just want to check if
it matches what we expect and we don't care about
the chunking or buffer metadata.

Based on patch by: Havard Graff <havard.graff@gmail.com>
2017-12-05 15:37:00 +00:00
Tim-Philipp Müller
76b54099bd aggregator: add finish_buffer() vfunc
So subclasses can override the finish behaviour
and/or decorate or modify buffers before they
get pushed out.

https://bugzilla.gnome.org/show_bug.cgi?id=760981
2017-12-04 15:27:04 +00:00