mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-10 18:14:15 +00:00
docs/design/part-element-transform.txt: Added some docs about the design of tranform elements.
Original commit message from CVS: * docs/design/part-element-transform.txt: Added some docs about the design of tranform elements. * libs/gst/base/gstbasesrc.c: (gst_base_src_perform_seek), (gst_base_src_loop), (gst_base_src_change_state): Mark buffers with the DISCONT flag.
This commit is contained in:
parent
81cc6d92ba
commit
3f3536bf73
3 changed files with 56 additions and 0 deletions
|
@ -1,3 +1,12 @@
|
|||
2006-03-08 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
* docs/design/part-element-transform.txt:
|
||||
Added some docs about the design of tranform elements.
|
||||
|
||||
* libs/gst/base/gstbasesrc.c: (gst_base_src_perform_seek),
|
||||
(gst_base_src_loop), (gst_base_src_change_state):
|
||||
Mark buffers with the DISCONT flag.
|
||||
|
||||
2006-03-08 Michael Smith <msmith@fluendo.com>
|
||||
|
||||
* gst/gstregistry.h:
|
||||
|
|
38
docs/design/part-element-transform.txt
Normal file
38
docs/design/part-element-transform.txt
Normal file
|
@ -0,0 +1,38 @@
|
|||
Transform elements
|
||||
------------------
|
||||
|
||||
Transform elements transform input buffers to output buffers based
|
||||
on the sink and source caps.
|
||||
|
||||
typical transform elements include:
|
||||
|
||||
- audio convertors (audioconvert, ...)
|
||||
- video convertors (colorspace, videoscale, audioconvert, ...)
|
||||
- filters (capfilter, colorbalance,
|
||||
|
||||
The implementation of the transform element has to take care of
|
||||
the following things:
|
||||
|
||||
- efficient negotiation both up and downstream
|
||||
- efficient buffer alloc and other buffer management
|
||||
|
||||
Some transform elements can operate in different modes:
|
||||
|
||||
- passthrough (no changes to buffers)
|
||||
- in-place (changes made to incomming buffer)
|
||||
- metadata changes only
|
||||
|
||||
Depending on the mode of operation the buffer allocation strategy might change.
|
||||
|
||||
|
||||
Negotiation
|
||||
-----------
|
||||
|
||||
The transform element is configured to perform a specific transform in these
|
||||
two situations:
|
||||
|
||||
- new caps are received on the sink pad.
|
||||
- new caps are received on the source pad when allocating an output buffer and
|
||||
we can transform to these caps with the current input buffer.
|
||||
|
||||
|
|
@ -207,6 +207,7 @@ struct _GstBaseSrcPrivate
|
|||
{
|
||||
gboolean last_sent_eos; /* last thing we did was send an EOS (we set this
|
||||
* to avoid the sending of two EOS in some cases) */
|
||||
gboolean discont;
|
||||
};
|
||||
|
||||
static GstElementClass *parent_class = NULL;
|
||||
|
@ -850,6 +851,7 @@ gst_base_src_perform_seek (GstBaseSrc * src, GstEvent * event, gboolean unlock)
|
|||
src->segment.last_stop, stop, src->segment.time));
|
||||
}
|
||||
|
||||
src->priv->discont = TRUE;
|
||||
src->data.ABI.running = TRUE;
|
||||
/* and restart the task in case it got paused explicitely or by
|
||||
* the FLUSH_START event we pushed out. */
|
||||
|
@ -1370,6 +1372,12 @@ gst_base_src_loop (GstPad * pad)
|
|||
if (position != -1)
|
||||
gst_segment_set_last_stop (&src->segment, src->segment.format, position);
|
||||
|
||||
if (G_UNLIKELY (src->priv->discont)) {
|
||||
buf = gst_buffer_make_metadata_writable (buf);
|
||||
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT);
|
||||
src->priv->discont = FALSE;
|
||||
}
|
||||
|
||||
ret = gst_pad_push (pad, buf);
|
||||
if (G_UNLIKELY (ret != GST_FLOW_OK))
|
||||
goto pause;
|
||||
|
@ -1787,6 +1795,7 @@ gst_base_src_change_state (GstElement * element, GstStateChange transition)
|
|||
basesrc->live_running = FALSE;
|
||||
}
|
||||
basesrc->priv->last_sent_eos = FALSE;
|
||||
basesrc->priv->discont = TRUE;
|
||||
GST_LIVE_UNLOCK (element);
|
||||
break;
|
||||
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
||||
|
|
Loading…
Reference in a new issue