All Products
Search
Document Center

ApsaraVideo Live:Integrate Queen SDK for Windows

Last Updated:Sep 05, 2024

This topic describes how to integrate Queen SDK for Windows into a project.

Prerequisites

A development environment is set up. The following table describes the requirements for the development environment.

Item

Requirement

Operating system

Windows 7 or later.

Development environment

Visual Studio 2010 or later. We recommend that you use Visual Studio 2017.

Integrate Queen SDK for C++

This section describes how to integrate and use Queen SDK for Windows. In this example, Visual Studio 2017 is used to create a C++ console app project, and Queen SDK for C++ is integrated into the project.

  1. Click the download URL to download Queen SDK.

    Decompress the downloaded SDK package. The following table describes the folders inside.

    Folder

    Description

    include

    Contains header files. The header files contain detailed comments on API operations.

    lib

    Contains the .lib file for compilation and the .dll files to be loaded when you run the SDK.

    queen_res

    Contains the resource files that are necessary when you run the SDK.

    res

    Contains the resource files for retouching effects. Files in this folder are optional if you want to use custom retouching materials.

  2. Create a project.

    Open Visual Studio and create a C++ console app project named AliyunQueenSDKDemo.

  3. Copy the files.

    In the directory in which the AliyunQueenSDKDemo.vcxproj file is located, create a folder named AliyunQueenSDK. Copy the folders extracted from the SDK package to the AliyunQueenSDK folder that you create.

  4. Configure the project.

    In the Solution Explorer section, right-click AliyunQueenSDKDemo and select Properties. In the AliyunQueenSDKDemo Property Pages dialog box, perform the following steps:

    1. Add the include directory. In the left-side navigation pane, choose C/C++ > General. In the Additional Include Directories field, enter $(ProjectDir)AliyunQueenSDK\include.

    2. Add the library directory. In the left-side navigation pane, choose Linker > General. In the Additional Library Directories field, enter $(ProjectDir)AliyunQueenSDK\lib\$(PlatformShortName).

    3. Add the library file. In the left-side navigation pane, choose Linker > Input. In the Additional Dependencies field, enter queen.lib.

    4. Add copy commands. In the left-side navigation pane, choose Build Events > Post-Build Event. In the Command Line field, enter the following commands:

      Note

      If you configure the copy commands, Visual Studio automatically copies the .dll files, queen_res folder, and res folder to the project folder after compilation.

      xcopy "$(ProjectDir)AliyunQueenSDK\lib\$(PlatformShortName)\*.dll" "$(TargetDir)" /y

      xcopy "$(ProjectDir)AliyunQueenSDK\queen_res" "$(TargetDir)queen_res" /i /s /y

      xcopy "$(ProjectDir)AliyunQueenSDK\res" "$(TargetDir)res" /i /s /y

  5. Call the API operations in the SDK and run your program.

    1. Replace the content of the AliyunQueenSDKDemo.cpp file with the following code:

      #include 
      #include "queen_engine.h"
      using namespace queen;
      using namespace std;
      int main()
      {
      const char* queenSDKVersion = queen_engine_getSDKVersion();
      cout << "Hello QueenEngine: " << queenSDKVersion << endl;
      }
    2. Press the F5 key on the keyboard. The console is enabled after the code is compiled.

References

  • For more usage examples of Queen SDK, see the ConsoleDemo/AliyunQueenSDKDemo/AliyunQueenSDKDemo/AliyunQueenSDKDemo.cpp file in the downloaded SDK package.

  • For more information about the API operations of Queen SDK, see AliyunQueenSDK.