fix media.class

This commit is contained in:
Wim Taymans 2017-04-04 15:32:11 +02:00
parent 8071b76e41
commit 39c3650b5f
4 changed files with 10 additions and 7 deletions

View file

@ -195,6 +195,7 @@ struct pod_type_name {
{ "float", "Float" },
{ "double", "Double" },
{ "string", "String" },
{ "bytes", "Bytes" },
{ "pointer", "Pointer" },
{ "rectangle", "Rectangle" },
{ "fraction", "Fraction" },
@ -203,7 +204,6 @@ struct pod_type_name {
{ "struct", "Struct" },
{ "object", "Object" },
{ "prop", "Prop" },
{ "bytes", "Bytes" },
};
static void

View file

@ -114,7 +114,7 @@ static int
fill_item (SpaALSAMonitor *this, ALSAItem *item, struct udev_device *udevice)
{
int err;
const char *str, *name;
const char *str, *name, *klass = NULL;
snd_pcm_t *hndl;
char device[64];
SpaPODBuilder b = { NULL, };
@ -158,9 +158,11 @@ fill_item (SpaALSAMonitor *this, ALSAItem *item, struct udev_device *udevice)
return -1;
} else {
factory = &spa_alsa_source_factory;
klass = "Audio/Source";
snd_pcm_close (hndl);
}
} else {
klass = "Audio/Sink";
factory = &spa_alsa_sink_factory;
snd_pcm_close (hndl);
}
@ -184,7 +186,7 @@ fill_item (SpaALSAMonitor *this, ALSAItem *item, struct udev_device *udevice)
SPA_POD_PROP (&f[1], this->type.monitor.flags, 0, SPA_POD_TYPE_INT, 1, 0),
SPA_POD_PROP (&f[1], this->type.monitor.state, 0, SPA_POD_TYPE_INT, 1, SPA_MONITOR_ITEM_STATE_AVAILABLE),
SPA_POD_PROP (&f[1], this->type.monitor.name, 0, SPA_POD_TYPE_STRING, 1, name),
SPA_POD_PROP (&f[1], this->type.monitor.klass, 0, SPA_POD_TYPE_STRING, 1, "Audio/Device"),
SPA_POD_PROP (&f[1], this->type.monitor.klass, 0, SPA_POD_TYPE_STRING, 1, klass),
SPA_POD_PROP (&f[1], this->type.monitor.factory, 0, SPA_POD_TYPE_POINTER, 1, this->type.handle_factory,
factory),
0);

View file

@ -301,7 +301,7 @@ make_nodes (AppData *data)
spa_pod_builder_init (&b, buffer, sizeof (buffer));
spa_pod_builder_props (&b, &f[0], data->type.props,
SPA_POD_PROP (&f[1], data->type.props_device, 0, SPA_POD_TYPE_STRING, 1, "hw:0"),
SPA_POD_PROP (&f[1], data->type.props_device, 0, SPA_POD_TYPE_STRING, 1, "hw:1"),
SPA_POD_PROP (&f[1], data->type.props_min_latency, 0, SPA_POD_TYPE_INT, 1, 256),
SPA_POD_PROP (&f[1], data->type.props_live, 0, SPA_POD_TYPE_BOOL, 1, false));
props = SPA_POD_BUILDER_DEREF (&b, f[0].ref, SpaProps);