【问题标题】:Cross Compiling v4l2-ctl for Android为 Android 交叉编译 v4l2-ctl
【发布时间】:2016-04-11 09:42:04
【问题描述】:

我有一个在 android 上运行的 USB 摄像头(通过 Android On-The-Go),我希望更改摄像头的曝光。我已经能够通过在 linux 机器上使用 v4l2-ctl 来实现它,我希望在我的 Android 设备上也能做到这一点。

安装文件提到以下内容:

Android Cross Compiling and Installing:
----------------

v4l-utils will only build using the complete AOSP source tree, because of the
stlport dependency.

List of v4l-utils that supply an Android.mk makefile:
* utils/v4l2-compliance
* utils/v4l2-ctl
* utils/v4l2-dbg

To cross compile an utility you must first configure the shell with Android's
envsetup.sh to add the mm alias, before running lunch to select your target
device.

cd /path/to/aosp
source build/envsetup.sh
lunch
cd /path/to/v4l-utils
cd <utility>
mm

所以我下载了android源,运行了前两个命令和lunch成功。然后我 cd'd 进入 v4l-utils/v4l2-ctl 并运行 mm。我收到以下错误:

make: *** No rule to make target `out/target/product/generic/obj/lib/crtbegin_dynamic.o', needed by `out/target/product/generic/obj/EXECUTABLES/v4l2-ctl_intermediates/LINKED/v4l2-ctl'.  Stop.

我可以尝试什么来解决这个问题?

注意:正常编译工作:我可以用./bootstrap.sh./configure,然后make制作所有v4l2。

【问题讨论】:

    标签: android makefile v4l2


    【解决方案1】:

    我已经想出办法了!我发现这些说明效果很好,除了以下两点:

    下载并构建整个 Android 源代码

    • 在做任何事情之前,您需要下载并制作完整的 Android 源代码。这意味着setting up your environmentdownloading it,然后是building it
    • 确保您下载的是正确版本的 Android 源代码(即您手机上运行的版本)。
    • 要更快下载,请运行 repo-sync-c,仅适用于当前分支
    • 我建议购买一个按小时计费的大型服务器并在其中运行它。网络连接会更好,机器可能比你自己的好。我在 DigitalOcean 上有一台 8 核、16GB 的机器。
    • 运行lunch时,我只选择了第一个选项:aosp_arm-eng

    设置 TOP 变量

    • 执行mm 步骤时,您会收到错误消息Couldn't locate the top of the tree. Try setting TOP. 所以运行export TOP=/location/of/android/source

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-09-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多