Commit graph

2192 commits

Author SHA1 Message Date
Tim-Philipp Müller
41f873fa0a aggregator: fix doc chunk for new buffer-consumed signal
Fixes 'Warning: GstBase: incorrect number of parameters in
comment block, parameter annotations will be ignored.' from
g-ir-scanner.
2019-04-16 23:51:19 +01:00
Mathieu Duponchelle
fee108f7cf basesrc: do not send EOS when automatic_eos is FALSE 2019-04-05 18:00:29 +00:00
Mathieu Duponchelle
ae57b1c76d aggregator: add buffer-consumed pad signal
The signal will be emitted when a buffer was consumed on
a pad, if the newly-added "emit-signals" property has been
set to TRUE.

Handlers connected to the signal will receive a valid reference on
the consumed buffer, allowing for example the retrieval of metas in
order to forward them once an output buffer is pushed out.
2019-04-05 12:13:54 +00:00
Tim-Philipp Müller
cef902814d bitwriter: mark as 'skip' for gobject-introspection
Silences g-ir-scanner warnings. We do the same for ByteWriter.
2019-03-23 17:53:07 +00:00
Matthew Waters
c6691abba1 aggregator: don't leak gap buffer when out of segment 2019-03-21 19:18:46 +11:00
Matthew Waters
619dfc91bb aggregator: take the pad lock around queue gap event removal
As is done for every other queue interaction
2019-03-21 19:18:46 +11:00
Matthew Waters
b8d00b9e6e baseparse: don't reset the disable-passthrough property value
Resetting as a result of _reset() on PAUSED->READY is unexpected.
2019-03-20 17:44:30 +11:00
Tim-Philipp Müller
41d5f22334 aggregator: fix typo in docs 2019-01-05 18:55:12 +00:00
Tim-Philipp Müller
33267b2ecc basesrc: ensure submitted buffer list is writable
Fixes flaky appsrc unit test where depending on scheduling
the submitted list might not be writable if submitted via
an action signal from the application thread.

Fixes gst-plugins-base#522
2018-12-19 00:34:40 +00:00
KimTaeSoo
bf1979e55f baseparse: Use buffer from short reads instead of pulling again
baseparse internally uses a 64kb buffer for pulling data from upstream.
If a 64kb pull is failing with a short read, it would previously pull
again the requested size.

Doing so is not only inefficient but also seems to cause problems with
some elements (rawvideoparse) where the second pull would fail with EOS.

Short reads are only allowed in GStreamer at EOS.

Closes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/294
2018-11-28 17:38:58 +02:00
Thomas Bluemel
36ab067905 clock: Keep weak reference to underlying clock
Fixes potential segmentation fault when using a GstClockID that
is referencing an already freed GstClock

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/187
2018-11-03 19:00:22 +02:00
Sebastian Dröge
fc3602aec8 queuearray: Only clear dropped item if it is not returned 2018-10-15 18:47:16 +03:00
Sebastian Dröge
2481e542c7 queuearray: Clear items when dropping them and a clear function was defined 2018-10-15 15:28:35 +03:00
Tim-Philipp Müller
135932872e aggregator: document new "min-upstream-latency" property is in nanosecs
https://bugzilla.gnome.org/show_bug.cgi?id=797213
2018-10-04 00:30:52 +01:00
Vivia Nikolaidou
22d0f40716 queuearray: Add set_clear_func and clear functions
gst_queue_array_clear will clear the GstQueueArray,
gst_queue_array_set_clear_func will set a clear function for each
element to be called on _clear and on _free.

https://bugzilla.gnome.org/show_bug.cgi?id=797218
2018-09-27 19:32:54 +03:00
Mathieu Duponchelle
62d7eaf3aa aggregator: add gtk-doc blurb for new min-upstream-latency prop 2018-09-27 13:20:10 +02:00
Mathieu Duponchelle
97e2e7a63d aggregator: add min-upstream-latency property.
This is exposed as a solution to the use case of plugging in
sources with a higher latency after the aggregator has started
playing with an initial set of sources, allowing to avoid resyncing.

https://bugzilla.gnome.org/show_bug.cgi?id=797213
2018-09-27 12:56:47 +02:00
Tim-Philipp Müller
57c8e0146f libs: figure out right export define in configure
Add new GST_API_EXPORT in config.h and use that for GST_*_API
decorators instead of GST_EXPORT.

The right export define depends on the toolchain and whether
we're using -fvisibility=hidden or not, so it's better to set it
to the right thing directly than hard-coding a compiler whitelist
in the public header.

