Commit graph

4859 commits

Author SHA1 Message Date
Wim Taymans b2486d65c6 gst/playback/gstqueue2.c: Tweak the buffering thresholds a little.
Original commit message from CVS:
* gst/playback/gstqueue2.c: (update_rates):
Tweak the buffering thresholds a little.
Update the buffer size with the previously calculate rate instead of
only when we calculate a new rate so that we get smoother buffering
updates.
* gst/playback/Makefile.am:
* gst/playback/gsturidecodebin.c: (gst_uri_decode_bin_base_init),
(gst_uri_decode_bin_class_init), (gst_uri_decode_bin_init),
(gst_uri_decode_bin_finalize), (gst_uri_decode_bin_set_property),
(gst_uri_decode_bin_get_property), (unknown_type),
(add_element_stream), (no_more_pads_full), (no_more_pads),
(source_no_more_pads), (new_decoded_pad), (array_has_value),
(gen_source_element), (has_all_raw_caps), (analyse_source),
(remove_decoders), (make_decoder), (remove_source),
(source_new_pad), (setup_source), (decoder_query_init),
(decoder_query_duration_fold), (decoder_query_duration_done),
(decoder_query_position_fold), (decoder_query_position_done),
(decoder_query_latency_fold), (decoder_query_latency_done),
(decoder_query_seeking_fold), (decoder_query_seeking_done),
(decoder_query_generic_fold), (gst_uri_decode_bin_query),
(gst_uri_decode_bin_change_state), (plugin_init):
New element that intergrates a source, optional buffering element and
decodebin.
2009-10-29 11:17:12 +01:00
Wim Taymans aa02328e2b gst/playback/gstqueue2.c: fix build.
Original commit message from CVS:
* gst/playback/gstqueue2.c: (gst_queue_get_type),
(gst_queue_class_init), (gst_queue_finalize), (update_time_level),
(apply_segment), (apply_buffer), (update_buffering),
(reset_rate_timer), (update_rates), (gst_queue_locked_flush),
(gst_queue_locked_enqueue), (gst_queue_locked_dequeue),
(gst_queue_handle_sink_event), (gst_queue_is_filled),
(gst_queue_chain), (gst_queue_push_one), (gst_queue_loop),
(plugin_init):
fix build.
2009-10-29 11:17:11 +01:00
Wim Taymans fa611dcc9d gst/playback/: On our way to playbin2 this is the new network queue that does buffering all by itself using high and ...
Original commit message from CVS:
* gst/playback/Makefile.am:
* gst/playback/gstqueue2.c: (gst_queue_get_type),
(gst_queue_class_init), (gst_queue_init), (gst_queue_finalize),
(gst_queue_getcaps), (gst_queue_bufferalloc),
(gst_queue_acceptcaps), (update_time_level), (apply_segment),
(apply_buffer), (update_buffering), (reset_rate_timer),
(update_rates), (gst_queue_locked_flush),
(gst_queue_locked_enqueue), (gst_queue_locked_dequeue),
(gst_queue_handle_sink_event), (gst_queue_is_empty),
(gst_queue_is_filled), (gst_queue_chain), (gst_queue_push_one),
(gst_queue_loop), (gst_queue_handle_src_event),
(gst_queue_handle_src_query), (gst_queue_sink_activate_push),
(gst_queue_src_activate_push), (gst_queue_change_state),
(gst_queue_set_property), (gst_queue_get_property), (plugin_init):
On our way to playbin2 this is the new network queue that does buffering
all by itself using high and low watermarks. It can also measure up and
downstream bandwidth to optimally size the queue.
2009-10-29 11:17:11 +01:00
David Schleef 62e236394a parse: Fix memleak of unused delayed links
Attach the DelayedLink structure to the element, so that when
the element is disposed, the DelayedLink is freed.
2009-10-28 22:05:06 -07:00
Rob Clark 746284f807 pad: make _fixate_caps() also truncate when needed
The default gst_pad_fixate_caps() previously would only fixate each individual
struct. In case there are multiple structs, the resulting caps would still not
be fixed. In the spirit of how individual structs are fixated, this patch
changes gst_pad_fixate_caps() to remove all but the first struct.

