Commit graph

2675 commits

Author SHA1 Message Date
Tim-Philipp Müller d8079ae1fe baseparse: fix taglist update spam
We would constantly re-post the taglist because
posted_avg_rate only gets set to avg_bitrate if
parse->priv->post_avg_bitrate is true, so if it's
false the posted rate will always differ from the
current average rate and we'd queue an update,
which leads to us spamming downstream and the
application with taglist updates.

Fix this by only queuing an update if the average
rate will actually be posted.

These taglists updates could cause expensive
operations on the application side, e.g. in Totem.

https://bugzilla.gnome.org/show_bug.cgi?id=786561
2017-09-01 12:14:09 +03:00
Jason Lin d7c47d1562 basesink: fix buffer leaks if preroll failed
buffer is not unreferened if preroll failed

:Detailed Notes:
- Problem : video freeze when switching from pause to 1/2-FF repeatedly
- RootCause : buffer leaks in basesink
- Solution : unref the buffer if prerolled failed

:Testing Preformed:
How to Test :
pause -> 1/2 FF -> resume -> pause -> 1/2 FF ...

https://bugzilla.gnome.org/show_bug.cgi?id=784932
2017-07-14 16:54:09 +10:00
Nicolas Dufresne 486dd447e6 baseparse: sinkcaps can be NULL in default caps negotiation
This was causing harmless assertion about the unreffed caps not being of
type caps.

https://bugzilla.gnome.org/show_bug.cgi?id=784041
2017-07-03 20:47:39 +01:00
Sebastian Dröge 70a0ee4c75 controller: Export boxed type copy/free functions for GstControlPoint 2017-06-20 10:09:06 +03:00
Sebastian Dröge 226d01a941 base: Export boxed type copy/free functions for the remaining types 2017-06-20 10:08:38 +03:00
Andrejs Vasiljevs ac31a3c1d1 ptp: Unref timeout GSource for delay requests
https://bugzilla.gnome.org/show_bug.cgi?id=783864
2017-06-17 10:52:45 +03:00
Olivier Crête 2325d00eee basesrc: Hold object lock while updating latency
Otherwise in gst_base_src_query_latency(), it ended up
sometimes thinking it wasn't -1 when it was actually.
2017-05-29 10:55:31 +03:00
Sebastian Dröge 733de3190b adapter: Check if meta transform_func is NULL before using it
https://bugzilla.gnome.org/show_bug.cgi?id=782050
2017-05-02 14:27:14 +03:00
Frédéric Dalleau ca7fa6a661 basetransform: Check if meta transform_func is NULL before using it
An untested pointer segfaulted in webkit while playing video
on imx6 sabrelite. It turned out that the imx plugin didn't
implement the meta transform function.

The following GST_DEBUG trace was visible:
gstbasetransform.c:1779:foreach_metadata:<conv2> copy metadata
                                                GstImxVpuBufferMetaAPI

Thread 26 vqueue:src received signal SIGSEGV, Segmentation fault.

(gdb) bt
 0x00000000 in ?? ()
 0x73f8d7d8 in foreach_metadata (inbuf=0xc9b020, meta=0x474b2490,
                  user_data=<optimized out>) at gstbasetransform.c:1781
 0x73eb3ea8 in gst_buffer_foreach_meta (buffer=buffer@entry=0xc9b020,
                  func=0x73f8d705 <foreach_metadata>,
                  user_data=user_data@entry=0x474b24d4)
                  at gstbuffer.c:2234

https://bugzilla.gnome.org/show_bug.cgi?id=782050
2017-05-02 14:26:21 +03:00
Yasushi SHOJI c423df49af basetransform: fix typo in debug log output
This unbalanced closing parenthesis is leftover from the commit
8b739d91e7. It used to wrap the caps but we don't seem to do that in
the current code.

So, just remove it. No functionality has been changed.

