0

I want to build a list of the audiovisualiser elements to be able to offer them in a dropdown list within a python program and same for audio effects but how do you access the gstreamer-1.0 registry.

Rolf of Saxony
  • 17,223
  • 3
  • 31
  • 47

1 Answers1

0

The solution was simple and yet it took an age to find it.
Here is some sample code to illustrate the method.

#!/usr/bin/python
#Access the registry to find out what plugins are available
#list elements within a plugin
#list all elements within a Klass
from gi.repository import Gst
Gst.init()
reg = Gst.Registry.get()

print "List Available Plugins\n"
for x in reg.get_plugin_list():
    print x.get_name()
print "End Available Plugins\n"

print "List Plugins in AudioVisual\n"
for x in reg.get_feature_list_by_plugin("audiovisualizers"):
    print x.get_name(), "\t", x.get_longname()
print "END\n"

print "All Available visualisations\n"
vis_list = [filt for filt in reg.get_feature_list(Gst.ElementFactory) \
        if (filt.get_klass().find("Visualization") >= 0)]
for x in vis_list:
    short = x.get_name()
    name = x.get_longname()
    print (short + "\t\t" + name)
print "END\n"

print "All Available Audio filters\n"
audio_filter_list = [filt for filt in reg.get_feature_list(Gst.ElementFactory) \
        if (filt.get_klass().find("Filter/Effect/Audio") >= 0)]
for x in audio_filter_list:
    short = x.get_name()
    name = x.get_longname()
    print (short + "\t\t" + name)
print "END\n"
Rolf of Saxony
  • 17,223
  • 3
  • 31
  • 47