MediaProcessors
Public Attributes | List of all members
proc_if_s Struct Reference

#include <proc_if.h>

Collaboration diagram for proc_if_s:
Collaboration graph
[legend]

Public Attributes

const char * proc_name
 
const char * proc_type
 
const char * proc_mime
 
uint64_t flag_proc_features
 
proc_ctx_t *(* open )(const proc_if_t *proc_if, const char *settings_str, log_ctx_t *log_ctx, va_list arg)
 
void(* close )(proc_ctx_t **ref_proc_ctx)
 
int(* send_frame )(proc_ctx_t *proc_ctx, const proc_frame_ctx_t *proc_frame_ctx)
 
int(* send_frame_nodup )(proc_ctx_t *proc_ctx, proc_frame_ctx_t **ref_proc_frame_ctx)
 
int(* recv_frame )(proc_ctx_t *proc_ctx, proc_frame_ctx_t **ref_proc_frame_ctx)
 
int(* unblock )(proc_ctx_t *proc_ctx)
 
int(* rest_put )(proc_ctx_t *proc_ctx, const char *str)
 
int(* rest_get )(proc_ctx_t *proc_ctx, const proc_if_rest_fmt_t rest_fmt, void **ref_reponse)
 
int(* process_frame )(proc_ctx_t *proc_ctx, fifo_ctx_t *fifo_ctx_iput, fifo_ctx_t *fifo_ctx_oput)
 
int(* opt )(proc_ctx_t *proc_ctx, const char *tag, va_list arg)
 
void *(* iput_fifo_elem_opaque_dup )(const proc_frame_ctx_t *proc_frame_ctx)
 
void(* iput_fifo_elem_opaque_release )(void **ref_t)
 
proc_frame_ctx_t *(* oput_fifo_elem_opaque_dup )(const void *t)
 

Detailed Description

PROC interface structure prototype. Each PROC type will define a static and unambiguous interface of this type.

Definition at line 169 of file proc_if.h.

Member Data Documentation

void(* proc_if_s::close) (proc_ctx_t **ref_proc_ctx)

Ends processing thread, de-initialize and release the processor (PROC) context structure and all the related resources. This callback is mandatory (cannot be NULL).

Parameters
ref_proc_ctxReference to the pointer to the processor (PROC) context structure to be release, that was obtained in a previous call to the 'open()' callback method. Pointer is set to NULL on return.

Definition at line 217 of file proc_if.h.

uint64_t proc_if_s::flag_proc_features

Processor features flags.

Definition at line 190 of file proc_if.h.

void*(* proc_if_s::iput_fifo_elem_opaque_dup) (const proc_frame_ctx_t *proc_frame_ctx)

This callback is registered in the FIFO management API and is used to internally duplicate the input frame structure when it is pushed to the processor input FIFO. Typically, this callback is used to transform the input type proc_frame_ctx_t to another structure type that will be actually allocated in the FIFO. This callback is optional, and can be set to NULL. In that case, the processor input frame structure is assumed to be of type proc_frame_ctx_t (thus will be duplicated using function 'proc_frame_ctx_allocate()').

Parameters
proc_frame_ctxProcessor frame context structure (see proc_frame_ctx_t). return Opaque structure (can be private format) duplicating the input frame. This structure will be pushed to the processor input FIFO.

Definition at line 311 of file proc_if.h.

void(* proc_if_s::iput_fifo_elem_opaque_release) (void **ref_t)

This callback is registered in the FIFO management API and is complementary to the callback 'iput_fifo_elem_opaque_dup()': it is the function used to release the elements duplicated and stored in the processor input FIFO using 'iput_fifo_elem_opaque_dup()'. This callback is optional, and can be set to NULL. In that case, the processor input frame structure is assumed to be of type proc_frame_ctx_t (thus will be released using function 'proc_frame_ctx_release()').

Parameters
ref_tOpaque reference to a pointer to the structure type to be released.

Definition at line 324 of file proc_if.h.

proc_ctx_t*(* proc_if_s::open) (const proc_if_t *proc_if, const char *settings_str, log_ctx_t *log_ctx, va_list arg)

Allocates specific processor (PROC) context structure, initializes, and launches processing thread. This callback is mandatory (cannot be NULL).

Parameters
proc_ifPointer to the processor interface structure (static and unambiguous interface of the type of processor we are opening).
settings_strCharacter string containing initial settings for the processor. String format can be either a query-string or JSON.
log_ctxPointer to the LOG module context structure.
argVariable list of parameters defined by user.
Returns
Pointer to the processor context structure on success, NULL if fails.

Definition at line 207 of file proc_if.h.

int(* proc_if_s::opt) (proc_ctx_t *proc_ctx, const char *tag, va_list arg)

Request for specific processor options. This callback is optional (can be set to NULL).

