GStreamer Application Development Manual (0.8.1) | ||
---|---|---|
<<< Previous | Autoplugging | Next >>> |
GstAutoplugCache
element
The GstAutoplugCache
element is used to cache the
media stream when performing typedetection. As we have seen in
the chapter called Type Detection, the typefind function consumes a
buffer to determine its media type. After we have set up the pipeline
to play the media stream we should be able to 'replay' the previous buffer(s).
This is what the autoplugcache is used for.
The basic usage pattern for the autoplugcache in combination with the typefind element is like this:
Add the autoplugcache element to a bin and link the sink pad to the source pad of an element with unknown caps.
Link the source pad of the autoplugcache to the sink pad of the typefind element.
Iterate the pipeline until the typefind element has found a type.
Remove the typefind element and add the plugins needed to play back the discovered media type to the autoplugcache source pad.
Reset the cache to start playback of the cached data. Connect to the "cache_empty" signal.
In the cache_empty signal callback function, remove the autoplugcache and relink the pads.
In the next chapter we will create a new version of our helloworld example using the autoplugger, the autoplugcache and the typefind element.
<<< Previous | Home | Next >>> |
Autoplugging | Up | Another approach to autoplugging |