1/*
2Copyright (c) 2012, Broadcom Europe Ltd
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without
6modification, 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
16THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23ON 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
25SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*/
27
28#ifndef MMAL_TYPES_H
29#define MMAL_TYPES_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/** \defgroup MmalTypes Common types
36 * Definition for common types */
37/* @{ */
38
39#include "mmal_common.h"
40
41/** Status return codes from the API.
42 *
43 * \internal Please try to keep this similar to the standard POSIX codes
44 * rather than making up new ones!
45 */
46typedef enum
47{
48 MMAL_SUCCESS = 0, /**< Success */
49 MMAL_ENOMEM, /**< Out of memory */
50 MMAL_ENOSPC, /**< Out of resources (other than memory) */
51 MMAL_EINVAL, /**< Argument is invalid */
52 MMAL_ENOSYS, /**< Function not implemented */
53 MMAL_ENOENT, /**< No such file or directory */
54 MMAL_ENXIO, /**< No such device or address */
55 MMAL_EIO, /**< I/O error */
56 MMAL_ESPIPE, /**< Illegal seek */
57 MMAL_ECORRUPT, /**< Data is corrupt \attention FIXME: not POSIX */
58 MMAL_ENOTREADY, /**< Component is not ready \attention FIXME: not POSIX */
59 MMAL_ECONFIG, /**< Component is not configured \attention FIXME: not POSIX */
60 MMAL_EISCONN, /**< Port is already connected */
61 MMAL_ENOTCONN, /**< Port is disconnected */
62 MMAL_EAGAIN, /**< Resource temporarily unavailable. Try again later*/
63 MMAL_EFAULT, /**< Bad address */
64 /* Do not add new codes here unless they match something from POSIX */
65 MMAL_STATUS_MAX = 0x7FFFFFFF /**< Force to 32 bit */
66} MMAL_STATUS_T;
67
68/** Describes a rectangle */
69typedef struct
70{
71 int32_t x; /**< x coordinate (from left) */
72 int32_t y; /**< y coordinate (from top) */
73 int32_t width; /**< width */
74 int32_t height; /**< height */
75} MMAL_RECT_T;
76
77/** Describes a rational number */
78typedef struct
79{
80 int32_t num; /**< Numerator */
81 int32_t den; /**< Denominator */
82} MMAL_RATIONAL_T;
83
84/** \name Special Unknown Time Value
85 * Timestamps in MMAL are defined as signed 64 bits integer values representing microseconds.
86 * However a pre-defined special value is used to signal that a timestamp is not known. */
87/* @{ */
88#define MMAL_TIME_UNKNOWN (INT64_C(1)<<63) /**< Special value signalling that time is not known */
89/* @} */
90
91/** Four Character Code type */
92typedef uint32_t MMAL_FOURCC_T;
93
94/* @} */
95
96#ifdef __cplusplus
97}
98#endif
99
100#endif /* MMAL_TYPES_H */
101