Commit graph

778 commits

Author SHA1 Message Date
Tim-Philipp Müller 2506dc5fe2 tests: test datetime deserialisation a bit more 2012-06-27 23:01:13 +01:00
Tim-Philipp Müller d6e6391518 tests: fix bus leak in GstBin test_state_change_skip test
Still not valgrind clean though.
2012-06-27 20:52:52 +01:00
Tim-Philipp Müller f95996d97f tests: add some datetime serialisation/deserialisation tests
https://bugzilla.gnome.org/show_bug.cgi?id=678031
2012-06-27 13:51:42 +01:00
Tim-Philipp Müller 2c532aa821 toc: put toc directly into event/message/query structure
Now that TOCs are refcounted and have a GType, we can just
stuff a ref of the TOC directly into the various toc
event/message/query structures and get rid of lots of
cracktastic GstStructure <-> GstToc serialisation and
deserialisation code. We lose some TOC sanity checking
in the process, but that should really be done when
it's being created anyway.
2012-06-26 20:43:50 +01:00
Tim-Philipp Müller 03ac16c1d8 tocsetter: clean up and update API for refcounted TOCs
Let's keep it simple for now:

gst_toc_setter_reset_toc() -> gst_toc_setter_reset()
gst_toc_setter_get_toc_copy() -> removed
gst_toc_setter_get_toc() -> returns a ref now
gst_toc_setter_get_toc_entry_copy() -> removed,
    use TOC functions instead
gst_toc_setter_get_toc_entry() -> removed,
    use TOC functions instead
gst_toc_setter_add_toc_entry() -> removed,
    to avoid problems with (refcount-dependent)
    writability of TOC; use TOC functions instead
2012-06-25 20:18:32 +01:00
Tim-Philipp Müller 8590be2861 tocsetter, gst-launch, tests: update for GstToc API changes 2012-06-24 20:15:19 +01:00
Tim-Philipp Müller bc28ebf08d sample: add compare function for GstSample
Should make gst_tag_list_is_equal() work properly with image tags.

https://bugzilla.gnome.org/show_bug.cgi?id=672637
2012-06-23 16:59:10 +01:00
Tim-Philipp Müller e4b6bcb7b9 tests: add unit test for gst_element_make_from_uri()
https://bugzilla.gnome.org/show_bug.cgi?id=645467
2012-06-23 14:43:26 +01:00
Wim Taymans 7da1d23a9b info: add destroy notify to gst_debug_add_log_function() 2012-06-20 13:28:08 +02:00
Wim Taymans 6efb5c9b6b bus: add GDestroyNotify to set_sync_handler() 2012-06-20 12:29:35 +02:00
Wim Taymans 76e8b2ecda task: add GDestroyNotify to _new
Add a GDestroyNotify to the user_data we pass to gst_task_new()
Change gst_pad_start_task() to also take the notify
2012-06-20 10:31:49 +02:00
Wim Taymans d7d5306009 clock: remove _full version
Rename gst_clock_id_wait_async_full() to gst_clock_id_wait_async()
and remove the old gst_clock_id_wait_async() version.
2012-06-20 09:58:14 +02:00
Wim Taymans a1c5b00e72 memory: make GstMemory a miniobject 2012-06-14 16:34:28 +02:00
Tim-Philipp Müller b45a44ef27 tests: add some basic unit tests for partial date time fields 2012-06-13 00:21:32 +01:00
Stefan Sauer 19e5fc54b7 childproxy: use GstChildProxy instead of GObject on the public api
Fix usage and also cleanup gst_object api use on gobjects.
2012-06-11 18:25:18 +02:00
Edward Hervey 502ee3d092 check: Add a test for GST_READ_* macros 2012-06-08 14:58:00 +02:00
Wim Taymans 11edb59462 tests: fix unit test after event change
Someone forgot to run make check before pushing...
2012-06-06 15:45:11 +02:00
Wim Taymans c10d39a804 event: add name to sticky_multi events
The name of the event is used to store multiple sticky events of a certain type
on a pad.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=676859
2012-06-06 12:52:09 +02:00
Tim-Philipp Müller 1f008928ae tests: add unit test for tag list writability 2012-06-05 15:05:07 +01:00
Tim-Philipp Müller 1f8e6b4fa5 gst_tag_list_free -> gst_tag_list_unref 2012-06-05 15:05:07 +01:00
Wim Taymans c4ae921ba6 tests: fix unit test
Before we can change the caps on a sinkpad with fixed caps we need to unfix the
pad caps.
2012-06-05 09:21:10 +02:00
Tim-Philipp Müller a88dcc2ab6 taglist: make GstTagList a GstMiniObject
Which adds refcounting support, and other things.
2012-05-28 00:05:16 +01:00
Wim Taymans e5f64e7a3c bin: port unit test to 0.11 2012-05-22 09:36:52 +02:00
Wim Taymans 146ab8a702 bin: try harder to avoid state changes in wrong direction
When the bin does an upward state change, try to avoid doing a downward state
change on the child and vice versa.
Add some more unit tests for this fix.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=621833
2012-05-21 11:58:28 +02:00
Tim-Philipp Müller 37e516ccf7 tools, tests: don't access the GstPluginFeature structure directly 2012-05-19 17:23:43 +01:00
Tim-Philipp Müller a9d19a6913 elementfactory: make object struct opaque for now
Make GstElementFactory opaque until we have time to
clean it up a little. It's not something anyone
would need to derive from.
2012-05-19 16:17:12 +01:00
Raimo Järvi 63234a9dab gst: Fix compiler warnings on mingw-w64
https://bugzilla.gnome.org/show_bug.cgi?id=675525
2012-05-09 09:35:35 +02:00
Tim-Philipp Müller d35487e50c uri: require URI protocol bit to be at least 3 characters to be valid
We want to return FALSE when run on a windows-style file path.

