5#ifndef SPA_POD_FILTER_H
6#define SPA_POD_FILTER_H
23#ifndef SPA_API_POD_FILTER
25 #define SPA_API_POD_FILTER SPA_API_IMPL
27 #define SPA_API_POD_FILTER static inline
55 memcpy(val, alt, size);
60 memcpy(val, alt, size);
68 for (i = 1; i < nvals; i++) {
78 memcpy(val, best, size);
89 uint32_t type,
const void *r1,
const void *r2, uint32_t size
SPA_UNUSED)
94 int32_t val = (*(int32_t *) r1) & (*(int32_t *) r2);
102 int64_t val = (*(int64_t *) r1) & (*(int64_t *) r2);
119 return *(int32_t *) r1 % *(int32_t *) r2 == 0;
121 return *(int64_t *) r1 % *(int64_t *) r2 == 0;
127 return (rec1->
width % rec2->width == 0 &&
128 rec1->
height % rec2->height == 0);
121 return *(int64_t *) r1 % *(int64_t *) r2 == 0; {
…}
143 uint32_t j, k, nalt1, nalt2;
144 void *alt1, *alt2, *a1, *a2;
145 uint32_t type, size, p1c, p2c;
192 for (j = 0, a1 = alt1; j < nalt1; j++, a1 =
SPA_PTROFF(a1, size,
void)) {
193 for (k = 0, a2 = alt2; k < nalt2; k++, a2 =
SPA_PTROFF(a2,size,
void)) {
210 for (j = 0, a1 = alt1, a2 = alt2; j < nalt1; j++, a1 =
SPA_PTROFF(a1,size,
void)) {
226 for (j = 0, a1 = alt1, a2 = alt2; j < nalt1; j++, a1 =
SPA_PTROFF(a1,size,
void)) {
251 for (k = 0, a1 = alt1, a2 = alt2; k < nalt2; k++, a2 =
SPA_PTROFF(a2,size,
void)) {
301 for (j = 0, a1 = alt1, a2 = alt2; j < nalt2; j++, a2 =
SPA_PTROFF(a1,size,
void)) {
339 const struct spa_pod *filter, uint32_t filter_size)
144 void *alt1, *alt2, *a1, *a2; {
…}
347 bool do_copy =
false, do_advance =
false;
348 uint32_t filter_offset = 0;
uint32_t int int res
Definition core.h:433
SPA_API_POD_BUILDER void * spa_pod_builder_pop(struct spa_pod_builder *builder, struct spa_pod_frame *frame)
Definition builder.h:187
SPA_API_POD_BUILDER int spa_pod_builder_int(struct spa_pod_builder *builder, int32_t val)
Definition builder.h:266
SPA_API_POD_BUILDER int spa_pod_builder_long(struct spa_pod_builder *builder, int64_t val)
Definition builder.h:275
SPA_API_POD_BUILDER int spa_pod_builder_push_choice(struct spa_pod_builder *builder, struct spa_pod_frame *frame, uint32_t type, uint32_t flags)
Definition builder.h:425
#define SPA_POD_CHOICE_VALUE_TYPE(choice)
Definition pod.h:138
SPA_API_POD_ITER struct spa_pod * spa_pod_get_values(const struct spa_pod *pod, uint32_t *n_vals, uint32_t *choice)
Definition iter.h:363
#define SPA_POD_PROP_FLAG_MANDATORY
is mandatory
Definition pod.h:222
#define SPA_POD_CHOICE_VALUE_SIZE(choice)
Definition pod.h:140
SPA_API_POD_FILTER int spa_pod_filter_prop(struct spa_pod_builder *b, const struct spa_pod_prop *p1, const struct spa_pod_prop *p2)
Definition filter.h:144
SPA_API_POD_BUILDER void spa_pod_builder_get_state(struct spa_pod_builder *builder, struct spa_pod_builder_state *state)
Definition builder.h:75
SPA_API_POD_ITER const struct spa_pod_prop * spa_pod_object_find_prop(const struct spa_pod_object *pod, const struct spa_pod_prop *start, uint32_t key)
Definition iter.h:404
SPA_API_POD_COMPARE int spa_pod_compare_value(uint32_t type, const void *r1, const void *r2, uint32_t size)
Definition compare.h:43
#define SPA_POD_OBJECT_FOREACH(obj, iter)
Definition iter.h:124
#define SPA_POD_BODY(pod)
Definition pod.h:39
#define SPA_POD_TYPE(pod)
Definition pod.h:28
SPA_API_POD_ITER void * spa_pod_next(const void *iter)
Definition iter.h:52
SPA_API_POD_BUILDER int spa_pod_builder_push_struct(struct spa_pod_builder *builder, struct spa_pod_frame *frame)
Definition builder.h:441
SPA_API_POD_BUILDER struct spa_pod * spa_pod_builder_deref(struct spa_pod_builder *builder, uint32_t offset)
Definition builder.h:103
SPA_API_POD_BUILDER int spa_pod_builder_push_object(struct spa_pod_builder *builder, struct spa_pod_frame *frame, uint32_t type, uint32_t id)
Definition builder.h:454
SPA_API_POD_FILTER int spa_pod_filter(struct spa_pod_builder *b, struct spa_pod **result, const struct spa_pod *pod, const struct spa_pod *filter)
Definition filter.h:445
SPA_API_POD_BUILDER void spa_pod_builder_reset(struct spa_pod_builder *builder, struct spa_pod_builder_state *state)
Definition builder.h:88
#define SPA_POD_FOREACH(pod, size, iter)
Definition iter.h:111
#define SPA_POD_CHOICE_VALUES(choice)
Definition pod.h:144
#define SPA_POD_PROP_SIZE(prop)
Definition pod.h:205
SPA_API_POD_FILTER int spa_pod_filter_flags_value(struct spa_pod_builder *b, uint32_t type, const void *r1, const void *r2, uint32_t size 1)
Definition filter.h:95
SPA_API_POD_ITER bool spa_pod_is_inside(const void *pod, uint32_t size, const void *iter)
Definition iter.h:44
SPA_API_POD_FILTER int spa_pod_choice_fix_default(struct spa_pod_choice *choice)
Definition filter.h:43
SPA_API_POD_BUILDER int spa_pod_builder_raw(struct spa_pod_builder *builder, const void *data, uint32_t size)
Definition builder.h:138
SPA_API_POD_BUILDER struct spa_pod * spa_pod_builder_frame(struct spa_pod_builder *builder, struct spa_pod_frame *frame)
Definition builder.h:115
#define SPA_POD_CHOICE_N_VALUES(choice)
Definition pod.h:142
SPA_API_POD_BUILDER int spa_pod_builder_primitive(struct spa_pod_builder *builder, const struct spa_pod *p)
Definition builder.h:205
SPA_API_POD_BUILDER int spa_pod_builder_raw_padded(struct spa_pod_builder *builder, const void *data, uint32_t size)
Definition builder.h:179
SPA_API_POD_FILTER int spa_pod_filter_is_step_of(uint32_t type, const void *r1, const void *r2, uint32_t size 1)
Definition filter.h:121
SPA_API_POD_FILTER int spa_pod_filter_part(struct spa_pod_builder *b, const struct spa_pod *pod, uint32_t pod_size, const struct spa_pod *filter, uint32_t filter_size)
Definition filter.h:344
#define SPA_POD_SIZE(pod)
Definition pod.h:30
SPA_API_POD_BUILDER int spa_pod_builder_prop(struct spa_pod_builder *builder, uint32_t key, uint32_t flags)
Definition builder.h:469
@ SPA_CHOICE_Step
range with step: default, min, max, step
Definition pod.h:149
@ SPA_CHOICE_None
no choice, first value is current
Definition pod.h:147
@ SPA_CHOICE_Flags
flags: default, possible flags,...
Definition pod.h:151
@ SPA_CHOICE_Range
range: default, min, max
Definition pod.h:148
@ SPA_CHOICE_Enum
list: default, alternative,...
Definition pod.h:150
@ SPA_TYPE_Int
Definition type.h:45
@ SPA_TYPE_Rectangle
Definition type.h:51
@ SPA_TYPE_Long
Definition type.h:46
@ SPA_TYPE_Object
Definition type.h:56
@ SPA_TYPE_Struct
Definition type.h:55
#define SPA_UNUSED
Definition defs.h:307
#define spa_return_val_if_fail(expr, val)
Definition defs.h:456
#define SPA_PTROFF(ptr_, offset_, type_)
Return the address (buffer + offset) as pointer of type.
Definition defs.h:222
#define SPA_API_POD_FILTER
Definition filter.h:34
uint32_t type
type of choice, one of enum spa_choice_type
Definition pod.h:155
struct spa_pod_choice_body body
Definition pod.h:164
struct spa_pod pod
Definition pod.h:163
uint32_t type
one of enum spa_type
Definition pod.h:178
uint32_t id
id of the object, depends on the object type
Definition pod.h:179
struct spa_pod_object_body body
Definition pod.h:185
uint32_t key
key of property, list of valid keys depends on the object type
Definition pod.h:209
uint32_t flags
flags for property
Definition pod.h:225
struct spa_pod value
Definition pod.h:226
uint32_t type
Definition pod.h:45
uint32_t size
Definition pod.h:44
uint32_t width
Definition defs.h:117
uint32_t height
Definition defs.h:118