bool VideoBackend::Initialize(void *window_handle) { InitializeShared(); InitBackendInfo(); frameCount = 0; g_Config.Load(File::GetUserPath(D_CONFIG_IDX) + GetConfigName() + ".ini"); g_Config.GameIniLoad(); g_Config.UpdateProjectionHack(); g_Config.VerifyValidity(); UpdateActiveConfig(); InitInterface(); GLInterface->SetMode(GLInterfaceMode::MODE_DETECT); if (!GLInterface->Create(window_handle)) return false; // Do our OSD callbacks OSD::DoCallbacks(OSD::OSD_INIT); s_BackendInitialized = true; return true; }
bool VideoBackend::Initialize(void* window_handle) { InitializeShared(); InitBackendInfo(); frameCount = 0; if (File::Exists(File::GetUserPath(D_CONFIG_IDX) + "GFX.ini")) g_Config.Load(File::GetUserPath(D_CONFIG_IDX) + "GFX.ini"); else g_Config.Load(File::GetUserPath(D_CONFIG_IDX) + "gfx_opengl.ini"); g_Config.GameIniLoad(); g_Config.UpdateProjectionHack(); g_Config.VerifyValidity(); UpdateActiveConfig(); InitInterface(); GLInterface->SetMode(GLInterfaceMode::MODE_DETECT); if (!GLInterface->Create(window_handle)) return false; // Do our OSD callbacks OSD::DoCallbacks(OSD::CallbackType::Initialization); m_initialized = true; return true; }
BOOL CSoftWareConfig::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here memset(&m_curParam, 0, sizeof(m_curParam)); //Title CString title; title.LoadString(IDS_TMPLCFG_TITLE); SetWindowText(title); //Init ListCtrl CRect rect; GetDlgItem(IDC_TEMP_LIST)->GetClientRect(&rect); InitInterface(rect); //Init // CapsuleParam param = CapsuleProc::CapsuleInfo(); // SetListContent(0, param); CapsuleSorterDlg* pMainDlg = ((CapsuleSorterDlg*)AfxGetMainWnd()); CapsuleProc* pMonoProc = pMainDlg->GetProcessor(1); m_monoBright = pMonoProc->RemainInfo().binaryLowThres; m_secondCapsuleParam = pMonoProc->CapsuleInfo(); CapsuleProc* pColorProc = pMainDlg->GetProcessor(3); m_colorBright = pColorProc->RemainInfo().binaryLowThres; m_firstCapsuleParam = pColorProc->CapsuleInfo(); const RadiumRange config = ConfigInfo::TheConfigInfo().RadiumRangeInfo(); const RemainParam remainConfig = ConfigInfo::TheConfigInfo().RemainInfo(ConfigInfo::SECOND); m_radiusScroll.SetScrollRange(config.minRadium, config.maxRadium); m_radiusScroll.SetScrollPos(remainConfig.radius); m_radius = m_radiusScroll.GetScrollPos(); const MinboxWidthRange minboxRange = ConfigInfo::TheConfigInfo().MinboxWidthInfo(); m_minboxScroll.SetScrollRange(minboxRange.minWidth, minboxRange.maxWidth); m_minboxScroll.SetScrollPos(remainConfig.minBoxWidth); m_minboxWidth = m_minboxScroll.GetScrollPos(); //Position GetWindowRect(&rect); int scWidth = GetSystemMetrics(SM_CXSCREEN); int scHeight= GetSystemMetrics(SM_CYSCREEN); int width = rect.right - rect.left; int height = rect.bottom - rect.top; int left = (scWidth - width)/2; int top = 0; MoveWindow(left, top, width, height); ShowWindow(SW_SHOW); UpdateData(FALSE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
void SWOGLWindow::Init(void* window_handle) { InitInterface(); GLInterface->SetMode(GLInterfaceMode::MODE_DETECT); if (!GLInterface->Create(window_handle)) { ERROR_LOG(VIDEO, "GLInterface::Create failed."); } s_instance.reset(new SWOGLWindow()); }
bool VideoBackend::Initialize(void* window_handle) { InitBackendInfo(); InitializeShared(); InitInterface(); GLInterface->SetMode(GLInterfaceMode::MODE_DETECT); if (!GLInterface->Create(window_handle)) return false; return true; }
BOOL CMainFrame::OnInitDialog() { CBkDialogST::OnInitDialog(); ///////////////////////////////////////////////////// HWND hDesktop; HDC hdc; DWORD w, h; hDesktop = ::GetDesktopWindow (); hdc = ::GetDC(hDesktop); ScrWidth = w = GetDeviceCaps(hdc, HORZRES); ScrHeight = h = GetDeviceCaps(hdc, VERTRES); bChanged = FALSE; if((w!=1024)&&(h!=768)) { DEVMODE lpDevMode; lpDevMode.dmBitsPerPel = 32; lpDevMode.dmPelsWidth = 1024; lpDevMode.dmPelsHeight = 768; lpDevMode.dmDisplayFrequency=75; lpDevMode.dmSize = sizeof(lpDevMode); lpDevMode.dmFields = DM_PELSWIDTH|DM_PELSHEIGHT|DM_BITSPERPEL; LONG result = ChangeDisplaySettings(&lpDevMode,0); if(result == DISP_CHANGE_SUCCESSFUL) { ChangeDisplaySettings(&lpDevMode,CDS_UPDATEREGISTRY); bChanged = TRUE; //使用CDS_UPDATEREGISTRY表示次修改是持久的, //并在注册表中写入了相关的数据 } else { ChangeDisplaySettings(NULL,0); } } //////////////////////////////////////////////////////// ModifyStyle(WS_CAPTION,0,0); this->ShowWindow(SW_SHOWMAXIMIZED); InitInterface(); //SetBitmap(IDB_1_PIC ); SetBitmap(IDB_4_PIC); SetTimer(0,1000,NULL); return TRUE; // return TRUE unless you set the focus to a control // 异常: OCX 属性页应返回 FALSE }
ADDON_STATUS CAddonDll::Create(KODI_HANDLE firstKodiInstance) { CLog::Log(LOGDEBUG, "ADDON: Dll Initializing - %s", Name().c_str()); m_initialized = false; if (!LoadDll()) { return ADDON_STATUS_PERMANENT_FAILURE; } /* Check versions about global parts on add-on (parts used on all types) */ for (unsigned int id = ADDON_GLOBAL_MAIN; id <= ADDON_GLOBAL_MAX; ++id) { if (!CheckAPIVersion(id)) return ADDON_STATUS_PERMANENT_FAILURE; } /* Allocate the helper function class to allow crosstalk over helper add-on headers */ if (!InitInterface(firstKodiInstance)) return ADDON_STATUS_PERMANENT_FAILURE; /* Call Create to make connections, initializing data or whatever is needed to become the AddOn running */ ADDON_STATUS status = m_pDll->Create(&m_interface, nullptr); if (status == ADDON_STATUS_OK) { m_initialized = true; } else if (status == ADDON_STATUS_NEED_SETTINGS) { if ((status = TransferSettings()) == ADDON_STATUS_OK) m_initialized = true; else new CAddonStatusHandler(ID(), status, "", false); } else { // Addon failed initialization CLog::Log(LOGERROR, "ADDON: Dll %s - Client returned bad status (%i) from Create and is not usable", Name().c_str(), status); // @todo currently a copy and paste from other function and becomes improved. std::string heading = StringUtils::Format("%s: %s", CAddonInfo::TranslateType(Type(), true).c_str(), Name().c_str()); HELPERS::ShowOKDialogLines(CVariant{ heading }, CVariant{ 24070 }, CVariant{ 24071 }); } return status; }
void LunaticInit(MGLDraw *mgl) { gamemgl = mgl; logFile = AppdataOpen("loonylog.txt", "wt"); InitCosSin(); InitDisplay(gamemgl); InitSound(); InitMonsters(); InitTiles(mgl); InitItems(); InitInterface(); LoadOptions(); MusicInit(); mgl->SetLastKey(0); MGL_srand(timeGetTime()); InitControls(); InitPlayer(INIT_GAME, 0, 0); msgFromOtherModules = 0; }
bool VideoBackend::Initialize(void *&window_handle) { InitializeShared(); InitBackendInfo(); frameCount = 0; g_Config.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_opengl.ini").c_str()); g_Config.GameIniLoad(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strGameIni.c_str()); g_Config.UpdateProjectionHack(); g_Config.VerifyValidity(); UpdateActiveConfig(); InitInterface(); if (!GLInterface->Create(window_handle)) return false; s_BackendInitialized = true; return true; }
int Camera::Init( void ) { Vector3 r; eye.Zero(); this->width = render.GetScreenWidth(); this->height = render.GetScreenHeight(); forward.x = 0.0f; forward.y = 0.0f; forward.z = 1.0f; up.x = 0.0f; up.y = 1.0f; up.z = 0.0f; right.x = 1.0f; right.y = 0.0f; right.z = 0.0f; yaw = 0.0f; minYaw = -D3DX_PI / 5; maxYaw = +D3DX_PI / 5; lookAt = forward + eye; InitInterface(); return 0; }
//--------------------------------------------------------------------------- void Tform_DeviceMonitor::UpdateDev( CBaseDevice *dev ) { InitInterface ( dev ); if ( dev == NULL ) return; if ( dev->SubDeviceCount == 0 ) return; if ( tabcontrol_DeviceInfo->TabIndex == -1 ) return; if ( (PassCount++) & 0x7 != 0) return; int tabIndex = tabcontrol_DeviceInfo->TabIndex; StringGrid1->Cells[1][1] = DeviceNames[dev->SubDevice[ tabIndex ]->DeviceType]; StringGrid1->Cells[1][2] = dev->SubDevice[ tabIndex ]->SerialPortPortName; StringGrid1->Cells[1][3] = dev->SubDevice[ tabIndex ]->ExtParam[0].Value; StringGrid1->Cells[1][4] = dev->SubDevice[ tabIndex ]->ExtParam[1].Value; StringGrid1->Cells[1][5] = dev->SubDevice[ tabIndex ]->DeviceInfo.GlobalPackedCounter; StringGrid1->Cells[1][6] = dev->SubDevice[ tabIndex ]->DeviceInfo.GlobalPackedCounter_stored; StringGrid1->Cells[1][7] = FloatToStrF(dev->SubDevice[ tabIndex ]->DeviceInfo.MBytesRecived, ffFixed, 20, 4); StringGrid1->Cells[1][8] = dev->SubDevice[ tabIndex ]->DeviceInfo.CountBadCRC; StringGrid1->Cells[1][9] = dev->SubDevice[ tabIndex ]->DeviceInfo.CountBadValues; }
BOOL CMainDlg::OnInitDialog(CWindow /*wndFocus*/, LPARAM /*lInitParam*/) { InitInterface(); int nPos = 0; nPos = g_strCmd.ReverseFind('\\'); if (nPos != -1) m_strFileName = g_strCmd.Right(g_strCmd.GetLength() - nPos - 1); if (m_strFileName.GetLength() > 23) { CString strTemp; strTemp = m_strFileName.Left(9) + L"..." + m_strFileName.Right(9); m_strFileName = strTemp; } if (g_strTip.GetLength() == 0) g_strTip = L"未知文件"; this->FormatRichText( IDC_TXT_FILE_NAME, BkString::Get(IDS_FILE_NAME_FORMAT), m_strFileName, g_strTip); m_csPhoneNess.Init(); m_IECtrl.Create(this->GetViewHWND(), IDC_CTL_IE, FALSE, RGB(0xFB, 0xFC, 0xFD)); m_IECtrl.SetExternalDispatch(this); m_IECtrl.SetCallback(this); CString strErrorHtml; if ( SUCCEEDED(GetKSoftDirectory(strErrorHtml)) ) strErrorHtml.Append(_T("\\html\\error.html")); else strErrorHtml.Empty(); m_IECtrl.Show2(g_strUrl, strErrorHtml); SetTimer( TIMER_LOADINFO_BIGBTN, 100, NULL ); return TRUE; }
DWORD WINAPI Execute(LPDWORD data) { int i, linenumber; char line[256], buf[256], logbuf[100], *prog; BOOL error = FALSE; obj = NULL; light = NULL; ULONG arg[MAXARGS]; InitInterface(); for (i = 0; i < MAXARGS; i++) arg[i] = NULL; prog = ((THREAD_DATA *)data)->szProg; pDisplay = ((THREAD_DATA *)data)->pDisplay; strcpy(szIncludePath, ""); strcpy(szPicturePath, ""); linenumber = 0; nIncludeDepth = 0; while ((*prog || nIncludeDepth > 0) && !error) { GetLine(&prog, line, &linenumber); // read command first if (!Scan(line, buf, arg)) { i = 0; // find command in list while (commands[i].name && stricmp(buf, commands[i].name)) i++; // call corresponding function with "arg" as argument if (commands[i].func) error = commands[i].func(arg); else error = ERROR_UNKNOWNCOM; for (i = 0; i < MAXARGS; i++) { if (arg[i]) delete (ULONG *)arg[i]; arg[i] = NULL; } if (error) { if (nIncludeDepth) { sprintf(logbuf, "In include file: \"%s\"", Includefile[nIncludeDepth].name); pDisplay->Log(logbuf); linenumber = Includefile[nIncludeDepth].linenumber; } sprintf(logbuf, "Error executing command in line %i", linenumber); pDisplay->Log(logbuf); pDisplay->Log(line); GetError(logbuf, error); pDisplay->Log(logbuf); } } } if (error) { pDisplay->Log("Error occurred"); pDisplay->Log("Cancel execution"); // close open include files while (nIncludeDepth > 0) { if (Includefile[nIncludeDepth].hFile) fclose(Includefile[nIncludeDepth].hFile); nIncludeDepth--; } } else { if (pDisplay->CheckCancel()) pDisplay->Log("Execution canceled"); else pDisplay->Log("Execution successful"); } CleanupInterface(); /*rsiCleanup(rc); rsiExit();*/ return TRUE; }
void MainServer() { InitInterfaceLocks(); InitInterface(); /* starts a thread with the window */ WrapInit(); InitMemory(); /* memory needs channels in general, but need to start before config, so just be careful. */ InitConfig(); LoadConfig(); /* must be nearly first since channels use it */ InitDebug(); InitChannelBuffer(); OpenDefaultChannels(); lprintf("Starting %s\n",BlakServLongVersionString()); InitClass(); InitMessage(); InitObject(); InitList(); InitTimer(); InitSession(); InitResource(); InitRoomData(); InitString(); InitUser(); InitAccount(); InitNameID(); InitDLlist(); InitSysTimer(); InitMotd(); InitLoadBof(); InitTime(); InitGameLock(); InitBkodInterpret(); InitBufferPool(); InitTable(); AddBuiltInDLlist(); LoadMotd(); LoadBof(); LoadRsc(); LoadKodbase(); LoadAdminConstants(); PauseTimers(); if (LoadAll() == True) { /* this loaded_game_msg tells it to disconnect all blakod info about sessions, * that were logged on when we saved */ SendTopLevelBlakodMessage(GetSystemObjectID(),LOADED_GAME_MSG,0,NULL); DoneLoadAccounts(); } /* these must be after LoadAll and ClearList */ InitCommCli(); InitParseClient(); InitProfiling(); InitAsyncConnections(); UpdateSecurityRedbook(); UnpauseTimers(); ServiceTimers(); /* returns if server termiated */ MainExitServer(); WrapShutdown(); }
int StartRAPthread(char *pszIfName, int iIANAFlag, int iIAPDFlag, int iDsliteFlag, int iDftRT) { int iIfx = -1; int iSockfd = -1; INTERFACE_RA_ST *p = NULL; if (!pszIfName) { loginfo(FUNC, "args NULL"); return (-1); } iIfx = if_nametoindex(pszIfName); if (0 >= iIfx) { loginfo(FUNC, "if_nametoindex error %s", strerror(errno)); return (-1); } p = FindInterfaceByIfindex(iIfx); if (p) { loginfo(FUNC, "Already exist the interface"); return (-1); } if (0 != InitInterface(&p)) { loginfo(FUNC, "init the interface error"); return (-1); } p->iIfindex = iIfx; p->stRAData.iIfindex = iIfx; p->iIANAFlag = iIANAFlag; p->iIAPDFlag = iIAPDFlag; p->iDsliteFlag = iDsliteFlag; /* start of by d00107688 2010-01-26 增加支持是否允许添加默认路由 */ p->iDftRt = iDftRT; /* end of by d00107688 2010-01-26 增加支持是否允许添加默认路由 */ p->iSockfd = CreateICMPv6Socket(); loginfo(FUNC, "create icmp socket %d\r\n", p->iSockfd); if (0 > p->iSockfd) { loginfo(FUNC, "error: create icmp socket error\r\n"); free(p); return (-1); } if (0 > SetICMPv6SockOpt(p->iSockfd)) { loginfo(FUNC, "error: setsockopt error"); close(p->iSockfd); free(p); return (-1); } if (0 > BindICMPSocket(p->iSockfd, p->iIfindex)) { loginfo(FUNC, "Err: bind error"); close(p->iSockfd); free(p); return (-1); } if (0 != AddInterfaceIntoList(&p)) { loginfo(FUNC, "add into list error"); close(p->iSockfd); free(p); return (-1); } if (0 != pthread_create(&p->tidp, NULL, RAMainLoop, (void *)p)) { loginfo(FUNC, "crate pthread for pthread error"); return (-1); } return (0); }
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR /*lpszCmdLine*/, int /*cmdShow*/) { HWND hwnd ; MSG msg ; WNDCLASSEX wc ; HACCEL hAccel ; int a; int scmd; char a1; HANDLE hMutex ; char tmp[_MAX_PATH]; hMutex = CreateMutex(NULL, TRUE, MUTEX_NAME); if(GetLastError() == ERROR_ALREADY_EXISTS){ EnumWindows((WNDENUMPROC)EnumWindowsProc, NULL); return 0; } InitCommonControls () ; OleInitialize(NULL); #ifdef FOOTYSTATIC Footy2Start(hInstance); #endif /*FOOTYSTATIC*/ // FootySetCursor(IDC_ONLINE, IDC_ONURL); // 2008-02-17 Shark++ 代替機能不明 //FootySetMetrics(0, F_SM_CREATESHOW, F_CS_HIDE, false); hInst = hInstance ; wc.cbSize = sizeof (wc) ; wc.lpszClassName = szAppName ; wc.hInstance = hInstance ; wc.lpfnWndProc = WndProc ; wc.hCursor = LoadCursor (NULL, IDC_ARROW) ; wc.hIcon = LoadIcon (hInst, szAppName) ; wc.lpszMenuName = szAppName ; wc.hbrBackground = NULL; wc.style = 0 ; wc.cbClsExtra = 0 ; wc.cbWndExtra = 0 ; wc.hIconSm = LoadIcon (hInst, szAppName) ; RegisterClassEx (&wc) ; wc.lpszClassName = "ClientWndProc" ; wc.hInstance = hInstance ; wc.lpfnWndProc = ClientWndProc ; wc.hCursor = LoadCursor (NULL, IDC_ARROW) ; wc.hIcon = LoadIcon (NULL, IDI_APPLICATION) ; wc.lpszMenuName = NULL ; wc.hbrBackground = NULL ; wc.style = 0 ; wc.cbClsExtra = 0 ; wc.cbWndExtra = 0 ; wc.hIconSm = LoadIcon (NULL, IDI_APPLICATION) ; RegisterClassEx (&wc) ; wc.lpszClassName = "DummyWndProc" ; wc.hInstance = hInstance ; wc.lpfnWndProc = DefWindowProc ; wc.hCursor = LoadCursor (NULL, IDC_ARROW) ; wc.hIcon = LoadIcon (NULL, IDI_APPLICATION) ; wc.lpszMenuName = NULL ; wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1) ; wc.style = 0 ; wc.cbClsExtra = 0 ; wc.cbWndExtra = 0 ; wc.hIconSm = LoadIcon (NULL, IDI_APPLICATION) ; RegisterClassEx (&wc) ; GetModuleFileName( NULL,szExeDir, _MAX_PATH ); a=(int)strlen(szExeDir)-1; for(;;) { a1=szExeDir[a];if (a1=='\\') break; a--; } szExeDir[a]=0; // DLLを初期化 strcpy( szDllDir,szExeDir ); strcat( szDllDir,"\\" FILE_HSPCMP ); a=dll_ini( szDllDir ); if (a!=1) { msgboxf(NULL, #ifdef JPNMSG "%sが見つかりませんでした。" #else "%s not found." #endif , "Startup error", MB_OK | MB_ICONEXCLAMATION, szDllDir); dll_bye(); return -1; } // XPのチェック // flag_xpstyle = CheckXPEditBox( hInstance ); // Window設定 flg_toolbar=1;flg_statbar=1; winflg=0; posx=CW_USEDEFAULT; posy=CW_USEDEFAULT; winx=CW_USEDEFAULT; winy=CW_USEDEFAULT; LoadConfig(); hwndDummy = CreateWindow("DummyWndProc", NULL, WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, NULL, NULL, hInstance, NULL); hwnd = CreateWindowEx( 0L, szAppName, szAppName, WS_OVERLAPPEDWINDOW, posx, posy, winx, winy, NULL, NULL, hInstance, NULL) ; hWndMain = hwnd; SetProp(hWndMain, PROP_NAME, (HANDLE)1); // コンテキストメニューの作成 AhtMenuBuf = new CMemBuf; AhtMenuBuf->AddIndexBuffer(); EzMenuId = IDM_AHTEZINPUT; hMenu = LoadMenu(hInstance, "CONTEXTMENU"); hSubMenu = GetSubMenu(hMenu, 0); wsprintf( tmp, "%s\\ezinput", szExeDir ); BuildEzInputMenu( hSubMenu, tmp, "かんたん入力" ); hMenu2 = LoadMenu(hInstance, "CONTEXTMENU2"); hSubMenu2 = GetSubMenu(hMenu2, 0); // 起動ディレクトリ設定 // switch( startflag ) { case STARTDIR_MYDOC: GetSpecialFolderPath( hwnd, CSIDL_PERSONAL, szStartDir ); break; case STARTDIR_USER: strcpy( szStartDir, startdir ); break; default: szStartDir[0] = 0; break; } if ( szStartDir[0] == 0 ) { _getcwd( szStartDir, _MAX_PATH ); } else { _chdir( szStartDir ); } SetMenuExtTool(); ExecStartupTools(hwnd); LoadFromCommandLine(GetCommandLine()); scmd=SW_SHOW; if (winflg&1) scmd=SW_SHOWMAXIMIZED; //if (winflg&2) scmd=SW_SHOWMINIMIZED; ShowWindow ( hwnd, scmd ) ; UpdateWindow (hwnd) ; hAccel = LoadAccelerators (hInstance, szAppName) ; if(!InitInterface(hInstance)) MessageBox(hwnd, #ifdef JPNMSG "外部ツール用のウィンドウの初期化に失敗しました。\n" "一部の外部ツールを使用することはできません。" #else "Failed to initialize a window for extension tools.\n" "You can't use some extending tools." #endif , "start up error", MB_OK | MB_ICONEXCLAMATION); // main loop while (GetMessage (&msg, NULL, 0, 0)) { if ((hDlgModeless == NULL || !IsDialogMessage (hDlgModeless, &msg)) &&(hConfigDlg == NULL || !IsDialogMessage (hConfigDlg, &msg)) &&(hConfigPage == NULL || !IsDialogMessage (hConfigPage, &msg))) { if (!TranslateAccelerator (hwnd, hAccel, &msg)) { TranslateMessage (&msg) ; DispatchMessage (&msg) ; } } } dll_bye(); // DLLを開放 #ifdef FOOTYSTATIC Footy2End(); #endif /*FOOTYSTATIC*/ delete AhtMenuBuf; return (int)msg.wParam ; }
extern "C" int main(int argc, char **argv) { int err; //register signal handler for Ctrl+C, Ctrl+'\' , and "kill" sys cmd signal(SIGINT, sigrecordstop); signal(SIGQUIT, sigrecordstop); signal(SIGTERM, sigrecordstop); if (argc < 2) { usage(); return -1; } if (init_param(argc, argv) < 0) { usage(); return -1; } // create the media controller if ((g_record_pController = AM_MediaControllerCreate()) == NULL) return -1; if ((err =g_record_pController ->InstallMsgCallback(ProcessAppMsg, NULL)) != ME_OK) return -1; // create the record pipeline if((err = g_record_pController->CreatePipeline(CreateRecordPipeline)) != ME_OK) { printf("record--CreatePipeline() failed %d.Exit!!!\n",err); return -1; } if ((g_record_pPipeline= IamRecordPipeline::GetInterfaceFrom(g_record_pController)) == NULL) { printf("record--No IamrecordPipeline.Exit!!!\n"); return -1; } IamRecordPipeline::FILE_TYPE file_type; IamRecordPipeline::AUDIO_TYPE audio_type; switch(recordType){ case 0: file_type = IamRecordPipeline::ES; break; case 1: file_type = IamRecordPipeline::TS; break; case 2: file_type = IamRecordPipeline::MP4; break; default: return -1; } switch(audioType){ case 0: audio_type = IamRecordPipeline::NONE; break; case 1: audio_type = IamRecordPipeline::AAC; break; case 2: audio_type = IamRecordPipeline::BPCM; break; default: return -1; } g_record_pPipeline->SetRecordType(file_type, audio_type); if (g_record_pPipeline->BuildPipeline()) return -1; if (InitInterface() < 0) return -1; if (ConfigAudio() < 0) return -1; if (ConfigPrg() < 0) return -1; if (StartPrg()) { return -1; } recordRunIdle(); g_record_pController->Delete(); if (exit_flag) { return -1; } else { return 0; } }