GNOME Bugzilla – Bug 778390
gstplayer: Add gst_player play / stop in sync mode API
Last modified: 2018-11-03 14:04:38 UTC
Currently the gst_player_play() / gst_player_stop() functions are in async mode. When return from _play/stop() function, the gstplayer state might not changed yet. When in application side, we may want to seek after gst_player_play(), and need get seekable flag in media_info. however, as the gst_player_play() function is async, the media_info might not been created yet. So we implement gst_player_play_sync() and gst_player_stop_sync() function to wait for the state change finished. So that it will be easy to handle for application. Do you think add these API is reasonable. or Should these functions should be implement on application side. Thanks Lyon
Created attachment 345305 [details] [review] patch for add sync mode play / stop function
You could directly call seek() after play(), GstPlayer will then make the seek happen (if possible) once the pipeline is started up.
(In reply to Sebastian Dröge (slomo) from comment #2) > You could directly call seek() after play(), GstPlayer will then make the > seek happen (if possible) once the pipeline is started up. Hi Slomo, Not just for seek after play. I also meet this issue when i want to get media info after play. If the state is not really playing or pause, we can not get the media info and will return NULL.
So basically you want to have a synchronous API for everything on top of GstPlayer? IMHO that's for the application to worry about. Like in your case, should play() block until playback actually started or only until mediainfo is known? That's application specific
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/520.