[gst-embedded] plugin class_init not called from test application but called from gst-inspect
Stefan Kost
ensonic at hora-obscura.de
Sat Apr 11 10:53:05 PDT 2009
ssn schrieb:
> Hi,
>
> I am in the process of testing my gstreamer plugin element. I want to add a property to my gst element and I do that in the
> my_element_class_init
> method. I wrote my own test application to test my pipeline as I have a few elements that need to be linked in a certain order. My observation is that when I run
> gst-inspect-0.10 my_element
> I can see the property that I added to my_element. However, when I run my test app, the app does not recognize the property in the element that I want access to.
>
> I install the property in the my_element_class_init method by calling
> g_object_class_install_property.
>
> This method does not seem to be called when I run my test app, but does get called by gst-inspect-0.10. Since the gst element is not initialized correctly in my app, I cannot proceed further. There is probably something basic that I am missing.
>
I am afraid we need to se you element sources too. Does the loop that prints the
object properties below print anything?
Stefan
> This is a subset of the app code for your reference:
> int main (int argc, char *argv[])
> {
> GMainLoop *loop;
>
> GstElement *pipeline, *my_element;
> GstBus *bus;
> gboolean gstRVal;
> char *filename;
> GstElementFactory *factory;
>
>
> /* Initialisation */
> gst_init (NULL, NULL);
>
> loop = g_main_loop_new (NULL, FALSE);
> /* Create gstreamer elements */
> pipeline = gst_pipeline_new ("my-plugin-test");
> my_element = gst_element_factory_make ("my-element", NULL);
> {
> GParamSpec *spec, **specs, **walk;
> guint nProps;
>
> specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (my_element), &nProps);
> g_print ("Element my_element: Num Properties: %d...\n", nProps);
> for (walk = specs; *walk; walk++) {
> spec = *walk;
> g_print ("Element my_element: property name [%s]...\n", spec->name);
> }
> g_free (specs);
> }
> bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
> gst_bus_add_watch (bus, bus_call, loop);
> gst_object_unref (bus);
>
> gst_bin_add_many (GST_BIN (pipeline), my_element, NULL);
>
> g_print ("Running...\n");
> gst_element_set_state (pipeline, GST_STATE_PLAYING);
> g_main_loop_run (loop);
>
> g_print ("Returned, stopping playback\n");
> gst_element_set_state (pipeline, GST_STATE_NULL);
>
> g_print ("Deleting pipeline\n");
> gst_object_unref (GST_OBJECT (pipeline));
>
> return 0;
>
>
> Thanks for your advice.
> - SSN
More information about the Gstreamer-embedded
mailing list