Parameters
proc_ctxPointer to the processor (PROC) context structure obtained in a previous call to the 'open()' callback method.
tagProcessor option tag, namely, option identifier string. Refer to the specific implementation of this function to see the available options. arg Variable list of parameters according to selected option. Refer to the specific implementation of this function to see the parameters corresponding to each available option.
Returns
Status code (STAT_SUCCESS code in case of success, for other code values please refer to .stat_codes.h).

Definition at line 295 of file proc_if.h.

proc_frame_ctx_t*(* proc_if_s::oput_fifo_elem_opaque_dup) (const void *t)

This callback is registered in the FIFO management API and is used to internally duplicate the processor's output frame structure when it is pushed into the processor output FIFO. Typically, this callback is used to transform the processor's opaque output type to the type proc_frame_ctx_t that will be actually allocated in the FIFO. This callback is optional, and can be set to NULL. In that case, the processor output frame structure is assumed to be of type proc_frame_ctx_t (thus will be duplicated using function 'proc_frame_ctx_allocate()').

Parameters
tOpaque processor's output frame structure. return Processor frame context structure (see proc_frame_ctx_t). This structure will be pushed to the processor output FIFO.

Definition at line 339 of file proc_if.h.

const char* proc_if_s::proc_mime

Media type and sub-type (formerly known as MIME types and sub-type). See http://www.iana.org/assignments/media-types/media-types.xhtml. For muxers we use by default: "application/octet-stream" This field is mandatory (can not be set to NULL).

Definition at line 186 of file proc_if.h.

const char* proc_if_s::proc_name

Unambiguous PROC identifier name (character string). This field is mandatory (can not be set to NULL).

Definition at line 174 of file proc_if.h.

const char* proc_if_s::proc_type

Processor type: encoder, decoder, multiplexer, demultiplexer. This field is mandatory (can not be set to NULL).

Definition at line 179 of file proc_if.h.

int(* proc_if_s::process_frame) (proc_ctx_t *proc_ctx, fifo_ctx_t *fifo_ctx_iput, fifo_ctx_t *fifo_ctx_oput)

Process one frame of data. The frame is read from the input FIFO buffer and is completely processed. If an output frame is produced, is written to the output FIFO buffer. This callback is optional (can be set to NULL).

Parameters
proc_ctxPointer to the processor (PROC) context structure obtained in a previous call to the 'open()' callback method.
fifo_ctx_iputPointer to the input FIFO buffer context structure.
fifo_ctx_oputPointer to the output FIFO buffer context structure.
Returns
Status code (STAT_SUCCESS code in case of success, for other code values please refer to .stat_codes.h).

Definition at line 279 of file proc_if.h.

int(* proc_if_s::recv_frame) (proc_ctx_t *proc_ctx, proc_frame_ctx_t **ref_proc_frame_ctx)

//TODO This callback is optional (can be set to NULL).

Definition at line 230 of file proc_if.h.

int(* proc_if_s::rest_get) (proc_ctx_t *proc_ctx, const proc_if_rest_fmt_t rest_fmt, void **ref_reponse)

Get current processor (PROC) settings. Settings are returned by argument in a character string in JSON format. This method is asynchronous and thread safe. This callback is optional (can be set to NULL).

Parameters
proc_ctxPointer to the processor (PROC) context structure obtained in a previous call to the 'open()' callback method.
rest_fmtIndicates the format in which the response data is to be returned. Available formats are enumerated at 'proc_if_rest_fmt_t'.
ref_reponseReference to the pointer to a data structure returning the processor's representational state (including current settings). The returned data structure is formatted according to what is indicated in the parameter 'rest_fmt'.
Returns
Status code (STAT_SUCCESS code in case of success, for other code values please refer to .stat_codes.h).

Definition at line 265 of file proc_if.h.

int(* proc_if_s::rest_put) (proc_ctx_t *proc_ctx, const char *str)

Put new processor (PROC) settings. Parameters can be passed either as a query-string or JSON. This method is asynchronous and thread safe. This callback is optional (can be set to NULL).

Parameters
proc_ctxPointer to the processor (PROC) context structure obtained in a previous call to the 'open()' callback method.
strPointer to a character string containing new settings for the processor. String format can be either a query-string or JSON.
Returns
Status code (STAT_SUCCESS code in case of success, for other code values please refer to .stat_codes.h).

Definition at line 248 of file proc_if.h.

int(* proc_if_s::send_frame) (proc_ctx_t *proc_ctx, const proc_frame_ctx_t *proc_frame_ctx)

// TODO This callback is optional (can be set to NULL).

Definition at line 222 of file proc_if.h.

int(* proc_if_s::unblock) (proc_ctx_t *proc_ctx)

//TODO

Definition at line 235 of file proc_if.h.


The documentation for this struct was generated from the following file: