Decodebin3 configuration error on Android

I got some errors when using decodebin3 on Android

2025-04-29 09:29:22.082 22414-22477 ExtendedACodec          com...ectricmaple.standalone_client  I  setupVideoDecoder()
2025-04-29 09:29:22.083 22414-22477 ExtendedACodec          com...ectricmaple.standalone_client  E  [OMX.qcom.video.decoder.avc] configureCodec returning error -1010
2025-04-29 09:29:22.083 22414-22477 ACodec                  com...ectricmaple.standalone_client  E  signalError(omxError 0x80001001, internalError -1010)
2025-04-29 09:29:22.083 22414-22477 ACodec                  com...ectricmaple.standalone_client  E  [OMX.qcom.video.decoder.avc] configureCodec returning error -1010
2025-04-29 09:29:22.083 22414-22477 ACodec                  com...ectricmaple.standalone_client  E  signalError(omxError 0x80001001, internalError -1010)
2025-04-29 09:29:22.083 22414-22476 MediaCodec              com...ectricmaple.standalone_client  E  Codec reported err 0xfffffc0e, actionCode 0, while in state 3/CONFIGURING
2025-04-29 09:29:22.083 22414-22476 SurfaceUtils            com...ectricmaple.standalone_client  D  disconnecting from surface 0x7a7dc1aa60, reason disconnectFromSurface
2025-04-29 09:29:22.083 22414-22476 MediaCodec              com...ectricmaple.standalone_client  E  Codec reported err 0xfffffc0e, actionCode 0, while in state 0/UNINITIALIZED
2025-04-29 09:29:22.083 22414-22475 MediaCodec              com...ectricmaple.standalone_client  E  configure failed with err 0xfffffc0e, resetting...

and

2025-04-29 09:29:22.100 22414-22475 NdkMediaCodec           com...ectricmaple.standalone_client  E  configure: err(-1010), failed with format: AMessage(what = 'conf', target = 24) = {
                                                                                                      string mime = "video/avc"
                                                                                                      int32_t width = 16
                                                                                                      int32_t height = 16
                                                                                                      RefBase *native-window = 0x7a7dc1aa50
                                                                                                      int32_t flags = 0
                                                                                                    }
2025-04-29 09:29:22.100 22414-22475 NdkMediaCodec           com...ectricmaple.standalone_client  E  sf error code: -1010
2025-04-29 09:29:22.100 22414-22475 GStreamer+amcvideodec   com...ectricmaple.standalone_client  E  0:00:04.748496560 0x794dc001b0 ../sys/androidmedia/gstamcvideodec.c:2029:gst_amc_video_dec_set_format:<amcvideodec-omxqcomvideodecoderavc0> Failed to configure codec

It doesn’t always happen. But on some devices, it happens more frequently.

If I replace it with decodebin, I get rid of these errors. But the player is always struck at a frame after a short time of playing.

When the issue appears, I see a bunch of

2025-04-29 11:23:36.393 19408-19520 NdkMediaCodec           com.gst.webrtc.standalone_client     E  configure: err(-22), failed with format: AMessage(what = 0x00000000) = {
                                                                                                      string mime = "video/avc"
                                                                                                      int32_t width = 16
                                                                                                      int32_t height = 16
                                                                                                      RefBase *native-window = 0x754d7de8d0
                                                                                                      int32_t native-window-generation = 19873793
                                                                                                      int32_t flags = 0
                                                                                                      int32_t android._color-format = 2130708361
                                                                                                    }
2025-04-29 11:23:36.443 19408-19520 NdkMediaCodec           com.gst.webrtc.standalone_client     E  configure: err(-22), failed with format: AMessage(what = 0x00000000) = {
                                                                                                      string mime = "video/avc"
                                                                                                      int32_t width = 16
                                                                                                      int32_t height = 16
                                                                                                      RefBase *native-window = 0x754d80f840
                                                                                                      int32_t native-window-generation = 19873794
                                                                                                      int32_t flags = 0
                                                                                                      int32_t android._color-format = 2130708361
                                                                                                    }
