Commit graph

16569 commits

Author SHA1 Message Date
Tim-Philipp Müller
243889a88c event: fix header formatting 2015-04-18 12:31:02 +01:00
Tim-Philipp Müller
ff71bed31c tests: protection: fix leak in unit test 2015-04-18 12:28:15 +01:00
Tim-Philipp Müller
640e3ecfee gst.h: include the new gstprotection.h header
https://bugzilla.gnome.org/show_bug.cgi?id=705991
2015-04-18 12:27:46 +01:00
Alex Ashley
abdafb0d64 protection: add GstProtectionMeta to support protected content
In order to support some types of protected streams (such as those
protected using DASH Common Encryption) some per-buffer information
needs to be passed between elements.

This commit adds a GstMeta type called GstProtectionMeta that allows
protection specific information to be added to a GstBuffer. An example
of its usage is qtdemux providing information to each output sample
that enables a downstream element to decrypt it.

This commit adds a utility function to select a supported protection
system from the installed Decryption elements found in the registry.
The gst_protection_select_system function that takes an array of
identifiers and searches the registry for a element of klass Decryptor that
supports one or more of the supplied identifiers. If multiple elements
are found, the one with the highest rank is selected.

This commit adds a unit test for the gst_protection_select_system
function that adds a fake Decryptor element to the registry and then
checks that it can correctly be selected by the utility function.

This commit adds a unit test for GstProtectionMeta that creates
GstProtectionMeta and adds & removes it from a buffer and performs some
simple reference count checks.

API: gst_buffer_add_protection_meta()
API: gst_buffer_get_protection_meta()
API: gst_protection_select_system()
API: gst_protection_meta_api_get_type()
API: gst_protection_meta_get_info()

https://bugzilla.gnome.org/show_bug.cgi?id=705991
2015-04-18 12:24:06 +01:00
Alex Ashley
0f36b16a29 event: add new GST_EVENT_PROTECTION
In order for a decrypter element to decrypt media protected using a
specific protection system, it first needs all the protection system
specific  information necessary (E.g. information on how to acquire
the decryption keys) for that stream.

The GST_EVENT_PROTECTION defined in this commit enables this information
to be passed from elements that extract it (e.g. qtdemux, dashdemux) to
elements that use it (E.g. a decrypter element).

API: GST_EVENT_PROTECTION
API: gst_event_new_protection()
API: gst_event_parse_protection()

https://bugzilla.gnome.org/show_bug.cgi?id=705991
2015-04-18 12:04:29 +01:00
Tim-Philipp Müller
3191440485 tee: fix use of possibly-freed pad in debug statement
The gst_object_unref() in the block above may be dropping
the last ref to the pad and free the pad. Set pad pointer
to NULL here, so that we don't accidentally use a
possibly-freed pad pointer in the debug log statements
further below, and also use the tee element as log object
since that's more appropriate anyway.

Fixes valgrind warnings and crashes in tee test_stress
unit test when debug logging is enabled.
2015-04-18 12:01:54 +01:00
Tim-Philipp Müller
7fa81b5352 tests: info: fix unit test when run with GST_DEBUG=*:9
Only save the messages we're interested in and expecting.
When run with *:9 we might get additional TRACE level
messages from other categories and then we don't end up
with the number of messages we expect.
2015-04-18 12:01:54 +01:00
Tim-Philipp Müller
072b1c6aba tests: pad: fix buffer leak in new blocking_with_probe_type_idle test 2015-04-18 12:01:54 +01:00
Tim-Philipp Müller
0759058896 tests: pad: fix invalid memory access in debug log message
The string we put in the buffer is not NUL-terminated, so
don't try to print that via %s in a debug log message.
2015-04-18 12:01:54 +01:00
Mathieu Duponchelle
41946aa3f6 helpers: on OSX, MKDIR_P is install-sh -c -d
So we need to call it before cding to the bin directory.
2015-04-17 15:19:07 +02:00
Mathieu Duponchelle
6ce8398bc6 helpers: install -D isn't portable, use $(MKDIR_P) instead. 2015-04-17 13:02:51 +02:00
Thiago Santos
d4d161a282 tests: pad: test that idle probe will block
This tests add an idle probe on an idle pad from a separate thread
so that the callback is called immediatelly. This callback will sit
still and then we try to push a buffer on this same pad. It verifies
that the idle probe blocks data passing

