Commit graph

51 commits

Author SHA1 Message Date
Edward Hervey d3ffa82639 Remove 0.10-related documentation and "Since" markers 2012-07-10 12:03:27 +02:00
Brian Cameron 461178fb59 typefind: fix prototype of helper_find_suggest
The proto for helper_find_suggest has a different argument than the actual
function in the same file has.  This causes the Sun Studio compiler to fail.

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

Conflicts:

	libs/gst/base/gsttypefindhelper.c
2012-05-24 11:10:22 +02:00
Tim-Philipp Müller e73747a7e0 tools, base: don't poke into GstTypeFindFactory struct, use public API 2012-05-01 23:23:41 +01:00
Tim-Philipp Müller ecf74cf2db typefindfactory: add gst_type_find_factory_has_function()
Add API so people don't have to poke the struct for this.
2012-05-01 23:23:41 +01:00
Mark Nauwelaerts a0649dd357 typefindhelper: also unmap collected mapped buffers 2012-03-30 16:53:05 +02:00
Wim Taymans fe5fe438d3 typefind: remove const from refcounted GstCaps
Having const on refcounted objects require us to make copies instead of simply
taking a ref, don't do that.
2012-03-10 09:25:43 +01:00
Wim Taymans 39c5f0b28a don't do logic in g_assert... 2012-01-31 12:10:21 +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
Wim Taymans be0e58a637 make some more macros as inline functions
Make some macros as inline functions for added type checking.
USe new gst_caps_take() in typefind
2011-12-05 10:24:34 +01:00
Wim Taymans cb54ab7d90 typefind: fix for new getrange method signature
gst_type_find_helper_get_range_ext -> gst_type_find_helper_get_range
2011-11-17 16:15:23 +01:00
Sebastian Dröge 43538e2e75 Merge branch 'master' into 0.11
Conflicts:
	docs/design/draft-buffer2.txt
	docs/design/part-TODO.txt
	docs/design/part-block.txt
	docs/design/part-bufferlist.txt
	docs/design/part-caps.txt
	docs/design/part-element-transform.txt
	docs/design/part-events.txt
	docs/design/part-negotiation.txt
	gst/gstcaps.c
	gst/gstevent.h
	gst/gstghostpad.c
	gst/gstinterface.c
	gst/gstpad.c
	gst/gstpad.h
	gst/gstutils.c
	libs/gst/base/gstbasesink.c
	libs/gst/base/gstbasesrc.c
	libs/gst/base/gstbasetransform.c
	libs/gst/base/gsttypefindhelper.c
	plugins/elements/gstcapsfilter.c
	plugins/elements/gsttee.c
	tests/check/generic/sinks.c
	tools/gst-launch.1.in
2011-09-08 14:28:23 +02:00
Piotr Fusik 14f5518f3d docs, gst: typo fixes
https://bugzilla.gnome.org/show_bug.cgi?id=658449
2011-09-07 18:03:17 +01:00
Wim Taymans 5cf8e68944 Merge branch 'master' into 0.11
Conflicts:
	gst/gstmessage.c
	gst/gstquery.c
	gst/gstregistrychunks.c
	gst/gstsegment.c
	libs/gst/base/gstbasetransform.c
	libs/gst/base/gstbasetransform.h
	libs/gst/base/gsttypefindhelper.c
	plugins/elements/gsttypefindelement.c
2011-08-26 14:37:54 +02:00
Josep Torra 306e317ae9 typefind: add GST_TYPE_FIND_NONE and use it
Fixes warning #188: enumerated type mixed with another type reported by ICC.
2011-08-26 14:11:15 +02:00
Wim Taymans 2c221a5729 feature: use object name
Remove the name property from the plugin feature and port code to use the object
name instead.
2011-05-24 18:17:24 +02:00
Wim Taymans ba6b915651 base: avoid using buffer caps
Comment all code using buffer caps.
Rework capsfilter code a little.
Fix some unit tests
2011-05-08 12:46:17 +02:00
Wim Taymans c4751ec8c1 Revert "context: use context on buffers instead of caps"
This reverts commit 9ef1346b1f.

