@@ -27,11 +27,11 @@ extern "C" {
27
27
* \{
28
28
*/
29
29
30
- #define PW_TYPE_INTERFACE_Port PW_TYPE_INFO_INTERFACE_BASE "Port"
30
+ #define PW_TYPE_INTERFACE_Port PW_TYPE_INFO_INTERFACE_BASE "Port"
31
31
32
- #define PW_PORT_PERM_MASK PW_PERM_R|PW_PERM_X|PW_PERM_M
32
+ #define PW_PORT_PERM_MASK PW_PERM_R|PW_PERM_X|PW_PERM_M
33
33
34
- #define PW_VERSION_PORT 3
34
+ #define PW_VERSION_PORT 3
35
35
struct pw_port ;
36
36
37
37
#ifndef PW_API_PORT_IMPL
@@ -47,132 +47,132 @@ struct pw_port;
47
47
const char * pw_direction_as_string (enum pw_direction direction );
48
48
49
49
struct pw_port_info {
50
- uint32_t id ; /**< id of the global */
51
- enum pw_direction direction ; /**< port direction */
52
- #define PW_PORT_CHANGE_MASK_PROPS (1 << 0)
53
- #define PW_PORT_CHANGE_MASK_PARAMS (1 << 1)
54
- #define PW_PORT_CHANGE_MASK_ALL ((1 << 2)-1)
55
- uint64_t change_mask ; /**< bitfield of changed fields since last call */
56
- struct spa_dict * props ; /**< the properties of the port */
57
- struct spa_param_info * params ; /**< parameters */
58
- uint32_t n_params ; /**< number of items in \a params */
50
+ uint32_t id ; /**< id of the global */
51
+ enum pw_direction direction ; /**< port direction */
52
+ #define PW_PORT_CHANGE_MASK_PROPS (1 << 0)
53
+ #define PW_PORT_CHANGE_MASK_PARAMS (1 << 1)
54
+ #define PW_PORT_CHANGE_MASK_ALL ((1 << 2)-1)
55
+ uint64_t change_mask ; /**< bitfield of changed fields since last call */
56
+ struct spa_dict * props ; /**< the properties of the port */
57
+ struct spa_param_info * params ; /**< parameters */
58
+ uint32_t n_params ; /**< number of items in \a params */
59
59
};
60
60
61
61
struct pw_port_info *
62
62
pw_port_info_update (struct pw_port_info * info ,
63
- const struct pw_port_info * update );
63
+ const struct pw_port_info * update );
64
64
65
65
struct pw_port_info *
66
66
pw_port_info_merge (struct pw_port_info * info ,
67
- const struct pw_port_info * update , bool reset );
67
+ const struct pw_port_info * update , bool reset );
68
68
69
69
void
70
70
pw_port_info_free (struct pw_port_info * info );
71
71
72
- #define PW_PORT_EVENT_INFO 0
73
- #define PW_PORT_EVENT_PARAM 1
74
- #define PW_PORT_EVENT_NUM 2
72
+ #define PW_PORT_EVENT_INFO 0
73
+ #define PW_PORT_EVENT_PARAM 1
74
+ #define PW_PORT_EVENT_NUM 2
75
75
76
76
/** Port events */
77
77
struct pw_port_events {
78
- #define PW_VERSION_PORT_EVENTS 0
79
- uint32_t version ;
80
- /**
81
- * Notify port info
82
- *
83
- * \param info info about the port
84
- */
85
- void (* info ) (void * data , const struct pw_port_info * info );
86
- /**
87
- * Notify a port param
88
- *
89
- * Event emitted as a result of the enum_params method.
90
- *
91
- * \param seq the sequence number of the request
92
- * \param id the param id
93
- * \param index the param index
94
- * \param next the param index of the next param
95
- * \param param the parameter
96
- */
97
- void (* param ) (void * data , int seq ,
98
- uint32_t id , uint32_t index , uint32_t next ,
99
- const struct spa_pod * param );
78
+ #define PW_VERSION_PORT_EVENTS 0
79
+ uint32_t version ;
80
+ /**
81
+ * Notify port info
82
+ *
83
+ * \param info info about the port
84
+ */
85
+ void (* info ) (void * data , const struct pw_port_info * info );
86
+ /**
87
+ * Notify a port param
88
+ *
89
+ * Event emitted as a result of the enum_params method.
90
+ *
91
+ * \param seq the sequence number of the request
92
+ * \param id the param id
93
+ * \param index the param index
94
+ * \param next the param index of the next param
95
+ * \param param the parameter
96
+ */
97
+ void (* param ) (void * data , int seq ,
98
+ uint32_t id , uint32_t index , uint32_t next ,
99
+ const struct spa_pod * param );
100
100
};
101
101
102
- #define PW_PORT_METHOD_ADD_LISTENER 0
103
- #define PW_PORT_METHOD_SUBSCRIBE_PARAMS 1
104
- #define PW_PORT_METHOD_ENUM_PARAMS 2
105
- #define PW_PORT_METHOD_NUM 3
102
+ #define PW_PORT_METHOD_ADD_LISTENER 0
103
+ #define PW_PORT_METHOD_SUBSCRIBE_PARAMS 1
104
+ #define PW_PORT_METHOD_ENUM_PARAMS 2
105
+ #define PW_PORT_METHOD_NUM 3
106
106
107
107
/** Port methods */
108
108
struct pw_port_methods {
109
- #define PW_VERSION_PORT_METHODS 0
110
- uint32_t version ;
111
-
112
- int (* add_listener ) (void * object ,
113
- struct spa_hook * listener ,
114
- const struct pw_port_events * events ,
115
- void * data );
116
- /**
117
- * Subscribe to parameter changes
118
- *
119
- * Automatically emit param events for the given ids when
120
- * they are changed.
121
- *
122
- * \param ids an array of param ids
123
- * \param n_ids the number of ids in \a ids
124
- *
125
- * This requires X permissions on the port.
126
- */
127
- int (* subscribe_params ) (void * object , uint32_t * ids , uint32_t n_ids );
128
-
129
- /**
130
- * Enumerate port parameters
131
- *
132
- * Start enumeration of port parameters. For each param, a
133
- * param event will be emitted.
134
- *
135
- * \param seq a sequence number returned in the reply
136
- * \param id the parameter id to enumerate
137
- * \param start the start index or 0 for the first param
138
- * \param num the maximum number of params to retrieve
139
- * \param filter a param filter or NULL
140
- *
141
- * This requires X permissions on the port.
142
- */
143
- int (* enum_params ) (void * object , int seq ,
144
- uint32_t id , uint32_t start , uint32_t num ,
145
- const struct spa_pod * filter );
109
+ #define PW_VERSION_PORT_METHODS 0
110
+ uint32_t version ;
111
+
112
+ int (* add_listener ) (void * object ,
113
+ struct spa_hook * listener ,
114
+ const struct pw_port_events * events ,
115
+ void * data );
116
+ /**
117
+ * Subscribe to parameter changes
118
+ *
119
+ * Automatically emit param events for the given ids when
120
+ * they are changed.
121
+ *
122
+ * \param ids an array of param ids
123
+ * \param n_ids the number of ids in \a ids
124
+ *
125
+ * This requires X permissions on the port.
126
+ */
127
+ int (* subscribe_params ) (void * object , uint32_t * ids , uint32_t n_ids );
128
+
129
+ /**
130
+ * Enumerate port parameters
131
+ *
132
+ * Start enumeration of port parameters. For each param, a
133
+ * param event will be emitted.
134
+ *
135
+ * \param seq a sequence number returned in the reply
136
+ * \param id the parameter id to enumerate
137
+ * \param start the start index or 0 for the first param
138
+ * \param num the maximum number of params to retrieve
139
+ * \param filter a param filter or NULL
140
+ *
141
+ * This requires X permissions on the port.
142
+ */
143
+ int (* enum_params ) (void * object , int seq ,
144
+ uint32_t id , uint32_t start , uint32_t num ,
145
+ const struct spa_pod * filter );
146
146
};
147
147
148
148
/** \copydoc pw_port_methods.add_listener
149
149
* \sa pw_port_methods.add_listener */
150
150
PW_API_PORT_IMPL int pw_port_add_listener (struct pw_port * object ,
151
- struct spa_hook * listener ,
152
- const struct pw_port_events * events ,
153
- void * data )
151
+ struct spa_hook * listener ,
152
+ const struct pw_port_events * events ,
153
+ void * data )
154
154
{
155
- return spa_api_method_r (int , - ENOTSUP ,
156
- pw_port , (struct spa_interface * )object , add_listener , 0 ,
157
- listener , events , data );
155
+ return spa_api_method_r (int , - ENOTSUP ,
156
+ pw_port , (struct spa_interface * )object , add_listener , 0 ,
157
+ listener , events , data );
158
158
}
159
159
/** \copydoc pw_port_methods.subscribe_params
160
160
* \sa pw_port_methods.subscribe_params */
161
161
PW_API_PORT_IMPL int pw_port_subscribe_params (struct pw_port * object , uint32_t * ids , uint32_t n_ids )
162
162
{
163
- return spa_api_method_r (int , - ENOTSUP ,
164
- pw_port , (struct spa_interface * )object , subscribe_params , 0 ,
165
- ids , n_ids );
163
+ return spa_api_method_r (int , - ENOTSUP ,
164
+ pw_port , (struct spa_interface * )object , subscribe_params , 0 ,
165
+ ids , n_ids );
166
166
}
167
167
/** \copydoc pw_port_methods.enum_params
168
168
* \sa pw_port_methods.enum_params */
169
169
PW_API_PORT_IMPL int pw_port_enum_params (struct pw_port * object ,
170
- int seq , uint32_t id , uint32_t start , uint32_t num ,
171
- const struct spa_pod * filter )
170
+ int seq , uint32_t id , uint32_t start , uint32_t num ,
171
+ const struct spa_pod * filter )
172
172
{
173
- return spa_api_method_r (int , - ENOTSUP ,
174
- pw_port , (struct spa_interface * )object , enum_params , 0 ,
175
- seq , id , start , num , filter );
173
+ return spa_api_method_r (int , - ENOTSUP ,
174
+ pw_port , (struct spa_interface * )object , enum_params , 0 ,
175
+ seq , id , start , num , filter );
176
176
}
177
177
178
178
/**
0 commit comments