|
/*********************************************************************
*
* _cbNotify
*
* Function description
* Callback function for movie player. Uses multiple buffering if
* available to avoid tearing effects.
*/
void _cbNotify(GUI_HMEM hMem, int Notification, U32 CurrentFrame) {
switch (Notification) {
case GUI_MOVIE_NOTIFICATION_PREDRAW:
GUI_MULTIBUF_Begin();
break;
case GUI_MOVIE_NOTIFICATION_POSTDRAW:
GUI_MULTIBUF_End();
break;
case GUI_MOVIE_NOTIFICATION_STOP:
break;
}
}
/*********************************************************************
*
* _GetData
*
* Function description
* Reading data directly from file system
*/
int _GetData(void * p, const U8 ** ppData, unsigned NumBytes, U32 Off) {
UINT NumBytesRead;
FIL * pFile;
pFile = (FIL *)p;
f_read(pFile, (U8 *)*ppData, NumBytes,&NumBytesRead);
return NumBytesRead;
}
void CreateFramewin(void)
{
GUI_MOVIE_INFO Info;
GUI_MOVIE_HANDLE hMovie;
GUI_SetBkColor(GUI_BLUE);
GUI_Clear();
GUI_Delay(100);
f_result=f_open(&f_file,"0:minxing.emf",FA_READ|FA_OPEN_EXISTING);
if (GUI_MOVIE_GetInfoEx(_GetData, &f_file, &Info) == 0)
{
printf("Info:xSize->(%d),ySize->(%d),msPerFrame->(%d),NumFrames->(%ld)\n",Info.xSize,Info.ySize,Info.msPerFrame,Info.NumFrames);
//
// Create and play movie
//
hMovie = GUI_MOVIE_CreateEx(_GetData, &f_file, _cbNotify);
if (hMovie)
{
GUI_MOVIE_Show(hMovie, 100, 100, 0);
}
}
while(1)
{
GUI_Exec();
GUI_X_Delay(1);
}
}
仿照官方例程MOVIE_ShowFromFS.c,视频内容完全没有显示
视频文件在Visual Studio仿真中可以正常播放。。。 |
|