-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stop and restart server when gstreamer window is closed (missing callback is added) #263
Conversation
"sleep(1)" in the loop checking "running" after start_server(..) is moved to a new video renderer function video_renderer->funcs->listen(video_renderer)
This required gstreamer feature was not implemented in antimof's original code. It is needed to stop the server when the GStreamer window is closed. The behavior after this event is now to relaunch the AirPlay server. (for gstreamer renderer only) As before, rpiplay itself is stopped with ctrl-C in the terminal window.
The code in this PR has been replaced by a GLib MainLoop as of UxPlay 1.35 at http://github.com/FDH2/UxPlay. |
Do you still want me to merge this in? Why are you restarting the server in case the window was closed? IMHO, we should either: 1) Stop the server when the window was closed, or 2) restart just the renderer, which should be possible by just changing the gstreamer renderer, without adding the listen callback. What do you think? |
The callback is essential. In the mode being used, gstreamer is opaque. I moved on after using this fix to a full g-mainloop in uxplay 1.3x but that doesn't fit well with the RPi renderers. |
To summarize: If you think (1) is what you want, just tell me. Its trivial to implement. One issue is that in my setup at least, the mDNS-SD registration quickly becomes "stale" when the server has no connection. Only clients that are already seeking a connection at the time the server registers with avahi see the service. |
@FD- If this PR can be disposed of ASAP, I can use this GitHub account FDH2 to feed you the proposed improvements/ |
I will redo this to shut down the server when the gstreamer window is closed and submit a new pull request. |
antimof's UxPlay fork of RPiPlay (which was backported into RPiPlay) did not include the required callback from the Gst bus when the gstreamer window was closed. This leaves the server running, including audio, without video. This pull request adds the missing callback, so when the gstreamer window is closed, the server is stopped and relaunched. ctrl-c in the terminal window will fully stop rpiplay in the usual way.
This fix is backported from the updated UxPlay at https://github.com/FDH2/UxPlay . and has been adjusted for the multiple renderers in RPiPlay.
The call to sleep(1) (between checks for sigint signals while the server is running) is first moved into a new video function bool video_renderer->func->listen(video_renderer). This leaves the behavior of rpiplay unchanged for all renderers.
for the gstreamer renderer, the callback is then implemented only in video_renderer_gstreamer_listen(renderer).
If something similar would be useful for rpi, it could be implemented in video_renderer_rpi_listen, which now just uses the sleep(1) call,
This pull request is completely independent of my other pull request #266 from a different github account.