We put the export define into config.h instead of passing it via the
command line to the compiler because it might contain spaces and brackets
and in the autotools scenario we'd have to pass that through multiple
layers of plumbing and Makefile/shell escaping and we're just not going
to be *that* lucky.

The export define is only used if we're compiling our lib, not by external
users of the lib headers, so it's not a problem to put it into config.h

Also, this means all .c files of libs need to include config.h
to get the export marker defined, so fix up a few that didn't
include config.h.

This commit depends on a common submodule commit that makes gst-glib-gen.mak
add an #include "config.h" to generated enum/marshal .c files for the
autotools build.

https://bugzilla.gnome.org/show_bug.cgi?id=797185
2018-09-24 08:39:37 +01:00
Tim-Philipp Müller
46ed0f0489 libs: fix 'inconsistent DLL linkage' warnings on Windows
For each lib we build export its own API in headers when we're
building it, otherwise import the API from the headers.

This fixes linker warnings on Windows when building with MSVC.

The problem was that we had defined all GST_*_API decorators
unconditionally to GST_EXPORT. This was intentional and only
supposed to be temporary, but caused linker warnings because
we tell the linker that we want to export all symbols even
those from externall DLLs, and when the linker notices that
they were in external DLLS and not present locally it warns.

What we need to do when building each library is: export
the library's own symbols and import all other symbols. To
this end we define e.g. BUILDING_GST_FOO and then we define
the GST_FOO_API decorator either to export or to import
symbols depending on whether BUILDING_GST_FOO is set or not.
That way external users of each library API automatically
get the import.

https://bugzilla.gnome.org/show_bug.cgi?id=797185
2018-09-23 23:23:01 +01:00
Mathieu Duponchelle
17798bca6d aggregator: define autoptr cleanup functions 2018-09-20 16:22:17 +02:00
Philippe Normand
d7c87910c2 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:35:35 +01:00
Nirbheek Chauhan
c389c59b22 meson: Maintain macOS ABI through dylib versioning
Requires Meson 0.48, but the feature will be ignored on older versions
so it's safe to add it without bumping the requirement.

Documentation:
https://github.com/mesonbuild/meson/blob/master/docs/markdown/Reference-manual.md#shared_library
2018-08-31 14:40:14 +05:30
Tim-Philipp Müller
f7b5151b58 bitwriter: fix compiler warning
Don't return a value from a function that doesn't
return a value using the returned value from a
function that also doesn't return a value.

gstbitwriter.h(265): warning C4098: 'gst_bit_writer_align_bytes_unchecked': 'void' function returning a value
2018-08-26 11:45:58 +02:00
Sebastian Dröge
49d212e908 aggregator: Fixup for previous commit to prevent infinite loop if no events are pending 2018-08-14 12:30:19 +03:00
Sebastian Dröge
08bd835f09 aggregator: Return an error directly if negotiation of a sink pad failed
And don't give buffers to subclasses in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=796951
2018-08-14 10:23:23 +03:00
Tim-Philipp Müller
88bd7c61a7 bitwriter: fix g-i scanner warning
gstbitwriter.h:45: Warning: GstBase: "@bit_capacity" parameter unexpected at this location:
 * @bit_capacity: Capacity of the allocated @data
2018-08-12 20:07:02 +01:00
Sebastian Dröge
c31ef7fa51 typefindhelper: Mark gst_type_find_helper_get_range_full() as Since 1.14.3 2018-08-02 10:57:28 +03:00
Sebastian Dröge
41f1a40704 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-01 14:23:04 +03:00
Mathieu Duponchelle
27f53141e2 aggregator: annotate GstAggregatorClass::update_src_caps 2018-07-27 23:22:59 +02:00
Sebastian Dröge
a569347789 aggregator: Don't leak peer pad of inactive pads when (not) forwarding QoS events to them 2018-07-26 02:32:57 +03:00
Sebastian Dröge
7bee79426d typefindhelper: Mark extension in gst_type_find_helper_get_range() as allow-none
It always allowed NULL and even said so in the documentation.
2018-07-25 01:12:49 +03:00
Sebastian Dröge
d196b0b904 typefind: Add _with_extension() variants for typefinding data or a buffer
And make use of that in the typefind element to also be able to make use
of the extension in push mode. It previously only did that in pull mode
and this potentially speeds up typefinding and might also prevent false
positives.

