My Project
mmal_vc_api.h File Reference

Go to the source code of this file.

Classes

struct  MMAL_VC_COMP_STATS_T
 
struct  MMAL_VC_STATS_T
 
struct  MMAL_VC_STATS_T::service
 
struct  MMAL_VC_STATS_T::commands
 
struct  MMAL_VC_HOST_LOG_T
 

Macros

#define MMAL_DEV_VCHIQ_PATH   "/dev/vchiq"
 
#define MMAL_DEV_VCHIQ_MODE   O_RDWR
 
#define MMAL_VC_API_HAVE_HOST_LOG
 

Typedefs

typedef struct MMAL_VC_STATS_T MMAL_VC_STATS_T
 
typedef struct MMAL_VC_HOST_LOG_T MMAL_VC_HOST_LOG_T
 

Enumerations

enum  MMAL_STATS_COMP_STATE_T {
  MMAL_STATS_COMP_IDLE, MMAL_STATS_COMP_CREATED, MMAL_STATS_COMP_DESTROYING, MMAL_STATS_COMP_DESTROYED,
  MMAL_STATS_COMP_UNUSED = 0xffffffff
}
 
enum  MMAL_STATS_RESULT_T { MMAL_STATS_FOUND, MMAL_STATS_COMPONENT_NOT_FOUND, MMAL_STATS_PORT_NOT_FOUND, MMAL_STATS_INVALID = 0x7fffffff }
 
enum  MMAL_VC_COMPACT_MODE_T {
  MMAL_VC_COMPACT_NONE = 0, MMAL_VC_COMPACT_NORMAL = 1, MMAL_VC_COMPACT_DISCARD = 2, MMAL_VC_COMPACT_AGGRESSIVE = 4,
  MMAL_VC_COMPACT_SHUFFLE = 0x80, MMAL_VC_COMPACT_ALL = MMAL_VC_COMPACT_NORMAL | MMAL_VC_COMPACT_DISCARD | MMAL_VC_COMPACT_AGGRESSIVE
}
 

Functions

MMAL_STATUS_T mmal_vc_init (void)
 
MMAL_STATUS_T mmal_vc_init_fd (int dev_vchiq_fd)
 
void mmal_vc_deinit (void)
 
MMAL_STATUS_T mmal_vc_use (void)
 
MMAL_STATUS_T mmal_vc_release (void)
 
MMAL_STATUS_T mmal_vc_get_version (uint32_t *major, uint32_t *minor, uint32_t *minimum)
 
MMAL_STATUS_T mmal_vc_get_stats (MMAL_VC_STATS_T *stats, int reset)
 
MMAL_STATUS_T mmal_vc_get_core_stats (MMAL_CORE_STATISTICS_T *stats, MMAL_STATS_RESULT_T *result, char *name, size_t namelen, MMAL_PORT_TYPE_T type, unsigned component, unsigned port, MMAL_CORE_STATS_DIR dir, MMAL_BOOL_T reset)
 
MMAL_STATUS_T mmal_vc_host_log (const char *msg)
 
MMAL_STATUS_T mmal_vc_consume_mem (size_t size, uint32_t *handle)
 
MMAL_STATUS_T mmal_vc_compact (MMAL_VC_COMPACT_MODE_T mode, uint32_t *duration)
 
MMAL_STATUS_T mmal_vc_lmk (uint32_t alloc_size)
 

Detailed Description

Public API for MMAL VC client. Most functionality is exposed via MMAL itself.

Definition in file mmal_vc_api.h.

Macro Definition Documentation

◆ MMAL_DEV_VCHIQ_MODE

#define MMAL_DEV_VCHIQ_MODE   O_RDWR

Definition at line 150 of file mmal_vc_api.h.

◆ MMAL_DEV_VCHIQ_PATH

#define MMAL_DEV_VCHIQ_PATH   "/dev/vchiq"

Definition at line 149 of file mmal_vc_api.h.

◆ MMAL_VC_API_HAVE_HOST_LOG

#define MMAL_VC_API_HAVE_HOST_LOG

Definition at line 195 of file mmal_vc_api.h.

Typedef Documentation

◆ MMAL_VC_HOST_LOG_T

Definition at line 136 of file mmal_vc_api.h.

◆ MMAL_VC_STATS_T

Definition at line 121 of file mmal_vc_api.h.

Enumeration Type Documentation

◆ MMAL_STATS_COMP_STATE_T

State of components created by the VC adaptation layer, used for statistics reporting.

Enumerator
MMAL_STATS_COMP_IDLE 
MMAL_STATS_COMP_CREATED 
MMAL_STATS_COMP_DESTROYING 
MMAL_STATS_COMP_DESTROYED 
MMAL_STATS_COMP_UNUSED 

Definition at line 48 of file mmal_vc_api.h.

◆ MMAL_STATS_RESULT_T

Status from querying MMAL core statistics.

Enumerator
MMAL_STATS_FOUND 
MMAL_STATS_COMPONENT_NOT_FOUND 
MMAL_STATS_PORT_NOT_FOUND 
MMAL_STATS_INVALID 

Definition at line 140 of file mmal_vc_api.h.

◆ MMAL_VC_COMPACT_MODE_T

Enumerator
MMAL_VC_COMPACT_NONE 
MMAL_VC_COMPACT_NORMAL 
MMAL_VC_COMPACT_DISCARD 
MMAL_VC_COMPACT_AGGRESSIVE 
MMAL_VC_COMPACT_SHUFFLE 
MMAL_VC_COMPACT_ALL 

Definition at line 216 of file mmal_vc_api.h.

Function Documentation

◆ mmal_vc_compact()

MMAL_STATUS_T mmal_vc_compact ( MMAL_VC_COMPACT_MODE_T  mode,
uint32_t *  duration 
)

Trigger relocatable heap compaction.

◆ mmal_vc_consume_mem()

MMAL_STATUS_T mmal_vc_consume_mem ( size_t  size,
uint32_t *  handle 
)

Consumes memory in the relocatable heap.

The existing reserved memory is freed first then the new chunk is allocated. If zero is specified for the size then the previously reserved memory is freed and no allocation occurs.

At startup no memory is reserved.

Parameters
sizeSize of memory to consume in bytes.
handleSet to the mem handle for the reserved memory or zero if no memory was allocated.
Returns
MMAL_SUCCESS if memory was reserved (or size zero requested), MMAL_ENOSPC if the allocation failed or MMAL_ENOSYS if the API is not supported e.g in release mode VC images.

◆ mmal_vc_deinit()

void mmal_vc_deinit ( void  )

◆ mmal_vc_get_core_stats()

MMAL_STATUS_T mmal_vc_get_core_stats ( MMAL_CORE_STATISTICS_T stats,
MMAL_STATS_RESULT_T result,
char *  name,
size_t  namelen,
MMAL_PORT_TYPE_T  type,
unsigned  component,
unsigned  port,
MMAL_CORE_STATS_DIR  dir,
MMAL_BOOL_T  reset 
)

Return the MMAL core statistics for a given component/port.

Parameters
statsUpdated with given port statistics
resultWhether the port/component was found
nameFilled in with the name of the port
namelenLength of name
componentWhich component (indexed from zero)
port_typeWhich type of port
portWhich port (index from zero)
resetReset the stats.

◆ mmal_vc_get_stats()

MMAL_STATUS_T mmal_vc_get_stats ( MMAL_VC_STATS_T stats,
int  reset 
)

◆ mmal_vc_get_version()

MMAL_STATUS_T mmal_vc_get_version ( uint32_t *  major,
uint32_t *  minor,
uint32_t *  minimum 
)

◆ mmal_vc_host_log()

MMAL_STATUS_T mmal_vc_host_log ( const char *  msg)

Stores an arbitrary text message in a circular buffer inside the MMAL VC server. The purpose of this message is to log high level events from the host in order to diagnose problems that require multiple actions to reproduce. e.g. taking multiple pictures with different settings.

Parameters
msgThe message text.
Returns
MMAL_SUCCESS if the message was logged or MMAL_ENOSYS if the API if not supported.

◆ mmal_vc_init()

MMAL_STATUS_T mmal_vc_init ( void  )

◆ mmal_vc_init_fd()

MMAL_STATUS_T mmal_vc_init_fd ( int  dev_vchiq_fd)

◆ mmal_vc_lmk()

MMAL_STATUS_T mmal_vc_lmk ( uint32_t  alloc_size)

Trigger LMK action from VC, for diagnostics.

◆ mmal_vc_release()

MMAL_STATUS_T mmal_vc_release ( void  )

◆ mmal_vc_use()

MMAL_STATUS_T mmal_vc_use ( void  )