https://bugzilla.gnome.org/show_bug.cgi?id=747852
2015-04-16 11:45:24 -03:00
Thiago Santos
3d8de8a4f9 pad: block data flow when idle probe is running
When idle probe runs directly from the gst_pad_add_probe() function
we need to make sure that no data flow happens as idle probe
is a blocking probe. The idle probe will prevent that any
buffer, bufferlist or serialized events and queries are not
flowing while it is running.

https://bugzilla.gnome.org/show_bug.cgi?id=747852
2015-04-16 10:09:29 -03:00
Tim-Philipp Müller
ac8a8f90b3 docs: clarify that return value of gst_filename_to_uri() must be freed
https://bugzilla.gnome.org/show_bug.cgi?id=747104
2015-04-16 13:42:18 +01:00
Vincent Penquerc'h
a3b42ec42a bin: undo upward state changes on children when a child fails
When a bin changes states upwards, and a child fails to change,
any child that was already switched will not be reset to its
original state, leaving its state inconsistent with the bin,
which does not change state due to the failure.

If the state change was from NULL to READY, it means that deleting
this bin will cause those children to be deleted while not in
NULL state, which is a Bad Thing. For other upward changes, it
is less of a problem, as a subsequent switch back to NULL will
cause an actual downwards change on those inconsistent elements,
albeit from the "wrong" state.

We now reset state to the original one when a child fails.

Includes unit test.

https://bugzilla.gnome.org/show_bug.cgi?id=747610
2015-04-15 16:00:21 +01:00
Mathieu Duponchelle
5dea4b82dc helpers: use $(INSTALL) to ... install the helper.
As it will create the folders and set permissions appropriately,
better than doing it manually.
2015-04-15 14:45:21 +02:00
Mathieu Duponchelle
d4dcce78b0 helpers: Fix Makefile.am to install the completion-helper correctly.
+ The program is installed at install-exec time, we thus need
  to move it in install-exec-hook, not install-data-hook.
2015-04-15 13:05:46 +02:00
Vincent Penquerc'h
6240b03085 Revert "basesrc: fix pool leak on allocation query error path"
This reverts commit 84fdf50b2f.

It seems the bug was fixed independently, and the merge was
automagic, yielding two extra free calls.
2015-04-15 11:40:51 +01:00
Suhwang Kim
be6d3e9255 tests: clock: fix test clock name
Don't call the slave test clock "Master".

https://bugzilla.gnome.org/show_bug.cgi?id=746430
2015-04-15 09:31:11 +01:00
Tim-Philipp Müller
d3400ce358 elementfactory: add ENCRYPTOR class defines
to go with DECRYPTOR.
2015-04-14 17:51:05 +01:00
Alex Ashley
b8f5a7ba45 elementfactory: add DECRYPTOR class defines
An element that performs decryption does not naturally fit within any
of the existing element factory class types. It is useful to be able
to easily get a list of all elements that support decryption so that
a union can be computed between the protection systems that have a
supported decryptor and the allowed protection systems for a particular
stream.

This commit adds a new GST_ELEMENT_FACTORY_TYPE_DECRYPTOR and its
associated string identifier "Decryptor". It also adds
GST_ELEMENT_FACTORY_TYPE_DECRYPTOR to GST_ELEMENT_FACTORY_TYPE_DECODABLE
so that uridecodebin can auto-plug a decryption element.

