我要评分
获取效率
正确性
完整性
易理解

Deploying the Server Compilation Environment

  1. Configure the AOSP environment. Download the AOSP source code to, for example, the /home/android-11.0.0_r48 directory, and run the following command to configure the environment:
    cd /home/android-11.0.0_r48/
    repo init -u https://android.googlesource.com/platform/manifest -b android-11.0.0_r48
    repo sync -j8
    repo start android-11.0.0_r48 --all
    source build/envsetup.sh
    lunch aosp_arm64-eng
    make -j8

    When running the repo sync and make commands, you can change the number of parallel threads based on the number of CPU cores on the compilation server to speed up compilation. For example, make -j64 indicates that 64 threads are used for compilation.

  2. Copy the files in the development package to the AOSP development directory, for example, /home/android-11.0.0_r48/VideoEngine, and decompress the development package of the video stream engine server.
    cd /home/android-11.0.0_r48/VideoEngine
    tar -xvpf VideoEngine.tar.gz
  3. Build the video stream engine.
    cd /home/android-11.0.0_r48
    source build/envsetup.sh
    lunch aosp_arm64-eng
    cd VideoEngine
    mm

    After the compilation is successful, information similar to the following is displayed:

    #### build completed successfully (03:40 (mm:ss)) ####
  4. Edit the Demo.cpp and Android.bp files to verify that the video stream engine can be properly linked and used. The following uses the /home/android-11.0.0_r48/Demo directory as an example.
    cd /home/android-11.0.0_r48
    source build/envsetup.sh
    lunch aosp_arm64-eng
    cd Demo
    1. Edit the Android.bp file. The following is an example:
      1. Open the Android.bp file.
        vim Android.bp
      2. Press i to enter the insert mode and add the following content to the file:
        cc_binary {
            name: "VideoEngineDemo",
            vendor: true,
            srcs: [
                "Demo.cpp",
            ],
            shared_libs: [
                "libMediaEngine"
            ],
            include_dirs: [
                "VideoEngine/include",
            ],
        }
      3. Press Esc, type :wq!, and press Enter to save the file and exit.
    2. Edit the Demo.cpp file. The following is an example:
      1. Open the Demo.cpp file.
        vim Demo.cpp
      2. Press i to enter the insert mode and add the following content to the file:
        #include "VmiApi.h"
        int main()
        {
            GetVersion();
            return 0;
        }
      3. Press Esc, type :wq!, and press Enter to save the file and exit.
    3. Compile the demo to verify that the compilation environment is properly deployed.
      mm
      After the compilation is successful, information similar to the following is displayed:
      #### build completed successfully (03:40 (mm:ss)) ####