diff --git a/spa/include/spa/log.h b/spa/include/spa/log.h index 95d1ea595..aaccee684 100644 --- a/spa/include/spa/log.h +++ b/spa/include/spa/log.h @@ -31,6 +31,7 @@ typedef struct _SpaLog SpaLog; #include #include +#define SPA_SUPPORT_ID_LOG 3 #define SPA_INTERFACE_ID_LOG 3 #define SPA_INTERFACE_ID_LOG_NAME "Log interface" #define SPA_INTERFACE_ID_LOG_DESCRIPTION "Log interface" diff --git a/spa/include/spa/plugin.h b/spa/include/spa/plugin.h index a4d3142a8..1d70d6861 100644 --- a/spa/include/spa/plugin.h +++ b/spa/include/spa/plugin.h @@ -79,17 +79,17 @@ typedef struct { } SpaInterfaceInfo; /** - * SpaInterface: - * @interface_id: the id of the interface - * @interface: an interface instance + * SpaSupport: + * @support_id: the id of the support item + * @data: specific data for the item * - * An interface instance that is usually passed to the init() function of - * a factory to provide extra API such as logging. + * Extra supporting infrastructure passed to the init() function of + * a factory. It can be extra information or interfaces such as logging. */ typedef struct { - uint32_t interface_id; - void *interface; -} SpaInterface; + uint32_t support_id; + void *data; +} SpaSupport; struct _SpaHandleFactory { /** @@ -117,14 +117,14 @@ struct _SpaHandleFactory { * @handle: a pointer to memory * @info: extra handle specific information, usually obtained * from a #SpaMonitor. This can be used to configure the handle. - * @platform: platform interfaces - * @n_platform: number of elements in @platform + * @support: support items + * @n_support: number of elements in @support * * Initialize an instance of this factory. The caller should allocate * memory at least SpaHandleFactory::size bytes and pass this as @handle. * - * @platform can optionally contain extra interfaces that the plugin can - * use such as a logger. + * @support can optionally contain extra interfaces or data ites that the + * plugin can use such as a logger. * * Returns: #SPA_RESULT_OK on success * #SPA_RESULT_NOT_IMPLEMENTED when an instance can't be made @@ -133,8 +133,8 @@ struct _SpaHandleFactory { SpaResult (*init) (const SpaHandleFactory *factory, SpaHandle *handle, const SpaDict *info, - const SpaInterface **platform, - unsigned int n_platform); + const SpaSupport **support, + unsigned int n_support); /** * SpaHandle::enum_interface_info: diff --git a/spa/plugins/alsa/alsa-monitor.c b/spa/plugins/alsa/alsa-monitor.c index 6f85f9fc5..dc488e2c0 100644 --- a/spa/plugins/alsa/alsa-monitor.c +++ b/spa/plugins/alsa/alsa-monitor.c @@ -380,8 +380,8 @@ static SpaResult alsa_monitor_init (const SpaHandleFactory *factory, SpaHandle *handle, const SpaDict *info, - const SpaInterface **platform, - unsigned int n_platform) + const SpaSupport **support, + unsigned int n_support) { SpaALSAMonitor *this; diff --git a/spa/plugins/alsa/alsa-sink.c b/spa/plugins/alsa/alsa-sink.c index 8e07d7d42..ff6314340 100644 --- a/spa/plugins/alsa/alsa-sink.c +++ b/spa/plugins/alsa/alsa-sink.c @@ -599,8 +599,8 @@ static SpaResult alsa_sink_init (const SpaHandleFactory *factory, SpaHandle *handle, const SpaDict *info, - const SpaInterface **platform, - unsigned int n_platform) + const SpaSupport **support, + unsigned int n_support) { SpaALSASink *this; diff --git a/spa/plugins/alsa/alsa-source.c b/spa/plugins/alsa/alsa-source.c index 8f3fa90ab..6cf541e26 100644 --- a/spa/plugins/alsa/alsa-source.c +++ b/spa/plugins/alsa/alsa-source.c @@ -752,8 +752,8 @@ static SpaResult alsa_source_init (const SpaHandleFactory *factory, SpaHandle *handle, const SpaDict *info, - const SpaInterface **platform, - unsigned int n_platform) + const SpaSupport **support, + unsigned int n_support) { SpaALSASource *this; unsigned int i; diff --git a/spa/plugins/audiomixer/audiomixer.c b/spa/plugins/audiomixer/audiomixer.c index 441c76edd..80a0e1125 100644 --- a/spa/plugins/audiomixer/audiomixer.c +++ b/spa/plugins/audiomixer/audiomixer.c @@ -780,8 +780,8 @@ static SpaResult spa_audiomixer_init (const SpaHandleFactory *factory, SpaHandle *handle, const SpaDict *info, - const SpaInterface **platform, - unsigned int n_platform) + const SpaSupport **support, + unsigned int n_support) { SpaAudioMixer *this; diff --git a/spa/plugins/audiotestsrc/audiotestsrc.c b/spa/plugins/audiotestsrc/audiotestsrc.c index 357cc2f71..67b51e184 100644 --- a/spa/plugins/audiotestsrc/audiotestsrc.c +++ b/spa/plugins/audiotestsrc/audiotestsrc.c @@ -989,8 +989,8 @@ static SpaResult audiotestsrc_init (const SpaHandleFactory *factory, SpaHandle *handle, const SpaDict *info, - const SpaInterface **platform, - unsigned int n_platform) + const SpaSupport **support, + unsigned int n_support) { SpaAudioTestSrc *this; diff --git a/spa/plugins/ffmpeg/ffmpeg.c b/spa/plugins/ffmpeg/ffmpeg.c index 4d6ddbb5e..384ef5ae4 100644 --- a/spa/plugins/ffmpeg/ffmpeg.c +++ b/spa/plugins/ffmpeg/ffmpeg.c @@ -32,8 +32,8 @@ static SpaResult ffmpeg_dec_init (const SpaHandleFactory *factory, SpaHandle *handle, const SpaDict *info, - const SpaInterface **platform, - unsigned int n_platform) + const SpaSupport **support, + unsigned int n_support) { if (factory == NULL || handle == NULL) return SPA_RESULT_INVALID_ARGUMENTS; @@ -45,8 +45,8 @@ static SpaResult ffmpeg_enc_init (const SpaHandleFactory *factory, SpaHandle *handle, const SpaDict *info, - const SpaInterface **platform, - unsigned int n_platform) + const SpaSupport **support, + unsigned int n_support) { if (factory == NULL || handle == NULL) return SPA_RESULT_INVALID_ARGUMENTS; diff --git a/spa/plugins/remote/proxy.c b/spa/plugins/remote/proxy.c index aaaa5b426..a24322801 100644 --- a/spa/plugins/remote/proxy.c +++ b/spa/plugins/remote/proxy.c @@ -1348,8 +1348,8 @@ static SpaResult proxy_init (const SpaHandleFactory *factory, SpaHandle *handle, const SpaDict *info, - const SpaInterface **platform, - unsigned int n_platform) + const SpaSupport **support, + unsigned int n_support) { SpaProxy *this; diff --git a/spa/plugins/v4l2/v4l2-monitor.c b/spa/plugins/v4l2/v4l2-monitor.c index 3061dfd46..b737adf69 100644 --- a/spa/plugins/v4l2/v4l2-monitor.c +++ b/spa/plugins/v4l2/v4l2-monitor.c @@ -351,8 +351,8 @@ static SpaResult v4l2_monitor_init (const SpaHandleFactory *factory, SpaHandle *handle, const SpaDict *info, - const SpaInterface **platform, - unsigned int n_platform) + const SpaSupport **support, + unsigned int n_support) { SpaV4l2Monitor *this; diff --git a/spa/plugins/v4l2/v4l2-source.c b/spa/plugins/v4l2/v4l2-source.c index 143b365e0..b72993e6f 100644 --- a/spa/plugins/v4l2/v4l2-source.c +++ b/spa/plugins/v4l2/v4l2-source.c @@ -831,8 +831,8 @@ static SpaResult v4l2_source_init (const SpaHandleFactory *factory, SpaHandle *handle, const SpaDict *info, - const SpaInterface **platform, - unsigned int n_platform) + const SpaSupport **support, + unsigned int n_support) { SpaV4l2Source *this; unsigned int i; diff --git a/spa/plugins/videotestsrc/videotestsrc.c b/spa/plugins/videotestsrc/videotestsrc.c index 456d0e8de..dfbbf7bbc 100644 --- a/spa/plugins/videotestsrc/videotestsrc.c +++ b/spa/plugins/videotestsrc/videotestsrc.c @@ -937,8 +937,8 @@ static SpaResult videotestsrc_init (const SpaHandleFactory *factory, SpaHandle *handle, const SpaDict *info, - const SpaInterface **platform, - unsigned int n_platform) + const SpaSupport **support, + unsigned int n_support) { SpaVideoTestSrc *this; diff --git a/spa/plugins/volume/volume.c b/spa/plugins/volume/volume.c index 142cedaf9..a14139b94 100644 --- a/spa/plugins/volume/volume.c +++ b/spa/plugins/volume/volume.c @@ -677,8 +677,8 @@ static SpaResult volume_init (const SpaHandleFactory *factory, SpaHandle *handle, const SpaDict *info, - const SpaInterface **platform, - unsigned int n_platform) + const SpaSupport **support, + unsigned int n_support) { SpaVolume *this; diff --git a/spa/plugins/xv/xv-sink.c b/spa/plugins/xv/xv-sink.c index af6cc0580..188416758 100644 --- a/spa/plugins/xv/xv-sink.c +++ b/spa/plugins/xv/xv-sink.c @@ -558,8 +558,8 @@ static SpaResult xv_sink_init (const SpaHandleFactory *factory, SpaHandle *handle, const SpaDict *info, - const SpaInterface **platform, - unsigned int n_platform) + const SpaSupport **support, + unsigned int n_support) { SpaXvSink *this;