My Project
mmal_vc_api.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2012, Broadcom Europe Ltd
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the name of the copyright holder nor the
13  names of its contributors may be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 #ifndef MMAL_VC_API_H
29 #define MMAL_VC_API_H
30 
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
48 typedef enum {
53  MMAL_STATS_COMP_UNUSED = 0xffffffff /* force 32bit */
55 
59  struct MMAL_DRIVER_COMPONENT_T *comp;
61  uint32_t pid;
63  char name[20];
64 };
65 
69 {
70  struct
71  {
72  uint32_t rx;
73  uint32_t rx_zero_copy;
74  uint32_t rx_empty;
75  uint32_t rx_fails;
76  uint32_t tx;
77  uint32_t tx_zero_copy;
78  uint32_t tx_empty;
79  uint32_t tx_fails;
80  uint32_t tx_short_msg;
81  uint32_t rx_short_msg;
82  } buffers;
83  struct service
84  {
85  uint32_t created;
86  uint32_t pending_destroy;
87  uint32_t destroyed;
88  uint32_t failures;
89  } service;
90  struct commands
91  {
92  uint32_t bad_messages;
93  uint32_t executed;
94  uint32_t failed;
95  uint32_t replies;
96  uint32_t reply_fails;
97  } commands;
98  struct
99  {
100  uint32_t tx;
101  uint32_t tx_fails;
102  } events;
103  struct
104  {
105  uint32_t created;
106  uint32_t destroyed;
107  uint32_t destroying;
108  uint32_t failed;
109  uint32_t list_size;
111  } components;
112  struct
113  {
118  } worker;
119 
120 };
122 
123 /* Simple circular text buffer used to store 'interesting' data
124  * from MMAL clients. e.g. settings for each picture taken */
126 {
128  char buffer[16 << 10];
130  uint32_t magic;
132  int32_t offset;
134  unsigned count;
135 };
137 
140 typedef enum
141 {
145  MMAL_STATS_INVALID = 0x7fffffff
147 
148 /* If opening dev_vchiq outside mmal/vchiq this is the file path and mode */
149 #define MMAL_DEV_VCHIQ_PATH "/dev/vchiq"
150 #define MMAL_DEV_VCHIQ_MODE O_RDWR
151 
153 MMAL_STATUS_T mmal_vc_init_fd(int dev_vchiq_fd);
154 void mmal_vc_deinit(void);
155 
158 
159 MMAL_STATUS_T mmal_vc_get_version(uint32_t *major, uint32_t *minor, uint32_t *minimum);
161 
174  MMAL_STATS_RESULT_T *result,
175  char *name,
176  size_t namelen,
177  MMAL_PORT_TYPE_T type,
178  unsigned component,
179  unsigned port,
181  MMAL_BOOL_T reset);
192 MMAL_STATUS_T mmal_vc_host_log(const char *msg);
193 
194 /* For backwards compatibility in builds */
195 #define MMAL_VC_API_HAVE_HOST_LOG
196 
197 /* VC DEBUG ONLY ************************************************************/
214 MMAL_STATUS_T mmal_vc_consume_mem(size_t size, uint32_t *handle);
215 
216 typedef enum
217 {
225 
229 MMAL_STATUS_T mmal_vc_compact(MMAL_VC_COMPACT_MODE_T mode, uint32_t *duration);
230 
234 MMAL_STATUS_T mmal_vc_lmk(uint32_t alloc_size);
235 
236 #ifdef __cplusplus
237 }
238 #endif
239 #endif
uint32_t max_parameter_set_delay
Definition: mmal_vc_api.h:116
struct MMAL_DRIVER_COMPONENT_T * comp
Definition: mmal_vc_api.h:59
uint32_t list_size
Definition: mmal_vc_api.h:109
struct MMAL_VC_STATS_T::@9 worker
struct MMAL_VC_STATS_T::service service
struct MMAL_VC_STATS_T::commands commands
uint32_t rx_fails
Definition: mmal_vc_api.h:75
MMAL_PORT_TYPE_T
Definition: mmal_port.h:45
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)
uint32_t enqueued_messages
Definition: mmal_vc_api.h:114
MMAL_STATS_RESULT_T
Definition: mmal_vc_api.h:140
MMAL_VC_COMPACT_MODE_T
Definition: mmal_vc_api.h:216
uint32_t destroying
Definition: mmal_vc_api.h:107
uint32_t destroyed
Definition: mmal_vc_api.h:106
uint32_t tx_fails
Definition: mmal_vc_api.h:79
struct MMAL_VC_STATS_T::@7 events
uint32_t failed
Definition: mmal_vc_api.h:108
MMAL_STATUS_T mmal_vc_init(void)
uint32_t tx_zero_copy
Definition: mmal_vc_api.h:77
MMAL_STATS_COMP_STATE_T
Definition: mmal_vc_api.h:48
MMAL_STATUS_T mmal_vc_get_stats(MMAL_VC_STATS_T *stats, int reset)
uint32_t rx_zero_copy
Definition: mmal_vc_api.h:73
uint32_t rx_empty
Definition: mmal_vc_api.h:74
uint32_t tx_short_msg
Definition: mmal_vc_api.h:80
MMAL_STATUS_T mmal_vc_get_version(uint32_t *major, uint32_t *minor, uint32_t *minimum)
uint32_t rx_short_msg
Definition: mmal_vc_api.h:81
MMAL_STATUS_T mmal_vc_host_log(const char *msg)
struct MMAL_VC_STATS_T::@6 buffers
void mmal_vc_deinit(void)
struct MMAL_VC_STATS_T::@8 components
MMAL_STATUS_T mmal_vc_init_fd(int dev_vchiq_fd)
MMAL_STATS_COMP_STATE_T state
Definition: mmal_vc_api.h:60
int32_t MMAL_BOOL_T
Definition: mmal_common.h:60
uint32_t pool_mem_alloc_size
Definition: mmal_vc_api.h:62
MMAL_STATUS_T mmal_vc_use(void)
uint32_t tx_empty
Definition: mmal_vc_api.h:78
uint32_t dequeued_messages
Definition: mmal_vc_api.h:115
MMAL_STATUS_T
Definition: mmal_types.h:46
MMAL_STATUS_T mmal_vc_lmk(uint32_t alloc_size)
uint32_t created
Definition: mmal_vc_api.h:105
struct MMAL_VC_COMP_STATS_T component_list[8]
Definition: mmal_vc_api.h:110
uint32_t max_messages_waiting
Definition: mmal_vc_api.h:117
char buffer[16<< 10]
Definition: mmal_vc_api.h:128
MMAL_STATUS_T mmal_vc_consume_mem(size_t size, uint32_t *handle)
MMAL_STATUS_T mmal_vc_release(void)
MMAL_STATUS_T mmal_vc_compact(MMAL_VC_COMPACT_MODE_T mode, uint32_t *duration)