Commit graph

1462 commits

Author SHA1 Message Date
Hyunjun Ko
7ecef53dbb bufferlist: add new api gst_buffer_list_copy_deep
https://bugzilla.gnome.org/show_bug.cgi?id=751420
2015-06-24 10:52:56 +02:00
Jonas Holmberg
fabe966b0a gstcheck: Print newline in message handler
The message handler is supposed to print a newline after the message
just like the default message handler.
2015-06-23 16:17:56 +01:00
Thiago Santos
c1a9a3424d tests: gstutils: add tests for gst_element_get_compatible_pad
Adds tests for gst_element_get_compatible_pad for when it has to
request pads.

Note that these tests don't cover the case when it has to request
a pad that already exists.

https://bugzilla.gnome.org/show_bug.cgi?id=751235
2015-06-22 17:18:43 -03:00
Nicolas Dufresne
a65cea7c69 gstprotection: Add missing namespace to macro
GST_PROTECTION_SYSTEM_ID_CAPS_FIELD was missing the GST_ namespace.
Add it before its too late.
2015-06-13 12:25:19 -04:00
Nicolas Dufresne
b5e4f7bd9d collectpads: Add negative DTS support
Make gst_collect_pads_clip_running_time() function also store the
signed DTS in the CollectData. This signed DTS value can be used by
muxers to properly handle streams where DTS can be negative initially.

https://bugzilla.gnome.org/show_bug.cgi?id=740575
2015-06-12 17:20:16 -04:00
Lazar Claudiu
cb2c141eac controller: Added absolute direct control binding, example and test
Fixes: 740502
API: gst_direct_control_binding_new_absolute
2015-06-12 10:07:24 +02:00
Tim-Philipp Müller
201b013fac tests: fakesink: fix string leak in unit test 2015-06-08 20:00:47 +01:00
Jan Schmidt
a198803bd6 basetransform: Split input buffer processing from output generation
Allow for sub-classes which want to collate incoming buffers or
split them into multiple output buffers by separating the input
buffer submission from output buffer generation and allowing
for looping of one of the phases depending on pull or push mode
operation.

https://bugzilla.gnome.org/show_bug.cgi?id=750033
2015-06-08 19:17:57 +10:00
Sebastian Dröge
c1393aff5c memory: Fix compiler warnings in unit test
gst/gstmemory.c:570:38: error: implicit conversion from enumeration type 'GstMapFlags' to different enumeration
      type 'GstLockFlags' [-Werror,-Wenum-conversion]
  fail_unless (gst_memory_lock (mem, GST_MAP_WRITE));
               ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
2015-06-07 09:08:35 +02:00
Tim-Philipp Müller
0c80c41ade tests: fakesink: test notify::last-message and deep-notify::last-message
deep-notify::last-message seems to cause some problems, so disable for now.

https://bugzilla.gnome.org/show_bug.cgi?id=681642
2015-06-05 19:38:36 +01:00
Matthew Waters
e9c15d5321 memory: gst_memory_share may fail to exclusively lock the parent memory
Now that locking exclusively dows not always succeed, we need to signal
the failure case from gst_memory_init.

Rather than introducing an API or funcionality change to gst_memory_init,
workaround by checking exclusivity in the calling code.

https://bugzilla.gnome.org/show_bug.cgi?id=750172
2015-06-03 20:41:44 +10:00
Matthew Waters
eb71ee4040 buffer: locking memory exclusively may fail
Attempt to return a copy of the memory instead.

https://bugzilla.gnome.org/show_bug.cgi?id=750172
2015-06-03 20:41:44 +10:00
Matthew Waters
ad4569c893 miniobject: disallow a double write/exclusive lock
gst_memory_lock (mem, WRITE | EXCLUSIVE);
gst_memory_lock (mem, WRITE | EXCLUSIVE);

Succeeds when the part-miniobject.txt design doc suggests that this should fail:

  "A gst_mini_object_lock() can fail when a WRITE lock is requested and
  the exclusive counter is > 1. Indeed a GstMiniObject object with an
  exclusive counter 1 is locked EXCLUSIVELY by at least 2 objects and is
  therefore not writable."

