Hello All,
We 're working on an Android App employing webrtc for video calls and got this exception when trying to resume video after the App changed from another App screen back to video call screen:
01-02 20:50:56.200 20168-21281/org.restcomm.android.olympus.premium.debug E/HardwareVideoEncoder: HardwareVideoEncoder: java.lang.IllegalStateException
at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:2568)
at org.webrtc.HardwareVideoEncoder.deliverEncodedImage(HardwareVideoEncoder.java:476)
at org.webrtc.HardwareVideoEncoder.access$100(HardwareVideoEncoder.java:33)
at org.webrtc.HardwareVideoEncoder$1.run(HardwareVideoEncoder.java:465)
01-02 20:50:56.200 20168-21281/org.restcomm.android.olympus.premium.debug E/HardwareVideoEncoder: HardwareVideoEncoder: deliverOutput failed
Any idea what might be wrong?
Some additional details:
In order to be able to pause video when the user leaves the video call screen to go to another App screen (while audio keeps flowing), and resume later using new views for video rendering (since Android destroys old activity views) we used this technique:
- When pausing: stop rendering and remove local and remote previous renderers from respective video tracks
- When resuming: start rending and add new renderers to previous tracks
Notice that the effect is that all UI elements are destroyed and recreated, while PeerConnection + original video tracks stay alive to be reused when the user comes back to call screen
IMPORTANT: this issue occurs some of the times, around 50%. The other half everything works and the video is resumed properly
Thanks in advance,
Antonis Tsakiridis
P.S. I can provide more details but didn't want to overwhelm you with details right off the bat