Commit graph

8688 commits

Author SHA1 Message Date
Tim-Philipp Müller
d1cd07b72b paramspecs: add 'Since: 1.18' markers for new param spec flags
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/524>
2020-06-08 16:04:51 +01:00
Seungha Yang
1769187328 paramspecs: Add a GParamSpecFlag to indicate the property might not always exists
Add new flag for users to notice that the property is not guaranteed
to exist depending on environment.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/283>
2020-06-08 14:18:09 +00:00
Edward Hervey
221cb03664 padtemplate: Directly unreference the documentation caps
The public-facing API has a (valid) protection against NULL caps. We can just
directly remove it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/515>
2020-06-06 08:25:16 +02:00
Mathieu Duponchelle
ba0ffeb36c utils: fix markdown link to #GstPluginAPIFlags 2020-06-06 01:10:09 +02:00
Mathieu Duponchelle
169abc86e9 padtemplate: expose getters and setters "documentation caps"
This can be used in elements where the caps of pad templates
are dynamically generated and dependent on the environment.

An example is x265enc.
2020-06-06 00:38:29 +02:00
Mathieu Duponchelle
0c1ce6e8c4 utils: expose GstPluginAPIFlags
These can be passed to gst_type_mark_as_plugin_api, to inform
plugin cache generation.

For now a single flag is specified, "IGNORE_ENUM_MEMBERS", it
can be used for dynamically generated enums to avoid documenting
environment-specific enumeration members. An example is
GstX265EncTune.
2020-06-06 00:38:29 +02:00
Thibault Saunier
2cd23d67d3 structure: Quickly document serialization format
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/510>
2020-06-05 11:01:43 +00:00
Thibault Saunier
bd0abb3857 structure: Reflow the SECTION comment
Removing trailing whitespaces and avoiding to exceed 80chars

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/510>
2020-06-05 11:01:43 +00:00
Mathieu Duponchelle
cc87357105 doc: document fundamental types 2020-06-04 15:49:25 -04:00
Sebastian Dröge
3de23c30e1 utils: Add helper function for marking types as plugin API
This can be used to mark additional types exposed by plugins (i.e.
enums, flags and GObjects) via properties, signals or pad templates as
plugin API. They can then be picked up by the documentation for the
plugin.

Not all types exposed by plugins are documented automatically because
they might come from an external library and should be documented from
there instead.
2020-06-04 15:49:23 -04:00
Matthew Waters
0cccf63fa0 promise: update documentation and annotations for NULL replies
The implementation and tests already handle NULL replies.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1300
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/502>
2020-05-28 10:23:51 +00:00
Sebastian Dröge
bf0672f00b systemclock: Only try initializing entries if they were not initialized before
And add assertions accordingly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/500>
2020-05-27 12:15:34 +00:00
Sebastian Dröge
d9bf0f1ec2 systemclock: Clarify comment that described a previous version of the code
Nowadays we are only waking up the head entry waiting if either the head
entry is unscheduled (which is handled some lines above already), or
when the head entry specifically is woken up because a new entry became
the new head entry.

We're not waking up *all* entries anymore whenever any entry in the last
was unscheduled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/500>
2020-05-27 12:15:34 +00:00
Sebastian Dröge
c4a2d92718 systemclock: Get rid of atomic access to clock entry status and use the mutex instead
We already have a mutex in each clock entry anyway and need to make use
of that mutex in most cases when the status changes. Removal of the
atomic operations and usage of the mutex instead simplifies the code
considerably.

The only downside is that unscheduling a clock entry might block for the
time it needs for the waiting thread to go from checking the status of
the entry to actually waiting, which is not a lot of code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/500>
2020-05-27 12:15:34 +00:00
Sebastian Dröge
3e924f5df9 systemclock: Don't start waiting for a clock id if it was signalled before
Otherwise it can happen that unscheduling a clock id never takes place
and instead it is waiting until the normal timeout. This can happen if
the wait thread checks the status and sets it to busy, then the
unschedule thread sets it to unscheduled and signals the condition
variable, and then the waiting thread starts waiting. As condition
variables don't have a state (unlike Windows event objects), we have to
remember ourselves in a new boolean flag protected by the entry mutex
whether it is currently signalled, and reset this after waiting.

Previously this was not a problem because a file descriptor was written
to for waking up, and the token was left on the file descriptor until
the read from it for waiting.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/500>
2020-05-27 12:15:34 +00:00
Edward Hervey
79374b8d94 value: Fix comparison of int/int64 ranges
ranges are only equal if:
* Their bounds are equal
* And their step value are equal *IF* they contain more than one value

https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/253
2020-05-25 08:29:21 +02:00
Edward Hervey
7f068512ec gstbin: Remove mentions of duration caching
This was effectively disabled in 1.0 with the intent of maybe re-enabling it.

The problem is that caching duration at a bin level doesn't make much sense
since there might be queueing/buffering taking place internally and therefore
the duration reported might have no correlation to what is actually being
outputted.

