Skip to content

Commit

Permalink
added files
Browse files Browse the repository at this point in the history
  • Loading branch information
orgicus committed Apr 2, 2014
1 parent 0268925 commit 655ddac
Show file tree
Hide file tree
Showing 41 changed files with 6,576 additions and 0 deletions.
62 changes: 62 additions & 0 deletions addon_config.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# All variables and this file are optional, if they are not present the PG and the
# makefiles will try to parse the correct values from the file system.
#
# Variables that specify exclusions can use % as a wildcard to specify that anything in
# that position will match. A partial path can also be specified to, for example, exclude
# a whole folder from the parsed paths from the file system
#
# Variables can be specified using = or +=
# = will clear the contents of that variable both specified from the file or the ones parsed
# from the file system
# += will add the values to the previous ones in the file or the ones parsed from the file
# system
#
# The PG can be used to detect errors in this file, just create a new project with this addon
# and the PG will write to the console the kind of error and in which line it is

meta:
ADDON_NAME = ofxCvPicam
ADDON_DESCRIPTION = Addon for computer vision addon to allow Raspberry Pi Camera frames to be processed by openCv
ADDON_AUTHOR = George Profenza
ADDON_TAGS = "computer vision" "opencv" "image processing" "raspberry pi" "pi camera"
ADDON_URL = http://github.com/orgicus/ofxCvPiCam

common:
# dependencies with other addons, a list of them separated by spaces
# or use += in several lines
# ADDON_DEPENDENCIES =

# include search paths, this will be usually parsed from the file system
# but if the addon or addon libraries need special search paths they can be
# specified here separated by spaces or one per line using +=
# ADDON_INCLUDES =

# any special flag that should be passed to the compiler when using this
# addon
# ADDON_CFLAGS =

# any special flag that should be passed to the linker when using this
# addon, also used for system libraries with -lname
# ADDON_LDFLAGS =
ADDON_LDFLAGS = -lmmal -lmmal_core -lmmal_util
# linux only, any library that should be included in the project using
# pkg-config
# ADDON_PKG_CONFIG_LIBRARIES =

# osx/iOS only, any framework that should be included in the project
# ADDON_FRAMEWORKS =

# source files, these will be usually parsed from the file system looking
# in the src folders in libs and the root of the addon. if your addon needs
# to include files in different places or a different set of files per platform
# they can be specified here
# ADDON_SOURCES =

# some addons need resources to be copied to the bin/data folder of the project
# specify here any files that need to be copied, you can use wildcards like * and ?
# ADDON_DATA =

# when parsing the file system looking for libraries exclude this for all or
# a specific platform
# ADDON_LIBS_EXCLUDE =

86 changes: 86 additions & 0 deletions libs/mmal/src/interface/mmal/core/mmal_buffer_private.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
Copyright (c) 2012, Broadcom Europe Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef MMAL_BUFFER_PRIVATE_H
#define MMAL_BUFFER_PRIVATE_H

/** Typedef for the private area the framework reserves for the driver / communication layer */
typedef struct MMAL_DRIVER_BUFFER_T MMAL_DRIVER_BUFFER_T;

/** Size of the private area the framework reserves for the driver / communication layer */
#define MMAL_DRIVER_BUFFER_SIZE 32

/** Typedef for the framework's private area in the buffer header */
typedef struct MMAL_BUFFER_HEADER_PRIVATE_T
{
/** Callback invoked just prior to actually releasing the buffer header. Returns TRUE if
* release should be delayed. */
MMAL_BH_PRE_RELEASE_CB_T pf_pre_release;
void *pre_release_userdata;

/** Callback used to release / recycle the buffer header. This needs to be set by
* whoever allocates the buffer header. */
void (*pf_release)(struct MMAL_BUFFER_HEADER_T *header);
void *owner; /**< Context set by the allocator of the buffer header and passed
during the release callback */

int32_t refcount; /**< Reference count of the buffer header. When it reaches 0,
the release callback will be called. */

MMAL_BUFFER_HEADER_T *reference; /**< Reference to another acquired buffer header. */

/** Callback used to free the payload associated with this buffer header. This is only
* used if the buffer header was created by MMAL with a payload associated with it. */
void (*pf_payload_free)(void *payload_context, void *payload);
void *payload; /**< Pointer / handle to the allocated payload buffer */
void *payload_context; /**< Pointer to the context of the payload allocator */
uint32_t payload_size; /**< Allocated size in bytes of payload buffer */

void *component_data; /**< Field reserved for use by the component */
void *payload_handle; /**< Field reserved for mmal_buffer_header_mem_lock */

uint8_t driver_area[MMAL_DRIVER_BUFFER_SIZE];

} MMAL_BUFFER_HEADER_PRIVATE_T;

