diff --git a/pinos/modules/spa/module.c b/pinos/modules/spa/module.c index ff5d6b6e1..96291d98a 100644 --- a/pinos/modules/spa/module.c +++ b/pinos/modules/spa/module.c @@ -69,7 +69,7 @@ setup_video_node (PinosCore *core, SpaNode *spa_node, PinosProperties *pinos_pro bool pinos__module_init (PinosModule * module, const char * args) { - PinosProperties *video_props = NULL; + PinosProperties *video_props = NULL, *audio_props = NULL; if (args != NULL) { char **tmp_argv; @@ -87,7 +87,7 @@ pinos__module_init (PinosModule * module, const char * args) argv[i] = tmp_argv[i-1]; } - video_props = pinos_properties_new (NULL, NULL); + video_props = pinos_properties_new ("media.class", "Video/Source", NULL); static struct option long_options[] = { {"filter", required_argument, 0, 'f' }, @@ -123,11 +123,12 @@ pinos__module_init (PinosModule * module, const char * args) "build/spa/plugins/v4l2/libspa-v4l2.so", "v4l2-monitor", "v4l2"); + audio_props = pinos_properties_new ("media.class", "Audio/Source", NULL); pinos_spa_node_load (module->core, "build/spa/plugins/audiotestsrc/libspa-audiotestsrc.so", "audiotestsrc", "audiotestsrc", - NULL, + audio_props, NULL); pinos_spa_node_load (module->core, "build/spa/plugins/videotestsrc/libspa-videotestsrc.so", diff --git a/spa/lib/debug.c b/spa/lib/debug.c index 8c03f77dc..a50b2ea71 100644 --- a/spa/lib/debug.c +++ b/spa/lib/debug.c @@ -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 diff --git a/spa/plugins/alsa/alsa-monitor.c b/spa/plugins/alsa/alsa-monitor.c index 7aa857b4e..4e1c1f112 100644 --- a/spa/plugins/alsa/alsa-monitor.c +++ b/spa/plugins/alsa/alsa-monitor.c @@ -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); diff --git a/spa/tests/test-mixer.c b/spa/tests/test-mixer.c index b23ccf12a..bc911852a 100644 --- a/spa/tests/test-mixer.c +++ b/spa/tests/test-mixer.c @@ -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);