GNOME Bugzilla – Bug 566881
[GstIndex] support/caching in GstBin
Last modified: 2009-08-28 16:43:01 UTC
Currently GstBin implements index support in a very 'simple' way, i.e. it just forwards _set_index()/_get_index() on its *current* children. What it should ideally do is the following: * When _set_index() is called: * cache internally (with refcount) the new index * call _set_index on all current children (current behaviour) * When a new child is added to a bin: * call _set_index on the new child with the currently cached index * When _get_index() is called: * If we have a cached index, return that one * If not, call _get_index() on each child until we get one and return that one.
One use-case this is meant to solve is the following (from an application point of view): Create playbin Set an index on it Set a URI Set it to PLAYING ==> All elements added use the index given at creation and the application can have an aggregated view of all index entries.
* When _get_index() is called: * If we have a cached index, return that one * if not, return NULL We don't want to retrieve indexes from elements, only supply them
This should work. commit d4012be4698e5aa4dc24d14c7fc95f0af0ee0d54 Author: Wim Taymans <wim.taymans@collabora.co.uk> Date: Fri Aug 28 18:37:44 2009 +0200 bin: cache index Cache the last index that was set with _set_index() and return this in the _get_index() call. Set the cached index on newly added elements. Fixes #566881