| 1 |
/* Simple Plugin API |
| 2 |
* |
| 3 |
* Copyright © 2018 Wim Taymans |
| 4 |
* |
| 5 |
* Permission is hereby granted, free of charge, to any person obtaining a |
| 6 |
* copy of this software and associated documentation files (the "Software"), |
| 7 |
* to deal in the Software without restriction, including without limitation |
| 8 |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 9 |
* and/or sell copies of the Software, and to permit persons to whom the |
| 10 |
* Software is furnished to do so, subject to the following conditions: |
| 11 |
* |
| 12 |
* The above copyright notice and this permission notice (including the next |
| 13 |
* paragraph) shall be included in all copies or substantial portions of the |
| 14 |
* Software. |
| 15 |
* |
| 16 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 19 |
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 |
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 21 |
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 22 |
* DEALINGS IN THE SOFTWARE. |
| 23 |
*/ |
| 24 |
|
| 25 |
#ifndef SPA_TYPE_H |
| 26 |
#define SPA_TYPE_H |
| 27 |
|
| 28 |
#ifdef __cplusplus |
| 29 |
extern "C" { |
| 30 |
#endif |
| 31 |
|
| 32 |
#include <spa/utils/defs.h> |
| 33 |
|
| 34 |
enum { |
| 35 |
/* Basic types */ |
| 36 |
SPA_TYPE_START = 0x00000, |
| 37 |
SPA_TYPE_None, |
| 38 |
SPA_TYPE_Bool, |
| 39 |
SPA_TYPE_Id, |
| 40 |
SPA_TYPE_Int, |
| 41 |
SPA_TYPE_Long, |
| 42 |
SPA_TYPE_Float, |
| 43 |
SPA_TYPE_Double, |
| 44 |
SPA_TYPE_String, |
| 45 |
SPA_TYPE_Bytes, |
| 46 |
SPA_TYPE_Rectangle, |
| 47 |
SPA_TYPE_Fraction, |
| 48 |
SPA_TYPE_Bitmap, |
| 49 |
SPA_TYPE_Array, |
| 50 |
SPA_TYPE_Struct, |
| 51 |
SPA_TYPE_Object, |
| 52 |
SPA_TYPE_Sequence, |
| 53 |
SPA_TYPE_Pointer, |
| 54 |
SPA_TYPE_Fd, |
| 55 |
SPA_TYPE_Choice, |
| 56 |
SPA_TYPE_Pod, |
| 57 |
SPA_TYPE_LAST, /**< not part of ABI */ |
| 58 |
|
| 59 |
/* Pointers */ |
| 60 |
SPA_TYPE_POINTER_START = 0x10000, |
| 61 |
SPA_TYPE_POINTER_Buffer, |
| 62 |
SPA_TYPE_POINTER_Meta, |
| 63 |
SPA_TYPE_POINTER_Dict, |
| 64 |
SPA_TYPE_POINTER_LAST, /**< not part of ABI */ |
| 65 |
|
| 66 |
/* Events */ |
| 67 |
SPA_TYPE_EVENT_START = 0x20000, |
| 68 |
SPA_TYPE_EVENT_Device, |
| 69 |
SPA_TYPE_EVENT_Node, |
| 70 |
SPA_TYPE_EVENT_LAST, /**< not part of ABI */ |
| 71 |
|
| 72 |
/* Commands */ |
| 73 |
SPA_TYPE_COMMAND_START = 0x30000, |
| 74 |
SPA_TYPE_COMMAND_Device, |
| 75 |
SPA_TYPE_COMMAND_Node, |
| 76 |
SPA_TYPE_COMMAND_LAST, /**< not part of ABI */ |
| 77 |
|
| 78 |
/* Objects */ |
| 79 |
SPA_TYPE_OBJECT_START = 0x40000, |
| 80 |
SPA_TYPE_OBJECT_PropInfo, |
| 81 |
SPA_TYPE_OBJECT_Props, |
| 82 |
SPA_TYPE_OBJECT_Format, |
| 83 |
SPA_TYPE_OBJECT_ParamBuffers, |
| 84 |
SPA_TYPE_OBJECT_ParamMeta, |
| 85 |
SPA_TYPE_OBJECT_ParamIO, |
| 86 |
SPA_TYPE_OBJECT_ParamProfile, |
| 87 |
SPA_TYPE_OBJECT_ParamPortConfig, |
| 88 |
SPA_TYPE_OBJECT_ParamRoute, |
| 89 |
SPA_TYPE_OBJECT_Profiler, |
| 90 |
SPA_TYPE_OBJECT_LAST, /**< not part of ABI */ |
| 91 |
|
| 92 |
/* vendor extensions */ |
| 93 |
SPA_TYPE_VENDOR_PipeWire = 0x02000000, |
| 94 |
|
| 95 |
SPA_TYPE_VENDOR_Other = 0x7f000000, |
| 96 |
}; |
| 97 |
|
| 98 |
#define SPA_TYPE_INFO_BASE "Spa:" |
| 99 |
|
| 100 |
#define SPA_TYPE_INFO_Flags SPA_TYPE_INFO_BASE "Flags" |
| 101 |
#define SPA_TYPE_INFO_FLAGS_BASE SPA_TYPE_INFO_Flags ":" |
| 102 |
|
| 103 |
#define SPA_TYPE_INFO_Enum SPA_TYPE_INFO_BASE "Enum" |
| 104 |
#define SPA_TYPE_INFO_ENUM_BASE SPA_TYPE_INFO_Enum ":" |
| 105 |
|
| 106 |
#define SPA_TYPE_INFO_Pod SPA_TYPE_INFO_BASE "Pod" |
| 107 |
#define SPA_TYPE_INFO_POD_BASE SPA_TYPE_INFO_Pod ":" |
| 108 |
|
| 109 |
#define SPA_TYPE_INFO_Struct SPA_TYPE_INFO_POD_BASE "Struct" |
| 110 |
#define SPA_TYPE_INFO_STRUCT_BASE SPA_TYPE_INFO_Struct ":" |
| 111 |
|
| 112 |
#define SPA_TYPE_INFO_Object SPA_TYPE_INFO_POD_BASE "Object" |
| 113 |
#define SPA_TYPE_INFO_OBJECT_BASE SPA_TYPE_INFO_Object ":" |
| 114 |
|
| 115 |
#define SPA_TYPE_INFO_Pointer SPA_TYPE_INFO_BASE "Pointer" |
| 116 |
#define SPA_TYPE_INFO_POINTER_BASE SPA_TYPE_INFO_Pointer ":" |
| 117 |
|
| 118 |
#define SPA_TYPE_INFO_Interface SPA_TYPE_INFO_POINTER_BASE "Interface" |
| 119 |
#define SPA_TYPE_INFO_INTERFACE_BASE SPA_TYPE_INFO_Interface ":" |
| 120 |
|
| 121 |
#define SPA_TYPE_INFO_Event SPA_TYPE_INFO_OBJECT_BASE "Event" |
| 122 |
#define SPA_TYPE_INFO_EVENT_BASE SPA_TYPE_INFO_Event ":" |
| 123 |
|
| 124 |
#define SPA_TYPE_INFO_Command SPA_TYPE_INFO_OBJECT_BASE "Command" |
| 125 |
#define SPA_TYPE_INFO_COMMAND_BASE SPA_TYPE_INFO_Command ":" |
| 126 |
|
| 127 |
struct spa_type_info { |
| 128 |
uint32_t type; |
| 129 |
uint32_t parent; |
| 130 |
const char *name; |
| 131 |
const struct spa_type_info *values; |
| 132 |
}; |
| 133 |
|
| 134 |
#ifdef __cplusplus |
| 135 |
} /* extern "C" */ |
| 136 |
#endif |
| 137 |
|
| 138 |
#endif /* SPA_TYPE_H */ |