https://bugzilla.gnome.org/show_bug.cgi?id=705991
2015-04-14 17:50:32 +01:00
Sebastian Dröge
d70631fe99 typefindelement: Use gst_event_unref() instead of gst_mini_object_unref() + casting 2015-04-13 17:01:41 +02:00
Guillaume Desmottes
15fd78f0b6 typefind: fix leak in gst_type_find_element_src_event()
gst_type_find_element_src_event() is supposed to consume @event but wasn't
doing so when it was handling the event itself.

https://bugzilla.gnome.org/show_bug.cgi?id=747775

Signed-off-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
2015-04-13 10:33:41 -03:00
Hyunjun Ko
e08c03ed07 gstvalue: reset errno before g_ascii_strtoull call
"errno" already has meaningless value before g_ascii_strtoull call.
This causes invalid error check without reset.

https://bugzilla.gnome.org/show_bug.cgi?id=747690
2015-04-13 11:39:59 +01:00
Sebastian Dröge
7d3d4503a1 basesrc: Only set DTS to segment.start on the first buffer if subclass did not provide PTS
Otherwise we're going to set a rather arbitrary DTS of segment.start (usually
0) for live sources, which confuses synchronization if the source started
capturing at a later time. And it's especially wrong for raw media, for which
we should not set any DTS at all.

https://bugzilla.gnome.org/show_bug.cgi?id=747731
2015-04-13 09:23:02 +02:00
Sebastian Dröge
6409420474 typefind: Run the default have-type handler after all application handlers
Otherwise the CAPS event will already be forwarded downstream and
the application has no way to intervene anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=735896
2015-04-13 09:04:14 +02:00
Duncan Palmer
0ad06434da multiqueue: Don't automatically enter the buffering state when use-buffering is set.
There is no reason I can see to set mq->buffering = TRUE when
use_buffering is set; the code here also calls update_buffering(), which
will set mq->buffering = TRUE if this is warranted because of low buffer
levels.

https://bugzilla.gnome.org/show_bug.cgi?id=745937
2015-04-10 10:40:00 -03:00
Guillaume Desmottes
b15e6f4bf0 inputselector: fix cached buffer leak in chain function
gst_selector_pad_chain() was popping cached buffers out of the queue without
freeing those. Make sure we don't steal the GstBuffer as the cached buffer ref
has been passed to the pad chain function.

This can be reproduced by running the
validate.file.playback.switch_subtitle_track_while_paused.test5_mkv scenario
with Valgrind.

https://bugzilla.gnome.org/show_bug.cgi?id=747611

Signed-off-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
2015-04-10 09:27:30 -03:00
Edward Hervey
0865bc02ea tests: Use AM_TESTS_ENVIRONMENT
Needed by the new automake test runner
2015-04-08 16:08:24 +02:00
Prashant Gotarne
a754eb45b9 bufferlist: make sure list is writable before adding or removing buffers
https://bugzilla.gnome.org/show_bug.cgi?id=747439
2015-04-08 09:51:18 +01:00
Prashant Gotarne
c547e01018 bufferlist: minor docs addition for gst_buffer_list_get()
Return buffer remains valid as long as list is valid
and buffer is not removed from list.

https://bugzilla.gnome.org/show_bug.cgi?id=747438
2015-04-08 09:44:29 +01:00
Vincent Penquerc'h
84fdf50b2f basesrc: fix pool leak on allocation query error path
It could be triggered by:

gst-launch-1.0 videotestsrc num-buffers=20 ! videcrop bottom=214748364 ! videoconvert ! autovideosink

Spotted while testing:

https://bugzilla.gnome.org/show_bug.cgi?id=743910
2015-04-07 11:41:40 +01:00
Sebastian Dröge
370076edd5 baseparse: Forward SEGMENT_DONE events immediately
There might be no more data coming afterwards, and we just drained everything
that was left to be pushed anyway.
2015-04-06 18:46:06 -07:00
Tim-Philipp Müller
bcbe8d0f01 docs: fix cross-reference to environment variables in GstInfo
https://bugzilla.gnome.org/show_bug.cgi?id=747416
2015-04-06 18:56:25 +01:00
Prashant Gotarne
6a8f65936b memory: add check for writablity in resize
Add guard to gst_memory_resize() to make sure the
memory to be resized is actually writable.