https://bugzilla.gnome.org/show_bug.cgi?id=781484
2017-04-19 09:21:32 +01:00
Rico Tzschichholz 72e42f0ce9 meson: A couple for GIR-generation fixes 2017-04-13 10:05:53 +01:00
Thibault Saunier 15566bf505 meson: Add controller enum file as generated sources
Avoiding build failure like
https://ci.appveyor.com/project/thiblahute/gst-build-ge9m5/build/1.0.2857
2017-04-12 10:03:29 -03:00
Tim-Philipp Müller 89ce63ee6c controller: include new proxycontrolbinding header
And fix includes in docs to just include the main header (the
include for the proxycontrolbinding was wrong in the docs).
2017-04-11 20:18:29 +01:00
Sebastian Dröge 9a04087347 controller: Fix build with srcdir!=builddir 2017-04-10 14:26:42 +03:00
Rico Tzschichholz f34c8aac4d controller: Add missing sources/headers to the GIR build 2017-04-10 13:52:41 +03:00
Sebastian Dröge 1365e675c6 meson: And actually make the controller mkenums rules work 2017-04-09 12:16:39 +03:00
Sebastian Dröge c7cc48b42e controller: Generate GLib enums automatically 2017-04-09 12:06:55 +03:00
Tim-Philipp Müller 519d64881f Don't use deprecated g_object_newv()
Use g_object_new() instead which nowadays has a shortcut for the
no-properties check. It still does an extra GType check in the
function guard, but there's a pending patch to remove that
and it's hardly going to be a performance issue in practice,
even less so on a system that's compiled without run-time checks.

Alternative would be to move to the new g_object_new_properties()
with a fallback define for older glib versions, but it makes the
code look more unwieldy and doesn't seem worth it.

Fixes deprecation warnings when building against newer GLib versions.

https://bugzilla.gnome.org/show_bug.cgi?id=780903
2017-04-08 09:49:59 +01:00
Nicolas Dufresne 35c4428083 meson: Add bash completion support 2017-04-04 14:46:48 -04:00
Nicolas Dufresne bae1fe254a completion: Place the completion helper in libexec
This patch reorganize the bash completion scripts in order to install
the binary helper (gst-completion-helper) in libexec path rather then
share folder. Most Linux hierarchy compliance requires that no binary
executable are placed in share. We also cleanup the unused .pc entries
and remove copy pasted parts of the script. Note that other project
including the common helper, should now use $_GST_HELPER to read
the binary executable gst-completion-helper. This helper is not longer
version, as it is placed in a versionned subfolder
(libexec/gstreamer.10) just like the other helpers (scanner and ptp).
2017-04-04 14:46:48 -04:00
Sebastian Dröge 50ec7129bb queuearray: Add G_BEGIN_DECLS and G_END_DECLS to make it usable from C++ code 2017-03-24 14:21:55 +02:00
Jan Schmidt e571002dcb baseparse: Don't forget error returns when processing more
If parsing returns a non-OK flow return in the middle
of processing an input buffer, don't overwrite that
if a later return is OK again - the subclass might
return not-linked in the middle, and then discard
subsequent data without pushing while returning OK.

A later success doesn't invalidate the earlier failure,
but we should continue processing after not-linked, so
as to keep parse state consistent.

https://bugzilla.gnome.org/show_bug.cgi?id=779831
2017-03-22 11:42:53 +11:00
Wim Taymans 586b34436e buffer: handle gst_buffer_map failures 2017-03-10 10:13:05 +01:00
Tim-Philipp Müller 834fd18dfa bytereader: fix peek value when scanning for 00 00 01 with non-0 offset
We would add the offset a second time in _scan_for_start_code()
when we found a result, but it's already been added to the data
pointer at the beginning of _masked_scan_uint32_peek(), so the
peeked value would be wrong if the initial offset was >0, and
we would potentially read memory out-of-bounds.

Add unit test for all of this.

