85 lines
2.4 KiB
C
85 lines
2.4 KiB
C
//global debug level: PRJ_DBG_LVL
|
|
#include "PrjCfg.h"
|
|
|
|
#include "SysCommon.h"
|
|
#include "UIApp/UIAppCommon.h"
|
|
#include "UIApp/Photo/UIAppPhoto.h"
|
|
#include "UIApp/Transcode/UIAppTranscode.h"
|
|
#include "UIWnd/UIFlow.h"
|
|
#include <kwrap/sxcmd.h>
|
|
#include <kwrap/stdio.h>
|
|
#include "kwrap/cmdsys.h"
|
|
#include <string.h>
|
|
|
|
//local debug level: THIS_DBGLVL
|
|
#define THIS_DBGLVL 2 // 0=FATAL, 1=ERR, 2=WRN, 3=UNIT, 4=FUNC, 5=IND, 6=MSG, 7=VALUE, 8=USER
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
#define __MODULE__ UiAppTranscodeCmd
|
|
#define __DBGLVL__ ((THIS_DBGLVL>=PRJ_DBG_LVL)?THIS_DBGLVL:PRJ_DBG_LVL)
|
|
#define __DBGFLT__ "*" //*=All, [mark]=CustomClass
|
|
#include <kwrap/debug.h>
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
void transcode_bs_ready_cb(void* bitstream_va, UINT32 size)
|
|
{
|
|
DBG_DUMP("bitstream_va = %lx , size = %lx\n", bitstream_va, size);
|
|
//SF_HD_DIR
|
|
}
|
|
|
|
static BOOL cmd_transcode_start(unsigned char argc, char **argv)
|
|
{
|
|
UIAppTranscode_User_Config user_config = {0};
|
|
|
|
DBG_DUMP("transcode start\r\n");
|
|
|
|
if(argc > 0)
|
|
user_config.filepath = (char*)argv[0];
|
|
|
|
user_config.bs_ready_cb = transcode_bs_ready_cb;
|
|
|
|
Ux_SendEvent(&CustomTranscodeObjCtrl, NVTEVT_EXE_TRANSCODE_START, 1, &user_config);
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
static SXCMD_BEGIN(uitranscode_cmd_tbl, "uitranscode_cmd_tbl")
|
|
SXCMD_ITEM("start", cmd_transcode_start, "transcode start")
|
|
SXCMD_END()
|
|
|
|
static int uitranscode_cmd_showhelp(int (*dump)(const char *fmt, ...))
|
|
{
|
|
UINT32 cmd_num = SXCMD_NUM(uitranscode_cmd_tbl);
|
|
UINT32 loop = 1;
|
|
|
|
dump("---------------------------------------------------------------------\r\n");
|
|
dump(" %s\n", "uitranscode");
|
|
dump("---------------------------------------------------------------------\r\n");
|
|
|
|
for (loop = 1 ; loop <= cmd_num ; loop++) {
|
|
dump("%15s : %s\r\n", uitranscode_cmd_tbl[loop].p_name, uitranscode_cmd_tbl[loop].p_desc);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
MAINFUNC_ENTRY(uitranscode, argc, argv)
|
|
{
|
|
UINT32 cmd_num = SXCMD_NUM(uitranscode_cmd_tbl);
|
|
UINT32 loop;
|
|
int ret;
|
|
|
|
if (argc < 2) {
|
|
return -1;
|
|
}
|
|
if (strncmp(argv[1], "?", 2) == 0) {
|
|
uitranscode_cmd_showhelp(vk_printk);
|
|
return 0;
|
|
}
|
|
for (loop = 1 ; loop <= cmd_num ; loop++) {
|
|
if (strncmp(argv[1], uitranscode_cmd_tbl[loop].p_name, strlen(argv[1])) == 0) {
|
|
ret = uitranscode_cmd_tbl[loop].p_func(argc-2, &argv[2]);
|
|
return ret;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|