https://bugzilla.gnome.org/show_bug.cgi?id=674296
2012-05-01 19:50:36 +01:00
Tim-Philipp Müller b8304137d3 tests: use public accessors to get plugin description details 2012-04-29 15:53:05 +01:00
Mark Nauwelaerts 678e9704fc tests: plug some leaks 2012-04-24 16:01:52 +02:00
Wim Taymans 6fae137027 meta: add LOCKED flag
Add a new LOCKED flag to the metadata. Refuse removing LOCKED metadata from
a buffer.
Mark the metadata from the bufferpool LOCKED.
Add unit test for LOCKED flag
2012-04-17 15:55:10 +02:00
Alexander Saprykin 54d9497e4d tocsetter: fix memory leaks in unit test 2012-04-11 09:58:06 +02:00
Alexander Saprykin 4cc1fbf18e toc: fix memory leaks in unit test 2012-04-11 09:58:06 +02:00
Stefan Sauer 1fb774577e controller: add a finalizer for the test controlbindings
No idea why valgrind still inists that there are leaks.
2012-04-05 21:17:57 +02:00
Sebastian Dröge b0d89da6b6 gst: Change versioning
Remove GST_MAJORMINOR and replace it by GST_API_VERSION
Also set GST_VERSION_{MAJOR,MINOR,MICRO,NANO} explicitely
now.

All versions are at 1.0.0 now for the release soon but
API/ABI can still change until the 1.0.0 release.

Next release versions until 1.0.0 will be 0.10.9X and
these will be release candidates. GST_VERSION_* will
nonetheless stay at 1.0.0.0.
2012-04-04 14:28:55 +02:00
Tim-Philipp Müller f8a7bd21df tests: add new unit test binaries to .gitignore 2012-04-02 23:29:24 +01:00
Stefan Sauer 3b0af8df9e toc: port to 0.11 2012-04-02 22:09:07 +02:00
Stefan Sauer 1074a4e99a Merge branch '0.10'
Conflicts:
	docs/gst/gstreamer-sections.txt
	gst/Makefile.am
	gst/gst.c
	gst/gst.h
	gst/gstevent.c
	gst/gstevent.h
	gst/gstmessage.h
	gst/gstquark.c
	gst/gstquark.h
	gst/gstquery.c
	gst/gstquery.h
	tests/check/Makefile.am