/** Get the size in bytes of a fully initialised MMAL_BUFFER_HEADER_T */
unsigned int mmal_buffer_header_size(MMAL_BUFFER_HEADER_T *header);

/** Initialise a MMAL_BUFFER_HEADER_T */
MMAL_BUFFER_HEADER_T *mmal_buffer_header_initialise(void *mem, unsigned int length);

/** Return a pointer to the area reserved for the driver.
*/
MMAL_DRIVER_BUFFER_T *mmal_buffer_header_driver_data(MMAL_BUFFER_HEADER_T *);

/** Return a pointer to a referenced buffer header.
* It is the caller's responsibility to ensure that the reference is still
* valid when using it.
*/
MMAL_BUFFER_HEADER_T *mmal_buffer_header_reference(MMAL_BUFFER_HEADER_T *header);

#endif /* MMAL_BUFFER_PRIVATE_H */
223 changes: 223 additions & 0 deletions libs/mmal/src/interface/mmal/core/mmal_clock_private.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
/*
Copyright (c) 2012, Broadcom Europe Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef MMAL_CLOCK_PRIVATE_H
#define MMAL_CLOCK_PRIVATE_H

#include "interface/mmal/mmal.h"
#include "interface/mmal/mmal_clock.h"

#ifdef __cplusplus
extern "C" {
#endif


/** Handle to a clock. */
typedef struct MMAL_CLOCK_T
{
void *user_data; /**< Client-supplied data (not used by the clock). */
} MMAL_CLOCK_T;

/** Create a new instance of a clock.
*
* @param clock Returned clock
*
* @return MMAL_SUCCESS on success
*/
MMAL_STATUS_T mmal_clock_create(MMAL_CLOCK_T **clock);

/** Destroy a previously created clock.
*
* @param clock The clock to destroy
*
* @return MMAL_SUCCESS on success
*/
MMAL_STATUS_T mmal_clock_destroy(MMAL_CLOCK_T *clock);

/** Definition of a clock request callback.
* This is invoked when the media-time requested by the client is reached.
*
* @param clock The clock which serviced the request
* @param media_time The current media-time
* @param cb_data Client-supplied data
* @param priv Function pointer used by the framework
*/
typedef void (*MMAL_CLOCK_VOID_FP)(void);
typedef void (*MMAL_CLOCK_REQUEST_CB)(MMAL_CLOCK_T *clock, int64_t media_time, void *cb_data, MMAL_CLOCK_VOID_FP priv);

/** Register a request with the clock.
* When the specified media-time is reached, the clock will invoke the supplied callback.
*
* @param clock The clock
* @param media_time The media-time at which the callback should be invoked (microseconds)
* @param offset Time offset (in microseconds) applied to the media-time. This can be used
* to schedule the request slightly in advance of the media-time.
* @param cb Callback to invoke
* @param cb_data Client-supplied callback data
* @param priv Function pointer used by the framework
*
* @return MMAL_SUCCESS on success
*/
MMAL_STATUS_T mmal_clock_request_add(MMAL_CLOCK_T *clock, int64_t media_time, int64_t offset,
MMAL_CLOCK_REQUEST_CB cb, void *cb_data, MMAL_CLOCK_VOID_FP priv);

/** Remove all previously registered clock requests.
*
* @param clock The clock
*
* @return MMAL_SUCCESS on success
*/
MMAL_STATUS_T mmal_clock_request_flush(MMAL_CLOCK_T *clock);

/** Update the clock's media-time.
*
* @param clock The clock to update
* @param media_time New media-time to be applied (microseconds)
*
* @return MMAL_SUCCESS on success
*/
MMAL_STATUS_T mmal_clock_media_time_set(MMAL_CLOCK_T *clock, int64_t media_time);

