PipeWire  0.3.33
buffer/type-info.h
Go to the documentation of this file.
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_BUFFER_TYPES_H
26 #define SPA_BUFFER_TYPES_H
27 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 #include <spa/buffer/buffer.h>
38 #include <spa/buffer/meta.h>
39 #include <spa/utils/type.h>
40 
41 #define SPA_TYPE_INFO_Buffer SPA_TYPE_INFO_POINTER_BASE "Buffer"
42 #define SPA_TYPE_INFO_BUFFER_BASE SPA_TYPE_INFO_Buffer ":"
43 
45 #define SPA_TYPE_INFO_Data SPA_TYPE_INFO_ENUM_BASE "Data"
46 #define SPA_TYPE_INFO_DATA_BASE SPA_TYPE_INFO_Data ":"
47 
49 #define SPA_TYPE_INFO_DATA_Fd SPA_TYPE_INFO_DATA_BASE "Fd"
50 #define SPA_TYPE_INFO_DATA_FD_BASE SPA_TYPE_INFO_DATA_Fd ":"
51 
52 /* static */ const struct spa_type_info spa_type_data_type[] = {
58  { 0, 0, NULL, NULL },
59 };
60 
61 #define SPA_TYPE_INFO_Meta SPA_TYPE_INFO_POINTER_BASE "Meta"
62 #define SPA_TYPE_INFO_META_BASE SPA_TYPE_INFO_Meta ":"
63 
64 #define SPA_TYPE_INFO_META_Array SPA_TYPE_INFO_META_BASE "Array"
65 #define SPA_TYPE_INFO_META_ARRAY_BASE SPA_TYPE_INFO_META_Array ":"
66 
67 #define SPA_TYPE_INFO_META_Region SPA_TYPE_INFO_META_BASE "Region"
68 #define SPA_TYPE_INFO_META_REGION_BASE SPA_TYPE_INFO_META_Region ":"
69 
70 #define SPA_TYPE_INFO_META_ARRAY_Region SPA_TYPE_INFO_META_ARRAY_BASE "Region"
71 #define SPA_TYPE_INFO_META_ARRAY_REGION_BASE SPA_TYPE_INFO_META_ARRAY_Region ":"
72 
73 /* static */ const struct spa_type_info spa_type_meta_type[] = {
82  { 0, 0, NULL, NULL },
83 };
84 
89 #ifdef __cplusplus
90 } /* extern "C" */
91 #endif
92 
93 #endif /* SPA_BUFFER_TYPES_H */
PW_DIRECTION_INPUT
#define PW_DIRECTION_INPUT
Definition: port.h:57
SPA_VIDEO_FORMAT_BGRx
@ SPA_VIDEO_FORMAT_BGRx
Definition: video/raw.h:66
PW_KEY_MEDIA_ROLE
#define PW_KEY_MEDIA_ROLE
Role: Movie, Music, Camera, Screen, Communication, Game, Notification, DSP, Production,...
Definition: src/pipewire/keys.h:281
pw_stream_new_simple
struct pw_stream * pw_stream_new_simple(struct pw_loop *loop, const char *name, struct pw_properties *props, const struct pw_stream_events *events, void *data)
Definition: stream.c:1357
SPA_FORMAT_mediaType
@ SPA_FORMAT_mediaType
media type (Id enum spa_media_type)
Definition: param/format.h:102
SPA_META_Cursor
@ SPA_META_Cursor
struct spa_meta_cursor
Definition: meta.h:46
PW_VERSION_CLIENT_EVENTS
#define PW_VERSION_CLIENT_EVENTS
Definition: client.h:78
SPA_TYPE_INFO_META_BASE
#define SPA_TYPE_INFO_META_BASE
Definition: buffer/type-info.h:62
spa_dict_item::key
const char * key
Definition: utils/dict.h:42
main
int main(int argc, char *argv[])
Definition: media-session.c:2431
spa_zero
#define spa_zero(x)
Definition: defs.h:303
SPA_TYPE_OBJECT_Format
@ SPA_TYPE_OBJECT_Format
Definition: build-12683127/doc/spa/utils/type.h:90
spa_type_data_type
const struct spa_type_info spa_type_data_type[]
Definition: buffer/type-info.h:52
pw_context_new
struct pw_context * pw_context_new(struct pw_loop *main_loop, struct pw_properties *props, size_t user_data_size)
Make a new context object for a given main_loop.
Definition: context.c:249
SPA_META_Invalid
@ SPA_META_Invalid
Definition: meta.h:41
pw_init
void pw_init(int *argc, char **argv[])
Initialize PipeWire.
Definition: pipewire.c:483
SPA_TYPE_INFO_DATA_FD_BASE
#define SPA_TYPE_INFO_DATA_FD_BASE
Definition: buffer/type-info.h:50
SPA_TYPE_Int
@ SPA_TYPE_Int
Definition: build-12683127/doc/spa/utils/type.h:48
SPA_META_VideoCrop
@ SPA_META_VideoCrop
struct spa_meta_region with cropping data
Definition: meta.h:43
SPA_POD_CHOICE_RANGE_Fraction
#define SPA_POD_CHOICE_RANGE_Fraction(def, min, max)
Definition: vararg.h:93
data
user data to add to an object
Definition: filter.c:75
SPA_DATA_DmaBuf
@ SPA_DATA_DmaBuf
fd to dmabuf memory
Definition: buffer/buffer.h:50
spa_type_info
Definition: build-12683127/doc/spa/utils/type.h:137
SPA_FRACTION
#define SPA_FRACTION(num, denom)
Definition: defs.h:103
SPA_META_VideoDamage
@ SPA_META_VideoDamage
array of struct spa_meta_region with damage
Definition: meta.h:44
pw_loop
Definition: src/pipewire/loop.h:47
SPA_VIDEO_FORMAT_YUY2
@ SPA_VIDEO_FORMAT_YUY2
Definition: video/raw.h:62
PW_VERSION_STREAM_EVENTS
#define PW_VERSION_STREAM_EVENTS
Definition: stream.h:212
pw_proxy_destroy
void pw_proxy_destroy(struct pw_proxy *proxy)
destroy a proxy
Definition: proxy.c:229
pw_main_loop_new
struct pw_main_loop * pw_main_loop_new(const struct spa_dict *props)
Create a new main loop.
Definition: main-loop.c:86
SPA_FORMAT_VIDEO_size
@ SPA_FORMAT_VIDEO_size
size (Rectangle)
Definition: param/format.h:117
handle
Definition: pipewire.c:68
PW_STREAM_FLAG_AUTOCONNECT
@ PW_STREAM_FLAG_AUTOCONNECT
try to automatically connect this stream
Definition: stream.h:249
SPA_POD_BUILDER_INIT
#define SPA_POD_BUILDER_INIT(buffer, size)
Definition: builder.h:71
props
const char * props
Definition: media-session.c:2382
spa_dict_item
Definition: utils/dict.h:41
stream
Definition: stream.c:97
SPA_RECTANGLE
#define SPA_RECTANGLE(width, height)
Definition: defs.h:85
pw_context_connect
struct pw_core * pw_context_connect(struct pw_context *context, struct pw_properties *properties, size_t user_data_size)
Connect to a PipeWire instance.
Definition: core.c:401
SPA_PARAM_Format
@ SPA_PARAM_Format
configured format as SPA_TYPE_OBJECT_Format
Definition: param.h:48
item
Definition: impl-metadata.c:49
SPA_TYPE_Pointer
@ SPA_TYPE_Pointer
Definition: build-12683127/doc/spa/utils/type.h:61
SPA_VIDEO_FORMAT_RGBx
@ SPA_VIDEO_FORMAT_RGBx
Definition: video/raw.h:65
pw_client_info::id
uint32_t id
id of the global
Definition: client.h:56
spa_pod
Definition: pod/pod.h:50
pw_main_loop_get_loop
struct pw_loop * pw_main_loop_get_loop(struct pw_main_loop *loop)
Get the loop implementation.
Definition: main-loop.c:119
SPA_META_Busy
@ SPA_META_Busy
don't write to buffer when count > 0
Definition: meta.h:49
SPA_TYPE_INFO_META_REGION_BASE
#define SPA_TYPE_INFO_META_REGION_BASE
Definition: buffer/type-info.h:68
meta.h
spa_type_meta_type
const struct spa_type_info spa_type_meta_type[]
Definition: buffer/type-info.h:73
buffer.h
pw_main_loop_run
int pw_main_loop_run(struct pw_main_loop *loop)
Run a main loop.
Definition: main-loop.c:145
type.h
SPA_TYPE_INFO_DATA_BASE
#define SPA_TYPE_INFO_DATA_BASE
Definition: buffer/type-info.h:46
spa_dict_for_each
#define spa_dict_for_each(item, dict)
Definition: utils/dict.h:58
pw_stream_destroy
void pw_stream_destroy(struct pw_stream *stream)
Destroy a stream.
Definition: stream.c:1419
pw_client_info
The client information.
Definition: client.h:55
spa_format_video_raw_parse
int spa_format_video_raw_parse(const struct spa_pod *format, struct spa_video_info_raw *info)
Definition: video/format-utils.h:42
pw_client_info::props
struct spa_dict * props
extra properties
Definition: client.h:60
SPA_MEDIA_TYPE_video
@ SPA_MEDIA_TYPE_video
Definition: param/format.h:43
start
int(* start)(struct sm_media_session *sess)
Definition: media-session.c:2381
pw_core_disconnect
int pw_core_disconnect(struct pw_core *core)
disconnect and destroy a core
Definition: core.c:488
pw_stream_connect
int pw_stream_connect(struct pw_stream *stream, enum pw_direction direction, uint32_t target_id, enum pw_stream_flags flags, const struct spa_pod **params, uint32_t n_params)
Connect a stream for input or output on port_path.
Definition: stream.c:1602
buffer
Definition: filter.c:59
SPA_FORMAT_mediaSubtype
@ SPA_FORMAT_mediaSubtype
media subtype (Id enum spa_media_subtype)
Definition: param/format.h:103
PW_VERSION_REGISTRY
#define PW_VERSION_REGISTRY
Definition: core.h:59
spa_dict
Definition: utils/dict.h:48
PW_KEY_MEDIA_TYPE
#define PW_KEY_MEDIA_TYPE
Media.
Definition: src/pipewire/keys.h:277
SPA_FORMAT_VIDEO_framerate
@ SPA_FORMAT_VIDEO_framerate
frame rate (Fraction)
Definition: param/format.h:118
SPA_VIDEO_FORMAT_RGBA
@ SPA_VIDEO_FORMAT_RGBA
Definition: video/raw.h:69
PW_KEY_MEDIA_CATEGORY
#define PW_KEY_MEDIA_CATEGORY
Media Category: Playback, Capture, Duplex, Monitor, Manager.
Definition: src/pipewire/keys.h:279
SPA_DATA_MemId
@ SPA_DATA_MemId
memory is identified with an id
Definition: buffer/buffer.h:51
data::size
size_t size
Definition: media-session.c:112
spa_type_video_format
const struct spa_type_info spa_type_video_format[]
Definition: param/video/type-info.h:41
SPA_PARAM_EnumFormat
@ SPA_PARAM_EnumFormat
available formats as SPA_TYPE_OBJECT_Format
Definition: param.h:47
pw_main_loop_quit
int pw_main_loop_quit(struct pw_main_loop *loop)
Quit a main loop.
Definition: main-loop.c:131
SPA_POD_CHOICE_RANGE_Rectangle
#define SPA_POD_CHOICE_RANGE_Rectangle(def, min, max)
Definition: vararg.h:88
spa_dict_item::value
const char * value
Definition: utils/dict.h:43
SPA_FORMAT_VIDEO_format
@ SPA_FORMAT_VIDEO_format
video format (Id enum spa_video_format)
Definition: param/format.h:115
param
Definition: filter.c:80
SPA_META_Bitmap
@ SPA_META_Bitmap
struct spa_meta_bitmap
Definition: meta.h:45
spa_format_parse
int spa_format_parse(const struct spa_pod *format, uint32_t *media_type, uint32_t *media_subtype)
Definition: format-utils.h:42
pw_context_destroy
void pw_context_destroy(struct pw_context *context)
destroy a context object, all resources except the main_loop will be destroyed
Definition: context.c:464
client
Definition: module-protocol-native.c:103
PW_ID_ANY
#define PW_ID_ANY
Definition: core.h:69
SPA_DATA_MemFd
@ SPA_DATA_MemFd
generic fd, mmap to get to memory
Definition: buffer/buffer.h:49
SPA_VIDEO_FORMAT_RGB
@ SPA_VIDEO_FORMAT_RGB
Definition: video/raw.h:73
PW_TYPE_INTERFACE_Client
#define PW_TYPE_INTERFACE_Client
Definition: client.h:46
SPA_DATA_MemPtr
@ SPA_DATA_MemPtr
pointer to memory, the data field in struct spa_data is set.
Definition: buffer/buffer.h:47
server
Definition: module-protocol-native.c:126
registry
Definition: pipewire.c:76
spa_pod_builder_add_object
#define spa_pod_builder_add_object(b, type, id,...)
Definition: builder.h:650
pw_client_events
Client events.
Definition: client.h:77
SPA_VIDEO_FORMAT_I420
@ SPA_VIDEO_FORMAT_I420
Definition: video/raw.h:60
spa_pod_builder::size
uint32_t size
Definition: builder.h:65
SPA_TYPE_INFO_META_ARRAY_REGION_BASE
#define SPA_TYPE_INFO_META_ARRAY_REGION_BASE
Definition: buffer/type-info.h:71
SPA_POD_CHOICE_ENUM_Id
#define SPA_POD_CHOICE_ENUM_Id(n_vals,...)
Definition: vararg.h:57
pw_loop::loop
struct spa_loop * loop
wrapped loop
Definition: src/pipewire/loop.h:49
pw_stream_queue_buffer
int pw_stream_queue_buffer(struct pw_stream *stream, struct pw_buffer *buffer)
Submit a buffer for playback or recycle a buffer for capture.
Definition: stream.c:2044
PW_STREAM_FLAG_MAP_BUFFERS
@ PW_STREAM_FLAG_MAP_BUFFERS
mmap the buffers except DmaBuf
Definition: stream.h:254
SPA_POD_Id
#define SPA_POD_Id(val)
Definition: vararg.h:56
PW_VERSION_CLIENT
#define PW_VERSION_CLIENT
Definition: client.h:48
SPA_META_Header
@ SPA_META_Header
struct spa_meta_header
Definition: meta.h:42
pw_properties_new
struct pw_properties * pw_properties_new(const char *key,...) 1
Make a new properties object.
Definition: properties.c:98
SPA_META_Control
@ SPA_META_Control
metadata contains a spa_meta_control associated with the data
Definition: meta.h:47
spa_pod_builder
Definition: builder.h:63
SPA_MEDIA_SUBTYPE_raw
@ SPA_MEDIA_SUBTYPE_raw
Definition: param/format.h:53
methods
struct spa_thread_utils_methods methods
Definition: thread.c:68
data::context
struct pw_context * context
Definition: filter.c:76
pw_client_add_listener
#define pw_client_add_listener(c,...)
Definition: client.h:169
pw_registry_add_listener
#define pw_registry_add_listener(p,...)
Registry.
Definition: core.h:507
spa_debug_type_find_name
const char * spa_debug_type_find_name(const struct spa_type_info *info, uint32_t type)
Definition: types.h:68
pw_stream_events
Events for a stream.
Definition: stream.h:211
pw_main_loop_destroy
void pw_main_loop_destroy(struct pw_main_loop *loop)
Destroy a loop.
Definition: main-loop.c:96
SPA_DATA_Invalid
@ SPA_DATA_Invalid
Definition: buffer/buffer.h:46