glimagesink: native_window_api_connect (win=0xe79fb808) failed (0xffffffea) (already connected to another API?)
When rechange the pipline state to playing, I get this error(on Android, show rtsp video by overlay).
The glcontext is unref in glimagesink casue this.
I fix it by the following, but don't find root cause.
gst-plugins-bad/ext/gl/gstglimagesink.c
936 static GstStateChangeReturnunref
937 gst_glimage_sink_change_state (GstElement * element, GstStateChange transition)
938 {
939 GstGLImageSink *glimage_sink;
940 GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
+
+
975 switch (transition) {
976 case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
977 break;
978 case GST_STATE_CHANGE_PAUSED_TO_READY:
979 {
980 GstBuffer *buf[2];
+
+
1038 gst_object_unref (window);
**1039 gst_object_unref (glimage_sink->context);
**1040 gst_object_unref (glimage_sink->context);
**1041 gst_object_unref (glimage_sink->context);
**1042 gst_object_unref (glimage_sink->context);
1043 glimage_sink->context = NULL;
1044 }
the glimage_sink->display also unref when glimagesink finalized.
(rtspsrc ! rtph264depay ! tee ! queue ! h264parse ! amcviddec ! autovideosink)