https://bugzilla.gnome.org/show_bug.cgi?id=778365
2017-02-22 11:07:24 +00:00
Stefan Sauer c189827619 gstbasesink: xref symbol in docs 2017-02-15 21:37:31 +01:00
Thibault Saunier 5ef7a20687 meson: libs: Add gir to the source list of the dependency 2017-01-27 16:36:39 -03:00
Thibault Saunier a87b4551a6 Port gtk-doc comments to their equivalent markdown syntax
Modernizing our documentation and preparing a possible move to hotdoc.
This commits also adds missing @title metadatas to all SECTIONs
2017-01-27 16:36:38 -03:00
Julien Isorce b2c05cac8e baseparse: correctly handle non-flush seek
Otherwise when seeking/looping to the start when reaching the end,
the sink waits for the duration of the stream. So the user hears
nothing for the duration of the stream before it actually loop again.
See example attached to the bug for that.

Existing test:
gst-plugins-good/tests/icles/test-segment-seeks foo.flac
Without the patch the user hears a crack/cut at each seek.

https://bugzilla.gnome.org/show_bug.cgi?id=777780
2017-01-26 16:51:21 +00:00
Stian Selnes 0c36e5766d check: Add API to filter g_warning/g_critical etc
New API functions to filter log messages before they are processed by
GstCheck. This can be used to discard specific messages that are
accepted by the test or to add callbacks that test specific messages.

Default bevavior when no callback is given to a filter is to discard the
message, because it does not makes sense to have a filter with no
callback which does not discard; that would be a noop.

Discarded messages will in addition to bypass the GstCheck handling also
return to GLib that the message is not fatal if it occurs.

https://bugzilla.gnome.org/show_bug.cgi?id=773091
2017-01-24 00:11:59 +00:00
Mark Nauwelaerts 9bcebaacc7 baseparse: also unset DISCONT on buffers in reverse playback fragments 2016-12-28 13:46:33 +01:00
Fabrice Bellet de65529d52 basesink: fix a use after free case
The event may be disposed while being pushed, so we make sure the
debug infrastructure won't use it after the gst_pad_push().
2016-12-17 09:40:25 +05:30
Tim-Philipp Müller bb28a59d5b check: fix typo in docs 2016-12-16 18:30:46 +00:00
Tim-Philipp Müller 6354b57295 check: export new global variable 2016-12-16 18:20:45 +00:00
Thibault Saunier 7b3d383971 check: Avoid possible double free 2016-12-16 14:00:18 -03:00
Thibault Saunier f7255f318f check: Allow listing unit tests names
Adding options while running gst_check_init

https://bugzilla.gnome.org/show_bug.cgi?id=775540
2016-12-16 13:46:39 -03:00
Nirbheek Chauhan f8df150e29 check: Fix macro check for OS X
TARGET_OS_MAC is defined on all Apple platforms. You need to check for
!TARGET_OS_IPHONE to detect OS X (now called macOS).
2016-12-09 22:39:36 +05:30
Nirbheek Chauhan 77af10a521 check: Don't try to include CoreServices.h on iOS
On iOS, we have MobileCoreServices.h but it's not really needed.
2016-12-09 18:01:35 +05:30
Nirbheek Chauhan e60bd6c662 check: Don't check for malloc/realloc and try to fallback
When malloc is not available, this will set #define malloc rpl_malloc
which is implemented only inside libcheck, and not everything will link
to libcheck.

We don't really need to care too much about how malloc is implemented
and we don't care about platforms that don't implement malloc.
2016-12-09 17:59:53 +05:30
Nirbheek Chauhan 958d791d3c Add a README.txt with context for libcheck
https://bugzilla.gnome.org/show_bug.cgi?id=775870
2016-12-09 16:03:41 +05:30
Nirbheek Chauhan d8e8e92176 libcheck: Update the compatibility code and checks
This brings us up-to-speed with the latest compatibility code from upstream
check git. For completeness, we do all the checks that upstream check does, but
we skip the snprintf/vsnprintf code because it's not straightforward (involves
running code and that is bad for cross-compilation) and not necessary for the
platforms we support anyway.

