Hello.
I am developing a plugin for live streaming with WebRtc on THETA X.
The following is a sample plug-in for live streaming with WebRtc on THETA V, but I would like to use it as a base for THETA X.
The situation is that after launching the plugin and starting streaming, an error occurs and the plugin crashes.
The error is output as “checkAndUpdateEglState: invalid current EGLDisplay”. (Detailed log will be explained later)
Below are the questions.
① I’m having trouble figuring out the cause of the error. Could you please tell me the cause and how to deal with it?
②If you know of any examples of using THETAX with WebRtc in the past, please let us know.
【supplement】
- The sample uses the Android standard camera API (android.hardware.Camera), but this time we want to distribute 360° videos with THETA X, so we changed it to use the THETA version (theta360.hardware.Camera). doing.
【Log when an error occurs】
2024-02-28 16:34:42.806 3203-3456 org.webrtc.Logging com…uginapplication.webrtc.sample I SurfaceTextureHelper: Setting listener to com.theta360.pluginapplication.webrtc.sample.network.WebRTCLibExtends.-$$Lambda$ThetaSession$_GytSbtfY-yp9gmCkhEWH7a1F8k@27846dc
2024-02-28 16:34:42.807 3203-3456 theta360.h…Camera.TAG com…uginapplication.webrtc.sample D handleMessage 8194
2024-02-28 16:34:42.815 3203-3456 theta360.h…Camera.TAG com…uginapplication.webrtc.sample D cameraModeChange state = 1
2024-02-28 16:34:42.816 3203-3520 gst_sensor_src com…uginapplication.webrtc.sample D gst_sensor_poll_event_task has callback, block task, enable_task:0
2024-02-28 16:34:42.834 3203-3492 stg_plugin com…uginapplication.webrtc.sample D camerabin_session on_capture_progressed in
2024-02-28 16:34:42.835 3203-3492 stg_plugin com…uginapplication.webrtc.sample D camerabin_session on_capture_progressed in
2024-02-28 16:34:42.838 3203-3492 stg_plugin com…uginapplication.webrtc.sample D camerabin_session on_capture_progressed in
2024-02-28 16:34:42.845 3203-3521 gst_sensor_src com…uginapplication.webrtc.sample D gst_sensor_poll_event_task has callback, block task, enable_task:0
2024-02-28 16:34:42.849 3203-3522 gst_sensor_src com…uginapplication.webrtc.sample D gst_sensor_poll_event_task has callback, block task, enable_task:0
2024-02-28 16:34:42.945 3203-3492 stg_plugin com…uginapplication.webrtc.sample D camerabin_session on_capture_progressed in
2024-02-28 16:34:42.949 3203-3492 stg_plugin com…uginapplication.webrtc.sample D camerabin_session on_capture_completed 1
2024-02-28 16:34:42.949 3203-3492 stg_plugin com…uginapplication.webrtc.sample D --ndk_capture_request_get_isHighlight_value-- isHighlight [0] = 0
2024-02-28 16:34:42.949 3203-3492 stg_plugin com…uginapplication.webrtc.sample D color_temp is 0, cameraID = 0, iso = 226, ex_time = 30000000
2024-02-28 16:34:42.964 3203-3523 stg_plugin com…uginapplication.webrtc.sample D camerabin_image_reader on_image_available in, is ready 0
2024-02-28 16:34:42.964 3203-3523 stg_plugin com…uginapplication.webrtc.sample D camerabin_image_reader on_image_available long_ex_image = 0, self->shutter_begin = 0
2024-02-28 16:34:42.964 3203-3523 camerabin_src com…uginapplication.webrtc.sample D camerabin_src gst_camera_source_on_ndk_image_preview 1042: in
2024-02-28 16:34:42.964 3203-3523 stg_plugin com…uginapplication.webrtc.sample D stg_dual_image_new called
2024-02-28 16:34:42.964 3203-3523 stg_plugin com…uginapplication.webrtc.sample D image->refcount 1
2024-02-28 16:34:42.964 3203-3523 stg_plugin com…uginapplication.webrtc.sample D gst_camera_sync_post_bus_message ret = 1 message = first-frame-done
2024-02-28 16:34:42.971 3203-3523 stg_plugin com…uginapplication.webrtc.sample D gstdisplay->nwBuffer = 0x79a2b49bd0
2024-02-28 16:34:42.972 3203-3523 gst_display_sink com…uginapplication.webrtc.sample D display nwBuffer out = 0x79a2b49bd0
2024-02-28 16:34:42.978 3203-3492 stg_plugin com…uginapplication.webrtc.sample D camerabin_session on_capture_progressed in
2024-02-28 16:34:42.980 3203-3455 theta360.h…Camera.TAG com…uginapplication.webrtc.sample D postEventFromNative->16
2024-02-28 16:34:42.981 3203-3523 gst_display_sink com…uginapplication.webrtc.sample D gst_displaysink_chain Entry
2024-02-28 16:34:42.981 3203-3523 gst_display_sink com…uginapplication.webrtc.sample D display map_out ANativeWindowBuffer 0x79a2b49bd0
2024-02-28 16:34:42.981 3203-3523 gst_display_sink com…uginapplication.webrtc.sample D gst_displaysink_chain Exit
2024-02-28 16:34:42.981 3203-3456 theta360.h…Camera.TAG com…uginapplication.webrtc.sample D handleMessage 16
2024-02-28 16:34:42.981 3203-3523 stg_plugin com…uginapplication.webrtc.sample D stg_dual_image_unref called
2024-02-28 16:34:42.981 3203-3523 stg_plugin com…uginapplication.webrtc.sample D image->refcount 2
2024-02-28 16:34:42.982 3203-3523 stg_plugin com…uginapplication.webrtc.sample D stg_dual_image_unref called
2024-02-28 16:34:42.982 3203-3523 stg_plugin com…uginapplication.webrtc.sample D image->refcount 1
2024-02-28 16:34:42.982 3203-3523 stg_plugin com…uginapplication.webrtc.sample D g_free called
2024-02-28 16:34:42.982 3203-3523 stg_plugin com…uginapplication.webrtc.sample D image->refcount 0
2024-02-28 16:34:42.982 3203-3456 OpenGLRenderer com…uginapplication.webrtc.sample E [SurfaceTexture-1-3203-1] checkAndUpdateEglState: invalid current EGLDisplay
2024-02-28 16:34:42.984 3203-3492 stg_plugin com…uginapplication.webrtc.sample D camerabin_session on_capture_completed 1
2024-02-28 16:34:42.984 3203-3492 stg_plugin com…uginapplication.webrtc.sample D --ndk_capture_request_get_isHighlight_value-- isHighlight [0] = 0
--------- beginning of crash
2024-02-28 16:34:42.984 3203-3492 stg_plugin com…uginapplication.webrtc.sample D color_temp is 0, cameraID = 0, iso = 226, ex_time = 30000000
2024-02-28 16:34:42.993 3203-3456 AndroidRuntime com…uginapplication.webrtc.sample E FATAL EXCEPTION: VideoCapturerThread
Process: com.theta360.pluginapplication.webrtc.sample, PID: 3203
java.lang.IllegalStateException: Unable to update texture contents (see logcat for details)
2024-02-28 16:34:43.001 3203-3523 stg_plugin com…uginapplication.webrtc.sample D camerabin_image_reader on_image_available in, is ready 0
2024-02-28 16:34:43.001 3203-3523 stg_plugin com…uginapplication.webrtc.sample D camerabin_image_reader on_image_available long_ex_image = 0, self->shutter_begin = 0
2024-02-28 16:34:43.001 3203-3523 camerabin_src com…uginapplication.webrtc.sample D camerabin_src gst_camera_source_on_ndk_image_preview 1042: in
2024-02-28 16:34:43.001 3203-3523 stg_plugin com…uginapplication.webrtc.sample D stg_dual_image_new called