mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
format: implement more gstreamer -> pinos format
This commit is contained in:
parent
0d2f5a1386
commit
837c23a370
8 changed files with 367 additions and 60 deletions
|
|
@ -234,3 +234,23 @@ fallback:
|
|||
|
||||
return res;
|
||||
}
|
||||
|
||||
SpaResult
|
||||
spa_audio_raw_fill_prop_info (SpaPropInfo *info,
|
||||
SpaPropIdAudio id,
|
||||
size_t offset)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
if (info == NULL)
|
||||
return SPA_RESULT_INVALID_ARGUMENTS;
|
||||
|
||||
for (i = 0; i < SPA_N_ELEMENTS (raw_format_prop_info); i++) {
|
||||
if (raw_format_prop_info[i].id == id) {
|
||||
memcpy (info, &raw_format_prop_info[i], sizeof (SpaPropInfo));
|
||||
info->offset = offset;
|
||||
return SPA_RESULT_OK;
|
||||
}
|
||||
}
|
||||
return SPA_RESULT_INVALID_PROPERTY_INDEX;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,10 +72,10 @@ typedef struct {
|
|||
*/
|
||||
SpaResult
|
||||
spa_control_init_data (SpaControl *control,
|
||||
void *data,
|
||||
size_t size,
|
||||
int *fds,
|
||||
unsigned int n_fds)
|
||||
void *data,
|
||||
size_t size,
|
||||
int *fds,
|
||||
unsigned int n_fds)
|
||||
{
|
||||
SpaStackControl *sc = SSC (control);
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ spa_props_set_prop (SpaProps *props,
|
|||
if (info->offset != 0)
|
||||
memcpy ((uint8_t*)props + info->offset, value->value, value->size);
|
||||
|
||||
props->unset_mask &= ~(1 << index);
|
||||
props->unset_mask &= ~(1u << index);
|
||||
|
||||
return SPA_RESULT_OK;
|
||||
}
|
||||
|
|
@ -68,8 +68,7 @@ spa_props_get_prop (const SpaProps *props,
|
|||
info = &props->prop_info[index];
|
||||
if ((info->flags & SPA_PROP_FLAG_READABLE) == 0)
|
||||
return SPA_RESULT_INVALID_PROPERTY_ACCESS;
|
||||
|
||||
if (props->unset_mask & (1 << index))
|
||||
if (props->unset_mask & (1u << index))
|
||||
return SPA_RESULT_PROPERTY_UNSET;
|
||||
|
||||
value->type = info->type;
|
||||
|
|
@ -106,7 +105,7 @@ spa_props_copy (const SpaProps *src,
|
|||
if (info->offset)
|
||||
memcpy ((uint8_t*)dest + info->offset, value.value, value.size);
|
||||
|
||||
dest->unset_mask &= ~(1 << i);
|
||||
dest->unset_mask &= ~(1u << i);
|
||||
}
|
||||
return SPA_RESULT_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue