Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

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.

Detailed Description

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.

Enumeration Type Documentation

◆ 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).

Function Documentation

◆ mpipe_fake_src_init()

int mpipe_fake_src_init ( struct mpipe_fake_src * fsrc,
uint8_t id )

#include <mpipe_fake_src.h>

Initialize a fake source element.

Parameters
fsrcPointer to the mpipe_fake_src to initialize.
idUnique element identifier.
Returns
0 on success, negative errno otherwise.

◆ mpipe_src_change_state()

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.

Parameters
selfPointer to the Elements struct
transitionTransition state, see mpipe_state_change
Returns
0 on success, negative errno otherwise

◆ mpipe_src_get_property()

int mpipe_src_get_property ( struct mpipe_object * obj,
uint32_t key,
void * val )

#include <mpipe_src.h>

Get property from source element.

Parameters
objPointer to the Objects (source element)
keyProperty key identifier
[out]valPointer to store the retrieved property value
Returns
0 on success, negative errno on failure

◆ mpipe_src_init()

int mpipe_src_init ( struct mpipe_src * src,
uint8_t id )

#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.

Parameters
srcPointer to the Sources to initialize.
idUnique element identifier.
Returns
0 on success, negative errno otherwise.

◆ mpipe_src_set_property()

int mpipe_src_set_property ( struct mpipe_object * obj,
uint32_t key,
const void * val )

#include <mpipe_src.h>

Set property on source element.

Parameters
objPointer to the Objects (source element)
keyProperty key identifier
valPointer to the property value to set
Returns
0 on success, negative errno on failure