Which event or message can be safely simulate android's MEDIA_PREPARED?

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

Which event or message can be safely simulate android's MEDIA_PREPARED?

rland
I use gstreamer 1.8.1 to instead of  MediaPlayer in Android,  looking for a gstreamer internal events or messages used to achieve the same effect in MEDIA_PREPARED of MediaPlayer(perhaps the first frame is decoded ? or the filtergraph just switch to paused),it mean that when the downstream  is ready, the upper application can safely do some operations.

The previous code, I was using the message :: async-done to simulate MEDIA_PREPARED, registered playbin of async-done event callback function,
----------------------------
  bus = gst_element_get_bus (self-> playbin);
  g_signal_connect (G_OBJECT (bus), "message :: async-done", G_CALLBACK (async_done_cb),
       self);
----------------------------
however, recent play with rtsp ipcamera, we found into the following piece of code,that is async-done discarded.
-------------------
gst-plugins-base-1.0-static-1.8/gst/playback/gstplaybin2.c gst_play_bin_handle_message() L2884

static void
gst_play_bin_handle_message (GstBin * bin, GstMessage * msg)
{
  GstPlayBin *playbin = GST_PLAY_BIN (bin);
  GstSourceGroup *group;
 .....

 else if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ASYNC_START ||
      GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ASYNC_DONE) {
    GstObject *src = GST_OBJECT_CAST (msg->src);

    /* Ignore async state changes from the uridecodebin children,
     * see bug #602000. */
    group = playbin->curr_group;
    if (src && group &&
        ((group->uridecodebin && src == GST_OBJECT_CAST (group->uridecodebin))
            || (group->suburidecodebin
                && src == GST_OBJECT_CAST (group->suburidecodebin)))) {
      GST_DEBUG_OBJECT (playbin,
          "Ignoring async state change of uridecodebin: %s",
          GST_OBJECT_NAME (src));
      gst_message_unref (msg);
      msg = NULL;
    }

  .....
}

I don't know which one  event or message can better simulate MEDIA_PREPARED,
any suggestion would be appreciated.

Best regards,
c

Reply | Threaded
Open this post in threaded view
|

Re: Which event or message can be safely simulate android's MEDIA_PREPARED?

Sebastian Dröge-3
On Mi, 2016-05-25 at 07:43 -0700, lucky chou wrote:

> however, recent play with rtsp ipcamera, we found into the following piece
> of code,that is async-done discarded.

Live and non-live pipelines work slightly different here.

The former would return NO_PREROLL instead of ASYNC/SUCCESS when
changing the state to PAUSED.

> I don't know which one  event or message can better simulate MEDIA_PREPARED,
> any suggestion would be appreciated. 

Use the state-changed message from the pipeline, and wait for the
PAUSED state to be reached. That should have more or less the desired
effect for all pipelines.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment