Commit graph

18531 commits

Author SHA1 Message Date
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
Philippe Normand
9f5e65f0a2 input-selector: Let context queries pass through
By doing so GL source elements can successfully reuse the GL context and display
of downstream elements. This change fixes an issue in playbin when using
gltestsrc where the context query made by the source element would fail and the
source element would create a second (useless) GLDisplay.
2018-11-28 11:00:21 +00:00
Jordan Petridis
84512152c1
Run gst-indent through the files
This is required before we enabled an indent test in the CI.

https://gitlab.freedesktop.org/gstreamer/gstreamer-project/issues/33
2018-11-28 05:58:53 +02:00
Zeeshan Ali
c45b386b54 gst-inspect: Use only original 16 colors
Not only this will make colored output work on old terminals and console
as well, terminals can theme the actual colors this way to make it fit
with their different themes this way.
2018-11-27 02:25:49 +00:00
Mathieu Duponchelle
f83b8ab701 Revert "harness: Take ownership of floating references (pads, elements) passed to the harness"
This reverts commit 2faf93c009.

THis broke half our unit tests, oops:

https://ci.gstreamer.net/job/GStreamer-master/11203/testReport/
2018-11-27 02:59:41 +01:00
Sebastian Dröge
2faf93c009 harness: Take ownership of floating references (pads, elements) passed to the harness
Without this bindings get confused about the meaning of references, and
we really own these references if they are not already owned by
something else.
2018-11-26 17:03:23 +00:00
Zeeshan Ali
ed4f8e368a gst-inspect: Tell less to parse color codes
This change was originally part of 2cf16838c5 (gst-inspect: Colored
output) but got lost during the recent rebase.
2018-11-24 12:06:38 +01:00
Zeeshan Ali
2cf16838c5 gst-inspect: Colored output
Let's make the output a bit pretty to read. The colored output can be
disabled with `--no-colors` option or by setting `GST_INSPECT_NO_COLORS'
env (to any value).

The chosen colors are based on the popular Solarized theme, which is
targeted for both dark and light backgrounds.

Note:

* We only support true colors. If the terminal doesn't signal support for
  that via 'COLORTERM' env, we disable colored output.

* We don't add colors to --print-plugin-auto-install-info output, as
  that's meant for machines, not humans. Not only machines don't care
  about beauty, the existing ones will likely not expect colors and choke
  on it and we'll get angry mob at our doors.

[1] https://ethanschoonover.com/solarized
2018-11-23 16:15:19 +01:00
Zeeshan Ali
d3811ca5cd gst-inspect: Remove redundant plugin name from output
When printing info about a specific plugin, there is no need to prefix
some of the details with plugin's name. It's not only redundant but also
inconsistent and makes the task of adding consistent coloring to the
output (which we'll do in a follow patch), harder.
2018-11-23 16:14:06 +01:00
Nirbheek Chauhan
a3abe8b9ae gst-inspect: Use less -F -X everywhere as the pager
This emulates the default behaviour of git help pages, and also fixes
a bug on macOS where `less -F` doesn't display anything at all when
the output is shorter than one terminal screen.

Also moved the DEFAULT_PAGER define to after the includes, because
it's an unprefixed define.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/330
2018-11-23 20:31:27 +05:30
Jordan Petridis
bd83f11b71 Add Gitlab CI configuration
This commit adds a .gitlab-ci.yml file, which uses a feature
to fetch the config from a centralized repository. The intent is
to have all the gstreamer modules use the same configuration.

The configuration is currently hosted at the gst-ci repository
under the gitlab/ci_template.yml path.

Part of https://gitlab.freedesktop.org/gstreamer/gstreamer-project/issues/29
2018-11-12 12:02:20 +00:00
Seungha Yang
94ac598204 tests: caps: Add more broken caps test case 2018-11-12 20:12:50 +09:00
Seungha Yang
3332e39baa gst: Fix string leak when G_VALUE_COLLECT_INIT() was failed
Returned string should be freed

Fixes #319
2018-11-12 20:12:41 +09:00
Sebastian Dröge
5f469abbed debugutils: Make sure that GST_DEBUG_GRAPH_SHOW_VERBOSE gets the correct value in introspection
Currently in Python it would become a signed 64 bit value but should
actually be an unsigned 32 bit value with all bits set.

This is the same problem as with GST_MESSAGE_TYPE_ANY.

See https://bugzilla.gnome.org/show_bug.cgi?id=732633
2018-11-10 19:08:52 +00:00
Havard Graff
1335110409 tests: fix tests when compiling with glib_checks=disabled
We won't be able to do ASSERT_CRITICAL, but the main body of the tests
are still valid, and given we ship GStreamer with this configuration, it
is important to be able to run some tests against it.
2018-11-10 15:37:36 +00:00
Havard Graff
320ac0ce1a test/datetime: fix test for windows
In the previous configuration, mktime returned -1 on Windows 10 compiled
with MSVC using meson.

Fix this by moving the hour one forward.
2018-11-10 15:37:36 +00:00
Havard Graff
4a7739f4b6 tests/uri: fix test after GHashTable changes in GLib 2.59
Maybe the implementation should not be dependent on a "random" hash-table
ordering, but at least this shows the problem clearly.
2018-11-10 15:37:36 +00:00
Zeeshan Ali
ef58a84571 gst-inspect: Pipe stderr to pager as well
If stderr is not redirected by the user, also page that.
2018-11-09 12:27:18 +00:00
Niels De Graef
cf3fdbe4c0 typefind: cleanup (un)reffing of several objects.
By using these functions, we can shave off a few lines, and make the
intent of that line more clear.
2018-11-09 08:44:11 +00:00
Tim-Philipp Müller
b92e34ebfd Fix distcheck
Follow-up to !18 and #320.
2018-11-08 14:09:32 +00:00
Michael Olbrich
bc621cc335 gst: add some gdb python macros
This adds gdb pretty printer for some GStreamer types.
For GstObject pointers the type and name is added, e.g.
"0x5555557e4110 [GstDecodeBin|decodebin0]".
For GstMiniObject pointers the object type is added, e.g.
"0x7fffe001fc50 [GstBuffer]".
For GstClockTime and GstClockTimeDiff the time is also printed in human
readable form, e.g. "150116219955 [+0:02:30.116219955]".

Fixes #320
2018-11-08 12:36:23 +00:00
Sebastian Dröge
1fda8c3bcf clock: Move clock GWeakRef to a private GstClockEntry struct
There's no need for it to be in the public struct and we can keep the
padding for things to be added in the future.
2018-11-08 09:07:07 +00:00
Matthew Waters
4fc4ad87d5 query: add a new bitrate query
Allows determining from downstream what the expected bitrate of a stream
may be which is useful in queue2 for setting time based limits when
upstream does not provide timing information.

Implement bitrate query handling in queue2

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/60
2018-11-07 15:04:14 +00:00
Matthew Waters
c4ccff7861 queue2: avoid ping-pong between 0% and 100% buffering messages
If upstream is pushing buffers larger than our limits, only 1 buffer
is ever in the queue at a time.  Once that single buffer has left the
queue, a 0% buffering message would be posted followed immediately by a
100% buffering message when the next buffer was inserted into the queue
a very short time later.  As per the recommendations, This would result
in the application pausing for a short while causing the appearance of
a short stutter.

The first step of a solution involves not posting a buffering message if
there is still data waiting on the sink pad for insertion into the queue.
This successfully drops the 0% messages from being posted however a
message is still posted on each transition to 100% when the new buffer
arrives resulting in a string of 100% buffering messages.  We silence
these by storing the last posted buffering percentage and only posting a
new message when it is different from or last posted message.
2018-11-07 15:04:14 +00:00
Nicolas Dufresne
e1be065293 tracers: log: Fix post query trace
The post tracer hooks have a GstQuery argument which was truncated from
the trace. As the post hook is the one that contains the useful data,
this bug was hiding the important information from that trace.
2018-11-06 15:41:01 -05:00
Havard Graff
8a8f2cebf4 docs: add new GstTestClock API 2018-11-06 15:02:21 +01:00
Havard Graff
fa34768729 harness: improve _wait_for_clock_id_waits performance
By moving the functionality down to the testclock, the implementation
no longer needs to poll the waits, but rather wait properly for
them to be added.

The performance-hit here would be that by polling the test-clock
regularly, you would create contention on the testclock-lock, making code
using the testclock (gst_clock_id_wait) fighting for the lock.
2018-11-06 11:46:06 +01:00
Havard Graff
c6e5f59b2c systemclock: pre-calculate the ratio for multiplying the perf-count on win
Saves a lot of computations.
2018-11-06 10:39:05 +01:00
Havard Graff
4b3872f757 gstpad: use hook_id instead of hook in called_probes list
A pointer to a hook in this list can easily not be unique, given both
the slice-allocator reusing memory, and the OS re-using freed blocks
in malloc.

By doing many repeated add and remove of probes, this becomes very easily
reproduced.

Instead use hook_id, which *is* unique for a added GHook.
2018-11-06 10:04:00 +01:00
Matthew Waters
ddfcc28c8b gst/buffer: add a new function for wrapping GBytes
One restriction on the GBytes is that the data cannot be NULL as this is
explicitly forbidden by GstMemory.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/318
2018-11-06 16:12:42 +11:00
Matthew Waters
874ad5faca meson: generate pkg-config files for our plugins 2018-11-05 15:18:41 +00:00
Jan Alexander Steffens (heftig)
92d5d5bc57
gst_clear_*: Remove volatile from arguments
g_clear_pointer is not thread-safe and never was. GLib similarly removed
the volatile from g_clear_object in 2aacef39b1.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/327
2018-11-05 14:16:36 +01:00
Jan Alexander Steffens (heftig)
1c3db34150
gst_clear_*: Cast to GstMiniObject** when needed 2018-11-05 14:03:54 +01:00
Niels De Graef
8410490727 docs: update gstreamer-sections.txt with new API 2018-11-05 11:06:30 +00:00
Niels De Graef
b7bb44fb72 query: add gst_query_take()
This makes its API consistent with the other GstMiniObject subclasses
2018-11-05 11:06:30 +00:00
Niels De Graef
ef1438f847 message: add gst_message_take()
This makes its API consistent with the other GstMiniObject subclasses
2018-11-05 11:06:30 +00:00
Niels De Graef
00b358d461 taglist: add gst_tag_list_replace/take()
This makes its API consistent with the other GstMiniObject subclasses.
2018-11-05 11:06:30 +00:00
Niels De Graef
63e3edecfd bufferlist: add gst_buffer_list_replace/take()
This makes its API consistent with the other GstMiniObject subclasses.
2018-11-05 11:06:30 +00:00
Niels De Graef
e35dc31fda structure: add gst_clear_structure()
Basically, you can use this instead of using gst_structure_free (which
needs to be preceded by a NULL-check).

Also fixes #275
2018-11-05 11:06:30 +00:00
Niels De Graef
fdeddb4b93 taglist: add gst_clear_tag_list()
Basically, you can use this instead of using gst_tag_list_unref (which
needs to be preceded by a NULL-check).

Also fixes #275
2018-11-05 11:06:30 +00:00
Niels De Graef
bb07550c2d query: add gst_clear_query()
Basically, you can use this instead of using gst_query_unref (which
needs to be preceded by a NULL-check).

Also fixes #275
2018-11-05 11:06:30 +00:00
Niels De Graef
24f1fb252a message: add gst_clear_message()
Basically, you can use this instead of using gst_message_unref (which
needs to be preceded by a NULL-check).

Also fixes #275
2018-11-05 11:06:30 +00:00
Niels De Graef
efbfa54a4a event: add gst_clear_event()
Basically, you can use this instead of using gst_event_unref (which
needs to be preceded by a NULL-check).

Also fixes #275
2018-11-05 11:06:30 +00:00
Niels De Graef
a0fd447abe caps: add gst_clear_caps()
Basically, you can use this instead of using gst_caps_unref (which
needs to be preceded by a NULL-check).

Also fixes #275
2018-11-05 11:06:30 +00:00
Niels De Graef
fa1d7a86af bufferlist: add gst_clear_buffer_list()
Basically, you can use this instead of using gst_buffer_list_unref
(which needs to be preceded by a NULL-check).

Also fixes #275
2018-11-05 11:06:30 +00:00
Niels De Graef
1068d9e2c8 buffer: add gst_clear_buffer()
Basically, you can use this instead of using gst_buffer_unref (which
needs to be preceded by a NULL-check).

Also fixes #275
2018-11-05 11:06:30 +00:00
Niels De Graef
7e69305657 miniobject: add gst_clear_mini_object()
This is based on g_clear_object(). Basically, you can use this instead
of using gst_mini_object_unref (which needs to be preceded by a NULL-check).

Also fixes #275
2018-11-05 11:06:30 +00:00
Niels De Graef
c5793f82d3 object: add gst_clear_object()
This is based on g_clear_object(). Basically, you can use this instead
of using g_object_unref (which needs to be preceded by a NULL-check).

Fixes #275
2018-11-05 11:06:30 +00:00
Haihao Xiang
e261c9534d Clone the code from gitlab
This fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/326
2018-11-05 12:29:45 +08:00
Sebastian Dröge
23e6096d0b typefind: Always forward RECONFIGURE events upstream
Based on a patch by Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/67
2018-11-04 12:45:57 +02:00