GNOME Bugzilla – Bug 354671
Element doesn't implement handling of this stream
Last modified: 2006-09-07 07:25:11 UTC
Please describe the problem: example program terminates with "Error: Element doesn't implement handling of this stream. Please file a bug." Steps to reproduce: #include <unistd.h> #include <gst/gst.h> static gboolean bus_call ( GstBus *bus, GstMessage *msg, gpointer data ) { GMainLoop *loop = data; switch (GST_MESSAGE_TYPE (msg)) { case GST_MESSAGE_EOS: g_print ("End-of-stream\n"); g_main_loop_quit (loop); break; case GST_MESSAGE_ERROR: { gchar *debug; GError *err; gst_message_parse_error (msg, &err, &debug); g_free (debug); g_print ("Error: %s\n", err->message); g_error_free (err); g_main_loop_quit (loop); } break; default: break; } return TRUE; } static void cb_new_pad(GstElement *el, GstPad *pad, gpointer data) { printf("pad added\n"); } int main(int argc, char **argv) { GstElement *dvsrc; GstElement *dvdmx; GstElement *dvdec; GstElement *scale; GstElement *pipe; GstElement *vid; GMainLoop *loop; GstBus *bus; gst_init(&argc, &argv); loop = g_main_loop_new (NULL, FALSE); dvsrc = gst_element_factory_make("dv1394src", "dv1394src"); if(dvsrc == NULL) { printf("gst_element_factory_make dv1394src failed\n"); } dvdmx = gst_element_factory_make("ffdemux_dv", "ffdemux_dv"); if(dvdec == NULL) { printf("gst_element_factory_make dvdmx failed\n"); } dvdec = gst_element_factory_make("ffdec_dvvideo", "ffdec_dvvideo"); if(dvdec == NULL) { printf("gst_element_factory_make dvdec failed\n"); } scale = gst_element_factory_make("ffvideoscale", "ffvideoscale"); if(scale == NULL) { printf("gst_element_factory_make scale failed\n"); } vid = gst_element_factory_make("xvimagesink", "xvimagesink"); if(vid == NULL) { printf("gst_element_factory_make vid failed\n"); } g_object_set(G_OBJECT(vid), "display", getenv("DISPLAY"), NULL); pipe = gst_pipeline_new ("dv2v4l"); gst_bin_add_many(GST_BIN(pipe), dvsrc, dvdmx, dvdec, scale, vid, NULL); bus = gst_pipeline_get_bus (GST_PIPELINE (pipe)); gst_bus_add_watch (bus, bus_call, loop); gst_object_unref (bus); if(!gst_element_link_many(dvdec, scale, vid, NULL)) { printf("#1gst_element_link_many failed\n"); if(!gst_element_link_many(dvsrc, dvdmx, NULL)) { printf("#2gst_element_link_many failed\n"); } g_signal_connect(G_OBJECT(dvdmx), "pad-added", G_CALLBACK(cb_new_pad), NULL); gst_element_set_state (pipe, GST_STATE_PLAYING); /* error message appears in the next call */ g_main_loop_run (loop); gst_element_set_state (pipe, GST_STATE_NULL); gst_object_unref(pipe); return 0; } } Actual results: Expected results: the 'cb_new_pad' function should be called Does this happen every time? yes Other information: a call gst_element_link_many(dvsrc, dvdmx, dvdec, scale, vid, NULL) fails as the ffdemux_dv (dvdmx) hasn't created its 'sometimes' pad yet (I think this is an API design problem).
virtually all demuxers have SOMETIMES pad which is perfectly valid, since you don't know before parsing: _ how many streams are contained in the muxed format _ AND/OR what the types of those streams are What you need is in your 'pad-added' callback : _ Check if the pad is the video pad (since the muxed stream might also contain audio) _ link that pad to the decoder Closing this, since it's not a bug but rather a wrong use of the API. Please continue discussion on the gstreamer-devel mailing-list if needed.