|
Zephyr Project API 4.4.99
A Scalable Open Source RTOS
|
Elements that produce buffers, and drive the negotiation. More...
Files | |
| file | mpipe_fake_src.h |
| Fake source element. | |
| file | mpipe_src.h |
| Source: an element that produces buffers. | |
Data Structures | |
| struct | mpipe_fake_src |
| Fake source element structure. More... | |
| struct | mpipe_src |
| Base Source Element Structure. More... | |
Enumerations | |
| enum | mpipe_prop_src { MPIPE_PROP_SRC_NUM_BUFS , MPIPE_PROP_SRC_LAST } |
| Properties for a base source element. More... | |
Functions | |
| int | mpipe_fake_src_init (struct mpipe_fake_src *fsrc, uint8_t id) |
| Initialize a fake source element. | |
| int | mpipe_src_init (struct mpipe_src *src, uint8_t id) |
| Initialize a source element. | |
| int | mpipe_src_change_state (struct mpipe_element *self, enum mpipe_state_change transition) |
| Change state function for base source element. | |
| int | mpipe_src_set_property (struct mpipe_object *obj, uint32_t key, const void *val) |
| Set property on source element. | |
| int | mpipe_src_get_property (struct mpipe_object *obj, uint32_t key, void *val) |
| Get property from source element. | |
Elements that produce buffers, and drive the negotiation.
A source has one source pad and no sink pad: it is where data enters the graph, whether from a device, a file, or nothing at all. It owns the buffer pool the buffers it pushes come from.
A source carries a second responsibility the other bases do not. Because it sits at the head of the graph, it is the source that drives negotiation on the READY to PAUSED transition. It offers the capabilities it supports downstream one at a time, keeps the first the whole chain accepts, reduces it to a single format and announces it as an event; then it runs the buffer pool query and configures and starts its pool. A derived source supplies the pieces - what it supports, what to do when a format is chosen, what buffers it needs - and the base performs the walk.
The num_buffers property bounds how many buffers are produced before the source declares the end of the stream; 0 means it runs until it is stopped.
| enum mpipe_prop_src |
#include <mpipe_src.h>
Properties for a base source element.
Enumeration of properties that can be configured for base source
| Enumerator | |
|---|---|
| MPIPE_PROP_SRC_NUM_BUFS | Number of buffers that the source outputs before sending EOS. |
| MPIPE_PROP_SRC_LAST | Last source property marker (for validation/iteration). |
| int mpipe_fake_src_init | ( | struct mpipe_fake_src * | fsrc, |
| uint8_t | id ) |
#include <mpipe_fake_src.h>
Initialize a fake source element.
| fsrc | Pointer to the mpipe_fake_src to initialize. |
| id | Unique element identifier. |
| int mpipe_src_change_state | ( | struct mpipe_element * | self, |
| enum mpipe_state_change | transition ) |
#include <mpipe_src.h>
Change state function for base source element.
On the PAUSED to READY transition this resets the negotiated pad caps back to ANY so a subsequent re-negotiation starts fresh. Derived sources that override change_state must chain to this base function to inherit that behavior.
| self | Pointer to the Elements struct |
| transition | Transition state, see mpipe_state_change |
| int mpipe_src_get_property | ( | struct mpipe_object * | obj, |
| uint32_t | key, | ||
| void * | val ) |
#include <mpipe_src.h>
Get property from source element.
| obj | Pointer to the Objects (source element) | |
| key | Property key identifier | |
| [out] | val | Pointer to store the retrieved property value |
#include <mpipe_src.h>
Initialize a source element.
This function initializes the base source element structure, including the source pad and default callbacks. A concrete source calls it first from its own init, with the same id, and then overrides what it needs.
| src | Pointer to the Sources to initialize. |
| id | Unique element identifier. |
| int mpipe_src_set_property | ( | struct mpipe_object * | obj, |
| uint32_t | key, | ||
| const void * | val ) |
#include <mpipe_src.h>
Set property on source element.
| obj | Pointer to the Objects (source element) |
| key | Property key identifier |
| val | Pointer to the property value to set |