2025-04-29 11:23:36.509 19408-19520 NdkMediaCodec           com.gst.webrtc.standalone_client     E  configure: err(-22), failed with format: AMessage(what = 0x00000000) = {
                                                                                                      string mime = "video/avc"
                                                                                                      int32_t width = 16
                                                                                                      int32_t height = 16
                                                                                                      RefBase *native-window = 0x754d7de8d0
                                                                                                      int32_t native-window-generation = 19873795
                                                                                                      int32_t flags = 0
                                                                                                      int32_t android._color-format = 2130708361
                                                                                                    }
2025-04-29 11:23:36.551 19408-19520 NdkMediaCodec           com.gst.webrtc.standalone_client     E  configure: err(-22), failed with format: AMessage(what = 0x00000000) = {
                                                                                                      string mime = "video/avc"
                                                                                                      int32_t width = 16
                                                                                                      int32_t height = 16
                                                                                                      RefBase *native-window = 0x754d7e4f00
                                                                                                      int32_t native-window-generation = 19873796
                                                                                                      int32_t flags = 0
                                                                                                      int32_t android._color-format = 2130708361
                                                                                                    }
2025-04-29 11:23:36.588 19408-19520 NdkMediaCodec           com.gst.webrtc.standalone_client     E  configure: err(-22), failed with format: AMessage(what = 0x00000000) = {
                                                                                                      string mime = "video/avc"
                                                                                                      int32_t width = 16
                                                                                                      int32_t height = 16
                                                                                                      RefBase *native-window = 0x754d7de8d0
                                                                                                      int32_t native-window-generation = 19873797
                                                                                                      int32_t flags = 0
                                                                                                      int32_t android._color-format = 2130708361
                                                                                                    }
2025-04-29 11:23:36.621 19408-19520 NdkMediaCodec           com.gst.webrtc.standalone_client     E  configure: err(-22), failed with format: AMessage(what = 0x00000000) = {
                                                                                                      string mime = "video/avc"
                                                                                                      int32_t width = 16
                                                                                                      int32_t height = 16
                                                                                                      RefBase *native-window = 0x754d7e4f00
                                                                                                      int32_t native-window-generation = 19873798
                                                                                                      int32_t flags = 0
                                                                                                      int32_t android._color-format = 2130708361
                                                                                                    }
2025-04-29 11:23:36.657 19408-19520 NdkMediaCodec           com.gst.webrtc.standalone_client     E  configure: err(-22), failed with format: AMessage(what = 0x00000000) = {
                                                                                                      string mime = "video/avc"
                                                                                                      int32_t width = 16
                                                                                                      int32_t height = 16
                                                                                                      RefBase *native-window = 0x754d7de8d0
                                                                                                      int32_t native-window-generation = 19873799
                                                                                                      int32_t flags = 0
                                                                                                      int32_t android._color-format = 2130708361
                                                                                                    }
2025-04-29 11:23:36.692 19408-19520 NdkMediaCodec           com.gst.webrtc.standalone_client     E  configure: err(-22), failed with format: AMessage(what = 0x00000000) = {
                                                                                                      string mime = "video/avc"
                                                                                                      int32_t width = 16
                                                                                                      int32_t height = 16
                                                                                                      RefBase *native-window = 0x754d7e4f00
                                                                                                      int32_t native-window-generation = 19873800
                                                                                                      int32_t flags = 0
                                                                                                      int32_t android._color-format = 2130708361
                                                                                                    }
2025-04-29 11:23:36.728 19408-19520 NdkMediaCodec           com.gst.webrtc.standalone_client     E  configure: err(-22), failed with format: AMessage(what = 0x00000000) = {
                                                                                                      string mime = "video/avc"
                                                                                                      int32_t width = 16
                                                                                                      int32_t height = 16
                                                                                                      RefBase *native-window = 0x754d80f840
                                                                                                      int32_t native-window-generation = 19873801
                                                                                                      int32_t flags = 0
                                                                                                      int32_t android._color-format = 2130708361
                                                                                                    }

These native windows of size (16, 16) were definitely not created by me.