If someone really wants this, they can uncomment this and copy the relevant
checks from the check git repository.

https://bugzilla.gnome.org/show_bug.cgi?id=775870
2016-12-09 15:31:01 +05:30
Nirbheek Chauhan eb1f861012 libcheck: Just move libcompat files to a subdir
Makes it clearer which files are actually used in libcheck and which are used
for cross-platform compatibility. This is going to be especially useful when we
add all the libcompat fallback code that upstream libcheck has which will add
about 6 new files.

https://bugzilla.gnome.org/show_bug.cgi?id=775870
2016-12-09 15:31:01 +05:30
Nirbheek Chauhan 0bb6d590cc libcheck: port to latest check git
Upstream seems to have stopped doing releases, but we need to update for better
Windows and Visual Studio support.

This patch only updates the libcheck sources and ignores the compatibility
sources for now.

https://bugzilla.gnome.org/show_bug.cgi?id=775870
2016-12-09 15:31:01 +05:30
Ricardo Ribalda Delgado 0728b9b59b helpers/gst: Get bash completion options from gst-launch
It is more likely that gst-launch is installed than ges-launch

Reported-by: Marianna Smidth Buschle <msb@qtec.com>

https://bugzilla.gnome.org/show_bug.cgi?id=775714
2016-12-06 18:25:23 +00:00
Marcin Kolny 90f101981c net: set clock name in the constructor
gst_net_client_clock_new() and gst_ntp_clock_new() didn't set the
"name" property.

https://bugzilla.gnome.org/show_bug.cgi?id=775538
2016-12-06 12:10:17 +02:00
Olivier Crête e6febb5bc1 basesink: Document the interaction between unlock() and wait_preroll()
This was totally non-obvious, the kind of big problem is that subclasses must
be able to unblock their streaming thread and continue exactly where they left off
on unpause!

https://bugzilla.gnome.org/show_bug.cgi?id=773912
2016-11-23 11:58:43 -05:00
Matthew Waters 3eb4896435 controllers: add new proxy control binding
Allows proxying the control interface from one property on one GstObject
to another property (of the same type) in another GstObject.

E.g. in a parent-child relationship, one may need to
gst_object_sync_values() on the child and have a binding (set elsewhere)
on the parent update the value.

Note: that this doesn't solve GObject property forwarding and must be
taken care of by the implementation manually or using GBinding.

https://bugzilla.gnome.org/show_bug.cgi?id=774657
2016-11-23 17:15:09 +11:00
Sebastian Dröge f08c8d2da3 basetransform: Ensure to set the RECONFIGURE flag again if reconfiguration failed
It might've failed just because of flushing or other things, and we
should retry again on the next possibility if something ever calls in
here again.

https://bugzilla.gnome.org/show_bug.cgi?id=774623
2016-11-18 12:04:18 +02:00
Jan Schmidt 2e579a7c1b baseparse: Fix previous commit
Check the correct segment format value.

parse->segment.format is the format we're outputting in,
not the upstream format. Use parse->priv->upstream_format instead,
and make sure it's set in pull mode.
2016-11-16 00:30:26 +11:00
Jan Schmidt d81c0aec81 baseparse: Restrict query/convert responses when demuxing
If the parser is not parsing a raw elementary stream, restrict
the position, duration and conversion query replies to
things we can sensibly answer about - especially don't do
random conversions to/from bytes.
2016-11-16 00:12:22 +11:00
Scott D Phillips 075744a894 Cast away const from GstMetaInfo in *_get_meta_info() functions
MSVC warns about the const in the implicit argument conversion in the
calls to g_once_init_{enter,leave}. It's OK so explicitly cast it.

https://bugzilla.gnome.org/show_bug.cgi?id=774293
2016-11-15 14:51:18 +02:00