我正在尝试从 ARCore 相机捕获图像,但连续执行此操作会返回一个异常(com.google.ar.core.exceptions.ResourceExhaustedException ),并且 JNI 级别也提供相同的日志
E: cpu_image_manager.cc:102 Failed to acquire new image, due to too many images acquired but not released.
E: status.cc:155 ArStatusErrorSpace::AR_ERROR_RESOURCE_EXHAUSTED:
Run Code Online (Sandbox Code Playgroud)
所以我试图找出如何释放图像,正如ARCore ref所指出的那样,使用 C ( Caller is responsible for later releasing the image with ArImage_release)很容易,但在 Java 中没有Frame对象的释放方法。是不是因为 GC 的目的是释放资源本身?
我在与Kotlin一起使用@JsonIgnoreProperties时遇到麻烦。我需要忽略多个属性,并且会看到许多教程/ SO问题,在使用Java的情况下,通常会执行以下操作:
@JsonIgnoreProperties({ "p0", "p1", "p2" })
class Example(){...}
Run Code Online (Sandbox Code Playgroud)
因此在kotlin中将是:
@JsonIgnoreProperties(value = arrayOf( "p0", "p1", "p2" ))
class Example(){...}
Run Code Online (Sandbox Code Playgroud)
valueJsonIgnoreProperties接口的字段应接受数组,因为它是通过以下方式声明的:
public String[] value() default { };
Run Code Online (Sandbox Code Playgroud)
但是编译器抱怨并想要一个字符串,而不是一个数组。我什至无法复制注释,所以我应该怎么做才能忽略多个字段?
编辑:似乎这是自1.2 Beta起实施的kotlin缺失功能。可以value = ["p0", "p1", "p2"]用于注释。在1.2 Beta之前,可以使用@JsonIgnoreProperties("p0", "p1", "p2"),无法在数组前添加value =