[gstreamer-bugs] [Bug 587896] New: "No stream given yet" error from giostreamsrc

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Mon Jul 6 07:12:47 PDT 2009


If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=587896

  GStreamer | gst-plugins-base | Ver: 0.10.22
           Summary: "No stream given yet" error from giostreamsrc
           Product: GStreamer
           Version: 0.10.22
          Platform: Other
        OS/Version: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-base
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: mike at flyn.org
         QAContact: gstreamer-bugs at lists.sourceforge.net
     GNOME version: Unspecified
   GNOME milestone: Unspecified


Please describe the problem:
I am trying to move an application from giosrc to giostreamsrc.  
However, I have not been able to get my giostreamsrc pipeline to  
work. Everything worked fine when I was using giosrc with a URI.

When I run the application with the GST_DEBUG environment variable  
set, I see the error "No stream given yet." This happens as the  
application tries to change the pipeline's state to playing.

The strange thing is that I added a check right before the state  
change that reads the stream property from the giostreamsrc element  
using g_object_get and confirms that it is a G_IS_INPUT_STREAM. The  
check does not complain. However, something sets the stream back to  
NULL after I call gst_element_set_state (see "FIRST CHECK" and  
"SECOND CHECK" below).

I've run my application through valgrind and did not see any memory  
issues, though I have not yet ruled that out entirely.

Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
See also
http://sourceforge.net/mailarchive/forum.php?thread_name=C5BEEF96-5ABB-4207-A14F-7ECCAD619E89%40flyn.org&forum_name=gstreamer-devel.

My code follows:

GInputStream* g_gst_mp3_input_stream_new (GInputStream *src_stream)
{
         GstStateChangeReturn sret;
         GstState state;
         GGstMP3InputStream *stream;

         stream = G_GST_MP3_INPUT_STREAM (g_object_new  
(TYPE_G_GST_MP3_INPUT_STREAM,
                                                    NULL));

         stream->priv->pipeline = gst_pipeline_new ("pipeline");

         stream->priv->src     = gst_element_factory_make  
("giostreamsrc", "src");
         stream->priv->decode  = gst_element_factory_make  
("decodebin", "decode");
         stream->priv->convert = gst_element_factory_make  
("audioconvert", "convert");
         stream->priv->encode  = gst_element_factory_make ("lame",  
"encode");
         stream->priv->sink    = gst_element_factory_make ("appsink",  
"sink");

         gst_bin_add_many (GST_BIN (stream->priv->pipeline),
                           stream->priv->src,
                           stream->priv->decode,
                           stream->priv->convert,
                           stream->priv->encode,
                           stream->priv->sink,
                           NULL);

         if (gst_element_link (stream->priv->src, stream->priv- 
decode) == FALSE) {
                 g_warning ("Error linking source and decode elements");
         }

         g_assert (G_IS_INPUT_STREAM (src_stream));
         g_object_set (G_OBJECT (stream->priv->src), "stream",  
src_stream, NULL);

         /* quality=9 is important for fast, realtime transcoding: */
         g_object_set (G_OBJECT (stream->priv->encode), "quality", 9,  
NULL);
         g_object_set (G_OBJECT (stream->priv->encode), "bitrate",  
128, NULL);
         g_object_set (G_OBJECT (stream->priv->encode), "vbr", 0, NULL);
         g_signal_connect (stream->priv->decode, "new-decoded-pad",  
G_CALLBACK (new_decoded_pad_cb), stream);

         g_object_set (G_OBJECT (stream->priv->sink), "emit-signals",  
TRUE, "sync", FALSE, NULL);
         gst_app_sink_set_max_buffers (GST_APP_SINK (stream->priv- 
sink),
                                       GST_APP_MAX_BUFFERS);
         gst_app_sink_set_drop (GST_APP_SINK (stream->priv->sink),  
FALSE);

         g_signal_connect (stream->priv->sink, "new-buffer",  
G_CALLBACK (g_gst_input_stream_new_buffer_cb), stream);

/* MY FIRST CHECK: NO PROBLEM: */
gpointer foo;
g_warning ("CHECK 1");
g_object_get (G_OBJECT (stream->priv->src), "stream",  &foo, NULL);
g_assert (G_IS_INPUT_STREAM (foo));
g_assert (src_stream == foo);

         sret = gst_element_set_state (stream->priv->pipeline,  
GST_STATE_PLAYING);
         if (GST_STATE_CHANGE_ASYNC == sret) {
                 if (GST_STATE_CHANGE_SUCCESS !=  
gst_element_get_state (GST_ELEMENT (stream->priv->pipeline), &state,  
NULL, 5 * GST_SECOND)) {
                         g_warning ("State change failed for stream.");
                 }
         } else if (sret != GST_STATE_CHANGE_SUCCESS) {
                 g_warning ("Could not read stream.");
         }

/* MY SECOND CHECK: FAILS, FOO == NULL! */
g_warning ("CHECK 2");
g_object_get (G_OBJECT (stream->priv->src), "stream",  &foo, NULL);
g_warning ("NULL == foo %d", NULL == foo);
g_assert (G_IS_INPUT_STREAM (src_stream));
g_assert (G_IS_INPUT_STREAM (foo));
g_assert (src_stream == foo);

         g_assert (G_IS_SEEKABLE (stream));
         return G_INPUT_STREAM (stream);
}


-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=587896.




More information about the Gstreamer-bugs mailing list