带有vlc库的Flutter应用每帧获取像素颜色

问题描述

我需要支持rtmp的播放器,并从每个帧中获取像素。

所以我在Flutter中使用vlc库。

Flutter_vlc_player库具有函数“ takesnapshot”,但我只需要颜色

所以我编辑getSnapshot并将此代码添加获取android中的像素颜色

case "getPixel":
            Map<String,Integer> response2 = new HashMap<>();
            if (mediaPlayer.isPlaying()) {
                Bitmap bitmap = textureView.getBitmap();
                
                int pixelX = methodCall.argument("pixelX");
                int pixelY = methodCall.argument("pixelY");
                int pixel = bitmap.getPixel(bitmap.getWidth()/2,bitmap.getHeight()/2);
                response2.put("pixel",pixel);
            }
            result.success(response2);
            break;

但是我也需要迅速... 当我尝试编辑代码时会给我错误

这是更好的方法吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)