/** Update the clock's media-time offset.
*
* @param clock The clock to update
* @param media_time New media-time offset to be applied (microseconds)
*
* @return MMAL_SUCCESS on success
*/
MMAL_STATUS_T mmal_clock_media_time_offset_set(MMAL_CLOCK_T *clock, int64_t offset);

/** Set the clock's scale.
*
* @param clock The clock
* @param scale Scale factor
*
* @return MMAL_SUCCESS on success
*/
MMAL_STATUS_T mmal_clock_scale_set(MMAL_CLOCK_T *clock, MMAL_RATIONAL_T scale);

/** Set the clock state.
*
* @param clock The clock
* @param active TRUE -> clock is active and media-time is advancing
*
* @return MMAL_SUCCESS on success
*/
MMAL_STATUS_T mmal_clock_active_set(MMAL_CLOCK_T *clock, MMAL_BOOL_T active);

/** Get the clock's scale.
*
* @param clock The clock
*
* @return Current clock scale
*/
MMAL_RATIONAL_T mmal_clock_scale_get(MMAL_CLOCK_T *clock);

/** Get the clock's current media-time.
* This takes the clock scale and media-time offset into account.
*
* @param clock The clock to query
*
* @return Current media-time in microseconds
*/
int64_t mmal_clock_media_time_get(MMAL_CLOCK_T *clock);

/** Get the clock's media-time offset.
*
* @param clock The clock to query
*
* @return Current media-time offset in microseconds
*/
int64_t mmal_clock_media_time_offset_get(MMAL_CLOCK_T *clock);

/** Get the clock's state.
*
* @param clock The clock to query
*
* @return TRUE if clock is running (i.e. local media-time is advancing)
*/
MMAL_BOOL_T mmal_clock_is_active(MMAL_CLOCK_T *clock);

/** Get the clock's media-time update threshold values.
*
* @param clock The clock
* @param update_threshold Pointer to clock update threshold values to fill
*
* @return MMAL_SUCCESS on success
*/
MMAL_STATUS_T mmal_clock_update_threshold_get(MMAL_CLOCK_T *clock, MMAL_PARAMETER_CLOCK_UPDATE_THRESHOLD_T *update_threshold);

/** Set the clock's media-time update threshold values.
*
* @param clock The clock
* @param update_threshold Pointer to new clock update threshold values
*
* @return MMAL_SUCCESS on success
*/
MMAL_STATUS_T mmal_clock_update_threshold_set(MMAL_CLOCK_T *clock, const MMAL_PARAMETER_CLOCK_UPDATE_THRESHOLD_T *update_threshold);

/** Get the clock's discontinuity threshold values.
*
* @param clock The clock
* @param discont Pointer to clock discontinuity threshold values to fill
*
* @return MMAL_SUCCESS on success
*/
MMAL_STATUS_T mmal_clock_discont_threshold_get(MMAL_CLOCK_T *clock, MMAL_PARAMETER_CLOCK_DISCONT_THRESHOLD_T *discont);

/** Set the clock's discontinuity threshold values.
*
* @param clock The clock
* @param discont Pointer to new clock discontinuity threshold values
*
* @return MMAL_SUCCESS on success
*/
MMAL_STATUS_T mmal_clock_discont_threshold_set(MMAL_CLOCK_T *clock, const MMAL_PARAMETER_CLOCK_DISCONT_THRESHOLD_T *discont);

/** Get the clock's request threshold values.
*
* @param clock The clock
* @param future Pointer to clock request threshold values to fill
*
* @return MMAL_SUCCESS on success
*/
MMAL_STATUS_T mmal_clock_request_threshold_get(MMAL_CLOCK_T *clock, MMAL_PARAMETER_CLOCK_REQUEST_THRESHOLD_T *req);

/** Set the clock's request threshold values.
*
* @param clock The clock
* @param discont Pointer to new clock request threshold values
*
* @return MMAL_SUCCESS on success
*/
MMAL_STATUS_T mmal_clock_request_threshold_set(MMAL_CLOCK_T *clock, const MMAL_PARAMETER_CLOCK_REQUEST_THRESHOLD_T *req);

#ifdef __cplusplus
}
#endif

#endif /* MMAL_CLOCK_PRIVATE_H */
Loading

0 comments on commit 655ddac

Please sign in to comment.