Remove commented code and fixmes, and update documentation

Fixes #4

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/489>
2020-05-18 15:37:20 +02:00
Edward Hervey
3c7db917dd gstvalue: Minor list intersection optimization
When matching against the 2nd list, increment the starting position of the inner
list iteration.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/484>
2020-05-14 12:19:58 +02:00
Xu Guangxin
003b25f39d bufferpool: unblock acquire thread when we discard buffer
else the acquire thread will wait infinitely.
The deadlock showed in prevous unit test commit. This will fix it

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/470>
2020-05-14 07:04:02 +00:00
Edward Hervey
2536cf7c57 gstvalue: Fix segment (de)serialization
By using the proper quarks (stored in the indirection table) and not the *enums*
of those entry in the quark table.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/473>
2020-05-08 17:21:20 +02:00
Matej Knopp
cab5b22f21 taglist: Fix crash when comparing two lists of the same length but with different items
Fixes #549

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/469>
2020-05-08 11:04:14 +03:00
Edward Hervey
81752169a4 taglist: Make equality check more uniform
Previously this was iterating over taglists with ... string names.

Instead use the same technique as `gst_structure_is_equal()` with the additional
double check.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/466>
2020-05-06 12:00:46 +02:00
Sebastian Dröge
a3c7e1c9b9 registrybinary: Also call fclose() if fflush()/fsync() failed
Otherwise we would be leaking the file in error cases.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/465>
2020-05-06 07:33:42 +00:00
Sebastian Dröge
0d1fe824e2 registrybinary: Don't call fclose() more than once
We must not retry fclose() on EINTR as POSIX states:

  After the call to fclose(), any use of stream results in undefined
  behavior.

We ensure above with fflush() and fsync() that everything is written out
so chances of running into EINTR are very low. Nonetheless assume that
the file can't be safely renamed, we'll just try again on the next
opportunity.

CID #1462697

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/465>
2020-05-06 07:33:42 +00:00
Thibault Saunier
c740c10404 segment: Enhance the GstSegment structure documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/435>
2020-05-05 20:52:11 +00:00
Richard Kreckel
96ebee1dc8 registrybinary: Use a FILE* in BinaryRegistryCache...
...instead of a file descriptor so buffered I/O is used when writing
the binary cache. This boosts performance at startup, particularly on
network filesystems where writes may be quite slow.

Fixes gstreamer#545.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/458>
2020-05-05 12:27:46 +00:00
Edward Hervey
ca2994700e gstvalue: Use quark-based structure usage for segment (de)serialization
Instead of string-based one. Smaller and faster code

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
2020-05-05 10:17:49 +00:00
Edward Hervey
d539d619e4 value: Handle runtime checks as such
The various `g_strdup_printf()` returns values are runtime checks
which could be disabled if one wants and therefore should be
handled as such with g_return_val_if_fail()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
2020-05-05 10:17:49 +00:00
Edward Hervey
be76ba1312 gstvalue: Remove useless checks
The calling function already checks that the values exists and it's
a valid list

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
2020-05-05 10:17:49 +00:00
Edward Hervey
761bdc9e5c gstvalue: Use previous assumption
The types were already checked for equality just before, not need to
check for that again

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
2020-05-05 10:17:49 +00:00
Edward Hervey
9af9113c4a gstvalue: Use comparision functions directly
We know the types of values, just use the comparision function directly

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
2020-05-05 10:17:49 +00:00
Edward Hervey
f800559789 gstvalue: Minor optimization for checks
For value types that aren't subclassable, just check the type directly.
For flags, compare against the fundamental type directly instead of going through
the more expensive recursive check of `G_TYPE_CHECK_VALUE_TYPE()`

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
2020-05-05 10:17:49 +00:00
Edward Hervey
dc7efe296d gstvalue: Optimize list subset some more
Avoid going through the double subtract function when comparing
anything to a list.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
2020-05-05 10:17:49 +00:00
Edward Hervey
46449cbb76 gstvalue: Optimize gst_value_compare_list
The compare function only needs to be retrieved once and used
directly

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
2020-05-05 10:17:49 +00:00
Edward Hervey
ee4d2f9178 gstvalue: Avoid temporary allocation
The problem is that:
* g_value_init will end up allocating an internal list/array
* g_value_copy *clears* the existing value by calling the free func
  and then the copy function (creating it again)

To avoid that alloc/free/alloc cycle, directly call the appropriate
function

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
2020-05-05 10:17:49 +00:00
Edward Hervey
62f553873b gstcaps: Move assignment outside loop
s1 and f1 stay the same within the inner loop

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
2020-05-05 10:17:49 +00:00
Edward Hervey
7e1a0ed604 gststructure: inline gst_structure_is_subset()
Having direct access to the iteration allows tighter code and
also being able to stop earlier.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
2020-05-05 10:17:49 +00:00
Edward Hervey
586454bf10 gststructure: Inline gst_structure_intersect()
Having direct access to the iteration allows tighter code and
also being able to stop earlier.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/453>
2020-05-05 10:17:49 +00:00
Edward Hervey
973986f40b gstregistry: Directly get list of plugin features
Previously this was:
* iterating and referencing all plugin features in a GList
* *then* filtering out the ones we want
* Was doing that filtering by name (i.e. `strcmp`) instead of direct pointer
comparision

