GStreamer-0.10 变成了 GstAdapter
In the above example, you'll notice how bytestream handles buffering of data for you. The result is that you can handle the same data multiple times. Event handling in bytestream is currently sort of wacky, but it works quite well. The one big disadvantage of bytestream is that it requires the element to be loop-based. Long-term, we hope to have a chain-based usable version of bytestream, too.
This class is for elements that receive buffers in an undesired size. While for example raw video contains one image per buffer, the same is not true for a lot of other formats, especially those that come directly from a file. So if you have undefined buffer sizes and require a specific size, this object is for you.
An adapter is created with gst_adapter_new(). It can be freed again with g_object_unref().
The theory of operation is like this: All buffers received are put into the adapter using gst_adapter_push() and the data is then read back in chunks of the desired size using gst_adapter_peek(). After the data is processed, it is freed using gst_adapter_flush().
For example, a sink pad's chain function that needs to pass data to a library in 512-byte chunks could be implemented like this:
觉得 Gstreamer 的文档写得真不错，连我都能看懂 :D 并且，重构也是出神入化的。