Way to much for one commit and I'm not sure we want to get rid of the pad caps
just like that. It's nice to have the buffer and its type in onw nice bundle
without having to drag the complete context with it.
2011-05-05 13:17:08 +02:00
Wim Taymans 9ef1346b1f context: use context on buffers instead of caps
Put the srcpad context on buffers instead of caps. This allows us to associate
all the relevant info contained in events with a buffer.
2011-05-04 18:59:47 +02:00
Wim Taymans d82c8bd2af memory: port code to new buffer data API 2011-03-28 20:08:45 +02:00
Edward Hervey bf41fb056a base: documentation fixups and annotation 2010-12-17 19:19:40 +01:00
Tim-Philipp Müller 686b16756d docs: libgstbase: more gobject introspection annotations
Many of these are superfluous and were added for clarity.
2010-12-07 18:37:04 +00:00
Wim Taymans 8fff434835 typefind: add a new method that also uses the file extension
Add a method to perform get_range typefinding that also uses the
uri/location extension as an extra hint. It will first try to call the
typefind functions of the factories that handle the given extension. The result
is that in the common case, we only call one typefind function, which speeds up
the typefinding a lot.
2010-01-12 17:34:39 +01:00
Sebastian Dröge c57e5bf07e typefindhelper: Remove obsolete FIXME
It's not necessary (and not a good idea) to cache the typefind factory
list anymore.
2009-10-24 13:14:25 +02:00
Edward Hervey 5067664c09 typefind: Keep typefind factories sorted in the registry. Fixes #599147
This avoids having to do the sorting everytime we use typefind

