Please note: this page has been translated automatically. If you can, you should read it in one of these languages:

Programming Guide IMP

APIs’ documentation can be seen here:

IMP ( Ingenic Media Platform ) ( See imp_system.h )

basic concepts

The T20 / T21 program is based on the following concepts:

  1. Device ( = Device )
    The device completes function.
    The group is also a container for specific “ Functions “. See the explanation in the channel section for more details.
  2. Eligo ( = Output )
    The output is the smallest data output unit per group.
    The channel is usually related to a single functional unit.
    For example:
    • For the Codel, channel completes the H264 or code function JPEG.

    • For IVS, a channel completes the function of a specific algorithm and the specific algorithm typical parameters are specified during creating the channel

    • For OSD, there is a region similar to Channel, a region is a specific supermetated area that can be a top ( image ) cover ( occlusion ), etc.

    • For FrameSource, a channel produces an original image and the channel FrameSource is actually a group

    The channel, as a functional unit, usually be preserved in the ( group except FrameSource ) Receive data.

    The number of channels that can be recorded by the group of various devices is also different.

After two groups are linked by Bind, data from the source group will automatically send to the destination.
Since the group is the smallest data input unit and the output is the smallest data output unit, the deviceID, groupID and outputID srcCell in the two parameters of IMP_System_Bind (IMPCell * srcCell, IMPCell * dstCell) are valid.

Example 1:

IMPCell fs_chn0 = {DEV_ID_FS, 0, 0};    // FrameSource deviceID: DEV_ID_FS groupID: 0 outputID: 0
IMPCell enc_grp0 = {DEV_ID_ENC, 0, 0}; // ENC deviceID: DEV_ID_ENC groupID : 0 outputID: 0, où le troisième paramètre de enc_grp0 n'a pas de sens. 
int ret = IMP_System_Bind (& fs_chn0, & enc_grp0);
if(ret <0>)
  printf ("Bind FrameSource Channel0 and Encoder Group0 failed \ n");

Result:

Example 2:

// flux de données principal
IMPCell fs_chn0 = {DEV_ID_FS, 0, 0};
IMPCell osd_grp0 = {DEV_ID_OSD, 0, 0};
IMPCell enc_grp0 = {DEV_ID_ENC, 0, 0};
int ret = IMP_System_Bind(&fs_chn0, &osd_grp0);
if (ret < 0)
    printf("Bind FrameSource Channel0 and OSD Group0 failed\n");

int ret = IMP_System_Bind(&osd_grp0, &enc_grp0);
if (ret < 0)
    printf("Bind OSD Group0 and Encoder Group0 failed\n");

// flux de données lié 
IMPCell fs_chn1_output0 = {DEV_ID_FS, 1, 0};
IMPCell ivs_grp0 = {DEV_ID_IVS, 0, 0};
IMPCell osd_grp1 = {DEV_ID_OSD, 1, 0};
IMPCell enc_grp1 = {DEV_ID_ENC, 1, 0};

int ret = IMP_System_Bind(&fs_chn1_output0, &ivs_grp0);
if (ret < 0)
    printf("Bind FrameSource Channel1 and IVS Group0 failed\n");

int ret = IMP_System_Bind(&ivs_grp0, &osd_grp1);
if (ret < 0)
    printf("Bind IVS Group0 and OSD Group1 failed\n");

int ret = IMP_System_Bind(&osd_grp1, &enc_grp1);
if (ret < 0)
    printf("Bind OSD Group1 and Encoder Group1 failed\n");

Apply is a typical application Bind : two-channel code.

Notes:

Functions

int IMP_System_Init (void )

Beginning of the IMP system.

int IMP_System_Exit (void)

After calling this function, all the memory and handles IMP will be released, and the hardware unit will be closed.

int64_t IMP_System_GetTimeStamp (void)

Get the timing field of the IMP system in microseconds.

int IMP_System_RebaseTimeStamp (bases int64_t)

Define the Timestamp IMP system in microseconds.

uint32_t IMP_System_ReadReg32 (uint32_t u32Addr)

Read the value of a 32-bit register.

void IMP_System_WriteReg32 (uint32 t regaddr, value uint32 t)

Write the value in the 32-bit register.

Note: Please call this API carefully and check the meaning of the registry, otherwise it may cause system errors.

int IMP System GetVersion (IMPVersion * pstVersion) T Regaddr, Value Uint32 )

Get the system of the IMP system.

const char * IMP System GetCPUInfo (void)

Get information about the CPU model.
Note: The return value is a string of CPU model, for example, for T10 there is “T10”and “T10-Lite”.

int IMP System (

Link between source cell and destination.

Note 1: According to the concepts of Device, Group and Output, each device can have several groups, and each group can have several outputs, Group is used as Device input interface, and Output is used as Device product interface. Therefore the link actually connects a certain output of the output device to a certain Group of the input device.

Note 2: After a successful link, the data generated by srcCell ( Eligo ) will be automatically transferred to the destination ( Group ).

int IMP System (

Ungroup the sources and destinations.

int IMP System (

Retrieves information from the source cell related to the destination.