News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Main Menu

Displaying Video

Started by b2mishra, November 04, 2019, 04:27:16 PM

Previous topic - Next topic

b2mishra

HI,

I am trying to display a small video as part of my splash screen. I used EVE Asset Builder to convert my video, and loaded it in to flash.
The sample C code generated looks a little confusing.
Do I need anything other than the following code to display the video?
I think I am missing some initialization.

/* Switch Flash to FULL Mode */
Gpu_CoCmd_FlashHelper_SwitchFullMode(&host);
Gpu_Hal_Wr32(phost, REG_PLAY_CONTROL, 1);
Gpu_CoCmd_Dlstart(phost);
App_WrCoCmd_Buffer(phost, CLEAR(1, 1, 1));
App_WrCoCmd_Buffer(phost, COLOR_RGB(255, 255, 255));

Gpu_CoCmd_FlashSource(phost, ADDR_VIDEO);
App_WrCoCmd_Buffer(phost, CMD_PLAYVIDEO);
App_WrCoCmd_Buffer(phost, OPT_FLASH | OPT_SOUND | OPT_NOTEAR);
App_Flush_Co_Buffer(phost);
Gpu_Hal_WaitCmdfifo_empty(phost);

BRT Community

Hello,

The code you have looks correct, the following is from the 'set10.c' file in our main 'SampleApp' linked below.

void SAMAPP_Video_Flash()
{
#define ADDR_VIDEO 4096
Gpu_CoCmd_FlashHelper_SwitchFullMode(g_phost);
Gpu_CoCmd_Dlstart(g_phost);
App_WrCoCmd_Buffer(g_phost, CLEAR(1, 1, 1));
App_WrCoCmd_Buffer(g_phost, COLOR_RGB(255, 255, 255));
Gpu_CoCmd_Text(g_phost, 0, 150, 30, 0, "Video display from Flash");
App_Flush_Co_Buffer(g_phost);
Gpu_Hal_WaitCmdfifo_empty(g_phost);
Gpu_CoCmd_FlashSource(g_phost, ADDR_VIDEO);
App_WrCoCmd_Buffer(g_phost, CMD_PLAYVIDEO);
App_WrCoCmd_Buffer(g_phost, OPT_FLASH | OPT_SOUND | OPT_NOTEAR | OPT_OVERLAY);
App_Flush_Co_Buffer(g_phost); //Video plays after this
Gpu_Hal_WaitCmdfifo_empty(g_phost);
Gpu_CoCmd_Nop(g_phost);
App_Flush_Co_Buffer_nowait(g_phost);
Gpu_Hal_Sleep(5000);
Gpu_Hal_Wr8(g_phost, REG_PLAY_CONTROL, -1);
}


Please see below for update version of our Sample Applications:
EVE_Samples_v1.1.0_RC_28062019.zip

Best Regards,
BRT Community

Klug_Avalon

hello,
i have  bridgetek 816c50a-d module. and i having pic micro controller ,i have downlod lib or pic interfacing and sucessfully display image from flash. but now i want play video from flash. but it working (video converted and upload on flash using eve asset builder software
sharing my pic code ,please give me suggestion if i am wrong

API_LIB_BeginCoProList();
         API_CMD_DLSTART();
         API_CLEAR_COLOR_RGB(255, 0, 0);
         API_CLEAR(1,1,1);
         API_COLOR_RGB(255,255,255);
            EVE_CMD_FLASHSOURCE(4160);
           
           API_CMD_VIDEOFRAME(4,0);
            API_CMD_PLAYVIDEO(OPT_FULLSCREEN| OPT_NOTEAR| EVE_OPT_FLASH);
            EVE_CMD_VIDEOSTARTF();
         
         API_DISPLAY();
         API_CMD_SWAP();
         API_LIB_EndCoProList();
         API_LIB_AwaitCoProEmpty();

BRT Community

Hello,

Here is a small code example. This assumes your video is loaded in flash at address 4096 right after the BLOB.

We will also post the code used after the video but for now here is the video play code.

HAL_MemWrite32(EVE_REG_PLAY_CONTROL, 1);

EVE_LIB_BeginCoProList(); // Begin co-processor commands
EVE_CMD_DLSTART(); // New display list
EVE_CLEAR_COLOR_RGB(0, 0, 0); // Clear screen to black
EVE_CLEAR(1,1,1); // Clear
EVE_COLOR_RGB(255,255,255); // White color for text

EVE_CMD_FLASHSOURCE(4096);
EVE_CMD_PLAYVIDEO(EVE_OPT_FLASH | EVE_OPT_NOTEAR | EVE_OPT_SOUND);

EVE_LIB_EndCoProList(); // Finish the list of commands
EVE_LIB_AwaitCoProEmpty(); // And wait until complete


Best Regards, BRT Community

Klug_Avalon

thanks for reply,
this code is not working
HAL_MemWrite32(EVE_REG_PLAY_CONTROL, 1);
this function is not given in PIC microcontroller lib,
please give me that function.

BRT Community

Hi,

This will be EVE_MemWrite32(EVE_REG_PLAY_CONTROL, 1); in the original PIC code,

Best Regards, BRT Community