Skip to content

Commit 655ddac

Browse files
author
orgicus
committed
added files
1 parent 0268925 commit 655ddac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+6576
-0
lines changed

addon_config.mk

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# All variables and this file are optional, if they are not present the PG and the
2+
# makefiles will try to parse the correct values from the file system.
3+
#
4+
# Variables that specify exclusions can use % as a wildcard to specify that anything in
5+
# that position will match. A partial path can also be specified to, for example, exclude
6+
# a whole folder from the parsed paths from the file system
7+
#
8+
# Variables can be specified using = or +=
9+
# = will clear the contents of that variable both specified from the file or the ones parsed
10+
# from the file system
11+
# += will add the values to the previous ones in the file or the ones parsed from the file
12+
# system
13+
#
14+
# The PG can be used to detect errors in this file, just create a new project with this addon
15+
# and the PG will write to the console the kind of error and in which line it is
16+
17+
meta:
18+
ADDON_NAME = ofxCvPicam
19+
ADDON_DESCRIPTION = Addon for computer vision addon to allow Raspberry Pi Camera frames to be processed by openCv
20+
ADDON_AUTHOR = George Profenza
21+
ADDON_TAGS = "computer vision" "opencv" "image processing" "raspberry pi" "pi camera"
22+
ADDON_URL = http://github.com/orgicus/ofxCvPiCam
23+
24+
common:
25+
# dependencies with other addons, a list of them separated by spaces
26+
# or use += in several lines
27+
# ADDON_DEPENDENCIES =
28+
29+
# include search paths, this will be usually parsed from the file system
30+
# but if the addon or addon libraries need special search paths they can be
31+
# specified here separated by spaces or one per line using +=
32+
# ADDON_INCLUDES =
33+
34+
# any special flag that should be passed to the compiler when using this
35+
# addon
36+
# ADDON_CFLAGS =
37+
38+
# any special flag that should be passed to the linker when using this
39+
# addon, also used for system libraries with -lname
40+
# ADDON_LDFLAGS =
41+
ADDON_LDFLAGS = -lmmal -lmmal_core -lmmal_util
42+
# linux only, any library that should be included in the project using
43+
# pkg-config
44+
# ADDON_PKG_CONFIG_LIBRARIES =
45+
46+
# osx/iOS only, any framework that should be included in the project
47+
# ADDON_FRAMEWORKS =
48+
49+
# source files, these will be usually parsed from the file system looking
50+
# in the src folders in libs and the root of the addon. if your addon needs
51+
# to include files in different places or a different set of files per platform
52+
# they can be specified here
53+
# ADDON_SOURCES =
54+
55+
# some addons need resources to be copied to the bin/data folder of the project
56+
# specify here any files that need to be copied, you can use wildcards like * and ?
57+
# ADDON_DATA =
58+
59+
# when parsing the file system looking for libraries exclude this for all or
60+
# a specific platform
61+
# ADDON_LIBS_EXCLUDE =
62+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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_BUFFER_PRIVATE_H
29+
#define MMAL_BUFFER_PRIVATE_H
30+
31+
/** Typedef for the private area the framework reserves for the driver / communication layer */
32+
typedef struct MMAL_DRIVER_BUFFER_T MMAL_DRIVER_BUFFER_T;
33+
34+
/** Size of the private area the framework reserves for the driver / communication layer */
35+
#define MMAL_DRIVER_BUFFER_SIZE 32
36+
37+
/** Typedef for the framework's private area in the buffer header */
38+
typedef struct MMAL_BUFFER_HEADER_PRIVATE_T
39+
{
40+
/** Callback invoked just prior to actually releasing the buffer header. Returns TRUE if
41+
* release should be delayed. */
42+
MMAL_BH_PRE_RELEASE_CB_T pf_pre_release;
43+
void *pre_release_userdata;
44+
45+
/** Callback used to release / recycle the buffer header. This needs to be set by
46+
* whoever allocates the buffer header. */
47+
void (*pf_release)(struct MMAL_BUFFER_HEADER_T *header);
48+
void *owner; /**< Context set by the allocator of the buffer header and passed
49+
during the release callback */
50+
51+
int32_t refcount; /**< Reference count of the buffer header. When it reaches 0,
52+
the release callback will be called. */
53+
54+
MMAL_BUFFER_HEADER_T *reference; /**< Reference to another acquired buffer header. */
55+
56+
/** Callback used to free the payload associated with this buffer header. This is only
57+
* used if the buffer header was created by MMAL with a payload associated with it. */
58+
void (*pf_payload_free)(void *payload_context, void *payload);
59+
void *payload; /**< Pointer / handle to the allocated payload buffer */
60+
void *payload_context; /**< Pointer to the context of the payload allocator */
61+
uint32_t payload_size; /**< Allocated size in bytes of payload buffer */
62+
63+
void *component_data; /**< Field reserved for use by the component */
64+
void *payload_handle; /**< Field reserved for mmal_buffer_header_mem_lock */
65+
66+
uint8_t driver_area[MMAL_DRIVER_BUFFER_SIZE];
67+
68+
} MMAL_BUFFER_HEADER_PRIVATE_T;
69+
70+
/** Get the size in bytes of a fully initialised MMAL_BUFFER_HEADER_T */
71+
unsigned int mmal_buffer_header_size(MMAL_BUFFER_HEADER_T *header);
72+
73+
/** Initialise a MMAL_BUFFER_HEADER_T */
74+
MMAL_BUFFER_HEADER_T *mmal_buffer_header_initialise(void *mem, unsigned int length);
75+
76+
/** Return a pointer to the area reserved for the driver.
77+
*/
78+
MMAL_DRIVER_BUFFER_T *mmal_buffer_header_driver_data(MMAL_BUFFER_HEADER_T *);
79+
80+
/** Return a pointer to a referenced buffer header.
81+
* It is the caller's responsibility to ensure that the reference is still
82+
* valid when using it.
83+
*/
84+
MMAL_BUFFER_HEADER_T *mmal_buffer_header_reference(MMAL_BUFFER_HEADER_T *header);
85+
86+
#endif /* MMAL_BUFFER_PRIVATE_H */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
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_CLOCK_PRIVATE_H
29+
#define MMAL_CLOCK_PRIVATE_H
30+
31+
#include "interface/mmal/mmal.h"
32+
#include "interface/mmal/mmal_clock.h"
33+
34+
#ifdef __cplusplus
35+
extern "C" {
36+
#endif
37+
38+
39+
/** Handle to a clock. */
40+
typedef struct MMAL_CLOCK_T
41+
{
42+
void *user_data; /**< Client-supplied data (not used by the clock). */
43+
} MMAL_CLOCK_T;
44+
45+
/** Create a new instance of a clock.
46+
*
47+
* @param clock Returned clock
48+
*
49+
* @return MMAL_SUCCESS on success
50+
*/
51+
MMAL_STATUS_T mmal_clock_create(MMAL_CLOCK_T **clock);
52+
53+
/** Destroy a previously created clock.
54+
*
55+
* @param clock The clock to destroy
56+
*
57+
* @return MMAL_SUCCESS on success
58+
*/
59+
MMAL_STATUS_T mmal_clock_destroy(MMAL_CLOCK_T *clock);
60+
61+
/** Definition of a clock request callback.
62+
* This is invoked when the media-time requested by the client is reached.
63+
*
64+
* @param clock The clock which serviced the request
65+
* @param media_time The current media-time
66+
* @param cb_data Client-supplied data
67+
* @param priv Function pointer used by the framework
68+
*/
69+
typedef void (*MMAL_CLOCK_VOID_FP)(void);
70+
typedef void (*MMAL_CLOCK_REQUEST_CB)(MMAL_CLOCK_T *clock, int64_t media_time, void *cb_data, MMAL_CLOCK_VOID_FP priv);
71+
72+
/** Register a request with the clock.
73+
* When the specified media-time is reached, the clock will invoke the supplied callback.
74+
*
75+
* @param clock The clock
76+
* @param media_time The media-time at which the callback should be invoked (microseconds)
77+
* @param offset Time offset (in microseconds) applied to the media-time. This can be used
78+
* to schedule the request slightly in advance of the media-time.
79+
* @param cb Callback to invoke
80+
* @param cb_data Client-supplied callback data
81+
* @param priv Function pointer used by the framework
82+
*
83+
* @return MMAL_SUCCESS on success
84+
*/
85+
MMAL_STATUS_T mmal_clock_request_add(MMAL_CLOCK_T *clock, int64_t media_time, int64_t offset,
86+
MMAL_CLOCK_REQUEST_CB cb, void *cb_data, MMAL_CLOCK_VOID_FP priv);
87+
88+
/** Remove all previously registered clock requests.
89+
*
90+
* @param clock The clock
91+
*
92+
* @return MMAL_SUCCESS on success
93+
*/
94+
MMAL_STATUS_T mmal_clock_request_flush(MMAL_CLOCK_T *clock);
95+
96+
/** Update the clock's media-time.
97+
*
98+
* @param clock The clock to update
99+
* @param media_time New media-time to be applied (microseconds)
100+
*
101+
* @return MMAL_SUCCESS on success
102+
*/
103+
MMAL_STATUS_T mmal_clock_media_time_set(MMAL_CLOCK_T *clock, int64_t media_time);
104+
105+
/** Update the clock's media-time offset.
106+
*
107+
* @param clock The clock to update
108+
* @param media_time New media-time offset to be applied (microseconds)
109+
*
110+
* @return MMAL_SUCCESS on success
111+
*/
112+
MMAL_STATUS_T mmal_clock_media_time_offset_set(MMAL_CLOCK_T *clock, int64_t offset);
113+
114+
/** Set the clock's scale.
115+
*
116+
* @param clock The clock
117+
* @param scale Scale factor
118+
*
119+
* @return MMAL_SUCCESS on success
120+
*/
121+
MMAL_STATUS_T mmal_clock_scale_set(MMAL_CLOCK_T *clock, MMAL_RATIONAL_T scale);
122+
123+
/** Set the clock state.
124+
*
125+
* @param clock The clock
126+
* @param active TRUE -> clock is active and media-time is advancing
127+
*
128+
* @return MMAL_SUCCESS on success
129+
*/
130+
MMAL_STATUS_T mmal_clock_active_set(MMAL_CLOCK_T *clock, MMAL_BOOL_T active);
131+
132+
/** Get the clock's scale.
133+
*
134+
* @param clock The clock
135+
*
136+
* @return Current clock scale
137+
*/
138+
MMAL_RATIONAL_T mmal_clock_scale_get(MMAL_CLOCK_T *clock);
139+
140+
/** Get the clock's current media-time.
141+
* This takes the clock scale and media-time offset into account.
142+
*
143+
* @param clock The clock to query
144+
*
145+
* @return Current media-time in microseconds
146+
*/
147+
int64_t mmal_clock_media_time_get(MMAL_CLOCK_T *clock);
148+
149+
/** Get the clock's media-time offset.
150+
*
151+
* @param clock The clock to query
152+
*
153+
* @return Current media-time offset in microseconds
154+
*/
155+
int64_t mmal_clock_media_time_offset_get(MMAL_CLOCK_T *clock);
156+
157+
/** Get the clock's state.
158+
*
159+
* @param clock The clock to query
160+
*
161+
* @return TRUE if clock is running (i.e. local media-time is advancing)
162+
*/
163+
MMAL_BOOL_T mmal_clock_is_active(MMAL_CLOCK_T *clock);
164+
165+
/** Get the clock's media-time update threshold values.
166+
*
167+
* @param clock The clock
168+
* @param update_threshold Pointer to clock update threshold values to fill
169+
*
170+
* @return MMAL_SUCCESS on success
171+
*/
172+
MMAL_STATUS_T mmal_clock_update_threshold_get(MMAL_CLOCK_T *clock, MMAL_PARAMETER_CLOCK_UPDATE_THRESHOLD_T *update_threshold);
173+
174+
/** Set the clock's media-time update threshold values.
175+
*
176+
* @param clock The clock
177+
* @param update_threshold Pointer to new clock update threshold values
178+
*
179+
* @return MMAL_SUCCESS on success
180+
*/
181+
MMAL_STATUS_T mmal_clock_update_threshold_set(MMAL_CLOCK_T *clock, const MMAL_PARAMETER_CLOCK_UPDATE_THRESHOLD_T *update_threshold);
182+
183+
/** Get the clock's discontinuity threshold values.
184+
*
185+
* @param clock The clock
186+
* @param discont Pointer to clock discontinuity threshold values to fill
187+
*
188+
* @return MMAL_SUCCESS on success
189+
*/
190+
MMAL_STATUS_T mmal_clock_discont_threshold_get(MMAL_CLOCK_T *clock, MMAL_PARAMETER_CLOCK_DISCONT_THRESHOLD_T *discont);
191+
192+
/** Set the clock's discontinuity threshold values.
193+
*
194+
* @param clock The clock
195+
* @param discont Pointer to new clock discontinuity threshold values
196+
*
197+
* @return MMAL_SUCCESS on success
198+
*/
199+
MMAL_STATUS_T mmal_clock_discont_threshold_set(MMAL_CLOCK_T *clock, const MMAL_PARAMETER_CLOCK_DISCONT_THRESHOLD_T *discont);
200+
201+
/** Get the clock's request threshold values.
202+
*
203+
* @param clock The clock
204+
* @param future Pointer to clock request threshold values to fill
205+
*
206+
* @return MMAL_SUCCESS on success
207+
*/
208+
MMAL_STATUS_T mmal_clock_request_threshold_get(MMAL_CLOCK_T *clock, MMAL_PARAMETER_CLOCK_REQUEST_THRESHOLD_T *req);
209+
210+
/** Set the clock's request threshold values.
211+
*
212+
* @param clock The clock
213+
* @param discont Pointer to new clock request threshold values
214+
*
215+
* @return MMAL_SUCCESS on success
216+
*/
217+
MMAL_STATUS_T mmal_clock_request_threshold_set(MMAL_CLOCK_T *clock, const MMAL_PARAMETER_CLOCK_REQUEST_THRESHOLD_T *req);
218+
219+
#ifdef __cplusplus
220+
}
221+
#endif
222+
223+
#endif /* MMAL_CLOCK_PRIVATE_H */

0 commit comments

Comments
 (0)