mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
fix media.class
This commit is contained in:
parent
8071b76e41
commit
39c3650b5f
4 changed files with 10 additions and 7 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue