我正在开发一个 Android 移动应用程序,该应用程序面向无人机摄像头视图的实时增强可视化(特别是我正在开发带有相关 SDK 的 DJI Phantom 3 Professional)。我正在为 AR 部分使用 Wikiitude 框架。每个 Wikiitude 示例都通过增强智能手机的摄像头视图来工作,因此我需要重定向输入视频流。在这个阶段,通过使用 DJI SDK 功能,我有一个 TextureView 对象,其中包含来自无人机的正确解码的流。以下是当前视图的 .xml 文件顶部的相关说明:
<TextureView
android:id="@+id/video_previewer_surface"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_centerHorizontal="true"
android:layout_above="@+id/linearLayout" />
实际上,Wikitude Architect View 是由相机流的渲染和增强的渲染组成的,如下图所示: Architect View Composition
sample_cam.xml 文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<com.wikitude.architect.ArchitectView
android:id="@+id/architectView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout>
有没有办法用我的TextureView的内容替换 Wikitude Architect View 的当前相机流?
或者,有没有办法让 ArchitectView 的相机流作为透明背景,以便将此层与TextureView重叠?
以下可能是 .xml 最终文件的部分代码:
<TextureView
android:id="@+id/video_previewer_surface"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_centerHorizontal="true"
android:layout_above="@+id/linearLayout" />
<com.wikitude.architect.ArchitectView // with transparent background for camera
android:id="@+id/architectView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>