ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_camera_stream.h File Reference

Bridge encoded camera frames to ra8_io_stream sinks. More...

#include <stdint.h>
#include "ra8_camera.h"
#include "ra8_err.h"
#include "ra8_io_stream.h"
Include dependency graph for ra8_camera_stream.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

ra8_err_t ra8_camera_codec_encode_to_stream (ra8_camera_codec_t *codec, const ra8_camera_frame_t *input, const ra8_camera_buffer_t *output_buffer, ra8_io_stream_t *stream, uint32_t *out_written)
 Encode one frame and write the complete result to a byte stream.

Detailed Description

Bridge encoded camera frames to ra8_io_stream sinks.

Tag
[Ring 4 / Service] {World: NS}

Keeps the base ra8_camera facade independent of output transports. Consumers opt into this ra8_camera_io bridge plus ra8_camera and ra8_io, then encode and write one complete frame with a single bounded operation.

Since
0.1.0

Definition in file ra8_camera_stream.h.

Function Documentation

◆ ra8_camera_codec_encode_to_stream()

ra8_err_t ra8_camera_codec_encode_to_stream ( ra8_camera_codec_t * codec,
const ra8_camera_frame_t * input,
const ra8_camera_buffer_t * output_buffer,
ra8_io_stream_t * stream,
uint32_t * out_written )
nodiscard

Encode one frame and write the complete result to a byte stream.

Calls ra8_camera_codec_encode, then one ra8_io_stream_write. It deliberately does not flush: callers may append a protocol trailer or batch several frames before committing a buffered sink.

Parameters
[in,out]codecBound camera codec.
[in]inputValid source frame.
[in]output_bufferCaller-owned codec output storage.
[in,out]streamBound output stream.
[out]out_writtenBytes accepted by the stream, or NULL.
Returns
ra8_err_t Error code.
Return values
k_ra8_okWhole encoded frame written.
k_ra8_err_null_ptrA required argument was NULL.
k_ra8_err_invalid_sizeA nominally successful sink accepted only a prefix of the encoded frame.
otherPropagated from the codec or stream.
Precondition
Input and output storage satisfy ra8_camera_codec_encode.
stream is bound and idle.
Postcondition
On success exactly one complete encoded frame was written.
*out_written, when provided, reports the accepted byte count.
Note
Not thread-safe with respect to the same codec, buffers, or stream.
Since
0.1.0

Definition at line 26 of file ra8_camera_stream.c.

References ra8_camera_frame_t::bytes, ra8_camera_frame_t::data, k_ra8_err_invalid_size, k_ra8_err_null_ptr, k_ra8_ok, ra8_camera_codec_encode(), and ra8_io_stream_write().