-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Critical from GstElement missing pad template, but pad template exists in Factory? #116
Comments
11 years ago - edeedf4 |
Thank you, I'll do some more digging... |
Here's a little program that reproduces the issue: #include <stdio.h>
#include <gst/gst.h>
GstPadTemplate *
bt_gst_element_factory_get_pad_template (GstElementFactory * factory,
const gchar * name)
{
/* get pad templates */
const GList *list = gst_element_factory_get_static_pad_templates (factory);
for (; list; list = g_list_next (list)) {
GstStaticPadTemplate *t = (GstStaticPadTemplate *) list->data;
GST_INFO_OBJECT (factory, "Checking pad-template '%s'", t->name_template);
if (g_strcmp0 (t->name_template, name) == 0) {
return gst_static_pad_template_get (t);
}
}
GST_WARNING_OBJECT (factory, "No pad-template '%s'", name);
return NULL;
}
int main(int argc, char** argv) {
gst_init (&argc, &argv);
GstElementFactory* fact_tee = gst_element_factory_find("tee");
GstPadTemplate* template = bt_gst_element_factory_get_pad_template(fact_tee, "src_%u");
g_assert(template);
GstElement* tee = gst_element_factory_make("tee", NULL);
GstPad* pad = gst_element_request_pad(tee, template, NULL, NULL);
g_assert(pad);
printf("%s\n", gst_object_get_name(GST_OBJECT(pad)));
GstPad* pad2 = gst_element_request_pad(tee, template, NULL, NULL);
g_assert(pad2);
printf("%s\n", gst_object_get_name(GST_OBJECT(pad2)));
return 0;
} Output will be:
Note that the pad seems to be created fine, and it even has a name as expected. No idea what the deal is. Anyone else seeing this? Take it to gstreamer or Ubuntu? |
Makefile: PKGS = gstreamer-base-1.0 gstreamer-audio-1.0 gstreamer-plugins-base-1.0 gstreamer-controller-1.0
CFLAGS != pkg-config --cflags $(PKGS)
CFLAGS += -Wall -Wno-unused-variable
LDLIBS != pkg-config --libs $(PKGS)
main: main.o
clean:
rm main *.o || true |
When running under gdb with
G_DEBUG="fatal-criticals"
, I got a breakpoint on the following message:(buzztrax-edit:48707): GStreamer-CRITICAL **: 12:19:28.674: Element type GstTee does not have a pad template src_%u (0x555556b6a1c0)
The repro is simple:
The breakpoint was in
bt_wire_make_internal_element:253
, and it was while a wire was trying to make a "src_%u" pad for the GstTee element. This is weird because GstTee definitely has that pad template.After iterating over the pad templates on the GstElement itself, I found that the GstPadTemplate returned from
bt_gst_element_factory_get_pad_template
had a different memory address to the one returned fromget_element_get_pad_template_list
. When I used the pad template from the GstElement rather than the GstElementFactory, then this error went away.Also, just using
gst_element_request_pad_simple
also worked, although I guess you used the Factory method for speed.Before I dig further, do you know what's going on here? Would you expect that pad templates returned from factories don't work when used to request pads on elements?
I also confirmed that the Factory used to create the GstElement and the one being used to retrieve the Template were the same, in both cases the Factory had the same memory address.
The text was updated successfully, but these errors were encountered: