I use GpuPixel in WebRTC, each VideoFrame processes GpuPixel to apply beauty filter. Below is my code:
fun uploadSourceToGPUPixel(originalBitmap: Bitmap) {
try {
if (originalBitmap.width > 0) {
processingFrame = true
runBlocking {
val sourceImage = GPUPixelSourceImage(originalBitmap)
sourceImage.captureAProcessedFrameData(beautyFaceFilter) { result ->
Log.d(tag, "---------FRAME PROCESSED---------")
callback?.onResult(result ?: originalBitmap)
processingFrame = false
}
}
}
} catch (error: Exception) {
Log.e(tag, error.toString())
}
}
2024-02-15 16:45:43.023 1625-13322 AISPQSelector camerahalserver E [DpEngineAALReConfigFrame] aispq_en: 0
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A Build fingerprint: 'Xiaomi/amber_global/amber:14/UP1A.231005.007/V816.0.3.0.UKWMIXM:user/release-keys'
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A Revision: '0'
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A ABI: 'arm64'
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A Timestamp: 2024-02-15 16:45:42.917734998+0700
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A Process uptime: 4351s
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A Cmdline: com.waterbus.wanted
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A pid: 9825, tid: 13815, name: Thread-24 >>> com.waterbus.wanted <<<
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A uid: 10729
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xffffffff00000008
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A x0 b4000079977a1180 x1 000000799502c748 x2 0000000000000000 x3 0000000000000000
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A x4 0000000000000000 x5 0000000000000000 x6 0000000000000043 x7 0000000000000000
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A x8 ffffffff00000000 x9 0000000000000000 x10 ffffffffffffffff x11 0000000000000000
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A x12 0000000000000000 x13 000000799502b2d0 x14 0000007af251ea01 x15 00000000ebad6a89
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A x16 00000079745f6eb0 x17 0000007974518acc x18 0000007947fee000 x19 b4000079ba75b700
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A x20 b400007a43c182a0 x21 00000000000001e0 x22 0000000000000168 x23 b4000079ba75b700
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A x24 000000799502d000 x25 000000799502c8c0 x26 000000799502c8e4 x27 000000799502c8c0
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A x28 000000799502c7b0 x29 000000799502c730
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A lr 0000007974542cb4 sp 000000799502c710 pc 0000007974522ec4 pst 0000000040001000
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A 14 total frames
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A backtrace:
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A #00 pc 0000000000071ec4 /data/app/~~4K4ZWsbcPj-USsnBCD1-cQ==/com.waterbus.wanted-vsBh_6tS-2BV5IhoR44pWA==/base.apk!libgpupixel.so (offset 0x1c11000) (std::__ndk1::__shared_ptr_pointer<GPUPixel::Filter*, std::__ndk1::default_delete<GPUPixel::Filter>, std::__ndk1::allocator<GPUPixel::Filter> >::__on_zero_shared()+12) (BuildId: 59441ca5dcd7bf4287e6ee971a172bd7897bc944)
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A #01 pc 0000000000091cb0 /data/app/~~4K4ZWsbcPj-USsnBCD1-cQ==/com.waterbus.wanted-vsBh_6tS-2BV5IhoR44pWA==/base.apk!libgpupixel.so (offset 0x1c11000) (GPUPixel::Source::captureAProcessedFrameData(std::__ndk1::shared_ptr<GPUPixel::Filter>, int, int)+268) (BuildId: 59441ca5dcd7bf4287e6ee971a172bd7897bc944)
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A #02 pc 00000000000713cc /data/app/~~4K4ZWsbcPj-USsnBCD1-cQ==/com.waterbus.wanted-vsBh_6tS-2BV5IhoR44pWA==/base.apk!libgpupixel.so (offset 0x1c11000) (Java_com_pixpark_gpupixel_GPUPixel_nativeSourceCaptureAProcessedFrameData+116) (BuildId: 59441ca5dcd7bf4287e6ee971a172bd7897bc944)
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A #03 pc 0000000000355630 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+144) (BuildId: 02bec5940be704b863f6514fc7d81c41)
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A #04 pc 00000000005bb68c /apex/com.android.art/lib64/libart.so (nterp_helper+3852) (BuildId: 02bec5940be704b863f6514fc7d81c41)
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A #05 pc 000000000133ae8a /data/app/~~4K4ZWsbcPj-USsnBCD1-cQ==/com.waterbus.wanted-vsBh_6tS-2BV5IhoR44pWA==/oat/arm64/base.vdex (com.pixpark.gpupixel.GPUPixelSource$5.run+130)
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A #06 pc 00000000005bc4f4 /apex/com.android.art/lib64/libart.so (nterp_helper+7540) (BuildId: 02bec5940be704b863f6514fc7d81c41)
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A #07 pc 000000000133a4fc /data/app/~~4K4ZWsbcPj-USsnBCD1-cQ==/com.waterbus.wanted-vsBh_6tS-2BV5IhoR44pWA==/oat/arm64/base.vdex (com.pixpark.gpupixel.GPUPixel$3.run+4)
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A #08 pc 0000000000505818 /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (java.lang.Thread.run+72)
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A #09 pc 000000000033eba4 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612) (BuildId: 02bec5940be704b863f6514fc7d81c41)
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A #10 pc 000000000023a9ac /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+144) (BuildId: 02bec5940be704b863f6514fc7d81c41)
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A #11 pc 000000000053b96c /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1600) (BuildId: 02bec5940be704b863f6514fc7d81c41)
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A #12 pc 0000000000101d5c /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+204) (BuildId: 84a42637b3a421b801818f5793418fca)
2024-02-15 16:45:43.057 13818-13818 DEBUG pid-13818 A #13 pc 0000000000095bc0 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 84a42637b3a421b801818f5793418fca)