https://bugzilla.gnome.org/show_bug.cgi?id=796865
2018-07-25 01:12:11 +03:00
Thibault Saunier
1f3ef7aa01 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-18 21:18:56 -04:00
Olivier Crête
4f3aea316a sink: Only add processing latency if upstream is live
Only add it if upstream is live, otherwise leave the latency at 0.

https://bugzilla.gnome.org/show_bug.cgi?id=640610
2018-07-16 13:04:44 -04:00
Thibault Saunier
b4d93abb24 basesink: Minor GI warning fix. 2018-07-13 08:52:55 -04:00
Olivier Crête
a7f9c80220 basesink: Add processing deadline
The processing deadline is the acceptable amount of time to process the media
in a live pipeline before it reaches the sink. This is on top of the algorithmic
latency that is normally reported by the latency query. This should make
pipelines such as "v4lsrc ! xvimagesink" not claim that all frames are late
in the QoS events. Ideally, this should replace max_lateness for most applications.

https://bugzilla.gnome.org/show_bug.cgi?id=640610
2018-07-07 09:05:26 -04:00
Tim-Philipp Müller
2db8e3705f Update for g_type_class_add_private() deprecation in recent GLib
https://gitlab.gnome.org/GNOME/glib/merge_requests/7
2018-06-24 12:49:14 +02:00
Edward Hervey
d34f046029 baseparse: Ensure seqnum consistency
We need all relevant events of a segment to have consistent seqnum:
* GST_EVENT_SEGMENT
* GST_EVENT_EOS

If we are push-based and create a new segment, use the same seqnum
as the upstream event.

If we are pull-based, use the seqnum of that newly created segment
event everywhere
2018-06-05 17:02:18 +02:00
Mike Wey
51b97d7403 dataqueue: add some missing introspection annotations
https://bugzilla.gnome.org/show_bug.cgi?id=796488
2018-06-03 19:42:17 +01:00
Edward Hervey
dfe5467209 baseparse: Documentation improvements
* Remove references to old functions and methods
* Use proper #ClassName.vmethod() decorator for vmethod
2018-05-30 14:06:06 +02:00
Olivier Crête
05298b3093 aggregator: Add get_next_time function for live streams
Add a function to do the right thing for live streams.

https://bugzilla.gnome.org/show_bug.cgi?id=795486
2018-05-16 18:13:04 +02:00
Seungha Yang
69ddcc175f bitwriter: Fix build error
Fix implicit-function-declaration warning for meemst and memcpy

gstbitwriter.h:166:3: error: implicit declaration of function ‘memset’
   memset (bitwriter->data + clear_pos, 0, (new_bit_size >> 3) - clear_pos);
   ^

https://bugzilla.gnome.org/show_bug.cgi?id=795867
2018-05-07 08:35:47 +02:00
Wind Yuan
fb4fc8fc09 bitwriter: Add a generic bit writer
GstBitWriter provides a bit writer that can write any number of
bits into a memory buffer. It provides functions for writing any
number of bits into 8, 16, 32 and 64 bit variables.

https://bugzilla.gnome.org/show_bug.cgi?id=707543
2018-05-06 17:05:21 +02:00
Tim-Philipp Müller
583a4677af aggregator: since marker for new API
Was also backported.

https://bugzilla.gnome.org/show_bug.cgi?id=795332
2018-05-05 12:10:39 +02:00
luz.paz
98200ddd8d Source code typo fixes
https://bugzilla.gnome.org/show_bug.cgi?id=795610
2018-05-01 11:25:21 +01:00
luz.paz
4a402c1c7d Fix typos in comments and docs
Found via `codespell`

https://bugzilla.gnome.org/show_bug.cgi?id=795610
2018-05-01 11:18:03 +01:00
Olivier Crête
96c3a635ce aggregator: Improve doc for gst_aggregator_pad_has_buffer 2018-04-25 14:30:04 -04:00
Olivier Crête
dda9a99989 aggregator: Add API to check if a pad has a new buffer
https://bugzilla.gnome.org/show_bug.cgi?id=795332
2018-04-25 14:20:19 -04:00
Xavier Claessens
b00b1d5361 Meson: Use library() to build both static and shared libs
Meson supports building both static and shared libraries in a single
library() call. It has the advantage of reusing the same .o objects and
thus avoid double compilation.

https://bugzilla.gnome.org/show_bug.cgi?id=794627
2018-04-25 00:40:30 +01:00
Mathieu Duponchelle
4456792218 adapter: port the buffer list from GSList to GstQueueArray
Significantly reduces the amount of memory allocation operations.

https://bugzilla.gnome.org/show_bug.cgi?id=795167
2018-04-14 01:20:38 +02:00