Frame data loading interface.
More...
#include <stdint.h>
Go to the source code of this file.
|
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.
|
|
Frame data loading interface.
◆ 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
-
pump | pump to check |
frame | current frame index for aligning read position |
- Returns
- 0 on success, a negative error code on failure
◆ FP_framesRemaining()
Returns the number of frames remaining in the pump's internal buffer.
- Parameters
-
- Returns
- number of frames remaining in the pump's internal buffer
◆ FP_free()
Frees the resources associated with the provided frame pump.
- Parameters
-
◆ 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
-
fc | file controller to read frames from |
seq | sequence file for file layout information |
pump | pointer to store the initialized frame pump in |
- Returns
- 0 on success, a negative error code on failure
◆ 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
-
pump | pump to copy from |
fd | frame 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