Commit graph

18559 commits

Author SHA1 Message Date
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
Sebastian Dröge
8250b8d81a clock: Move clock weak ref into its own ABI struct
Otherwise it will be hard to add other things into the padding later
without breaking API.
2018-11-03 19:00:36 +02:00
Sebastian Dröge
4de89865d4 clock: Add new functions to the documentation 2018-11-03 19:00:35 +02:00
Sebastian Dröge
f34472822c clock: Fix deprecation handling of the GstClock clock field 2018-11-03 19:00:24 +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
Zeeshan Ali
8abe052590 gst-inspect: Don't page if output fits the screen 2018-10-30 15:30:38 +01:00
Zeeshan Ali
4fbd3baf1e gst-inspect: Flush stdout before closing stdout FD
Otherwise, last line can be lost.
2018-10-30 14:53:00 +01:00
Sebastian Dröge
c3214e8deb harness: Add API for proposing meta APIs from the allocation query
https://bugzilla.gnome.org/show_bug.cgi?id=797350
2018-10-28 17:05:27 +00:00
Jan Schmidt
80015d69a7 segment: Allow stop == -1 in gst_segment_to_running_time() and rate < 0
If a segment has stop == -1, then gst_segment_to_running_time()
would refuse to calculate a running time for negative rates,
but gst_segment_do_seek() allows this scenario and uses a
valid duration for calculations.

Make the 2 functions consistent by using any configured duration
to calculate a running time too in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=796559
2018-10-29 04:03:56 +11:00
Zeeshan Ali
5d115a5d64 gst-inspect: Pipe stdout to less if not piped already
https://bugzilla.gnome.org/show_bug.cgi?id=797344
2018-10-28 13:19:47 +00:00
Sebastian Dröge
3eb334a7f9 typefind: Lower debug level of some output related to the URI query
It's not a warning if an URI doesn't have an extension, and it's also
not mandatory that sources have an URI or even answer the URI query.
2018-10-26 09:21:42 +01:00
Jordan Petridis
9251cd9bf5 gst: skip format specifiers from gir generation
GST_TIME_FORMAT, GST_TIME_ARGS, GST_STIME_FORMAT, GST_STIME_ARGS
GST_PTR_FORMAT, GST_SEGMENT_FORMAT, GST_FOURCC_FORMAT and
GST_FOURCC_ARGS are format specifiers.
They can't be used outside of C and should be generated in the gir.

https://bugzilla.gnome.org/show_bug.cgi?id=797320
2018-10-23 16:21:58 +01:00
Jordan Petridis
cd6ceb1c41 gst/gsterror.h: skip GST_ERROR_SYSTEM during gir generation
GST_ERROR_SYSTEM can't really be used outside of C and should
be skipped.

https://bugzilla.gnome.org/show_bug.cgi?id=797320
2018-10-23 16:21:58 +01:00
Edward Hervey
127e211004 multiqueue: Don't clamp running times for position calculation
Since we use full signed running times, we no longer need to clamp
the buffer time.

This avoids having the position of single queues not advancing for
buffers that are out of segment and never waking up non-linked
streams (resulting in an apparent "deadlock").
2018-10-22 15:28:45 +02:00
Edward Hervey
98fabd2fa2 queue2: Reset result flow when retrying
If we ever get a GST_FLOW_EOS from downstream, we might retry
pushing new data. But if pushing that data doesn't return a
GstFlowReturn (such as pushing events), we would end up returning
the previous GstFlowReturn (i.e. EOS).

Not properly resetting it would cause cases where queue2 would
stop pushing on the first GstEvent stored (even if there is more
data contained within).
2018-10-22 13:52:30 +02:00
Olivier Crête
5658ae9986 tests: Use GstTestClock for processing-deadline test
Use the test clock instead of using a real one to make it
easier to run in valgrind.

https://bugzilla.gnome.org/show_bug.cgi?id=797291
2018-10-17 16:42:50 -04:00
Tim-Philipp Müller
5947ff970e tests: pipeline: fix leak 2018-10-16 10:48:40 +01: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
Philippe Normand
a2832689ad gstelementfactory: Remove MEDIA_HARDWARE FactoryType
Using the MEDIA_ classifier prefix was inappropriate. It is sufficient to
specify the additional klass name that element can set in their metadata.

(follow-up of commit ca4b61c555)

https://bugzilla.gnome.org/show_bug.cgi?id=796921
2018-10-12 17:20:02 +01:00
Philippe Normand
ca4b61c555 gstelementfactory: Add MEDIA_HARDWARE klass classifier
The Harware factory type classifier allows elements (decoders and encoders,
mostly) to advertize they rely on hardware devices to perform encoding or
decoding operations. This classifier can be used by applications to filter and
select only the elements that use hardware devices, for instance to ensure
zero-copy support is enabled for a specific pipeline.

https://bugzilla.gnome.org/show_bug.cgi?id=796921
2018-10-12 10:08:47 +01:00
Aleix Conchillo Flaqué
a9370319b6 gst-uninstalled: add libnice to LD_LIBRARY_PATH
https://bugzilla.gnome.org/show_bug.cgi?id=797269
2018-10-12 00:29:30 +01:00
Jan Schmidt
04176bede1 ptp clock: Wait for ANNOUNCE before selecting a master
Previously, with opportunistic sync we'd track a master
clock as soon as we see a SYNC message, and hence sync up
faster, but then we'd announce we're synched before seeing
the ANNOUNCE, leaving the clock details like grandmaster-clock
empty.

A better way is to start tracking the clock opportunistically,
but not announce we're synched until we've also seen the ANNOUNCE.
2018-10-11 22:11:51 +11:00