GNOME Bugzilla – Bug 602937
Can't display video preview when there is no call
Last modified: 2011-08-29 10:12:37 UTC
Once a call has been terminated, it's not possible to display the video preview until a new call is started. That's because the pipeline is completely destroyed when the call is closed and a new one is recreated later. We should refactor the pipeline code to be able to always have video preview.
I started working on this but I'm currently blocked by my misunderstanding of GStreamer. Currently the pipeline is set to the playing state in empathy_call_window_bus_message when we receive a state-changed message from the pipeline saying that it became "paused". To be able to display the preview after the call has been terminated, the new pipeline (a new pipeline is created for the future second call after the first one has been terminated) should be set to playing before the new call is started. What's the best option? a) Set the newly created pipeline to playing right away? Then, when should we call empathy_call_handler_start_call? It's currently called just before setting the pipeline to playing in empathy_call_window_bus_message If we do that, should we start playing the pipeline for the first call as well? b) Don't start the whole pipeline but only the bits needed to display the preview. I tried but it seems that setting the video_input, preview and video_tee to playing is not enough. c) other idea?
Created attachment 154044 [details] [review] http://git.collabora.co.uk/?p=user/cassidy/empathy;a=shortlog;h=refs/heads/video-preview-602937 src/empathy-call-window.c | 345 ++++++++++++++++++++++++++------------------- 1 files changed, 200 insertions(+), 145 deletions(-)
Let's wait for 2.32 before merging this, it changes a lot of code.
Some comment son the branch, call-window: factor out create_pipeline (and other patches split create_video_output_widget out of create_pipeline: - g_object_unref (bus); -> gst_object_unref (bus); (its a GstObject) Actually turn off the camera when preview/sending is disabled: - Avoid the gst_*_many functions, they don't report errors. You want to to add and link them them one by one and check for errors using gst_bin_add and gst_element_link The rest looks fine to me.
(In reply to comment #4) > Some comment son the branch, > > call-window: factor out create_pipeline (and other patches > split create_video_output_widget out of create_pipeline: > - g_object_unref (bus); -> gst_object_unref (bus); (its a GstObject) According to Sjoerd gst_object_unref isn't needed any more. > Actually turn off the camera when preview/sending is disabled: > - Avoid the gst_*_many functions, they don't report errors. You want to to add > and link them them one by one and check for errors using gst_bin_add and > gst_element_link Done. I fixed few more issues, see the 6 top commits of http://git.collabora.co.uk/?p=user/cassidy/empathy;a=shortlog;h=refs/heads/video-preview-602937 Also, according my understanding of the doc of gst_element_get_request_pad (), we should callgst_element_release_request_pad () and gst_object_unref() once we're done with the pad. Is that right?
(In reply to comment #5) > (In reply to comment #4) > Also, according my understanding of the doc of gst_element_get_request_pad (), > we should callgst_element_release_request_pad () and gst_object_unref() once > we're done with the pad. Is that right? Yes, you can unref the pad as soon as you don't have a pointer to it. You only have to release it if you want to get it of it before its parent element.
Done: http://git.collabora.co.uk/?p=user/cassidy/empathy;a=commitdiff;h=a177b40ac1b43beedf68fdb4e9254be6f2e5fd2c Not sure if we should release in that case. Any other comment regarding the branch?
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.