Fixes #595886
2009-10-28 16:36:13 +01:00
Wim Taymans f5df3dea7d info: fix docs 2009-10-28 16:36:13 +01:00
Edward Hervey 27284628e4 optimisation : Use g_object_newv where possible.
This avoids:
* triple-checking for the GType when type-checking is enabled (see #597260)
* Avoids going through an expensive no-argument checking which landed in
  glib-2.22
* Avoids going through 2 extrac functions (g_object_new -> g_object_new_valist)
2009-10-28 09:31:17 +01:00
Stefan Kost cfebdcd452 annotations: add annotations to gst_init_check too 2009-10-28 10:14:36 +02:00
Stefan Kost b66a4dbd42 docs: tell more about what happens in gst_init.
Add links to gst_update_registry and the env-vars.
2009-10-28 09:58:52 +02:00
Stefan Kost 369a63b11c docs: remove reference to OGI and rephrase sections docs
The OGI links are dead, so remove them. Also remove the paragraph that pointed
to OGI and DS. Only mentioning DS there made it a but pointless. Add a generic
paragraph instead that tells a bit about the usecases gstreamer covers.
2009-10-28 09:38:45 +02:00
Tim-Philipp Müller daecaf0e8a Remove GST_DEBUG_FUNCPTR where they're pointless
There's not much point in using GST_DEBUG_FUNCPTR with GObject
virtual functions such as get_property, set_propery, finalize and
dispose, since they'll never be used by anyone anyway. Saves a
few bytes and possibly a tenth of a polar bear.
2009-10-28 00:44:24 +00:00
Stefan Kost b83fb45fac debugutils: allow to hide/show pad status with graphdetails flag 2009-10-27 12:06:35 +02:00
Sebastian Dröge b04f7489bf registry: private is a C++ keyword, don't use it
...otherwise C++ compilers will complain when including gstregistry.h
2009-10-24 11:58:25 +02:00
Tim-Philipp Müller 4a9e983f4a docs: add Since tag to docs for new API
And tell gtk-doc that GstRegistryPrivate is private.
2009-10-24 10:31:08 +01: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 c79ed99bab registry: Cache element and typefind factories. Fixes 598896
This avoids unneeded list/filtering if the registry hasn't changed
2009-10-24 10:44:04 +02:00
Edward Hervey ebee258806 gstpluginfeature: API : new gst_plugin_feature_list_copy() method
This allows copying AND incrementing the refcount at the same time,
avoiding a double iteratio of the GList
2009-10-24 10:39:30 +02:00
Edward Hervey 9e792ee5b8 gstregistry: Add a cookie for detecting feature list changes
We also create a private structure, since we will need to add more
data there in following patches.
2009-10-24 10:39:13 +02:00
Wim Taymans db79dd88c3 message: don't use typechecking cast macros
Simply use casting macros for accessing the message fields like we do for
buffers and events. Avoids some costly typechecking that does not really buy us
much.
2009-10-23 13:40:32 -04:00
Wim Taymans c9a7e2d188 Revert "gstmessage: Avoid expensive src/type/timestamp fetch."
This reverts commit 61cf93a334.
2009-10-23 13:13:52 -04:00
Edward Hervey 61cf93a334 gstmessage: Avoid expensive src/type/timestamp fetch.
If we've already checked that we have a valid message, use the entries
directly.
2009-10-23 18:21:47 +02:00
Edward Hervey e5a13bd3fc gstcaps: Use inlined version of _is_any()/_is_empty()
CAPS_IS_ANY and CAPS_IS_EMPTY are the equivalent of their gst_caps_*
counterpart except that they avoid the typechecking and are inlined.

CAPS_IS_EMPTY_SIMPLE only checks for empty caps (without checking if
the caps is ANY).
2009-10-23 17:47:43 +02:00
Jan Schmidt dc2c4de73a gstpipeline: Simplify base time checking slightly
Simplify checking and distribution of the base time - don't re-check
the value of a local variable that was set 3 lines earlier.
2009-10-22 12:54:17 +01:00
Edward Hervey 517ab2860e gsturi: Optimisation: Avoid type-checking in sorting method.
We already know the list only contains plugin features
2009-10-22 13:16:07 +02:00
Edward Hervey a9ed7c0ec4 gsturi: Optimisation : Cast when we're sure of the type.
Also directly access GstElementFactory->uri_type instead of going
through a function that will (once again) check whether it's a
GstElementFactory
2009-10-22 13:13:56 +02:00
Edward Hervey 4b13520b61 gstregistry: Use hash table when finding a feature. Fixes #598895 2009-10-22 11:13:47 +02:00
Wim Taymans 368b7899c0 registry: hash the plugin basename
Maintain a hashtable of the plugin basename. We can then use this
hashtable to speedup the search for an existing plugin and avoid
a whole lot of strcmp calls.
2009-10-20 23:28:54 -04:00
Wim Taymans 5de94ede2f registry: speed up _strlen
Make the _strlen function a little tighter
2009-10-20 23:27:41 -04:00
Wim Taymans 50b9a3ecc3 registry: name is never NULL
When looking up a feature by name, we never call this internal
function with NULL so we don't have to check for it.
2009-10-20 21:43:58 -04:00
Wim Taymans d722d16155 registry: refactor plugin lookup
We keep lookup plugins by their basename. Avoid creating a basename
from a filename if we can.
2009-10-20 21:39:11 -04:00
Wim Taymans 1be3d5cd83 registry: do quick check for . files
Do a quick check for . files before calling the strcmp functions
2009-10-20 21:15:56 -04:00
Benjamin Otte 868711fc70 docs: Fix docs for gst_caps_set_simple() 2009-10-20 10:51:25 +01:00
Jan Schmidt 08c56edb84 docs: Modify docs string slightly.
Apparently starting the last line of a docs string with 'returns' both
confuses and enrages gtk-doc. Use a slightly different wording instead.
2009-10-19 13:02:30 +01:00
Jan Schmidt de199b4d8d pluginloader: When a plugin is blacklisted, output a GST_ERROR line. 2009-10-19 12:30:07 +01:00
Peter Kjellerstedt 485ae69c9e trace: Do not poison gst_trace_add_entry()
Since gst_trace_add_entry() is a macro, gcc will barf when it is
defined in case it has been poisoned due to trace support being
disabled.
2009-10-19 10:53:00 +02:00
Wim Taymans 7d86ad93a2 caps: fix typo in docs 2009-10-16 12:39:54 +02:00
Benjamin Otte 0ff4086507 Improve caps setters API
This patch adds gst_caps_set_value() and allows gst_caps_set_simple() to
work on non-simple caps. See the API documentation for the functions
about what they do.

The intention of these changes is to ease working with caps in caps
transform functions. An example for this would be ffmpegcolorspace,
where the caps transform function could be changed to look roughly like
this (pseudocode ahead):
  result = gst_caps_copy (template_caps);
  value = gst_structure_get_value (gst_caps_get_structure (caps, 0),
    "widh");
  gst_caps_set_value (result, value);
  /* same for height, framerate and par */
  return caps;
which is much cleaner and easier to understand than the current code.

https://bugzilla.gnome.org/show_bug.cgi?id=597690
2009-10-15 19:10:50 +02:00
Stefan Kost bad284be7a docs: clarify preset api docs 2009-10-15 12:16:05 +03:00
Peter Kjellerstedt 1314aa75d5 iterator: Fix a documentation typo 2009-10-14 10:16:31 +02:00
Sebastian Dröge b8454d623d gstobject: Replace recursive gst_object_has_ancestor() with an iterative version
This is slightly more efficient because the compiler can't do tail
recursion here and has to keep all stack frames.

Not that efficiency is that important here but I already had
the iterative version somewhere else and both are easy to read.
2009-10-14 08:34:03 +02:00
Jan Schmidt 36ccb66fb5 debug: Mark the GST_POLL symbol as extern to avoid multiply-defined error 2009-10-12 14:57:35 +01:00
Jan Schmidt 2ddf028503 gstpoll: Make the new GST_POLL debug completely private
Make the GST_POLL debug category symbol private to libgstreamer, as
there should be no external users of it.
2009-10-12 14:24:53 +01:00
Edward Hervey 7f68d7a6f8 gstpluginloader: Don't wait forever on gst_poll_wait.
This allows the macosx versions to properly error out when fds are closed.

This is only a temporary fix until the pluginloader is switched to not
use GstPoll but GIOChannels.
2009-10-12 12:21:49 +02:00
Edward Hervey edce400c79 gstpoll: Only take into account active fds
This is needed so that select properly errors out on macosx (sigh)
2009-10-12 12:01:59 +02:00
Edward Hervey dc3fb58a90 gstpoll: Add some debugging statements 2009-10-12 10:07:03 +02:00
Edward Hervey 3254f19c6f gstpoll: Use the error fdset when using select/pselect.
This is needed to properly detect fds that are closed or that got
an error
2009-10-12 10:01:01 +02:00
Edward Hervey 95413683fa gstpoll: Don't use poll on systems with broken poll 2009-10-12 09:53:58 +02:00
Edward Hervey 0fc16a8e74 gst: Add debugging category GST_POLL for gstpoll 2009-10-12 09:50:00 +02:00
Jan Schmidt e3ce7d3e35 pluginloader: Fix valgrind warnings by zeroing padding bytes. 2009-10-08 23:10:40 +01:00
Jan Schmidt 09ae85670c registrychunks: Fix a debug format string harder to satisfy OS/X's gcc. 2009-10-08 16:21:45 +01:00
Jan Schmidt a58702de89 registrychunks: Fix format string for debug error message. 2009-10-08 16:05:08 +01:00
Jan Schmidt 63934021ab pluginloader: Move stdin and stdout out of harm's way
In the plugin loader subprocess, move stdin and stdout to new fd's
so that plugins printing things during plugin init or (*gasp*)
possibly reading from stdin don't interfere with the data sent to
and from the parent.
2009-10-08 15:21:48 +01:00
Jan Schmidt f514ef0efc registry: Fix error handling in the registry loader
When the plugin-scanner load fails (because the helper can't be
spawned), make sure to load the plugin that failed in-process, so
that all plugins do get loaded.
2009-10-08 10:36:56 +01:00
Tim-Philipp Müller 8b8d8bb112 gstinfo: add back fix that shouldn't have been reverted 2009-10-08 09:36:38 +01:00
Edward Hervey 015c5dda8f gstobject: Remove dead assignment.
object is no longer used after that line
2009-10-08 08:53:26 +02:00
Edward Hervey 219c3c5236 gstindex: Make sure writer is non-NULL.
Fixes the NULL dereference a few lines lower (where it gets the object type).
2009-10-08 08:52:18 +02:00
Jan Schmidt 69bce376b0 plugin: Ignore an empty dependency list.
If a plugin registers an empty dependency set, just ignore it rather
than serialising and checking an empty set.
2009-10-08 02:06:34 +01:00
Jan Schmidt 83252f42c9 registrychunks: Fix off-by-one error. Improve debug.
Fix an off-by-one error in the size guard for unpack_element, and
improve various debug statements in the failure paths.

Also, swap some g_new0 to g_malloc0 for the fun of it.
2009-10-08 02:06:33 +01:00
Tim-Philipp Müller 07d953b791 docs: fix Since: tags in docs for newly-added API 2009-10-07 23:34:44 +01:00
Stefan Kost cb7a8e8b61 info: revert two of the changes
It only needed for the non constant string.
2009-10-08 00:08:47 +03:00
Stefan Kost 084bbe3921 info: use a "%s" format string when printing the memory dump line
We know that the content is save, but the compiler does not.
2009-10-07 23:36:45 +03:00
Rob Clark e025e328fd parse: don't format the string twice
We were formatting the string once and then passing the string as a format
string to the log functions.
2009-10-07 23:23:08 +03:00
Stefan Kost fcc5d783df pad: add variants of gst_pad_get_caps() that don't copy caps. Fixes #590941
In most places in core and baseclasses we just need the caps to do caps-
intersections. In that case ref'ed caps are enough (no need to copy).
This patch also switches the code to use the new functions.
API: gst_pad_get_caps_refed(), gst_pad_peer_get_caps_refed()
2009-10-07 22:41:30 +03:00
Michael Smith 8fd0f64951 elementfactory: fix spelling in comment 2009-10-07 10:37:39 -07:00
Tim-Philipp Müller 53c9c9d975 registry: improve plugin loader failure message for uninstalled setups
Everyone running an uninstalled git setup is going to wonder about
this failure next time they update, so let's mention the solution
in the error message.
2009-10-07 14:39:03 +01:00
Wim Taymans b5adcf13a0 message: whitespace fixes 2009-10-07 10:38:11 +02:00
Stefan Kost 201cbbdce0 pad: flip the G_UNLIKELY
Its likely that we have caps and unlikely (error) otherwise.
2009-10-07 11:12:57 +03:00
Stefan Kost cfb4aa4627 build: sprintf, sscanf need stdio.h 2009-10-07 10:59:54 +03:00
Stefan Kost 09c7d34921 childproxy: initialize gvalue in _valist function. Fixes #595602
Reflow the code to move error handling to the end of the functions. Initialize
gvalue like we do in the setter. Add a unit-test module with two simple tests
the catche this bug.
2009-10-07 10:59:54 +03:00
Stefan Kost 82526701f0 pad: don't intersect with any in proxy_pad_get_caps
We initialize the caps with any and if a pad has NULL caps, just skip it instead
of intersecting with any. Also add branch prediction here.
2009-10-07 10:59:54 +03:00
Stefan Kost b1f88b3f1f docs: rename aggregator to adder in the docs. 2009-10-07 10:59:54 +03:00
Johan Bilien 920e9b569d introspection: Add annotations for gst_element_query_{duration,position}
Fixes bug #595511.
2009-10-07 07:18:04 +02:00
Wim Taymans 3ac4a08383 ghostpad: take locks around smaller section
We don't need the hold the proxy mutex locked for getting the internal pad and
for linking the new target pad when we retarget. So take the lock a little later
and release it earlier.

Fixes #596366
2009-10-06 22:40:17 +02:00
Tim-Philipp Müller 3c6db4ed95 gst: remove more unnecessary cast when using g_signal_*() 2009-10-06 20:04:10 +01:00
Jan Schmidt 8108494a38 pluginloader: Add a magic number and maximum size limit.
Guard against a hostile child process that sends bogus data
due to memory corruption by adding a magic number to each packet,
and limit the maximum size of any message to 32MB
2009-10-06 19:51:45 +01:00
Jan Schmidt 97d6c854ae registry: Also check the binary registry chunk version of the child.
When trying to find a function plugin-scanner, include a check on the
version of the binary registry chunks it sends, to make sure it's
what we understand.
2009-10-06 19:51:45 +01:00
Jan Schmidt 8bf3d8cec2 registry: Support installed/uninstalled plugin-scanner helper
Add a simple version check when starting the plugin-scanner so we can
verify we're talking to one that talks the same language.
First try a plugin-scanner in the installed path, then try one via the
GST_PLUGIN_SCANNER env var if that doesn't work.
Update the uninstalled script.
Install the plugin-scanner to the libexec dir
2009-10-06 19:51:44 +01:00
Jan Schmidt 6eee943b36 Remove checking for and mentions of fork where possible.
We no longer use fork() directly, instead using glib's spawn
functionality, so don't check for it, and don't use it in the
documentation notes.
2009-10-06 19:51:44 +01:00
Jan Schmidt 82aeddbc61 Only load the registry cache once per process.
When updating the registry, we don't need to re-read the registry cache
and waste time replacing all our existing, hopefully identical, plugins
and features that we're about to re-scan anyway.
2009-10-06 19:51:43 +01:00
Jan Schmidt c7922fb838 Add some more debug the registry.
Add the full set of debug about why it's decided that a given plugin is
stale or not, and include the plugin name when finalizing it.
2009-10-06 19:51:43 +01:00
Jan Schmidt ef32c11e6e Add restarting of the plugin loader and blacklisting of broken files 2009-10-06 19:51:42 +01:00
Jan Schmidt 38083fb0c8 Plugin loader phase 2
phase 2 - make the plugin loader receive the list of plugins to load and
send back the results asynchronously, so we don't context switch back
and forth so much.
2009-10-06 19:51:42 +01:00
Jan Schmidt 51675e0c2a registry: Add registry helper phase 1
Phase 1 of adding the registry scan helper
2009-10-06 19:51:42 +01:00
Jan Schmidt 1f4e477033 registry: Rearrange some things.
Prepare to land the external plugin helper process
2009-10-06 19:51:41 +01:00
Stefan Kost 4d472935a6 docs: GST_MESSAGE_STREAM_STATUS is implemented nowadays.
Docs were still mention it as "not yet implemented".
2009-09-14 14:09:07 +03:00
Sebastian Dröge 1c253a01a4 introspection: Don't typedef GstTagList to GstStructure for gobject-introspection 2009-09-12 14:35:08 +02:00
Jan Schmidt fb1e9408b2 Don't use C++ style comments 2009-09-11 22:42:51 +01:00
Jan Schmidt 5128a1980b message: Disable restriction that structure changes are sink pads
The structure_change message was originally emitted on source pads and
then recently changed to be sink pads. This causes a failure in the
gst-python testsuite. Disable the restriction so that the published
behaviour is still allowed.
2009-09-11 22:22:34 +01:00
Stefan Kost 1949360f9b binaryregistry: don't crash in cleaning up on error.
Don't dereference NULL pointers.
2009-09-11 21:20:57 +03:00
David Schleef 61203b825f debug: use dummy code to avoid spurious semicolons
Fixes bug #589173.
2009-09-11 07:40:30 +02:00
Wim Taymans d1032a2835 whitespace fixes 2009-09-10 11:54:01 +02:00
Wim Taymans 06e27c5209 pluginfeature: improve version check
Also parse the nano of the version and assume that X.Y.Z-1.1 >= X.Y.Z
With this change we can also check development versions against the version of
the upcomming release.
2009-09-10 11:54:01 +02:00
Sebastian Dröge a4d38192f1 taglist: Add FIXME for 0.11 to not typedef GstTagList to be a GstStructure
See bug #518934.
2009-09-10 10:07:24 +02:00
David Schleef e810dc0bca Fix typo in inline documentation 2009-09-09 16:29:47 -07:00
Sebastian Dröge c4f76d5d22 utils: Add a comment to the scaling functions to explain why the rounding is correct 2009-09-09 18:38:29 +02:00
Wim Taymans 6a872b0b14 ghostpad: don't unref NULL caps
Caps can be NULL so don't call unref on it unconditionally, instead use an
existing exit pad for the function.
2009-09-09 16:45:17 +02:00
Sebastian Dröge 8d1aeeb2af utils: Use gcc's __uint128_t for 64bit unsigned integer scaling
This is available in newer gcc releases and it should only exist
on platforms that provide some native 128bit integer arithmetic
instructions.

The x86-64 assembly for this is still kept for non-gcc compilers
that don't provide __uint128_t magic.
2009-09-09 14:59:39 +02:00
Benjamin Otte fceba1d6fe docs: Fix typo in gst_value_union() 2009-09-07 16:16:19 +02:00
Sebastian Dröge 6bbb833409 introspection: Fix for out-of-tree builds 2009-09-05 12:22:37 +02:00
Sebastian Dröge 0bb8634b37 gstbase: Add gobject-introspection support 2009-09-05 10:28:46 +02:00