The behaviour of gst_type_find_factory_get_list has subtlely changed
in the sense that the order was previously undefined, whereas now
it returns them sorted by rank and then by name.
2009-10-24 10:44:09 +02:00
Edward Hervey bb0918279f libs/base/typefindhelper: Remove useless typechecking in tight loop
The list against which we run the comparefunc will only contain
GstPluginFeature, therefore remove the 6 expensive type checks we do
for every single comparision.
2009-10-18 17:17:17 +02:00
Edward Hervey d72c17e328 gsttypefindhelper: Fix indentation 2009-05-22 12:57:10 +02:00
Wim Taymans 8620bc3295 Add new typefing helper function to guess the caps based on the file
extension. See #566661.
API: gst_type_find_helper_for_extension()
2009-01-21 12:48:18 +01:00
Wim Taymans a739ae387d docs/design/part-negotiation.txt: Update the docs some more.
Original commit message from CVS:
* docs/design/part-negotiation.txt:
Update the docs some more.
* libs/gst/base/gsttypefindhelper.c: (helper_find_peek):
If we pull a buffer with non-trivial caps, suggest those caps with the
max probability.
2008-10-10 15:12:11 +00:00
Wim Taymans bfb7bace38 libs/gst/base/gsttypefindhelper.c: Increase code readability.
Original commit message from CVS:
* libs/gst/base/gsttypefindhelper.c: (helper_find_peek):
Increase code readability.
Don't try to compare buffer offsets when ther are invalid.
2008-06-20 11:24:03 +00:00
Sebastian Dröge 654ba215df libs/gst/base/gsttypefindhelper.c: Sort buffer cache list by end offsets. This makes sure that we don't stop to searc...
Original commit message from CVS:
* libs/gst/base/gsttypefindhelper.c: (helper_find_peek):
Sort buffer cache list by end offsets. This makes sure that we don't
stop to search for a cached buffer that contains the requested data
too early.
Also read a minimum of 4k bytes instead of 512 bytes as this is a bit
more efficient. Fixes bug #459862.
2008-05-16 21:09:45 +00:00
Stefan Kost 4331d3880e libs/gst/base/gsttypefindhelper.c: Speedup typefinding. This is work in progress (see #459862).
Original commit message from CVS:
* libs/gst/base/gsttypefindhelper.c:
Speedup typefinding. This is work in progress (see #459862).
2007-10-03 12:05:17 +00:00
Stefan Kost 308e3f4410 libs/gst/base/gsttypefindhelper.c: Cleanup the typefindhelper code and add private doc comments.
Original commit message from CVS:
* libs/gst/base/gsttypefindhelper.c: (helper_find_peek),
(helper_find_suggest), (helper_find_get_length),
(gst_type_find_helper_get_range), (buf_helper_find_suggest),
(gst_type_find_helper_for_buffer):
Cleanup the typefindhelper code and add private doc comments.
2007-07-24 13:38:21 +00:00
Tim-Philipp Müller 651061dfd9 libs/gst/base/gsttypefindhelper.c: Fix off-by-one bug that would only allow peeks of N-1 bytes from the start even if...
Original commit message from CVS:
* libs/gst/base/gsttypefindhelper.c: (buf_helper_find_peek):
Fix off-by-one bug that would only allow peeks of N-1 bytes
from the start even if the buffer to typefind on contains
in fact N bytes of data (makes vorbis typefinding from a
vorbis identification header buffer work).
* tests/check/Makefile.am:
* tests/check/libs/.cvsignore:
* tests/check/libs/typefindhelper.c: (GST_START_TEST),
(gst_typefindhelper_suite), (main), (foobar_typefind),
(plugin_init):
Add very basic unit test for gst_type_find_helper_for_buffer()
that checks for the problem fixed above.
2006-05-24 17:11:06 +00:00
James Andrewartha 5deab8d3c3 Make sure gstprivate.h and/or config.h are always included first, otherwise some of our defines (like _FILE_OFFSET_BI...
Original commit message from CVS:
Patch by: James Andrewartha <trs80 at tartarus uwa edu au>
* gst/gst.c:
* gst/gstbus.c:
* gst/gstclock.c:
* gst/gstevent.c:
* gst/gstformat.c:
* gst/gstmessage.c:
* gst/gstparse.c:
* gst/gstquery.c:
* gst/gstutils.c:
* gst/parse/Makefile.am:
* libs/gst/base/gstadapter.c:
* libs/gst/base/gstbasesrc.c:
* libs/gst/base/gstpushsrc.c:
* libs/gst/base/gsttypefindhelper.c:
* plugins/elements/gstfakesrc.c:
* plugins/elements/gstidentity.c:
Make sure gstprivate.h and/or config.h are
always included first, otherwise some of our
defines (like _FILE_OFFSET_BITS) might be
redefined in the system headers. Fixes build
on opensolaris (#340016).
2006-05-04 15:20:14 +00:00
Tim-Philipp Müller b53dc49d8d libs/gst/base/gsttypefindhelper.c: If we are provided with the size, we should implement
Original commit message from CVS:
* libs/gst/base/gsttypefindhelper.c: (helper_find_get_length),
(gst_type_find_helper_get_range):
If we are provided with the size, we should implement
GstTypeFind::get_length, so that typefind functions who
want to can actually peek at the middle of a file.
2006-03-09 10:46:35 +00:00
Tim-Philipp Müller eeec129c6f New API: gst_type_find_helper_get_range() (#333042).
Original commit message from CVS:
* docs/libs/gstreamer-libs-sections.txt:
* libs/gst/base/gsttypefindhelper.c: (helper_find_peek),
(helper_find_suggest), (gst_type_find_helper_get_range),
(gst_type_find_helper):
* libs/gst/base/gsttypefindhelper.h:
New API: gst_type_find_helper_get_range() (#333042).
2006-03-02 13:45:32 +00:00
Tim-Philipp Müller aad2aa1288 libs/gst/base/gsttypefindhelper.c: Try typefinding factories with the highest rank first.
Original commit message from CVS:
* libs/gst/base/gsttypefindhelper.c: (type_find_factory_rank_cmp),
(gst_type_find_helper):
Try typefinding factories with the highest rank first.
2006-02-27 19:45:31 +00:00
Tim-Philipp Müller cc13a984eb Add section for typefind helper and add documentation for the old and the new function.
Original commit message from CVS:
* docs/libs/gstreamer-libs-docs.sgml:
* docs/libs/gstreamer-libs-sections.txt:
* libs/gst/base/gsttypefindhelper.c:
Add section for typefind helper and add documentation
for the old and the new function.
2006-02-27 19:19:40 +00:00
Tim-Philipp Müller 991aa71ffb libs/gst/base/gsttypefindhelper.*: New API: gst_type_find_helper_for_buffer() (#332723).
Original commit message from CVS:
* libs/gst/base/gsttypefindhelper.c: (buf_helper_find_peek),
(buf_helper_find_suggest), (type_find_factory_rank_cmp),
(gst_type_find_helper_for_buffer):
* libs/gst/base/gsttypefindhelper.h:
New API: gst_type_find_helper_for_buffer() (#332723).
2006-02-27 18:43:26 +00:00
Michael Smith 83a815e648 gst/gsttypefindfactory.c: Don't unref factories after calling them.
Original commit message from CVS:
* gst/gsttypefindfactory.c: (gst_type_find_factory_call_function):
Don't unref factories after calling them.
* libs/gst/base/gsttypefindhelper.c: (gst_type_find_helper):
* plugins/elements/gsttypefindelement.c:
(gst_type_find_element_chain):
Free lists of factories after using them. Fixing typefinding memory
leaks.
2005-12-12 19:09:49 +00:00
Edward Hervey 04b5f119c6 gst/:
Original commit message from CVS:
* gst/base/gsttypefindhelper.c:
* gst/gsttypefind.c:
* gst/gsttypefind.h:
2005-11-09 16:44:40 +00:00
Thomas Vander Stichele 2dd1598c56 whitespace fixes
Original commit message from CVS:
whitespace fixes
2005-10-15 15:30:24 +00:00
Tim-Philipp Müller b846fed997 gst/base/gsttypefindhelper.c: Check whether we have the requested data already in our list of cached buffers before p...
Original commit message from CVS:
* gst/base/gsttypefindhelper.c: (helper_find_peek),
(gst_type_find_helper):
Check whether we have the requested data already in our list of
cached buffers before pulling a new buffer; also make the buffer
list a GSList. Speeds up typefinding by ca. 5-10% altogether.
2005-10-10 10:43:15 +00:00
Tim-Philipp Müller 2b41c044a2 gst/base/gsttypefindhelper.c: Fix evil typefind crasher: getrange() might return a short buffer at the end of a file,...
Original commit message from CVS:
* gst/base/gsttypefindhelper.c: (helper_find_peek):
Fix evil typefind crasher: getrange() might return a short
buffer at the end of a file, but gst_type_find_peek() must
either return the full data as requested or NULL, but
never a short buffer.
2005-10-09 17:59:08 +00:00
Jan Schmidt 84b76a4359 check/Makefile.am: Use CHECK_CFLAGS and CHECK_LIBS
Original commit message from CVS:
* check/Makefile.am:
Use CHECK_CFLAGS and CHECK_LIBS
* check/gst/gstevent.c: (event_probe), (test_event),
(GST_START_TEST):
Don't leak events.
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_start), (gst_base_src_stop),
(gst_base_src_activate_push), (gst_base_src_activate_pull),
(gst_base_src_change_state):
Sprinkle gst_base_src_stop liberally around error paths to fix
problems reusing a source after failed state changes.
* gst/base/gsttypefindhelper.c: (helper_find_peek),
(helper_find_suggest), (gst_type_find_helper):
Extra debug output. Don't segfault on GST_PAD_GETRANGEFUNC = NULL
* gst/gstevent.h:
* docs/gst/tmpl/gstevent.sgml:
Migrate part of the docs from the SGML file. Wait for ensonic to
tell me how I did it wrong ;)
* tools/gst-typefind.c: (main):
Extra robustness to state changes between files.
2005-08-21 10:54:47 +00:00
Tim-Philipp Müller ba8a8319fd gst/base/gsttypefindhelper.c: The memory returned by gst_type_find_peek() needs to stay valid until the end of a type...
Original commit message from CVS:
* gst/base/gsttypefindhelper.c: (helper_find_peek),
(gst_type_find_helper):
The memory returned by gst_type_find_peek() needs to
stay valid until the end of a typefind function, and
typefind functions may keep results from different
offsets around, so we can't just unref the buffer from
the previous _peek(), but have to save all buffers
returned by _peek() until typefinding is done and only
free them then.
2005-08-10 15:08:03 +00:00
Andy Wingo f2cf753b17 gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer.
Original commit message from CVS:
2005-06-27  Andy Wingo  <wingo@pobox.com>

* gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any
remaining buffer.

* gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper,
returns a sorted copy of the trace list.
(gst_alloc_trace_print_live): New API, only prints traces with
live objects. Sort the list.
(gst_alloc_trace_print_all): Sort the list.
(gst_alloc_trace_print): Align columns.

* gst/elements/gstttypefindelement.c:
* gst/elements/gsttee.c:
* gst/base/gstbasesrc.c:
* gst/base/gstbasesink.c:
* gst/base/gstbasetransform.c:
* gst/gstqueue.c: Adapt for pad activation changes.

* gst/gstpipeline.c (gst_pipeline_init): Unref after parenting
sched.
(gst_pipeline_dispose): Drop ref on sched.

* gst/gstpad.c (gst_pad_init): Set the default activate func.
(gst_pad_activate_default): Push mode by default.
(pre_activate_switch, post_activate_switch): New stubs, things to
do before and after switching activation modes on pads.
(gst_pad_set_active): Take a boolean and not a mode, dispatch to
the pad's activate function to choose which mode to activate.
Shortcut on deactivation and call the right function directly.
(gst_pad_activate_pull): New API, (de)activates a pad in pull
mode.
(gst_pad_activate_push): New API, same for push mode.
(gst_pad_set_activate_function)
(gst_pad_set_activatepull_function)
(gst_pad_set_activatepush_function): Setters for new API.

* gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free):
Trace all miniobjects.
(gst_mini_object_make_writable): Unref the arg if we copy, like
gst_caps_make_writable.

* gst/gstmessage.c (_gst_message_initialize): No trace init.

* gst/gstghostpad.c (gst_proxy_pad_do_activate)
(gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush):
Adapt for new pad API.

* gst/gstevent.c (_gst_event_initialize): Don't initialize trace.

* gst/gstelement.h:
* gst/gstelement.c (gst_element_iterate_src_pads)
(gst_element_iterate_sink_pads): New API functions.

* gst/gstelement.c (iterator_fold_with_resync): New utility,
should fold into gstiterator.c in some form.
(gst_element_pads_activate): Simplified via use of fold and
delegation of decisions to gstpad->activate.

* gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL,
help in debugging.

* gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type
class once in init, like gstmessage. Didn't run into this issue
but it seems correct. Don't initialize a trace, gstminiobject does
that.

* check/pipelines/simple_launch_lines.c (test_stop_from_app): New
test, runs fakesrc ! fakesink, stopping on ::handoff via a message
to the bus.
(assert_live_count): New util function, uses alloc traces to check
cleanup.

* check/gst/gstghostpad.c (test_ghost_pads): More refcount checks.
To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
Andy Wingo 4b908e33e0 gst/gstutils.c: RPAD fixes all around.
Original commit message from CVS:
2005-06-08  Andy Wingo  <wingo@pobox.com>

* gst/gstutils.c: RPAD fixes all around.
(gst_element_link_pads): Refcounting fixes.

* tools/gst-inspect.c:
* tools/gst-xmlinspect.c:
* parse/grammar.y:
* gst/base/gsttypefindhelper.c:
* gst/base/gstbasesink.c:
* gst/gstqueue.c: RPAD fixes.

* gst/gstghostpad.h:
* gst/gstghostpad.c: New ghost pad implementation as full proxy
pads. The tricky thing is they provide both source and sink
interfaces, since they proxy the internal pad for the external
pad, and vice versa. Implement with lower-level ProxyPad objects,
with the interior proxy pad as a child of the exterior ghost pad.
Should write a doc on this.

* gst/gstpad.h: s/RPAD/PAD/, s/RealPad/Pad/.
(gst_pad_set_name, gst_pad_set_parent): Macros removed, use
gst_object API.

* gst/gstpad.c: Big changes. No more stub base GstPad, now all
pads are real pads. No ghost pads in this file. Not documenting
the myriad s/RPAD/PAD/ and REALIZE fixes.
(gst_pad_class_init): Add properties for "direction" and
"template". Both are construct-only, so they can't change during
the life of the pad. Fixes properly deriving from GstPad.
(gst_pad_custom_new, gst_pad_custom_new_from_template): Gone. For
derived objects, just set properties when creating the objects via
g_object_new.
(gst_pad_get_parent): Implement as a function, return NULL if the
parent is not an element.
(gst_pad_get_real_parent, gst_pad_add_ghost_pad)
(gst_pad_remove_ghost_pad, gst_pad_realize): Removed.

* gst/gstobject.c (gst_object_class_init): Make name a construct
property. Don't set it in the object init.

* gst/gstelement.c (gst_element_add_pad): Don't allow adding pads
with UNKNOWN direction.
(gst_element_add_ghost_pad): Remove non-orthogonal API. Replace
with gst_element_add_pad (e, gst_ghost_pad_new (name, pad)).
(gst_element_remove_pad): Remove ghost-pad special cases.
(gst_element_pads_activate): Remove rpad cruft.

* gst/gstbin.c (gst_bin_change_state): Use gst_pad_get_parent to
catch the pad's-parent-not-an-element case.

* gst/gst.h: Include gstghostpad.h.

* gst/gst.c (init_post): No more real, ghost pads.

* gst/Makefile.am: Add gstghostpad.[ch].

* check/Makefile.am:
* check/gst/gstbin.c:
* check/gst/gstghostpad.c (test_ghost_pads): Check that linking
into a bin creates ghost pads, and that the refcounts are right.
Partly moved from gstbin.c.
2005-06-08 22:16:27 +00:00
Ronald S. Bultje 5b9c84091d gst/: Handle negative offsets better. Fixes decodebin.
Original commit message from CVS:
* gst/base/gsttypefindhelper.c: (helper_find_peek):
* gst/elements/gsttypefindelement.c: (find_peek):
Handle negative offsets better. Fixes decodebin.
2005-05-09 15:54:26 +00:00
Wim Taymans ee13415b38 gst/: Make gst_caps_replace() work like other _replace() functions.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_basesink_base_init),
(gst_basesink_pad_getcaps), (gst_basesink_init),
(gst_basesink_chain_unlocked):
* gst/base/gsttypefindhelper.c: (helper_find_suggest),
(gst_type_find_helper):
* gst/elements/gsttypefindelement.c:
(gst_type_find_element_have_type), (gst_type_find_element_init),
(stop_typefinding), (gst_type_find_element_handle_event),
(find_suggest), (gst_type_find_element_chain),
(gst_type_find_element_checkgetrange),
(gst_type_find_element_getrange), (do_typefind),
(gst_type_find_element_activate):
* gst/gstbuffer.c: (_gst_buffer_sub_free),
(gst_buffer_default_free), (gst_buffer_default_copy),
(gst_buffer_set_caps):
* gst/gstcaps.c: (gst_caps_ref), (gst_caps_unref),
(gst_caps_replace):
* gst/gstmessage.c: (gst_message_new),
(gst_message_new_state_changed):
* gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active),
(gst_pad_set_checkgetrange_function),
(gst_pad_link_prepare_filtered), (gst_pad_relink_filtered),
(gst_pad_set_caps), (gst_pad_check_pull_range),
(gst_pad_pull_range), (gst_static_pad_template_get_caps):
* gst/gstpad.h:
* gst/gsttypefind.c: (gst_type_find_register):
Make gst_caps_replace() work like other _replace() functions.
Use _caps_replace() where possible.
Make sure _message_new() initialises its field.
Add gst_static_pad_template_get_caps()
2005-04-20 09:10:42 +00:00