https://bugzilla.gnome.org/show_bug.cgi?id=747392
2015-04-06 13:32:20 +01:00
Tim-Philipp Müller
fd67f40e4d tests: multiqueue: add test to make sure initial events go through without buffers 2015-04-05 16:47:26 +01:00
Tim-Philipp Müller
fe455d1330 tests: queue: check that the initial events are sent on immediately
Add a check that makes sure stream-start, caps, and segment events
are passed on by queue without delay, i.e. even if no buffer is
sent.
2015-04-05 16:11:03 +01:00
Sebastian Dröge
36f7b13658 pad: Print debug output from gst_pad_link_full() if preparing linking failed
Makes it easier to find linking failures in debug logs.
2015-04-04 18:33:50 -07:00
Tim-Philipp Müller
c8f680e395 segment: small docs addition
https://bugzilla.gnome.org/show_bug.cgi?id=690564
2015-04-04 19:32:27 +01:00
Tim-Philipp Müller
199c8ba561 docs: design: fix some 0.10-isms in GstSegment docs
1) segment.accum -> segment.base

2) Refer to GstSegment members as S.foo instead of
NS.foo, the event is now called a segment event
rather than newsegment event.

3) There's no more abs_rate field in GstSegment,
and there never was an abs_applied_rate field.

https://bugzilla.gnome.org/show_bug.cgi?id=690564
2015-04-04 19:31:42 +01:00
Ilya Konstantinov
f35ec14d33 basesrc: do not leak buffer pool in error case
https://bugzilla.gnome.org/show_bug.cgi?id=747321
2015-04-04 11:14:12 +01:00
Nicolas Dufresne
1b955c08df uri: Silence a compiler warning
This is a false positive for use initialized. The variable is set and
used enclosed in the safe if condition.
2015-04-03 19:12:48 -04:00
Nicolas Dufresne
e684e9ea68 doc: Add gst_segment_to_running_time_full 2015-04-03 16:32:16 -04:00
Sebastian Dröge
7742f0a0d3 basesrc: Fix documentation, buffer pools are unreffed and not freed 2015-04-03 13:19:33 -07:00
Tim-Philipp Müller
a9c9f54db7 Update INSTALL to the automake 1.14 version 2015-04-03 20:43:15 +01:00
Tim-Philipp Müller
2c19914d9a Automatic update of common submodule
From bc76a8b to c8fb372
2015-04-03 18:57:36 +01:00
Tim-Philipp Müller
8b19aabbbc win32: fix exports 2015-04-03 16:27:10 +01:00
Vincent Penquerc'h
d6ae9c0feb segment: add gst_segment_is_equal
It beats memcmp due to the 'reserved' fields.

API: gst_segment_is_equal()

Found via, but probably not directly linked to,
https://bugzilla.gnome.org/show_bug.cgi?id=738216
2015-04-03 12:10:33 +01:00
Tim-Philipp Müller
936b252253 win32: add new API to exports 2015-04-03 00:37:10 +01:00
Tim-Philipp Müller
5deb4f658e pad: allow probes to remove the data item whilst returning PROBE_OK
Use case: we want to block the source pad of a leaky queue and
drop the buffer that causes the block. If we return PROBE_DROP
then the buffer gets dropped, but we get called again. If we
return PROBE_OK we can't easily drop the buffer. If we just
replace the item into the GstPadProbeInfo structure with NULL,
GStreamer will push a NULL buffer to the next element when we
unblock the pad probe. This patch ensures it doesn't do that.

https://bugzilla.gnome.org/show_bug.cgi?id=734342
2015-04-03 00:07:26 +01:00