This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How can I use CODEC ENGINE APIs in QT application?

Other Parts Discussed in Thread: OMAP3530

Hi!

In my project,we use QT to design arm side UI applications.

We use CODEC ENGINE to communicate with DSP, which XDC is used.

But when I create a UI project ,the QT will  generate a makefile,which we use to make a application .

How can I use CODEC ENGINE  APIs in QT application,?how about the makefile?and the config.bld?the pakckdeg.xdc and so on?

Thanks!

  • This is a FAQ.

    From a build POV, you'll need to do the following

    1. Run the XDC config step.  Input is a .cfg file - likely to the configuro utility, output is a compiler.opt and linker.cmd file.  Your ARM-side .cfg script will likely leverage Engine.createFromServer().
    2. Build your app with the generated compiler.opt file (which includes options for your compiler when building your app).
    3. Link your executable with the generated linker.cmd file (which includes library names, and linker script).

    If you provide the version of Codec Engine you're using, I may be able to point you at an example makefile which uses configuro.

    Chris

  • Thanks!Chris. My CODEC ENGINE is version 2.24,and QT 4.5. You said that I should first run the XDC config step.I have gone through the CE examples(apps/video_copy),is the .cfg file I needed here same like apps/video_copy/remote.cfg? After I have prapared the .cfg file, how should I run the config step?Directly use configuro command? If I have got the compiler.opt and linker.cmd file, and some coressponding .c files(where functions like Engine_open and VIDDEC_create are used,and needed .h files are includee ),I copy them to my QT project.Then I modify the makefile created by QT, to add the compiler.opt when build, and linker.cmd when link.Then I run make using arm-none-linux-gnueabi- tools. Am I right?If you can provide me with an example,it really helps me much. Thanks a lot!
  • XIAN ZHAO said:
    I have gone through the CE examples(apps/video_copy),is the .cfg file I needed here same like apps/video_copy/remote.cfg?

    Yes, that's the one.

    XIAN ZHAO said:
    After I have prapared the .cfg file, how should I run the config step?Directly use configuro command?

    Yes.  If you notice, the .../apps/video_copy example has a 'configuro/<platform>' subdirectory that contains an example makefile showing "the configuro way" to build the app.  (This was restructured in CE 2.24, so readers using CE before 2.24 won't find the configuro example here.)

    In that example, you'll see the configuro command line used to generate the compiler.opt and linker.cmd, as well as the commands used during your compile and link steps.

    XIAN ZHAO said:
    If I have got the compiler.opt and linker.cmd file, and some coressponding .c files(where functions like Engine_open and VIDDEC_create are used,and needed .h files are includee ),I copy them to my QT project.Then I modify the makefile created by QT, to add the compiler.opt when build, and linker.cmd when link.

    Not quite.  The libraries that contain the CE APIs (e.g. Engine_open(), VIDDEC_create(), etc) are pre-built, and you don't have to rebuild them.  The generated linker.cmd file contains "the right libraries" to link in, and should just be provided to the linker as the example makefile demonstrates. (the list of libraries to link varies based on your configuration - which is why it falls out of the config step.)

    Chris

  • Tanks!Chris.

    I want to first prove my understanding is right.Here is what I wrote:

    /*********************prog.cpp***********************/

    #include <stdio.h>
    #include <xdc/runtime/System.h>

    int main()
    {
      printf("stdio_printf.\n");
      System_printf("system_printf.\n");

      return 0;
    }

    /*********************prog.cfg***********************/
    var p = xdc.useModule('xdc.runtime.System');

    /***********************config.bld******************/

    GCArmv5T = xdc.module('gnu.targets.arm.GCArmv5T');

    var V5T_rootdir = "/home/davinci/zxcall_omap/toolchain/arm-2008q1";
    var CC_V5T = "bin/arm-none-linux-gnueabi-g++";
    GCArmv5T.rootDir = V5T_rootdir;
    GCArmv5T.LONGNAME = CC_V5T;

    /****************************Makefile**********************/

    CONFIGURO = /home/davinci/zxcall_omap/dvsdk_3_00_02_44/xdctools_3_15_01_59/xs xdc.tools.configuro

    CCTOOLS = /home/davinci/zxcall_omap/toolchain/arm-2008q1
    CC = $(CCTOOLS)/bin/arm-none-linux-gnueabi-g++
    CONFIG = cfgdir
    COMPILER_FILE = $(CONFIG)/compiler.opt
    LINKER_FILE = $(CONFIG)/linker.cmd
    TARGET = gnu.targets.arm.GCArmv5T
    PLATFORM = ti.platforms.evm3530

    linker.cmd compiler.opt : prog.cfg
            $(CONFIGURO) -c $(CCTOOLS) -b config.bld  -t $(TARGET) -p $(PLATFORM) -o $(CONFIG) prog.cfg


    CPPFLAGS +=  $(shell cat $(COMPILER_FILE)) -g -Wall -Os

    all : prog

    prog.o : prog.cpp $(COMPILER_FILE)
            $(CC) -c prog.cpp $(CPPFLAGS) $(CFLAGS)


    prog: prog.o $(LINKER_FILE)
            $(CC) -o prog prog.o -lpthread

    clean :
            rm -rf $(CONFIG) *.o *.out

    /*********************end************************/

     

    Then I run "make",it seems work  fine.,and a directory named "cfgdir" is created,which contains link.cmd and complier.opt.

    But when I run "make all",it fails with:

      undefined reference to `xdc_runtime_System_printf__E'.

     

      I am using OMAP3530,is the TARGET I set  in the makefile correct?Or is there anything  else wrong ?

      And,what is the difference between  the role of config.bld and .cfg?

       After all, have I misunderstood you?If not, what  shall you suggest to correct this example?

      Thanks! 

     

     

  • I think you need to add the generated $(LINKER_FILE) when linking your 'prog' app.  Change this:

    XIAN ZHAO said:
    prog: prog.o $(LINKER_FILE)
            $(CC) -o prog prog.o -lpthread

    ... to this...

    prog: prog.o $(LINKER_FILE)
            $(CC) -o prog $^ -lpthread

    The '$^' gets replaced with "everything after the ':' on the line above", including prog.o and the generated $(LINKER_FILE).

    Chris

  • Do I need to compile the C files in the packages which generator by the configuro tool if I only want to generator code for ARM side?

    For example, I write a simpile C++ file named "test.cpp", and my cfg file is called test.cfg.

    After running configuro tool, it auromatically generator a directory named test.

    In this directory, there are linker.cmd and compiler.opt, which are certainly necessary for compiling and linking, and other files, including a directory named package.

    There is also a C file named "package_test.c" and in /test/package/cfg, there is also a C file named "test_x470MV.c".

    Do I need to compile these 3 C files to get my program for ARM side?

    THX!

     

     

  • Could you help me ?I have some problems between qt and codec engine .How can I use CODEC ENGINE  APIs in QT application? Please note : QT APIS  dierctly call  CODEC ENGINE   APIS. Do you know how to deal with it?

  • yin yu 

    你好!

            你在qt里调用codec engine 成功了吗?