mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-08 18:39:54 +00:00
osxaudio: add individual elements registration for gst-full compatibility
Found that osxaudiosink could not be added standalone in gst-full build using -Dgst-full-elements=osxaudio:osxaudiosink because element registration was done at the plugin level. Now src/sink elements and deviceprovider have their individual registration. Copied/adapted from the alsa plugin. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5419>
This commit is contained in:
parent
63da298b84
commit
7affa01e05
7 changed files with 19 additions and 12 deletions
|
@ -37,21 +37,15 @@
|
|||
static gboolean
|
||||
plugin_init (GstPlugin * plugin)
|
||||
{
|
||||
if (!gst_element_register (plugin, "osxaudiosink", GST_RANK_PRIMARY,
|
||||
GST_TYPE_OSX_AUDIO_SINK)) {
|
||||
return FALSE;
|
||||
}
|
||||
if (!gst_element_register (plugin, "osxaudiosrc", GST_RANK_PRIMARY,
|
||||
GST_TYPE_OSX_AUDIO_SRC)) {
|
||||
return FALSE;
|
||||
}
|
||||
gboolean ret = FALSE;
|
||||
|
||||
ret |= GST_ELEMENT_REGISTER (osxaudiosrc, plugin);
|
||||
ret |= GST_ELEMENT_REGISTER (osxaudiosink, plugin);
|
||||
#ifndef HAVE_IOS
|
||||
if (!gst_device_provider_register (plugin, "osxaudiodeviceprovider",
|
||||
GST_RANK_PRIMARY, GST_TYPE_OSX_AUDIO_DEVICE_PROVIDER))
|
||||
return FALSE;
|
||||
ret |= GST_DEVICE_PROVIDER_REGISTER (osxaudiodeviceprovider, plugin);
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
return ret;
|
||||
}
|
||||
|
||||
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
||||
|
|
|
@ -51,6 +51,9 @@ static GstOsxAudioDevice *gst_osx_audio_device_new (AudioDeviceID device_id,
|
|||
|
||||
G_DEFINE_TYPE (GstOsxAudioDeviceProvider, gst_osx_audio_device_provider,
|
||||
GST_TYPE_DEVICE_PROVIDER);
|
||||
GST_DEVICE_PROVIDER_REGISTER_DEFINE (osxaudiodeviceprovider,
|
||||
"osxaudiodeviceprovider", GST_RANK_PRIMARY,
|
||||
GST_TYPE_OSX_AUDIO_DEVICE_PROVIDER);
|
||||
|
||||
static GList *gst_osx_audio_device_provider_probe (GstDeviceProvider *
|
||||
provider);
|
||||
|
|
|
@ -87,5 +87,7 @@ struct _GstOsxAudioDeviceClass
|
|||
|
||||
GType gst_osx_audio_device_get_type (void);
|
||||
|
||||
GST_DEVICE_PROVIDER_REGISTER_DECLARE(osxaudiodeviceprovider);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __GST_OSX_AUDIO_DEIVCE_PROVIDER_H__ */
|
||||
|
|
|
@ -148,6 +148,8 @@ gst_osx_audio_sink_do_init (GType type)
|
|||
#define gst_osx_audio_sink_parent_class parent_class
|
||||
G_DEFINE_TYPE_WITH_CODE (GstOsxAudioSink, gst_osx_audio_sink,
|
||||
GST_TYPE_AUDIO_BASE_SINK, gst_osx_audio_sink_do_init (g_define_type_id));
|
||||
GST_ELEMENT_REGISTER_DEFINE (osxaudiosink, "osxaudiosink", GST_RANK_PRIMARY,
|
||||
GST_TYPE_OSX_AUDIO_SINK);
|
||||
|
||||
static void
|
||||
gst_osx_audio_sink_class_init (GstOsxAudioSinkClass * klass)
|
||||
|
|
|
@ -96,6 +96,8 @@ struct _GstOsxAudioSinkClass
|
|||
|
||||
GType gst_osx_audio_sink_get_type (void);
|
||||
|
||||
GST_ELEMENT_REGISTER_DECLARE (osxaudiosink);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_OSXAUDIOSINK_H__ */
|
||||
|
|
|
@ -123,6 +123,8 @@ gst_osx_audio_src_do_init (GType type)
|
|||
#define gst_osx_audio_src_parent_class parent_class
|
||||
G_DEFINE_TYPE_WITH_CODE (GstOsxAudioSrc, gst_osx_audio_src,
|
||||
GST_TYPE_AUDIO_BASE_SRC, gst_osx_audio_src_do_init (g_define_type_id));
|
||||
GST_ELEMENT_REGISTER_DEFINE (osxaudiosrc, "osxaudiosrc", GST_RANK_PRIMARY,
|
||||
GST_TYPE_OSX_AUDIO_SRC);
|
||||
|
||||
static void
|
||||
gst_osx_audio_src_class_init (GstOsxAudioSrcClass * klass)
|
||||
|
|
|
@ -82,6 +82,8 @@ struct _GstOsxAudioSrcClass
|
|||
|
||||
GType gst_osx_audio_src_get_type (void);
|
||||
|
||||
GST_ELEMENT_REGISTER_DECLARE (osxaudiosrc);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_OSXAUDIOSRC_H__ */
|
||||
|
|
Loading…
Reference in a new issue