https://bugzilla.gnome.org/show_bug.cgi?id=750172
2015-06-03 20:41:44 +10:00
Jan Schmidt
58e5cd2695 gstvalue: Implement gst_value_is_subset() for flagsets 2015-06-03 00:48:17 +10:00
Edward Hervey
c5a3e8db37 check: Use GST_CHECK_MAIN macro 2015-06-02 16:33:48 +02:00
Tim-Philipp Müller
c991c64fb2 tests: fix some leaks in new flagset checks 2015-05-30 13:02:36 +01:00
Jan Schmidt
f9e5178dd1 gstvalue: Add GstFlagSet type
GstFlagSet is a new type designed for negotiating sets
of boolean capabilities flags, consisting of a 32-bit
flags bitfield and 32-bit mask field. The mask field
indicates which of the flags bits an element needs to have
as specific values, and which it doesn't care about.

This allows efficient negotiation of arrays of boolean
capabilities.

The standard serialisation format is FLAGS:MASK, with
flags and mask fields expressed in hexadecimal, however
GstFlagSet has a gst_register_flagset() function, which
associates a new GstFlagSet derived type with an existing
GFlags gtype. When serializing a GstFlagSet with an
associated set of GFlags, it also serializes a human-readable
form of the flags for easier debugging.

It is possible to parse a GFlags style serialisation of a
flagset, without the hex portion on the front. ie,
+flag1/flag2/flag3+flag4, to indicate that
flag1 & flag4 must be set, and flag2/flag3 must be unset,
and any other flags are don't-care.

https://bugzilla.gnome.org/show_bug.cgi?id=746373
2015-05-25 16:23:33 +10:00
Stefan Sauer
b8c6ebd0f2 gstobject: add gst_object_has_as_ancestor and deprecate previous function
The old gst_object_has_ancestor will call the new code. This establishes the
symetry with the new gst_object_has_as_parent.

API: gst_object_has_as_ancestor()
2015-05-15 13:55:19 +02:00
Stefan Sauer
3492105a06 gstobject: rename gst_object_has_parent to gst_object_has_as_parent
This avoid confusion with a potential punction that check if a gstobject has-a
parent.

API: gst_object_has_as_parent()
2015-05-15 13:45:18 +02:00
Tim-Philipp Müller
a0f2e9ec2a tests: printf: add unit test for %%
https://bugzilla.gnome.org/show_bug.cgi?id=748414
2015-04-24 15:19:26 +01:00
Tim-Philipp Müller
cde5a6fea3 tests: define GST_CHECK_TEST_ENVIRONMENT_BEACON 2015-04-23 15:55:44 +01:00
Prashant Gotarne
6237314ee0 test: memory: Added test to verify the allocation params
New test added to verify the allocation params for the memory

https://bugzilla.gnome.org/show_bug.cgi?id=748277
2015-04-23 13:41:27 +01:00
Jason Litzinger
6aee4af034 tests: info: add test case to reproduce infinite loop
gst_debug_unset_threshold_for_name() used to go into an
infinite loop when there was more than one category in
the list.  This test captures the problem by failing
via timeout.

https://bugzilla.gnome.org/show_bug.cgi?id=748321
2015-04-23 11:21:22 +01:00
Tim-Philipp Müller
41a1d1a416 tests: error out if test environment is not actually set up properly
https://bugzilla.gnome.org//show_bug.cgi?id=747624
2015-04-22 10:11:51 +01:00
Tim-Philipp Müller
ff71bed31c tests: protection: fix leak in unit test 2015-04-18 12:28:15 +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
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
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
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
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
Edward Hervey
0865bc02ea tests: Use AM_TESTS_ENVIRONMENT
Needed by the new automake test runner
2015-04-08 16:08:24 +02: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
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
Prashant Gotarne
b1c59a17cc test: filesink: add tests for buffers with multiple memory blocks
Update test_seeking testcase to verify the render and render_list
virtual method handle buffers and buffer list containing multiple
memory blocks correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=747223
2015-04-02 09:54:08 +01:00
Prashant Gotarne
714d8e58e3 tests: filesink: add check for render_list virtual method
GstFileSink implements the render_list virtual method to render
a list of buffers. Update the test_seeking test case to also
check the render_list method implementation.

