small cleanups

Remove the temp storage for formats and props now that we get a builder
from the host to write into.
This commit is contained in:
Wim Taymans 2017-11-07 20:28:07 +01:00
parent f3bca48398
commit 4d890a2d98
9 changed files with 7 additions and 48 deletions

View file

@ -121,7 +121,6 @@ struct port {
bool have_format;
struct spa_video_info current_format;
uint8_t format_buffer[1024];
int fd;
bool opened;
@ -154,7 +153,6 @@ struct impl {
uint32_t seq;
uint8_t props_buffer[512];
struct props props;
const struct spa_node_callbacks *callbacks;
@ -455,16 +453,6 @@ static int impl_node_port_get_info(struct spa_node *node,
return SPA_RESULT_OK;
}
static int port_enum_formats(struct spa_node *node,
enum spa_direction direction, uint32_t port_id,
uint32_t *index,
const struct spa_pod_object *filter,
struct spa_pod_builder *builder)
{
struct impl *this = SPA_CONTAINER_OF(node, struct impl, node);
return spa_v4l2_enum_format(this, index, filter, builder);
}
static int port_get_format(struct spa_node *node,
enum spa_direction direction, uint32_t port_id,
uint32_t *index,
@ -547,7 +535,7 @@ static int impl_node_port_enum_params(struct spa_node *node,
return SPA_RESULT_ENUM_END;
}
else if (id == t->param.idEnumFormat) {
return port_enum_formats(node, direction, port_id, index, filter, builder);
return spa_v4l2_enum_format(this, index, filter, builder);
}
else if (id == t->param.idFormat) {
return port_get_format(node, direction, port_id, index, filter, builder);

View file

@ -683,7 +683,6 @@ spa_v4l2_enum_format(struct impl *this,
media_subtype = *SPA_MEMBER(&this->type, info->media_subtype_offset, uint32_t);
video_format = *SPA_MEMBER(&this->type, info->format_offset, uint32_t);
spa_pod_builder_init(builder, port->format_buffer, sizeof(port->format_buffer));
spa_pod_builder_push_object(builder, &f[0],
this->type.param.idEnumFormat, this->type.format);
spa_pod_builder_add(builder,