Instead, just create a private direct function to get the list of plugin
features

Uses 4 times less instructions ...

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/462>
2020-05-05 10:50:05 +02:00
Rubén Gonzalez
32600b48a2 plugin: Fix typo with GStremaer version:
```
has incompatible version (plugin: 1.15, gst: 1,12)
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/460>
2020-05-04 20:20:17 +00:00
Edward Hervey
841fa7062e gstvalue: No longer store same-type intersection functions in table
The intersection function table is a legacy of 2005, when one could
register random intersection functions. This is no longer the case.

The only place where that table was used was:

* `gst_value_can_intersect()`, where it was already only used for identical
GType
* `gst_value_intersect()`, where the table iteration was insanely expensive

Instead this patch:
* Only stored intersection functions for *different* types (of which there are
only 4)
* Make gst_value_intersect directly call the same-type intersection functions
and only use the table if ever it doesn't match.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/454>
2020-05-04 14:41:01 +00:00
Edward Hervey
5e553b8cce gstpad: Simplify task name creation
This was going through a few locks and doing temporarily allocations for every
single task creation.. just to get a name.

We don't need to take locks since:
* The parent exists (we have a reference to it)
* The pad exists (the task belongs to it)
* Changing names of pad/elements when activating is a big no-no

Instead use the existing direct GST_DEBUG_PAD_NAME macro

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/455>
2020-05-04 12:26:10 +00:00
Edward Hervey
7a207da733 gstevent: Add function for checking event name by GQuark
Avoids doing string<=>quark conversions in the sticky event handling path.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/455>
2020-05-04 12:26:10 +00:00
Edward Hervey
1d0bda8005 caps: Unify common checks for intersections
Regardless of the intersect method chosen, migrate the same checks
up into the calling function. Same result, just less code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/455>
2020-05-04 12:26:10 +00:00
Edward Hervey
a307c0623c gstregistry: Remove unneeded call
_priv_gst_preload_plugins is only filled if option parsing is active.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/455>
2020-05-04 12:26:10 +00:00
Sebastian Dröge
333b77bc9f Add missing colons to Since markers in the docs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/452>
2020-05-01 10:07:09 +03:00
Juan Navarro
358d4e991a gstcaps: fix out of bounds checks
These two checks could end up allowing out of bounds array access, when
the index equals the array size.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/445>
2020-04-22 17:27:31 +00:00
Matthew Waters
166c0fbc47 Revert "gstvalue: Avoid expensive fallback on intersection"
This reverts commit cd751c2de3.
Reverts https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/406

Fixes glviewconvert negotiation in e.g.:

gltestsrc ! glviewconvert output-mode-override=side-by-side ! glstereosplit name=s s.left ! queue ! fakesink s.right ! queue ! glimagesink

Problem here is that intersecting flagsets in gst_value_intersect will
always find a value comparison function but may fail a direct type
comparison due to flagsets supporting derived types.  When flagset
derived types are intersected, an intersection will therefore always
fail.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/441>
2020-04-22 15:18:50 +00:00
Seungha Yang
684723d07c systemclock: Fix clock waiting on Windows
Add missing parentheses in macro for the divide operation

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/444>
2020-04-22 20:59:02 +09:00
Charlie Turner
e310a738f6 debugutils: Skip multiqueue stats in dot dump
If this is not done, tools like xdot fail with "unexpected char
b'\\'". This is a regression caused by commit
74938f07c2 (multiqueue: Add stats
property).

The deserialized value coming out of g_object_get_property looks like
this,

$24 = (gchar *) 0x7f560c0046a0 "application/x-gst-multi-queue-stats, queues=(structure)< \\\"queue_0\\\\,\\\\ buffers\\\\=\\\\(uint\\\\)39\\\\,\\\\ bytes\\\\=\\\\(uint\\\\)8
120251\\\\,\\\\ time\\\\=\\\\(guint64\\\\)1460000000\\\\;\\\", \\\"queue_1\\\\,\\\\ buffers\\\\=\\\\(uint\\\\)186\\\\,\\\\ bytes\\\\=\\\\(uint\\\\)838020\\\\,\\\\ time\\\\=\
\\\(guint64\\\\)1984000002\\\\;\\\" >;"

That is immediately looking wrong. I don't know enough about GNOME
serialization details to say with confidence what happened here. It
gets worse after this is sent through g_strescape and then written to
the dot file. Interestingly, dot -Tpng is fine to ignore them it
seems.

Since the stats are by definition verbose, I decided the best choice
to omit them from the dot file, since such details are not of interest
there.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/442>
2020-04-21 19:53:33 +00:00