2012-04-02 21:33:10 +02:00
Alexander Saprykin 9b80982c53 gstchecks: Add unit test for the GstTocSetter 2012-04-02 10:49:38 +02:00
Alexander Saprykin 7fd9bb5cd2 gstchecks: Add unit test for the GstToc 2012-04-02 10:49:38 +02:00
Wim Taymans 0e9241cfc6 buffer: make function to find memory in a buffer
Make a function to find the memory blocks for a region in a buffer.
2012-04-01 12:02:40 +02:00
Stefan Sauer f35267bb92 childproxy: use GObject instead of GstObject
This makes it prossible to be used more widely. Fix implementations for the API
change.
2012-03-30 22:24:26 +02:00
Wim Taymans 38b96e6c8c buffer: improve the buffer memory methods
gst_buffer_take_memory -> gst_buffer_insert_memory because insert is what the
method does.
Make all methods deal with ranges so that we can replace, merge, remove and map
a certain subset of the memory in a buffer. With the new methods we can make
some code nicer and reuse more code. Being able to deal with a subset of the
buffer memory allows us to optimize more cases later (most notably RTP headers
and payload that could be in different memory objects).
Make some more convenient macros that call the more generic range methods.
2012-03-30 18:15:24 +02:00
Wim Taymans bb876588ac buffer: unify buffer merge methods
Add gst_buffer_append() which appends the memory blocks from one buffer to
another. Remove the old inefficient _merge() and _join() methods which forced a
premature memcpy in most cases.
Remove the _is_span() and _span() methods they are not needed anymore now that
we can _append(). Merging and spanning will be delayed until mapping or maybe
not at all when the element can deal with the different memory blocks.
2012-03-28 12:51:58 +02:00
Wim Taymans 7bcc3baf64 buffer: improve gst_buffer_new_wrapped_full()
Make it possible to wrap all kinds of memory by exposing all properties to
gst_buffer_new_wrapped_full(). This makes it possible to also create writable
memory without a free function or memory with extra padding.
2012-03-20 10:20:29 +01:00
Wim Taymans 85c9543841 memory: group allocation parameters in a struct
Group the extra allocation parameters in a GstAllocationParams structure to make
it easier to deal with them and so that we can extend them later if needed.
Make gst_buffer_new_allocate() take the GstAllocationParams for added
functionality.
Add boxed type for GstAllocationParams.
2012-03-15 13:42:17 +01:00
Wim Taymans edd2ffe4d4 memory: Add 0 padding
Change gst_allocator_alloc() so that we can also spicify flags and padding.
Add 2 new flags to mark the memory 0 prefixed/padded. This allows us to
remove some resizes in the base classes.
When allocating memory, memset prefix and padding with 0 when the flags tell
us to.
On resize, clear the zero padding flags if we can't guarantee the memory is
still 0 filled.
Update tests.
2012-03-14 21:32:22 +01:00
Wim Taymans 67931bfded caps: make _normalize take ownership of input
Make gst_caps_normalize() take ownership of the input so that it can more
intelligently decide when to copy or not.
2012-03-12 12:21:34 +01:00
Wim Taymans 8a76c3269a caps: _do_simplify() -> _simplify()
Rename _do_simplify() to _simplify(). The name was introduced as a replacement
method for a deprecated method but we can now rename it again.
Fix some docs.
2012-03-12 11:38:37 +01:00
Wim Taymans 9cdbffea94 caps: improve _do_simplify
Make gst_caps_do_simplify() take ownership of the input caps and produce a
simplified output caps. This removes the requirement of having writable input
caps and the method can make the caps writable only when needed.
2012-03-12 10:42:23 +01:00
Wim Taymans 6886be59f5 tests: fix unit test
with the new caps API, there is more sharing and less copying going on so the
unit test refcounts are different.
2012-03-12 10:41:28 +01:00
Wim Taymans 43abf99a8a caps: avoid using in-place oprations
Rework some caps operations so they don't rely on writable caps but instead take
ownership of the input caps and do _make_writable() only when needed.
Remove some const from caps functions, it does not make much sense for
refcounted objects and does not allow us to return a refcount to the const input
caps.
Rework the base classes fixate vmethods to not operate on the caps in-place.
All this saves us around 30% of caps and structure copy and new operations.
2012-03-11 18:57:44 +01:00
Wim Taymans 842afb9732 test: add test to check sticky events order
Sticky events pushed on an unlinked pad should be stored on the pad. When the
pad is then linked and an event is pushed, the event should be merged with the
already existing sticky events and then the sticky events should be pushed in
the order that they were originally pushed.
2012-03-09 11:49:08 +01:00
Wim Taymans 2d63298cac test: fix typo in comment 2012-03-09 11:48:40 +01:00
Wim Taymans 7b8263de93 pad: return ANY for a pad without template
Because gst_pad_get_pad_template_caps() returns ANY when there is no template,
the query caps function should also return ANY when there is no template (and no
pad current caps) instead of EMPTY.
2012-03-08 10:34:42 +01:00
Wim Taymans 68a6f2faaf tests: improve metadata test 2012-03-02 13:02:37 +01:00
Wim Taymans 92b61a6a18 tests: fix old caps in tests now that core warns 2012-03-01 17:41:56 +01:00
Sebastian Dröge 99a8cd1048 Merge branch 'master' into 0.11
Conflicts:
	libs/gst/base/gstcollectpads2.c
	libs/gst/check/gstconsistencychecker.c