https://bugzilla.gnome.org/show_bug.cgi?id=747100
2015-04-01 12:31:15 +01:00
Luis de Bethencourt
ae0b2ec46b tests: check location isn't truncated
Test covering the recent commit where location='".abc' won't get truncated
to '.ab' anymore

https://bugzilla.gnome.org/show_bug.cgi?id=688625
2015-03-27 17:19:02 +00:00
Luis de Bethencourt
555e0211c8 gstvalue: only unwrap string delimited with "
Don't unwrap strings that start but don't finish with a double quote. If a
string is delimited by two quotes we unescape them and any special characters
in the middle (like \" or \\). If the first character or the last character
aren't a quote we assume it's part of an unescaped string.

Moved some deserialize_string unit tests because we don't try to unwrap strings
missing that second quote anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=688625
2015-03-27 17:18:23 +00:00
Thiago Santos
a041d8862d baseparse: only post 'no valid frames' error if buffers were received
Otherwise baseparse will consider empty streams to be an error while
an empty stream is a valid scenario. With this patch, errors would
only be emitted if the parser received data but wasn't able to
produce any output from it.

This change is only for push-mode operation as in pull mode an
empty file can be considered an error for the one driving the
pipeline

Includes a unit test for it

https://bugzilla.gnome.org/show_bug.cgi?id=733171
2015-03-26 12:25:57 -03:00
Jose Antonio Santos Cadenas
3e8e0a7065 tee: Add allow-not-linked property
This property avoids not linked error when all the pads are unlinked
or when there are no source pads. This is useful in dynamic pipelines
where it can happen that for a short time there are no pads at all or
all downstream pads are not linked yet.

https://bugzilla.gnome.org/show_bug.cgi?id=746436
2015-03-26 10:46:26 +01:00
Thiago Santos
150e8a5c97 tests: input-selector: new tests for EOS handling
3 new tests:

1) Tests that a stream that is empty (just an EOS event)
   on inactive pad doesn't get through and tamper
   with the active pad that still has data

2) Tests that a stream that is shorter than the active one
   (pushes EOS earlier) doesn't has its EOS pushed

3) Tests that switching to an inactive stream that has received
   EOS will make input-selector push EOS

https://bugzilla.gnome.org/show_bug.cgi?id=746518
2015-03-24 09:13:57 -03:00
Thiago Santos
92d2351b2e tests: selector: remove weird semicolons at the end of test functions
Even though it works, it is not needed and seems more natural
to not have semicolons at the end of function declarations

https://bugzilla.gnome.org/show_bug.cgi?id=746518
2015-03-24 08:22:26 -03:00
Wim Taymans
bc282da83c segment: remove the bounds check from _to_running_time_full()
Do not do any checks for the start/stop in the new
gst_segment_to_running_time_full() method, we can let this be done by
the more capable gst_segment_clip() method. This allows us to remove the
enum of results and only return the sign of the calculated running-time.
We need to put the old clipping checks in the old
gst_segment_to_running_time() still because they work slightly
differently than the _clip methods.

See https://bugzilla.gnome.org/show_bug.cgi?id=740575
2015-03-20 09:00:47 +01:00
Wim Taymans
edf484ab6b segment: add option to disable clipping
Add a clip argument to gst_segment_to_running_time_full() to disable
the checks against the segment boundaries. This makes it possible to
generate an extrapolated running-time for timestamps outside of the
segment.

See https://bugzilla.gnome.org/show_bug.cgi?id=740575
2015-03-19 17:36:36 +01:00
Wim Taymans
8c8b3818e4 segment: add helper to get negative running-time
Add a helper method to get a running-time with a little more features
such as detecting if the value was before or after the segment and
negative running-time.

API: gst_segment_to_running_time_full()

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=740575
2015-03-18 11:35:42 +01:00
Wim Taymans
6e67ad7675 segment: fix offset handling with non 0 start
The position in the segment is relative to the start but the offset
isn't, so subtract the start from the position when setting the offset.
Add unit test for this as well.
2015-03-18 11:35:42 +01:00
Tim-Philipp Müller
b1b718c6d0 tests: add unit test for gst_adapter_take_buffer_list() 2015-03-14 17:23:03 +00:00