design: gstbin: add missing markup
Also fix some minor grammar issues.
This commit is contained in:
parent
8ee70333cf
commit
7f309fca40
@ -1,8 +1,8 @@
|
|||||||
# GstBin
|
# GstBin
|
||||||
|
|
||||||
GstBin is a container element for other GstElements. This makes it
|
`GstBin` is a container element for other `GstElements`. This makes it
|
||||||
possible to group elements together so that they can be treated as one
|
possible to group elements together so that they can be treated as one
|
||||||
single GstElement. A GstBin provides a GstBus for the children and
|
single `GstElement`. A `GstBin` provides a `GstBus` for the children and
|
||||||
collates messages from them.
|
collates messages from them.
|
||||||
|
|
||||||
## Add/removing elements
|
## Add/removing elements
|
||||||
@ -16,7 +16,7 @@ The bin maintains a parent-child relationship with its elements (see
|
|||||||
|
|
||||||
## Retrieving elements
|
## Retrieving elements
|
||||||
|
|
||||||
GstBin provides a number of functions to retrieve one or more children
|
`GstBin` provides a number of functions to retrieve one or more children
|
||||||
from itself. A few examples of the provided functions:
|
from itself. A few examples of the provided functions:
|
||||||
|
|
||||||
* `gst_bin_get_by_name()` retrieves an element by name.
|
* `gst_bin_get_by_name()` retrieves an element by name.
|
||||||
@ -24,8 +24,8 @@ from itself. A few examples of the provided functions:
|
|||||||
|
|
||||||
## element management
|
## element management
|
||||||
|
|
||||||
The most important function of the GstBin is to distribute all
|
The most important function of the `GstBin` is to distribute all
|
||||||
GstElement operations on itself to all of its children. This includes:
|
`GstElement` operations on itself to all of its children. This includes:
|
||||||
|
|
||||||
- state changes
|
- state changes
|
||||||
|
|
||||||
@ -38,20 +38,20 @@ The state change distribution is the most complex and is explained in
|
|||||||
|
|
||||||
## GstBus
|
## GstBus
|
||||||
|
|
||||||
The GstBin creates a GstBus for its children and distributes it when
|
The `GstBin` creates a `GstBus` for its children and distributes it when
|
||||||
child elements are added to the bin. The bin attaches a sync handler to
|
child elements are added to the bin. The bin attaches a sync handler to
|
||||||
receive messages from children. The bus for receiving messages from
|
receive messages from children. The bus for receiving messages from
|
||||||
children is distinct from the bin’s own externally-visible GstBus.
|
children is distinct from the bin’s own externally-visible `GstBus`.
|
||||||
|
|
||||||
Messages received from children are forwarded intact onto the bin’s
|
Messages received from children are forwarded intact onto the bin’s
|
||||||
external message bus, except for EOS and SEGMENT_START/DONE which are
|
external message bus, except for EOS and `SEGMENT_START`/`DONE` which are
|
||||||
handled specially.
|
handled specially.
|
||||||
|
|
||||||
ASYNC_START/ASYNC_STOP messages received from the children are used to
|
`ASYNC_START`/`ASYNC_STOP` messages received from the children are used to
|
||||||
trigger a recalculation of the current state of the bin, as described in
|
trigger a recalculation of the current state of the bin, as described in
|
||||||
[states](design/states.md).
|
[states](design/states.md).
|
||||||
|
|
||||||
The application can retrieve the external GstBus and integrate it in the
|
The application can retrieve the external `GstBus` and integrate it in the
|
||||||
mainloop or it can just `pop()` messages off in its own thread.
|
mainloop or it can just `pop()` messages off in its own thread.
|
||||||
|
|
||||||
When a bin goes to READY it will clear all cached messages.
|
When a bin goes to READY it will clear all cached messages.
|
||||||
@ -74,16 +74,16 @@ going to PLAYING again.
|
|||||||
A bin collects `SEGMENT_START` messages but does not post them to the
|
A bin collects `SEGMENT_START` messages but does not post them to the
|
||||||
application. It counts the number of `SEGMENT_START` messages and posts a
|
application. It counts the number of `SEGMENT_START` messages and posts a
|
||||||
`SEGMENT_STOP` message to the application when an equal number of
|
`SEGMENT_STOP` message to the application when an equal number of
|
||||||
`SEGMENT_STOP` messages where received.
|
`SEGMENT_STOP` messages were received.
|
||||||
|
|
||||||
The cached SEGMENT_START/STOP messages are cleared when going to READY.
|
The cached `SEGMENT_START`/`STOP` messages are cleared when going to READY.
|
||||||
|
|
||||||
## DURATION
|
## DURATION
|
||||||
|
|
||||||
When a DURATION query is performed on a bin, it will forward the query
|
When a DURATION query is performed on a bin, it will forward the query
|
||||||
to all its sink elements. The bin will calculate the total duration as
|
to all its sink elements. The bin will calculate the total duration as
|
||||||
the MAX of all returned durations and will then cache the result so that
|
the MAX of all returned durations and will then cache the result so that
|
||||||
any further query can use the cached version. The reason for caching the
|
any further queries can use the cached version. The reason for caching the
|
||||||
result is because the duration of a stream typically does not change
|
result is because the duration of a stream typically does not change
|
||||||
that often.
|
that often.
|
||||||
|
|
||||||
@ -96,10 +96,10 @@ application, which can then fetch the updated DURATION.
|
|||||||
|
|
||||||
## Subclassing
|
## Subclassing
|
||||||
|
|
||||||
Subclasses of GstBin are free to implement their own add/remove
|
Subclasses of `GstBin` are free to implement their own add/remove
|
||||||
implementations. It is a good idea to update the GList of children so
|
functions. It is a good idea to update the `GList` of children so
|
||||||
that the `_iterate()` functions can still be used if the custom bin
|
that the `_iterate()` functions can still be used if the custom bin
|
||||||
allows access to its children.
|
allows access to its children.
|
||||||
|
|
||||||
Any bin subclass can also implement a custom message handler by
|
Any bin subclass can also implement a custom message handler by
|
||||||
overriding the default message handler.
|
overriding the default one.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user