BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

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

Author Topic: Displaying Video  (Read 2024 times)

b2mishra

  • Newbie
  • *
  • Posts: 8
    • View Profile
Displaying Video
« on: November 04, 2019, 04:27:16 PM »

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.

 
Code: [Select]
/* 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);
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 586
    • View Profile
Re: Displaying Video
« Reply #1 on: November 05, 2019, 03:16:24 PM »

Hello,

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

Code: [Select]
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
Logged

Klug_Avalon

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Displaying Video
« Reply #2 on: May 30, 2022, 06:12:28 AM »

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();
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 586
    • View Profile
Re: Displaying Video
« Reply #3 on: May 30, 2022, 04:34:13 PM »

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.

Code: [Select]
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
Logged

Klug_Avalon

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Displaying Video
« Reply #4 on: May 31, 2022, 07:12:51 AM »

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.
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 586
    • View Profile
Re: Displaying Video
« Reply #5 on: May 31, 2022, 11:10:46 AM »

Hi,

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

Best Regards, BRT Community
Logged