[HarmonyOS] Add support for HarmanyOS
Describe the issue AVPro Video codec error on HUAWEI P50 Pro
Your Setup (please complete the following information):
- Unity 2022.3.17f1
- AVPro 3.0.8
- Harmony0S 4.2.0
- HUAWEI P50 Pro
- 1536x768 rate:1960kb/s codec:h264 main profile yuv420p
**Logs**
2024-08-30 19:25:19.428 11102-15436 MediaCodecVideoRenderer com.miner.and.pd E Video codec error
java.lang.IllegalStateException
at android.media.MediaCodec.native_queueInputBuffer(Native Method)
at android.media.MediaCodec.queueInputBuffer(MediaCodec.java:2634)
at androidx.media3.exoplayer.mediacodec.SynchronousMediaCodecAdapter.queueInputBuffer(SynchronousMediaCodecAdapter.java:145)
at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:1399)
at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:818)
at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:852)
at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1047)
at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:522)
at android.os.Handler.dispatchMessage(Handler.java:113)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:293)
at android.os.HandlerThread.run(HandlerThread.java:110)
2024-08-30 19:25:19.431 11102-15436 ExoPlayerImplInternal com.miner.and.pd E Playback error
androidx.media3.exoplayer.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, avc1.4D4020, -1, null, [1536, 768, 29.996841, null], [-1, -1]), format_supported=YES
at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:601)
at android.os.Handler.dispatchMessage(Handler.java:113)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:293)
at android.os.HandlerThread.run(HandlerThread.java:110)
Caused by: androidx.media3.exoplayer.video.MediaCodecVideoDecoderException: Decoder failed: OMX.hisi.video.decoder.avc
at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.createDecoderException(MediaCodecVideoRenderer.java:1862)
at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:837)
at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:852)
at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1047)
at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:522)
at android.os.Handler.dispatchMessage(Handler.java:113)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:293)
at android.os.HandlerThread.run(HandlerThread.java:110)
Caused by: java.lang.IllegalStateException
at android.media.MediaCodec.native_queueInputBuffer(Native Method)
at android.media.MediaCodec.queueInputBuffer(MediaCodec.java:2634)
at androidx.media3.exoplayer.mediacodec.SynchronousMediaCodecAdapter.queueInputBuffer(SynchronousMediaCodecAdapter.java:145)
at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:1399)
at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:818)
at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:852)
at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1047)
at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:522)
at android.os.Handler.dispatchMessage(Handler.java:113)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:293)
at android.os.HandlerThread.run(HandlerThread.java:110)
2024-08-30 19:25:19.432 11102-15436 ExoPlayerImplInternal com.miner.and.pd E Disable failed.
java.lang.IllegalStateException
at android.media.MediaCodec.native_flush(Native Method)
at android.media.MediaCodec.flush(MediaCodec.java:2350)
at androidx.media3.exoplayer.mediacodec.SynchronousMediaCodecAdapter.flush(SynchronousMediaCodecAdapter.java:168)
at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.flushCodec(MediaCodecRenderer.java:901)
at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.flushOrReleaseCodec(MediaCodecRenderer.java:894)
at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.onDisabled(MediaCodecRenderer.java:733)
at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.onDisabled(MediaCodecVideoRenderer.java:634)
at androidx.media3.exoplayer.BaseRenderer.disable(BaseRenderer.java:197)
at androidx.media3.exoplayer.ExoPlayerImplInternal.disableRenderer(ExoPlayerImplInternal.java:1721)
at androidx.media3.exoplayer.ExoPlayerImplInternal.resetInternal(ExoPlayerImplInternal.java:1453)
at androidx.media3.exoplayer.ExoPlayerImplInternal.stopInternal(ExoPlayerImplInternal.java:1413)
at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:634)
at android.os.Handler.dispatchMessage(Handler.java:113)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:293)
at android.os.HandlerThread.run(HandlerThread.java:110)
2024-08-30 19:25:19.433 11102-15436 MediaCodec com.miner.and.pd I MediaCodec releaseAsync
2024-08-30 19:25:19.433 11102-11102 AVProVideo com.miner.and.pd I 💬️ Player_ExoPlayer.onVideoSizeChanged - Changing video size 1536x768 to 0x0
2024-08-30 19:25:19.433 11102-15548 ACodec com.miner.and.pd I ACodec initiateShutdown
2024-08-30 19:25:19.433 11102-15549 ACodec com.miner.and.pd W forcing OMX state to Idle when received shutdown in ExecutingState
2024-08-30 19:25:19.433 11102-15548 MediaCodec com.miner.and.pd I kWhatRelease or kWhatStop processing is complete.
2024-08-30 19:25:19.434 3864-4153 DeviceStateService pid-3864 I event is too short, not process app: com.miner.and.pd mediacodec action.
2024-08-30 19:25:19.436 11102-15436 MediaDrm-JNI com.miner.and.pd I MediaDrm_native drm release 0xb40000799716cb80
2024-08-30 19:25:19.436 11102-15436 MediaDrm-JNI com.miner.and.pd I MediaDrm_native drm disconnect
2024-08-30 19:25:19.436 11102-15436 MediaDrm-JNI com.miner.and.pd I MediaDrm_native destroyPlugin and clear
2024-08-30 19:25:19.440 11102-15549 Surface com.miner.and.pd E getSlotFromBufferLocked: unknown buffer: 0xb40000778a164780
2024-08-30 19:25:19.441 11102-15549 ACodec com.miner.and.pd W [OMX.hisi.video.decoder.avc] can not return buffer 18 to native window
2024-08-30 19:25:19.442 11102-15549 Surface com.miner.and.pd E getSlotFromBufferLocked: unknown buffer: 0xb40000778a164000
2024-08-30 19:25:19.442 11102-15549 ACodec com.miner.and.pd W [OMX.hisi.video.decoder.avc] can not return buffer 17 to native window
2024-08-30 19:25:19.442 11102-15549 Surface com.miner.and.pd E getSlotFromBufferLocked: unknown buffer: 0xb40000778a164600
2024-08-30 19:25:19.442 11102-15549 ACodec com.miner.and.pd W [OMX.hisi.video.decoder.avc] can not return buffer 16 to native window
2024-08-30 19:25:19.443 11102-15549 Surface com.miner.and.pd E getSlotFromBufferLocked: unknown buffer: 0xb40000778a164180
2024-08-30 19:25:19.444 11102-15549 ACodec com.miner.and.pd W [OMX.hisi.video.decoder.avc] can not return buffer 15 to native window
2024-08-30 19:25:19.444 11102-15549 Surface com.miner.and.pd E getSlotFromBufferLocked: unknown buffer: 0xb40000778a164300
2024-08-30 19:25:19.445 11102-15549 ACodec com.miner.and.pd W [OMX.hisi.video.decoder.avc] can not return buffer 14 to native window
2024-08-30 19:25:19.445 11102-15549 Surface com.miner.and.pd E getSlotFromBufferLocked: unknown buffer: 0xb40000778a164480
2024-08-30 19:25:19.445 11102-15549 ACodec com.miner.and.pd W [OMX.hisi.video.decoder.avc] can not return buffer 13 to native window
2024-08-30 19:25:19.446 11102-15549 Surface com.miner.and.pd E getSlotFromBufferLocked: unknown buffer: 0xb400007789b00e80
2024-08-30 19:25:19.446 11102-15549 ACodec com.miner.and.pd W [OMX.hisi.video.decoder.avc] can not return buffer 12 to native window
2024-08-30 19:25:19.447 11102-15436 DrmHal com.miner.and.pd I DrmHal Destroyed 0xb4000077d2c83c00
2024-08-30 19:25:19.448 11102-15549 Surface com.miner.and.pd E getSlotFromBufferLocked: unknown buffer: 0xb400007789b00d00
2024-08-30 19:25:19.448 11102-15549 ACodec com.miner.and.pd W [OMX.hisi.video.decoder.avc] can not return buffer 11 to native window
2024-08-30 19:25:19.448 1395-29537 DataCollector pid-1395 I VIDEO:[SendMsg]:[246] VdecExitMsg: processName com.miner.and.pd, displayWH[1536x768], bitDepth 8, frameRate 30, bitRate 3093640 bps, maxInputSize 33991, maxGopLength 0, firstFrameSendDelay 37 ms, firstFrameDecodeDelay 32 ms
2024-08-30 19:25:19.448 1878-1883 MODEMCHR pid-1878 I [vendor/hisi/ap/system/core/modemchr/src/modemchr_global.cpp:355][ReportVdecData] vdec msg ignored, packName: com.miner.and.pd
2024-08-30 19:25:19.450 11102-11102 AVProVideo com.miner.and.pd E ❌ Player_ExoPlayer.onPlayerError - onPlayerError - error: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/avc, avc1.4D4020, -1, null, [1536, 768, 29.996841, null], [-1, -1]), format_supported=YES
2024-08-30 19:25:19.450 11102-11102 System.out com.miner.and.pd I AVProVideo video state: idle
2024-08-30 19:25:19.455 11102-15548 MediaCodec com.miner.and.pd D flushMediametrics
2024-08-30 19:25:19.455 11102-15548 MediaCodec com.miner.and.pd I mediacodec kWhatReleaseCompleted end
2024-08-30 19:25:19.457 11102-15548 MediaCodec com.miner.and.pd D flushMediametrics
I previously worked on Android video hardware decoding, and on the HUAWEI Mate 40 Pro, calling MediaCodec.start() and MediaCodec.flush() in close succession or at the same time can lead to decoding failures. I wonder if this is related.
We currently do not support Harmony OS. It is something we are looking into.
Dear AVPro Support, now can the plugins support HarmonyOS Next? Thanks.
What if Huawei assign some tech specialists and software engineers to assist your team to deal with harmony OS support? Will you accept such assist if possible? @Chris-RH
What if Huawei assign some tech specialists and software engineers to assist your team to deal with harmony OS support? Will you accept such assist if possible? @Chris-RH
Our official stance remains the same:
We currently do not support Harmony OS. It is something we are looking into.
Support for OpenHarmony has been added with version 3.2.5. Currently this is the trial plugin only.