fplayer
C99 Falcon Sequence (fseq) file player for Light-O-Rama hardware (like xLights)
Loading...
Searching...
No Matches
pump.h File Reference

Frame data loading interface. More...

#include <stdint.h>
Include dependency graph for pump.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int FP_init (struct FC *fc, const struct tf_header_t *seq, struct frame_pump_s **pump)
 Initializes a frame pump with the provided file controller. The pump will read frames from the file controller and store them in an internal buffer for playback. The pump will also preload the next frame set asynchronously in a separate thread to ensure smooth playback. The caller is responsible for freeing the pump with FP_free.
 
int FP_checkPreload (struct frame_pump_s *pump, uint32_t frame)
 Checks if the pump's internal buffer is low, and if so, preloads the next frame set from the file controller asynchronously in a separate thread. The preloaded data is stored within the pump, allowing it to be read once the pre-existing primary buffer is empty.
 
int FP_nextFrame (struct frame_pump_s *pump, uint8_t **fd)
 Copies the next frame of data from the pump to the provided frame data buffer. If the pump's internal buffer is empty, the pump will attempt to read more frames from the file controller provided during initialization.
 
int FP_framesRemaining (struct frame_pump_s *pump)
 Returns the number of frames remaining in the pump's internal buffer.
 
void FP_free (struct frame_pump_s *pump)
 Frees the resources associated with the provided frame pump.
 

Detailed Description

Frame data loading interface.

Function Documentation

◆ FP_checkPreload()

int FP_checkPreload ( struct frame_pump_s * pump,
uint32_t frame )

Checks if the pump's internal buffer is low, and if so, preloads the next frame set from the file controller asynchronously in a separate thread. The preloaded data is stored within the pump, allowing it to be read once the pre-existing primary buffer is empty.

Parameters
pumppump to check
framecurrent frame index for aligning read position
Returns
0 on success, a negative error code on failure
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FP_framesRemaining()

int FP_framesRemaining ( struct frame_pump_s * pump)

Returns the number of frames remaining in the pump's internal buffer.

Parameters
pumppump to check
Returns
number of frames remaining in the pump's internal buffer
Here is the caller graph for this function:

◆ FP_free()

void FP_free ( struct frame_pump_s * pump)

Frees the resources associated with the provided frame pump.

Parameters
pumppump to free
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FP_init()

int FP_init ( struct FC * fc,
const struct tf_header_t * seq,
struct frame_pump_s ** pump )

Initializes a frame pump with the provided file controller. The pump will read frames from the file controller and store them in an internal buffer for playback. The pump will also preload the next frame set asynchronously in a separate thread to ensure smooth playback. The caller is responsible for freeing the pump with FP_free.

Parameters
fcfile controller to read frames from
seqsequence file for file layout information
pumppointer to store the initialized frame pump in
Returns
0 on success, a negative error code on failure
Here is the caller graph for this function:

◆ FP_nextFrame()

int FP_nextFrame ( struct frame_pump_s * pump,
uint8_t ** fd )

Copies the next frame of data from the pump to the provided frame data buffer. If the pump's internal buffer is empty, the pump will attempt to read more frames from the file controller provided during initialization.

Parameters
pumppump to copy from
fdframe data pointer to return the next frame in
Returns
0 on success, a negative error code on failure, or 1 if the pump has reached the end of the sequence
Here is the call graph for this function:
Here is the caller graph for this function: