afsaredrisy / MediapipeHandtracking_GPU_Bitmap_Input

Handtracking mediapipe sample with bitmap RGB input
31 stars 10 forks source link

JNI ERROR (app bug): local reference table overflow (max=512) #3

Open wangzi815 opened 2 years ago

wangzi815 commented 2 years ago

2013-01-18 17:32:24.951 3347-3462/com.google.mediapipe.apps.hands A/art: art/runtime/indirect_reference_table.cc:132] JNI ERROR (app bug): local reference table overflow (max=512) 2013-01-18 17:32:24.951 3347-3462/com.google.mediapipe.apps.hands A/art: art/runtime/indirect_reference_table.cc:132] local reference table dump: 2013-01-18 17:32:24.951 3347-3462/com.google.mediapipe.apps.hands A/art: art/runtime/indirect_reference_table.cc:132] Last 10 entries (of 512): 2013-01-18 17:32:24.951 3347-3462/com.google.mediapipe.apps.hands A/art: art/runtime/indirect_reference_table.cc:132] 511: 0x12ceed90 byte[][] (2 elements) 2013-01-18 17:32:24.951 3347-3462/com.google.mediapipe.apps.hands A/art: art/runtime/indirect_reference_table.cc:132] 510: 0x6fd5e0b0 java.lang.Class<byte[]> 2013-01-18 17:32:24.951 3347-3462/com.google.mediapipe.apps.hands A/art: art/runtime/indirect_reference_table.cc:132] 509: 0x12ceea30 java.util.ArrayList ... see:https://github.com/google/mediapipe/issues/2604

wangzi815 commented 2 years ago

i use the project, @afsaredrisy your project use the aar mode,i only modify it in solution mode,main code as below.when run 6 minutes,the err produce. what is the problem? 1、mainactivity bmpInput.start( this, resultIntent.getData(), hands.getGlContext(), glSurfaceView.getWidth(), glSurfaceView.getHeight()));

bmpInput = new BmpInput(this); bmpInput.setNewFrameListener(textureFrame -> hands.send(textureFrame));

hands.setResultListener( handsResult -> { logWristLandmark(handsResult, /showPixelValues=/ false); glSurfaceView.setRenderData(handsResult); glSurfaceView.requestRender(); }); 2、bmpInput.class: public void start(Activity activity, Uri videoUri, EGLContext sharedContext, int displayWidth, int displayHeight) { this.converter = new BitmapConverter(sharedContext, 2); this.converter.setConsumer(this.newFrameListener); bitmapProducer = new BmpProducer(activity); bitmapProducer.setCustomFrameAvailableListner(this.converter); } 3、BmpProducer.class: bmp = BitmapFactory.decodeResource(context.getResources(), R.drawable.img2); public void run(){ while ((true)){ customFrameAvailableListner.onFrame(bmp); try{ Thread.sleep(10); }catch (Exception e){ Log.d(TAG,e.toString()); } } 4、 BitmapConverter.class private AppTextureFrame nextOutputFrame(Bitmap bitmap) { int textureName = ShaderUtil.createRgbaTexture(bitmap); outputFrameIndex = (outputFrameIndex + 1) % outputFrames.size(); destinationHeight = bitmap.getHeight(); destinationWidth = bitmap.getWidth(); setupDestination(outputFrameIndex, textureName); AppTextureFrame outputFrame = outputFrames.get(outputFrameIndex); //waitUntilReleased(outputFrame); //Log.d(TAG,String.format("outputFrameIndex = %d",outputFrameIndex)); return outputFrame; }