20 return "ENCODER_ERROR_SUCCESS";
22 return "ENCODER_ERROR_SKIP_FRAME";
24 return "ENCODER_ERROR_RETRY_FRAME";
26 return "ENCODER_ERROR_CONFIGURATION";
28 return "ENCODER_ERROR_INVALID";
Interface for a generic buffer that stores image data.
Interface for an encoder buffer supporting resizing and variable-length data.
virtual size_t get_size() const =0
Returns number of bytes currently used.
virtual size_t get_max_size() const =0
Returns total allocated buffer size.
virtual uint8_t * get_data() const =0
Returns a pointer to the buffer data.
virtual bool set_buffer_size(size_t size)=0
Sets logical buffer size, reallocates if needed.
virtual ~EncoderBuffer()=default
Interface for image encoders used in a camera pipeline.
virtual ~Encoder()=default
virtual void dump_config()=0
Prints the encoder's configuration to the log.
virtual EncoderBuffer * get_output_buffer()=0
Returns the encoder's output buffer.
virtual EncoderError encode_pixels(CameraImageSpec *spec, Buffer *pixels)=0
Encodes pixel data from a previous camera pipeline stage.
EncoderError
Result codes from the encoder used to control camera pipeline flow.
@ ENCODER_ERROR_RETRY_FRAME
Retry current frame, after buffer growth or for incremental encoding.
@ ENCODER_ERROR_SUCCESS
Encoding succeeded, continue pipeline normally.
@ ENCODER_ERROR_CONFIGURATION
Fatal config error, shut down pipeline.
@ ENCODER_ERROR_SKIP_FRAME
Skip current frame, try again on next frame.
const char * to_string(PixelFormat format)
Returns string name for a given PixelFormat.
Specification of a caputured camera image.