Hello,everyone!
I'm writing android app to play online video(rtmp live video),when the network is bad(maybe the router disconnected from internet), I call gst_element_set_state (data->pipeline, GST_STATE_PLAYING) on android UI thread and it will hangs about 20 seconds, this is not allowed on android because it will freeze the app.so I need to call gst_element_set_state on a separated thread. I want to know if there is such a thread in GStreamer or I need to create it myself? what is the best practice? |
I have no android experience but in c, gst_element_set_state has a timeout parameter. If you set it to 0 it should just issue the operation without causing the calling thread to hang. dmtOn Wed, Mar 22, 2017 at 4:47 AM, Jesse <[hidden email]> wrote: Hello,everyone! _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
thank you for your reply,but I can't see the timeout parameter,the API is declared like this:
GstStateChangeReturn gst_element_set_state (GstElement *element,GstState state); |
wups, my bad, I was talking about gst_element_get_state. Is the hanging element one of your own or something in mainline? because state transitions with set are suppose to not leave the main thread hanging, at least from my understanding. Instead you should be receiving a GST_STATE_CHANGE_ASYNC. I think you can see an example of some threads handling state changes in camerabin under gst-plugins-bad. There is a "reset-element-thread" that resets elements in the pipeline via state transitions. However, my first course of action would be to figure out which element is causing the hang, since it may need a thread of it's own. DmtOn Thu, Mar 23, 2017 at 3:13 AM, Jesse <[hidden email]> wrote: thank you for your reply,but I can't see the timeout parameter,the API is _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |