mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
uri -> type
Clean up some more types.
This commit is contained in:
parent
5825c62d6d
commit
25b7ede0bc
46 changed files with 276 additions and 256 deletions
|
|
@ -159,20 +159,20 @@ core_event_remove_id (void *object,
|
|||
}
|
||||
|
||||
static void
|
||||
core_event_update_uris (void *object,
|
||||
uint32_t first_id,
|
||||
uint32_t n_uris,
|
||||
const char **uris)
|
||||
core_event_update_types (void *object,
|
||||
uint32_t first_id,
|
||||
uint32_t n_types,
|
||||
const char **types)
|
||||
{
|
||||
PinosProxy *proxy = object;
|
||||
PinosContext *this = proxy->context;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < n_uris; i++, first_id++) {
|
||||
SpaType this_id = spa_type_map_get_id (this->type.map, uris[i]);
|
||||
printf ("update %d %s -> %d\n", first_id, uris[i], this_id);
|
||||
for (i = 0; i < n_types; i++, first_id++) {
|
||||
SpaType this_id = spa_type_map_get_id (this->type.map, types[i]);
|
||||
printf ("update %d %s -> %d\n", first_id, types[i], this_id);
|
||||
if (!pinos_map_insert_at (&this->types, first_id, SPA_UINT32_TO_PTR (this_id)))
|
||||
pinos_log_error ("can't add uri for client");
|
||||
pinos_log_error ("can't add type for client");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -181,7 +181,7 @@ static const PinosCoreEvents core_events = {
|
|||
&core_event_done,
|
||||
&core_event_error,
|
||||
&core_event_remove_id,
|
||||
&core_event_update_uris
|
||||
&core_event_update_types
|
||||
};
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ static struct {
|
|||
SpaTypeMediaSubtype media_subtype;
|
||||
SpaTypeMediaSubtypeVideo media_subtype_video;
|
||||
SpaTypeMediaSubtypeAudio media_subtype_audio;
|
||||
SpaTypePropVideo prop_video;
|
||||
SpaTypePropAudio prop_audio;
|
||||
SpaTypeFormatVideo format_video;
|
||||
SpaTypeFormatAudio format_audio;
|
||||
SpaTypeVideoFormat video_format;
|
||||
SpaTypeAudioFormat audio_format;
|
||||
} type = { 0, };
|
||||
|
|
@ -59,8 +59,8 @@ ensure_types (void)
|
|||
spa_type_media_subtype_map (map, &type.media_subtype);
|
||||
spa_type_media_subtype_video_map (map, &type.media_subtype_video);
|
||||
spa_type_media_subtype_audio_map (map, &type.media_subtype_audio);
|
||||
spa_type_prop_video_map (map, &type.prop_video);
|
||||
spa_type_prop_audio_map (map, &type.prop_audio);
|
||||
spa_type_format_video_map (map, &type.format_video);
|
||||
spa_type_format_audio_map (map, &type.format_audio);
|
||||
spa_type_video_format_map (map, &type.video_format);
|
||||
spa_type_audio_format_map (map, &type.audio_format);
|
||||
}
|
||||
|
|
@ -369,10 +369,10 @@ handle_video_fields (ConvertData *d)
|
|||
for (i = 0; (v = get_nth_string (value, i)); i++) {
|
||||
if (i == 0)
|
||||
spa_pod_builder_push_prop (&d->b, &f,
|
||||
type.prop_video.format,
|
||||
type.format_video.format,
|
||||
get_range_type (value) | SPA_POD_PROP_FLAG_READWRITE);
|
||||
|
||||
spa_pod_builder_uri (&d->b, *video_format_map[gst_video_format_from_string (v)]);
|
||||
spa_pod_builder_id (&d->b, *video_format_map[gst_video_format_from_string (v)]);
|
||||
}
|
||||
if (i > 1)
|
||||
SPA_POD_BUILDER_DEREF (&d->b, f.ref, SpaPODProp)->body.flags |= SPA_POD_PROP_FLAG_UNSET;
|
||||
|
|
@ -385,7 +385,7 @@ handle_video_fields (ConvertData *d)
|
|||
for (i = 0; get_nth_rectangle (value, value2, i, &v); i++) {
|
||||
if (i == 0)
|
||||
spa_pod_builder_push_prop (&d->b, &f,
|
||||
type.prop_video.size,
|
||||
type.format_video.size,
|
||||
get_range_type2 (value, value2) | SPA_POD_PROP_FLAG_READWRITE);
|
||||
|
||||
spa_pod_builder_rectangle (&d->b, v.width, v.height);
|
||||
|
|
@ -401,7 +401,7 @@ handle_video_fields (ConvertData *d)
|
|||
for (i = 0; get_nth_fraction (value, i, &v); i++) {
|
||||
if (i == 0)
|
||||
spa_pod_builder_push_prop (&d->b, &f,
|
||||
type.prop_video.framerate,
|
||||
type.format_video.framerate,
|
||||
get_range_type (value) | SPA_POD_PROP_FLAG_READWRITE);
|
||||
|
||||
spa_pod_builder_fraction (&d->b, v.num, v.denom);
|
||||
|
|
@ -426,10 +426,10 @@ handle_audio_fields (ConvertData *d)
|
|||
for (i = 0; (v = get_nth_string (value, i)); i++) {
|
||||
if (i == 0)
|
||||
spa_pod_builder_push_prop (&d->b, &f,
|
||||
type.prop_audio.format,
|
||||
type.format_audio.format,
|
||||
get_range_type (value) | SPA_POD_PROP_FLAG_READWRITE);
|
||||
|
||||
spa_pod_builder_uri (&d->b, *audio_format_map[gst_audio_format_from_string (v)]);
|
||||
spa_pod_builder_id (&d->b, *audio_format_map[gst_audio_format_from_string (v)]);
|
||||
}
|
||||
if (i > 1)
|
||||
SPA_POD_BUILDER_DEREF (&d->b, f.ref, SpaPODProp)->body.flags |= SPA_POD_PROP_FLAG_UNSET;
|
||||
|
|
@ -451,7 +451,7 @@ handle_audio_fields (ConvertData *d)
|
|||
|
||||
if (i == 0)
|
||||
spa_pod_builder_push_prop (&d->b, &f,
|
||||
type.prop_audio.layout,
|
||||
type.format_audio.layout,
|
||||
get_range_type (value) | SPA_POD_PROP_FLAG_READWRITE);
|
||||
|
||||
spa_pod_builder_int (&d->b, layout);
|
||||
|
|
@ -466,7 +466,7 @@ handle_audio_fields (ConvertData *d)
|
|||
for (i = 0; get_nth_int (value, i, &v); i++) {
|
||||
if (i == 0)
|
||||
spa_pod_builder_push_prop (&d->b, &f,
|
||||
type.prop_audio.rate,
|
||||
type.format_audio.rate,
|
||||
get_range_type (value) | SPA_POD_PROP_FLAG_READWRITE);
|
||||
|
||||
spa_pod_builder_int (&d->b, v);
|
||||
|
|
@ -481,7 +481,7 @@ handle_audio_fields (ConvertData *d)
|
|||
for (i = 0; get_nth_int (value, i, &v); i++) {
|
||||
if (i == 0)
|
||||
spa_pod_builder_push_prop (&d->b, &f,
|
||||
type.prop_audio.channels,
|
||||
type.format_audio.channels,
|
||||
get_range_type (value) | SPA_POD_PROP_FLAG_READWRITE);
|
||||
|
||||
spa_pod_builder_int (&d->b, v);
|
||||
|
|
|
|||
|
|
@ -54,8 +54,8 @@ setup_video_node (PinosCore *core, SpaNode *spa_node, PinosProperties *pinos_pro
|
|||
}
|
||||
|
||||
if ((prop = spa_pod_object_find_prop (props, spa_type_map_get_id (core->type.map, SPA_TYPE_PROPS__patternType)))) {
|
||||
if (prop->body.value.type == SPA_POD_TYPE_URI)
|
||||
SPA_POD_VALUE (SpaPODURI, &prop->body.value) = spa_type_map_get_id (core->type.map, pattern_type);
|
||||
if (prop->body.value.type == SPA_POD_TYPE_ID)
|
||||
SPA_POD_VALUE (SpaPODId, &prop->body.value) = spa_type_map_get_id (core->type.map, pattern_type);
|
||||
}
|
||||
|
||||
if ((res = spa_node_set_props (spa_node, props)) != SPA_RESULT_OK) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue