mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-01 23:48:29 +00:00
camera: work around old PipeWire versions
This commit is contained in:

committed by
Sam Lantinga

parent
8186e4b322
commit
fb429f0dfe
@@ -292,6 +292,12 @@ static uint32_t param_clear(struct spa_list *param_list, uint32_t id)
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if PW_CHECK_VERSION(0,3,60)
|
||||||
|
#define SPA_PARAMS_INFO_SEQ(p) ((p).seq)
|
||||||
|
#else
|
||||||
|
#define SPA_PARAMS_INFO_SEQ(p) ((p).padding[0])
|
||||||
|
#endif
|
||||||
|
|
||||||
static struct param *param_add(struct spa_list *params,
|
static struct param *param_add(struct spa_list *params,
|
||||||
int seq, uint32_t id, const struct spa_pod *param)
|
int seq, uint32_t id, const struct spa_pod *param)
|
||||||
{
|
{
|
||||||
@@ -332,7 +338,7 @@ static void param_update(struct spa_list *param_list, struct spa_list *pending_l
|
|||||||
for (i = 0; i < n_params; i++) {
|
for (i = 0; i < n_params; i++) {
|
||||||
spa_list_for_each_safe(p, t, pending_list, link) {
|
spa_list_for_each_safe(p, t, pending_list, link) {
|
||||||
if (p->id == params[i].id &&
|
if (p->id == params[i].id &&
|
||||||
p->seq != params[i].seq &&
|
p->seq != SPA_PARAMS_INFO_SEQ(params[i]) &&
|
||||||
p->param != NULL) {
|
p->param != NULL) {
|
||||||
spa_list_remove(&p->link);
|
spa_list_remove(&p->link);
|
||||||
free(p);
|
free(p);
|
||||||
@@ -765,14 +771,14 @@ static void node_event_info(void *object, const struct pw_node_info *info)
|
|||||||
if (id != SPA_PARAM_EnumFormat)
|
if (id != SPA_PARAM_EnumFormat)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
param_add(&g->pending_list, info->params[i].seq, id, NULL);
|
param_add(&g->pending_list, SPA_PARAMS_INFO_SEQ(info->params[i]), id, NULL);
|
||||||
if (!(info->params[i].flags & SPA_PARAM_INFO_READ))
|
if (!(info->params[i].flags & SPA_PARAM_INFO_READ))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
res = pw_node_enum_params((struct pw_node*)g->proxy,
|
res = pw_node_enum_params((struct pw_node*)g->proxy,
|
||||||
++info->params[i].seq, id, 0, -1, NULL);
|
++SPA_PARAMS_INFO_SEQ(info->params[i]), id, 0, -1, NULL);
|
||||||
if (SPA_RESULT_IS_ASYNC(res))
|
if (SPA_RESULT_IS_ASYNC(res))
|
||||||
info->params[i].seq = res;
|
SPA_PARAMS_INFO_SEQ(info->params[i]) = res;
|
||||||
|
|
||||||
g->changed++;
|
g->changed++;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user