uri -> type

Clean up some more types.
This commit is contained in:
Wim Taymans 2017-03-24 13:11:57 +01:00
parent 5825c62d6d
commit 25b7ede0bc
46 changed files with 276 additions and 256 deletions

View file

@ -74,7 +74,7 @@ typedef struct {
SpaTypeMediaType media_type;
SpaTypeMediaSubtype media_subtype;
SpaTypeMediaSubtypeVideo media_subtype_video;
SpaTypePropVideo prop_video;
SpaTypeFormatVideo format_video;
SpaTypeVideoFormat video_format;
SpaTypeEventNode event_node;
SpaTypeCommandNode command_node;
@ -95,7 +95,7 @@ init_type (Type *type, SpaTypeMap *map)
spa_type_media_type_map (map, &type->media_type);
spa_type_media_subtype_map (map, &type->media_subtype);
spa_type_media_subtype_video_map (map, &type->media_subtype_video);
spa_type_prop_video_map (map, &type->prop_video);
spa_type_format_video_map (map, &type->format_video);
spa_type_video_format_map (map, &type->video_format);
spa_type_event_node_map (map, &type->event_node);
spa_type_command_node_map (map, &type->command_node);
@ -593,22 +593,22 @@ spa_v4l2_source_node_port_get_format (SpaNode *node,
if (state->current_format.media_subtype == this->type.media_subtype.raw) {
spa_pod_builder_add (&b,
PROP (&f[1], this->type.prop_video.format, SPA_POD_TYPE_URI, state->current_format.info.raw.format),
PROP (&f[1], this->type.prop_video.size, -SPA_POD_TYPE_RECTANGLE, &state->current_format.info.raw.size),
PROP (&f[1], this->type.prop_video.framerate, -SPA_POD_TYPE_FRACTION, &state->current_format.info.raw.framerate),
PROP (&f[1], this->type.format_video.format, SPA_POD_TYPE_ID, state->current_format.info.raw.format),
PROP (&f[1], this->type.format_video.size, -SPA_POD_TYPE_RECTANGLE, &state->current_format.info.raw.size),
PROP (&f[1], this->type.format_video.framerate, -SPA_POD_TYPE_FRACTION, &state->current_format.info.raw.framerate),
0);
}
else if (state->current_format.media_subtype == this->type.media_subtype_video.mjpg ||
state->current_format.media_subtype == this->type.media_subtype_video.jpeg) {
spa_pod_builder_add (&b,
PROP (&f[1], this->type.prop_video.size, -SPA_POD_TYPE_RECTANGLE, &state->current_format.info.mjpg.size),
PROP (&f[1], this->type.prop_video.framerate, -SPA_POD_TYPE_FRACTION, &state->current_format.info.mjpg.framerate),
PROP (&f[1], this->type.format_video.size, -SPA_POD_TYPE_RECTANGLE, &state->current_format.info.mjpg.size),
PROP (&f[1], this->type.format_video.framerate, -SPA_POD_TYPE_FRACTION, &state->current_format.info.mjpg.framerate),
0);
}
else if (state->current_format.media_subtype == this->type.media_subtype_video.h264) {
spa_pod_builder_add (&b,
PROP (&f[1], this->type.prop_video.size, -SPA_POD_TYPE_RECTANGLE, &state->current_format.info.h264.size),
PROP (&f[1], this->type.prop_video.framerate, -SPA_POD_TYPE_FRACTION, &state->current_format.info.h264.framerate),
PROP (&f[1], this->type.format_video.size, -SPA_POD_TYPE_RECTANGLE, &state->current_format.info.h264.size),
PROP (&f[1], this->type.format_video.framerate, -SPA_POD_TYPE_FRACTION, &state->current_format.info.h264.framerate),
0);
} else
return SPA_RESULT_NO_FORMAT;

View file

@ -389,10 +389,10 @@ enum_filter_format (Type *type, const SpaFormat *filter, uint32_t index)
uint32_t n_values;
const uint32_t *values;
if (!(p = spa_format_find_prop (filter, type->prop_video.format)))
if (!(p = spa_format_find_prop (filter, type->format_video.format)))
return type->video_format.UNKNOWN;
if (p->body.value.type != SPA_POD_TYPE_URI)
if (p->body.value.type != SPA_POD_TYPE_ID)
return type->video_format.UNKNOWN;
values = SPA_POD_BODY_CONST (&p->body.value);
@ -572,7 +572,7 @@ next_frmsize:
SpaPODProp *p;
/* check if we have a fixed frame size */
if (!(p = spa_format_find_prop (filter, this->type.prop_video.size)))
if (!(p = spa_format_find_prop (filter, this->type.format_video.size)))
goto do_frmsize;
if (p->body.value.type != SPA_POD_TYPE_RECTANGLE)
@ -605,7 +605,7 @@ do_frmsize:
uint32_t i, n_values;
/* check if we have a fixed frame size */
if (!(p = spa_format_find_prop (filter, this->type.prop_video.size)))
if (!(p = spa_format_find_prop (filter, this->type.format_video.size)))
goto have_size;
range = p->body.flags & SPA_POD_PROP_RANGE_MASK;
@ -668,16 +668,16 @@ have_size:
if (media_subtype == this->type.media_subtype.raw) {
spa_pod_builder_add (&b,
PROP (&f[1], this->type.prop_video.format, SPA_POD_TYPE_URI, video_format),
PROP (&f[1], this->type.format_video.format, SPA_POD_TYPE_ID, video_format),
0);
}
spa_pod_builder_add (&b,
PROP (&f[1], this->type.prop_video.size, SPA_POD_TYPE_RECTANGLE, state->frmsize.discrete.width,
PROP (&f[1], this->type.format_video.size, SPA_POD_TYPE_RECTANGLE, state->frmsize.discrete.width,
state->frmsize.discrete.height),
0);
spa_pod_builder_push_prop (&b, &f[1],
this->type.prop_video.framerate,
this->type.format_video.framerate,
SPA_POD_PROP_RANGE_NONE |
SPA_POD_PROP_FLAG_UNSET |
SPA_POD_PROP_FLAG_READWRITE);
@ -705,7 +705,7 @@ have_size:
uint32_t i, n_values;
const SpaFraction step = { 1, 1 }, *values;
if (!(p = spa_format_find_prop (filter, this->type.prop_video.framerate)))
if (!(p = spa_format_find_prop (filter, this->type.format_video.framerate)))
goto have_framerate;
if (p->body.value.type != SPA_POD_TYPE_FRACTION)