Hi,
Developing Android NDK based renderer for Video call App
When call is started, receiving Surface (S1) from App which is being passed via JNI to Native Code where "ANativeWindow_fromSurface" is called on this Surface to get AnativeWindow
and then on this nativewindow "ANativeWindow_acquire" is called.
Then again receiving another surface (S2) from App, this new Surface is also passed via JNI to Native and again on this surface "ANativeWindow_fromSurface" is called.
Before doing "ANativeWindow_acquire" on this new window, for the previous window "ANativeWindow_release" is called, then for new window "ANativeWindow_acquire" is called
and rendering is done using "ANativeWindow_lock" and "ANativeWindow_unlockAndPost", till this point it works fine and rendering is happening.
But as the device is rotated from Portrait to Landscape, again Surface (S1) is coming from App, which is again passed via JNI to native code and "ANativeWindow_fromSurface" is called to get Window.
Then again "ANativeWindow_acquire" is called on this window, and now when try to render using "ANativeWindow_lock" and "ANativeWindow_unlockAndPost",
ANativeWindow_lock is giving error -22
BufferQueueProducer: [SurfaceView - com.sec.svetestapp/com.sec.svetestapp.main] connect: already connected (cur=2 req=2)
Has someone faced this problem, and have solution to it ??
Is something being missed to be done, when for first Surface (S1) , ANativeWindow_release is called, because it looks like when the same Surface is given by App again
then this issue is happening.
Note: When "native_window_api_disconnect" is called on window before releasing then this issue is not happening.
But since I am trying to do NDK build using NDK interfaces, so "native_window_api_disconnect" cannot be called.
Thanks in advance