Skip to content

Commit

Permalink
camera: work around old PipeWire versions
Browse files Browse the repository at this point in the history
  • Loading branch information
wtay committed May 9, 2024
1 parent 17688b7 commit ff6dd81
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/camera/pipewire/SDL_camera_pipewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,12 @@ static void do_resync(void)
hotplug.pending_seq = pw_core_sync(hotplug.core, PW_ID_CORE, 0);
}

#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

/** node */
static void node_event_info(void *object, const struct pw_node_info *info)
{
Expand All @@ -765,14 +771,14 @@ static void node_event_info(void *object, const struct pw_node_info *info)
if (id != SPA_PARAM_EnumFormat)
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))
continue;

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))
info->params[i].seq = res;
SPA_PARAMS_INFO_SEQ(info->params[i]) = res;

g->changed++;
}
Expand Down

0 comments on commit ff6dd81

Please sign in to comment.