EOS before playing state changed

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

EOS before playing state changed

Simon Qiu
Hi,

We started a playbin2  to play a very short local audio file (about 2 sec)
and sink element was set to filesink.
In the test program, we directly set PLAYING state to playbin2.

We found sometimes EOS message is post by playbin2 too early to beyond
PLAYING state changed message of playbin2 whatever attribute "async" of sink
element is set FALSE or TRUE.

As docs said, EOS should be posted after sink element was in PLAYING state,
but not pipeline (playbin2).

So, can I assume EOS must be posted after playbin2 was in PLAYING state?
If yes, why didn't I find any limit to cache EOS message when playbin2 was
in the course of PLAYING state changed?

Thanks.
Simon
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: EOS before playing state changed

Simon Qiu
 the main related test code :
 
  GstElement *pipeline = gst_element_factory_make ("playbin2", "playbin2");
  bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
  gst_bus_add_watch (bus, my_bus_callback, loop);
  gst_object_unref (bus);

  g_object_set (pipeline, "buffer-size", 400 * 1024, NULL);
  g_object_set (pipeline, "flags", 0x0103, NULL);
  g_object_set (pipeline, "uri", uri, NULL);
 
  g_object_set_data ((GObject *)pipeline, "playmode", (gpointer)playmode);
  g_signal_connect (pipeline, "video-changed",
      G_CALLBACK (add_video_sink), pipeline);
  g_signal_connect (pipeline, "audio-changed",
      G_CALLBACK (add_audio_sink), pipeline);

  if (GST_STATE_CHANGE_FAILURE !=
                  gst_element_set_state ((GstElement *)pipeline, GST_STATE_PLAYING)) {
          /* run, if set states failed (0), we should not run main loop */
          g_main_loop_run (loop);
  }

  /* exit */
  gst_element_set_state (pipeline, GST_STATE_NULL);

  gst_object_unref (GST_OBJECT (pipeline));


and in my_bus_callback (), we check the message send from pipeline.

Sometimes AFTER EOS comes, the PAUSE_TO_PLAYING state change message of some elements can be got.
And then, the second EOS can be received, this came from playsink, and I have checked the code.

We thought in the design of GStreamer, EOS should not come back before the pipeline is in PLAYING state. But this test result didnot follow the rule.

Is there any mistake in my test code?  We should not set pipeline to PLAYING directly?
Or GStreamer didnot have any rules between EOS and state_change message?

Can any one help me to understand this mechanism?
Thank you!