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.

DM385 SWOSD background transparency

Other Parts Discussed in Thread: DM385

Hi!

I am working with DM385 IPNC.

I want to make Date/Time stamp with transparent background.

By default transparency is disabled and background color is black.

I read other threads aobut SWOSD and transparency and found information about colorKey. So I made changes:

#define GLOBAL_ALPHA_VALUE (255)//(127)
createPrm.colorKey[0] = 0;//255; //Revisit
createPrm.colorKey[1] = 0;//255; //Revisit
createPrm.transparencyEnable = TRUE;//FALSE;

Now I have following result:

In place of completly black region I see grey block(It is transparent but it is grey, not original color). In place of symbols background only few pixels are "transparent", any way they are grey too..

IPNC RDK v3.5 includes swosd library in a binary format so I can't view source code.

What can I do with that?

Thank you.

  • Hi Dmitry,


    For SWOSD reference please refer "SoftwareOSD_UserGuide.pdf" document, which can be found under "Collaterals/OSD" directory.

    Thanks,
    Prashant.

  • Thank you, Prashant.

    After correct enabling, it works.

  • Hi Dmitry,
    Can the Swosdlink connect with capturelink?
  • Hi Andani,
    I'm working customized DM385 platform

    My usecase is like that

    CaptureLink------ SWOSD ------ Display

    when SwosdLink created ,The following error occurred:

    [m3vpss ] StreamID is 0
    [m3vpss ] staticPrm.isInterlaced = 0
    [m3vpss ] staticPrm.videoLineOffset[0] = 2208
    [m3vpss ] staticPrm.videoLineOffset[1] = 2208
    [m3vpss ] [SWOSD] SWOSD_imxCreate for stream 0
    [m3vpss ] SWOSD Open failed for stream#0 !!!!!!!
    [m3vpss ] 44953: Assertion @ Line: 217 in links_m3vpss/swosd/swosdLink_tsk.c: SWOSD_imxCreate(strId, isTiled[strId] ,lineOffsets[strId] ) ==0 : failed !!!

    Configuration information is as follows:

    int SWOSD_imxCreate(int streamID, int isTiled, int offset)
    {
    int status;
    int i;

    StreamWindows * sWin = &streamWindows[streamID];

    sWin->isAnyWindowEnabled = 0;

    staticPrm.maxWidth = SWOSD_MAX_STRING_LENGTH*SWOSD_CHARWIDTH_1540_40;
    staticPrm.maxHeight = SWOSD_STRINGHEIGHT_1540_40;
    staticPrm.dataFormat = SWOSD_FORMAT_YUV420SP_UV;
    staticPrm.isTiledMem = isTiled;
    staticPrm.isInterlaced = 0;
    staticPrm.videoLineOffset[0] = offset;
    staticPrm.videoLineOffset[1] = offset;

    Vps_printf("StreamID is %d \n", streamID);
    Vps_printf("staticPrm.isInterlaced = %d\n", staticPrm.isInterlaced);
    Vps_printf("staticPrm.videoLineOffset[0] = %d\n",staticPrm.videoLineOffset[0] );
    Vps_printf("staticPrm.videoLineOffset[1] = %d\n",staticPrm.videoLineOffset[1]);


    dynPrm.numWindows = 1;
    dynPrm.winPrm[0].startX = 0;
    dynPrm.winPrm[0].startY = 0;
    dynPrm.winPrm[0].width = 160;
    dynPrm.winPrm[0].height = 160;
    dynPrm.winPrm[0].alpha = GLOBAL_ALPHA_VALUE;
    dynPrm.winPrm[0].lineOffset[0] = 160;
    dynPrm.winPrm[0].lineOffset[1] =160;
    dynPrm.winPrm[0].graphicsWindowAddr[0] = 0;
    dynPrm.winPrm[0].graphicsWindowAddr[1] = 0;


    createPrm.numChannels = 1;
    createPrm.colorKey[0] = 0; //Revisit 255
    createPrm.colorKey[1] = 0; //Revisit 255
    createPrm.transparencyEnable = TRUE; //FALSE

    createPrm.useGlobalAlpha = 1;
    createPrm.globalAlphaValue = GLOBAL_ALPHA_VALUE;
    createPrm.acquire = AcquireResource;
    createPrm.release = ReleaseResource;


    for(i=0; i < createPrm.numChannels; i++)
    {
    memcpy(&createPrm.chStaticPrm[i], &staticPrm, sizeof(SWOSD_StaticPrm));
    memcpy(&createPrm.chDynamicPrm[i], &dynPrm, sizeof(SWOSD_DynamicPrm));
    }

    Vps_printf("[SWOSD] SWOSD_imxCreate for stream %d \n", streamID);

    if(status = SWOSD_open(&gOsdHndl[streamID], &createPrm))
    {
    Vps_printf("SWOSD Open failed for stream#%d !!!!!!!\n\n", streamID);
    return status;
    }

    {
    RM_SIMCOP_CLIENT_PARAMS stRMClientParams;
    RM_SIMCOP_STATUS eRMStatus = RM_SIMCOP_STATUS_SUCCESS;

    stRMClientParams.nSize = sizeof(RM_SIMCOP_CLIENT_PARAMS);
    stRMClientParams.pClientHandle = (RM_SIMCOP_CLIENT_HANDLE)&gOsdHndl[streamID];
    /* Get Resource Manager Handle independent of resources And register Client */
    eRMStatus = RM_SIMCOP_RegisterClient(stRMClientParams, (RM_SIMCOP_CLIENT_HANDLE *) &pRMHandle[streamID]);
    UTILS_assert(eRMStatus==RM_SIMCOP_STATUS_SUCCESS);

    }

    /* Get memory for osd algorithm */
    SWOSD_getMemAllocInfo(&gOsdHndl[streamID], &gMemInfo);

    if(isMemoryAllocationDone == 0)
    {
    if(SWOSD_allocMemory(&gMemInfo) != SWOSD_OK)
    {
    RM_SIMCOP_DeRegisterClient(pRMHandle[streamID]);
    SWOSD_close(&gOsdHndl[streamID]);
    Vps_printf("SWOSD_allocMemory failed!!!!!!!\n\n");
    return SWOSD_ERROR;
    }
    isMemoryAllocationDone = 1;
    }
    else
    {
    Int32 i;
    for(i=0;i<gMemInfo.numMemBlocks; i++)
    {
    gMemInfo.memBlockAddr[i] = memBlockAddr[i];
    }
    }

    /* Set memory for osd algorithm */
    if(SWOSD_setMemAllocInfo(&gOsdHndl[streamID], &gMemInfo) != SWOSD_OK)
    return SWOSD_ERROR;

    return 0;
    }

    int SWOSD_imxDelete(int streamID)
    {
    if(streamID == 0)
    SWOSD_freeMemory(&gMemInfo);

    RM_SIMCOP_DeRegisterClient(pRMHandle[streamID]);

    SWOSD_close(&gOsdHndl[streamID]);

    isMemoryAllocationDone = 0;

    return 0;
    }


    int SWOSD_imxPrepUpdateDynamicParamsAndTrigger(SWOSD_Hndl * Hndl, short *mainWinAddrY,
    short *mainWinAddrUV, int streamId)
    {
    int status;


    /* update dynamic channel params */
    if(status = SWOSD_setDynamicPrm(&gOsdHndl[streamId], 0, &dynPrm))
    {
    Vps_printf("Error occured in the Setting of Dynamic Params\n");
    return status;
    }

    osdFrameList.numFrames = 1;
    osdFrameList.frames[0].channelNum = 0; /* channelNum */
    osdFrameList.frames[0].fid = 0; /* field Id */

    if(isTiled[streamId])
    {
    osdFrameList.frames[0].addr[0] = (Ptr)Utils_tilerAddr2CpuAddr( (UInt32)mainWinAddrY );
    osdFrameList.frames[0].addr[1] = (Ptr)Utils_tilerAddr2CpuAddr( (UInt32)mainWinAddrUV );
    }
    else
    {
    osdFrameList.frames[0].addr[0] = mainWinAddrY;
    osdFrameList.frames[0].addr[1] = mainWinAddrUV;
    }


    status = SWOSD_blendFrames(&gOsdHndl[streamId], &osdFrameList, 0);
    if(SWOSD_OK != status)
    Vps_printf("SWOSD_ IMX Blend Failed!!!!!!!!!!!\n");


    return 0;
    }

    Please reply to me as soon as possible, thank you
  • Hello,

    Are you using IPNC?

    BR
    Margarita
  • Hello,

    I will notify the IPNC team for help.

    BR
    Margarita
  • Hello,
    Thank you !
    DM385 and IPNC: Can Swosd be used to overlay subtitles?