2012-03-01 14:43:01 +01:00
Wim Taymans e80296cf46 meta: split registration of API and implementation
Split out the registration of the metadata API and its implementation. Make a
GType for each metadata API. This allows us to store extra information with the
API type such as the tags.
Change the buffer API so that we can get the metadata using the API GType.
Change the query API so that we use the metadata API GType in the allocation
query instead of a string.
Update netaddress and unit tests
2012-02-29 17:37:09 +01:00
Wim Taymans f0105dd81f meta: add return vale to transform
Add a boolean return value so that we can see when a transform fails.
2012-02-28 16:17:47 +01:00
Wim Taymans 549347f81c tests: fix unit test 2012-02-28 12:51:27 +01:00
Wim Taymans 825bc829b1 tests: increase bus test timeout 2012-02-27 11:46:08 +01:00
Tim-Philipp Müller 64effe78e7 tests: make datetime test more reliably when comparing two almost identical nows
Account for rounding errors in some places, and that two nows are
not always entirely identical, so allow some leeway when comparing
microseconds and seconds. Ran into this too often, esp. when the
system is under load.
2012-02-27 09:37:22 +00:00
Wim Taymans eb84682e92 clock: make more stuff private
Expose methods to get and set the timeout because subclasses uses this.
2012-02-27 09:11:36 +01:00
Wim Taymans 6b22a63f1b meta: flesh out the metadata transform
Flesh out the transform method. Add a type and extra info to the transform
function so that implementation can transform the metadata.
Remove the copy function and replace with the more generic transform.
2012-02-24 10:28:56 +01:00
Wim Taymans 7b0e4f27fb memory: make _new_wrapped take user_data and notify
Make it possible to configure a GDestroyNotify and user_data for
gst_memory_new_wrapped() this allows for more flexible wrapping of foreign
memory blocks.
2012-02-22 02:10:21 +01:00
Matej Knopp 1d7626f293 Unit test for queue src caps notification 2012-02-21 11:04:55 +01:00
Wim Taymans f2e05faaaf tests: fix useless segment test 2012-02-20 14:42:11 +01:00
Wim Taymans c6a1bed1ad memory: more work on refcount and writability
Rename _is_writable() with _is_exclusive because the writability does not depend
on the amount of references to the memory object anymore.
Add accessor macros for the memory flags.
Rename the GstBuffer _peek_memory() method to _get_memory() and return a
reference to the memory now that we can do this without affecting writability
of the memory object. Make it possible to also make this function merge the
buffer memory.
Add methods to replace memory in a buffer. Make some convience macros for the
buffer memory functions.
Fix unit tests.
2012-02-13 18:04:03 +01:00
Tim-Philipp Müller 4d937fafbb event: rename gst_event_{set,parse}_stream_config_codec_data() to _setup_data()
More generic.
2012-02-12 20:51:39 +00:00
Wim Taymans 7ab1d62c24 GST_FLOW_WRONG_STATE -> GST_FLOW_FLUSHING 2012-02-08 16:18:04 +01:00
Wim Taymans e74daf61d1 buffer: add new test 2012-02-02 13:17:38 +01:00
Tim-Philipp Müller 068d9ecf5a event: add constructor and parse function for new GAP event
(Whatever you do, don't mention the filler event.)
2012-01-28 18:09:01 +00:00
Tim-Philipp Müller 75e17f0002 event: add construct and parse API for the new STREAM CONFIG event
codec data and stream headers don't belong into caps, since they
are not negotiated. We signal them using the STREAM CONFIG event
instead.
2012-01-27 17:42:07 +00:00
Sebastian Dröge c5b7e7903e utils: Fix unit test 2012-01-27 12:14:50 +01:00
Wim Taymans 9676e141ce tests: fix leaks 2012-01-27 12:10:09 +01:00
Wim Taymans 203dd6fbe1 memory: make guint8 * for easy usage 2012-01-25 11:54:23 +01:00
Wim Taymans a521252845 Add new GstMapInfo
Use a structure to hold info about the mapping. The application then keeps track
of this state and we can use it to unmap the memory again later.
2012-01-25 11:54:23 +01:00
Stefan Sauer 660d9c071a controller: cleanup the control-binding construction
This is now bindings firendly as _new is just a classic c convenience and all
the work is done in a constructor. As a side effect _new never fails.
Fix the tests.
2012-01-24 21:57:44 +01:00
Vincent Penquerc'h 982ff80c38 tests: add basic tests for new stepped ranges
https://bugzilla.gnome.org/show_bug.cgi?id=665294
2012-01-24 12:11:44 +00:00
Stefan Sauer b23977cb93 controller: allow different controlbindings
Make controlbinding an abstract baseclass. Move implementation to control-
binding-direct and add a control-binding-argb. Add an example.
2012-01-23 11:03:43 +01:00
Tim-Philipp Müller 1654b7f1d7 Use GLib's type for GError instead of our own
We introduced our own when GLib didn't want to add a GType
for GError. But now that there is one, we can use GLib's
unconditionally and remove our version.
2012-01-22 15:16:14 +00:00
Stefan Sauer dd9f0481ea controller: improve control binding handling
Change _set_control_binding to _add_control_binding and take ownership. Add a
_remove_control_binding function.
2012-01-20 14:42:31 +01:00
Stefan Sauer c227d51fa9 controller: remove convenience api for control sources
This is needed to support multiple kinds of control-bindings.
2012-01-20 11:31:23 +01:00
Wim Taymans a1d7bd02e4 memory improvements
Make the memory object simply manage the data pointer and the maxsize and move
the offset and size handling to common functionality.
Use the READONLY flag to set a readonly lock.
Remove the data and size fields from the unmap method. We need an explicit
resize operation instead of using the unmap function.
Make internal helper lock and unlock functions.
Update unit test and users of the old API.
2012-01-19 12:51:41 +01:00
Wim Taymans 252327f87a Update for new gthread API 2012-01-19 09:27:04 +01:00
Wim Taymans c96d5a330c memory: make writability check into a method
Use a method to check for writability instead of a macro so that we can change
the implementation more easily.
2012-01-16 15:57:35 +01:00
Wim Taymans 4eb0c8ae07 tests: improve memory test 2012-01-16 12:24:48 +01:00
Tim-Philipp Müller c721d53773 Remove GST_TYPE_DATE, our own GDate type
Which we had to add because GLib didn't have it
back in the day. Port everything to plain old
G_TYPE_DATE, which is also a boxed type. Ideally
we'd just use GDateTime for everything, but it
doesn't support not setting some of the fields
unfortuntely (which would be very useful for
tag handling in general, if we could express
2012-01 for example).

https://bugzilla.gnome.org/show_bug.cgi?id=666351
2012-01-12 20:50:53 +00:00
Tim-Philipp Müller 71e89bc514 tests: ignore new memory test binary 2012-01-09 13:19:04 +00:00
Wim Taymans 80f4716a61 memory: check semantics of nested mappings
Count how many mappings are currently active and also with what access pattern.
Update the design doc with restrictions on the access patterns for nested
mappings.
Check if nested mappings obey the access mode restrictions of the design doc.
Add various unit tests to check the desired behaviour.
2012-01-06 13:10:18 +01:00
Wim Taymans 960c580ae2 memory: handle -1 size in unmap
handle -1 in unmap correctly when the offset is modified.
2012-01-06 07:02:36 +01:00
Wim Taymans e4a58ec71e memory: improve semantics of unmap
Make an unmap call with a different data pointer than the map call update the
offset field. This allows for both offset and size adjustements in the unmap
call.
2012-01-06 06:43:08 +01:00
Wim Taymans d483ff2db5 memory: add more checks
Add check for mapping and resizing
2012-01-05 18:15:20 +01:00
Wim Taymans 6e0024e76e memory: take offset into account
Take the offset into account whem mapping and unmapping the buffer.
2012-01-05 17:28:28 +01:00
Wim Taymans b750dc5090 memory: clarify nested mappings, add unit test 2012-01-05 16:48:49 +01:00
Wim Taymans 8ec07bb6f7 tests: add more memory unit tests
Check for unmap with invalid size
2012-01-05 13:22:42 +01:00
Wim Taymans 8658b2fd68 tests: add unit test for GstMemory
Add a GstMemory unit test
Add some more asserts in GstMemory to catch invalid cases.
2012-01-05 13:11:05 +01:00
Sebastian Dröge da81ada9d0 value: Add tests for the bitmask type 2012-01-05 10:24:14 +01:00
Tim-Philipp Müller 8ff3102116 registry: get rid of gst_default_registry_*() convenience macros
They're not really worth it: hardly save any typing, and aren't
great for bindings or gobject-introspection.
2012-01-02 02:32:49 +00:00