mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 23:06:49 +00:00
adapter: fix docs for 1.0
Add parent to chain function signature and use it.
This commit is contained in:
parent
c33be7ec77
commit
89d6ac116c
1 changed files with 4 additions and 5 deletions
|
@ -45,18 +45,19 @@
|
||||||
* in 512-byte chunks could be implemented like this:
|
* in 512-byte chunks could be implemented like this:
|
||||||
* |[
|
* |[
|
||||||
* static GstFlowReturn
|
* static GstFlowReturn
|
||||||
* sink_pad_chain (GstPad *pad, GstBuffer *buffer)
|
* sink_pad_chain (GstPad *pad, GstObject *parent, GstBuffer *buffer)
|
||||||
* {
|
* {
|
||||||
* MyElement *this;
|
* MyElement *this;
|
||||||
* GstAdapter *adapter;
|
* GstAdapter *adapter;
|
||||||
* GstFlowReturn ret = GST_FLOW_OK;
|
* GstFlowReturn ret = GST_FLOW_OK;
|
||||||
*
|
*
|
||||||
* // will give the element an extra ref; remember to drop it
|
* this = MY_ELEMENT (parent);
|
||||||
* this = MY_ELEMENT (gst_pad_get_parent (pad));
|
*
|
||||||
* adapter = this->adapter;
|
* adapter = this->adapter;
|
||||||
*
|
*
|
||||||
* // put buffer into adapter
|
* // put buffer into adapter
|
||||||
* gst_adapter_push (adapter, buffer);
|
* gst_adapter_push (adapter, buffer);
|
||||||
|
*
|
||||||
* // while we can read out 512 bytes, process them
|
* // while we can read out 512 bytes, process them
|
||||||
* while (gst_adapter_available (adapter) >= 512 && ret == GST_FLOW_OK) {
|
* while (gst_adapter_available (adapter) >= 512 && ret == GST_FLOW_OK) {
|
||||||
* const guint8 *data = gst_adapter_map (adapter, 512);
|
* const guint8 *data = gst_adapter_map (adapter, 512);
|
||||||
|
@ -65,8 +66,6 @@
|
||||||
* gst_adapter_unmap (adapter);
|
* gst_adapter_unmap (adapter);
|
||||||
* gst_adapter_flush (adapter, 512);
|
* gst_adapter_flush (adapter, 512);
|
||||||
* }
|
* }
|
||||||
*
|
|
||||||
* gst_object_unref (this);
|
|
||||||
* return ret;
|
* return ret;
|
||||||
* }
|
* }
|
||||||
* ]|
|
* ]|
|
||||||
|
|
Loading…
Reference in a new issue