After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 778390 - gstplayer: Add gst_player play / stop in sync mode API
gstplayer: Add gst_player play / stop in sync mode API
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.x
Other Windows
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-02-09 12:08 UTC by Lyon
Modified: 2018-11-03 14:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for add sync mode play / stop function (2.39 KB, patch)
2017-02-09 12:09 UTC, Lyon
none Details | Review

Description Lyon 2017-02-09 12:08:27 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
Comment 1 Lyon 2017-02-09 12:09:00 UTC
Created attachment 345305 [details] [review]
patch for add sync mode play / stop function
Comment 2 Sebastian Dröge (slomo) 2017-02-09 12:22:16 UTC
You could directly call seek() after play(), GstPlayer will then make the seek happen (if possible) once the pipeline is started up.
Comment 3 Haihua Hu 2017-02-09 16:08:11 UTC
(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.
Comment 4 Sebastian Dröge (slomo) 2017-02-10 10:49:32 UTC
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
Comment 5 GStreamer system administrator 2018-11-03 14:04:38 UTC
-- 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.