static int Enum(advanced* p, int* No, datadef* Param) { int Result = NodeEnumTable(No,Param,Params); if (Result == ERR_NONE) { #if defined(TARGET_WINCE) if (Param->No == ADVANCED_WIDCOMMAUDIO && !p->WidcommDLL) Param->Flags |= DF_HIDDEN; if (Param->No == ADVANCED_OLDSHELL && ( (QueryPlatform(PLATFORM_CAPS) & CAPS_OLDSHELL) || QueryPlatform(PLATFORM_TYPENO) == TYPE_SMARTPHONE || (QueryPlatform(PLATFORM_TYPENO) == TYPE_POCKETPC && QueryPlatform(PLATFORM_VER) >= 421))) Param->Flags |= DF_HIDDEN; #endif #if defined(TARGET_PALMOS) if (Param->No == ADVANCED_MEMORYOVERRIDE && !MemGetInfo(NULL)) Param->Flags |= DF_HIDDEN; #endif if (Param->No == ADVANCED_NOWMMX && !(QueryPlatform(PLATFORM_CAPS) & CAPS_ARM_WMMX)) Param->Flags |= DF_HIDDEN; if (Param->No == ADVANCED_HOMESCREEN && QueryPlatform(PLATFORM_TYPENO) != TYPE_SMARTPHONE) Param->Flags |= DF_HIDDEN; if (Param->No == ADVANCED_VR41XX && !(QueryPlatform(PLATFORM_CAPS) != CAPS_MIPS_VR41XX)) Param->Flags |= DF_HIDDEN; } return Result; }
static int Create(advanced* p) { int Caps = QueryPlatform(PLATFORM_CAPS); video Desktop; QueryDesktop(&Desktop); p->Node.Enum = (nodeenum)Enum, p->Node.Get = (nodeget)Get, p->Node.Set = (nodeset)Set, p->SlowVideo = 0; #if defined(TARGET_WINCE) p->SystemVolume = QueryPlatform(PLATFORM_VER) < 421; #else p->SystemVolume = 0; #endif p->BenchFromPos = 0; p->VR41XX = 1; p->MemoryOverride = 0; p->KeyFollowDir = HaveDPad(); p->ColorLookup = !(Caps & CAPS_MIPS_VR41XX) && !(Caps & CAPS_ARM_XSCALE); p->OldShell = (Caps & CAPS_OLDSHELL) != 0; p->DropTolerance = (TICKSPERSEC*55)/1000; p->SkipTolerance = (TICKSPERSEC*700)/1000; p->AVOffset = 0; p->BlinkLED = 1; #if defined(TARGET_ANDROID) p->NoDeblocking = 1; #endif #if defined(TARGET_PALMOS) // causes major problems on Sony TJ35, like screen not turning off with audio, or hold/power button not working... //p->NoEventChecking = (QueryPlatform(PLATFORM_CAPS) & CAPS_SONY)!=0; #endif #if defined(TARGET_WINCE) { tchar_t FileName[MAXPATH]; GetSystemPath(FileName,TSIZEOF(FileName),T("BtCeAvIf.dll")); p->WidcommAudio = p->WidcommDLL = FileExits(FileName); } #endif return ERR_NONE; }
void FFMPEGV_Init() { nodedef Def; const codecinfo* i; avcodec_init(); /* video codecs */ REGISTER_DECODER (FLV, flv); REGISTER_DECODER (AVS, avs); REGISTER_DECODER (CAVS, cavs); REGISTER_DECODER (CINEPAK, cinepak); REGISTER_DECODER (H261, h261); REGISTER_DECODER (H263, h263); REGISTER_DECODER (H263I, h263i); REGISTER_DECODER (H264, h264); REGISTER_DECODER (INDEO2, indeo2); REGISTER_DECODER (INDEO3, indeo3); REGISTER_DECODER (MPEG2VIDEO, mpeg2video); REGISTER_DECODER (MPEG4, mpeg4); REGISTER_DECODER (MSMPEG4V1, msmpeg4v1); REGISTER_DECODER (MSMPEG4V2, msmpeg4v2); REGISTER_DECODER (MSMPEG4V3, msmpeg4v3); REGISTER_DECODER (MSRLE, msrle); REGISTER_DECODER (MSVIDEO1, msvideo1); REGISTER_DECODER (RV10, rv10); REGISTER_DECODER (RV20, rv20); REGISTER_DECODER (RV30, rv30); REGISTER_DECODER (RV40, rv40); //REGISTER_DECODER (sp5x); REGISTER_DECODER (SVQ1, svq1); REGISTER_DECODER (SVQ3, svq3); REGISTER_DECODER (THEORA, theora); REGISTER_DECODER (VC1, vc1); REGISTER_DECODER (VP3, vp3); REGISTER_DECODER (VP5, vp5); REGISTER_DECODER (VP6, vp6); REGISTER_DECODER (VP6A, vp6a); REGISTER_DECODER (VP6F, vp6f); REGISTER_DECODER (VP8, vp8); REGISTER_DECODER (WMV1, wmv1); REGISTER_DECODER (WMV2, wmv2); REGISTER_DECODER (WMV3, wmv3); REGISTER_DECODER (TSCC, tscc); /* register_avcodec(&flv_decoder); register_avcodec(&mpeg1video_decoder); register_avcodec(&mpeg2video_decoder); register_avcodec(&mpegvideo_decoder); // register_avcodec(&svq1_decoder); register_avcodec(&svq3_decoder); register_avcodec(&h263_decoder); register_avcodec(&mpeg4_decoder); register_avcodec(&msmpeg4v1_decoder); register_avcodec(&msmpeg4v2_decoder); register_avcodec(&msmpeg4v3_decoder); register_avcodec(&wmv1_decoder); register_avcodec(&wmv2_decoder); // register_avcodec(&wmv3_decoder); register_avcodec(&h264_decoder); register_avcodec(&cinepak_decoder); register_avcodec(&msvideo1_decoder); register_avcodec(&tscc_decoder); */ NodeRegisterClass(&FFMPEGVideo); memset(&Def,0,sizeof(Def)); for (i=Info;i->Id;++i) { StringAdd(1,i->Id,NODE_NAME,i->Name); StringAdd(1,i->Id,NODE_CONTENTTYPE,i->ContentType); Def.Class = i->Id; Def.ParentClass = FFMPEG_VIDEO_CLASS; Def.Priority = PRI_DEFAULT-10; // do not override ARM optimized codecs by default Def.Flags = 0; // parent size if ((i->CodecId == CODEC_ID_WMV1 && QueryPlatform(PLATFORM_WMPVERSION)!=10) || //WMP10 RGB only output -> prefer ffmpeg i->CodecId == CODEC_ID_WMV2 || i->CodecId == CODEC_ID_WMV3) Def.Priority -= 100; // prefer DMO, WMV2 J-frames are not supported by ffmpeg, WMMX support by MS codecs are faster NodeRegisterClass(&Def); } NodeRegisterClass(&WMVF); }
static int Init(gapi* p) { GXDisplayProperties Info; video GDI; int Caps = QueryPlatform(PLATFORM_CAPS); if (!p->Opened) { ShowError(p->Overlay.Node.Class,GAPI_ID,GAPI_OPEN_ERROR); return ERR_NOT_SUPPORTED; // don't show device error } Info = p->Info; if (Info.cxWidth == GetSystemMetrics(SM_CXSCREEN) && Info.cyHeight < GetSystemMetrics(SM_CYSCREEN)) { // HPC devices we need the taskbar counted in the height too RECT WorkArea; SystemParametersInfo(SPI_GETWORKAREA,0,&WorkArea,0); if (WorkArea.top == 0 && WorkArea.bottom == Info.cyHeight) Info.cyHeight = GetSystemMetrics(SM_CYSCREEN); } p->Overlay.Output.Format.Video.Direction = 0; p->Overlay.Output.Format.Video.Aspect = ASPECT_ONE; if (Info.ffFormat & kfPalette) { QueryDesktop(&GDI); p->Overlay.Output.Format.Video.Pixel.Flags = PF_PALETTE; p->Overlay.Output.Format.Video.Pixel.BitCount = Info.cBPP; p->Overlay.Output.Format.Video.Pixel.Palette = GDI.Pixel.Palette; } else if (Info.ffFormat & kfDirect444) DefaultRGB(&p->Overlay.Output.Format.Video.Pixel,Info.cBPP,4,4,4,0,0,0); else if (Info.ffFormat & kfDirect565) { if (Caps & CAPS_ONLY12BITRGB) DefaultRGB(&p->Overlay.Output.Format.Video.Pixel,Info.cBPP,4,4,4,1,2,1); else DefaultRGB(&p->Overlay.Output.Format.Video.Pixel,Info.cBPP,5,6,5,0,0,0); } else if (Info.ffFormat & kfDirect555) DefaultRGB(&p->Overlay.Output.Format.Video.Pixel,Info.cBPP,5,5,5,0,0,0); else if (Info.ffFormat & kfDirect888) DefaultRGB(&p->Overlay.Output.Format.Video.Pixel,Info.cBPP,8,8,8,0,0,0); if (Info.ffFormat & kfDirectInverted) p->Overlay.Output.Format.Video.Pixel.Flags |= PF_INVERTED; // get signed x/y pitches in bits Info.cbxPitch <<= 3; Info.cbyPitch <<= 3; // one pitch is probably zero when BPP<8 if (!Info.cbxPitch) if (Info.cbyPitch < 0) Info.cbxPitch = -Info.cBPP; else Info.cbxPitch = Info.cBPP; else if (!Info.cbyPitch) if (Info.cbxPitch < 0) Info.cbyPitch = Info.cBPP; else Info.cbyPitch = -Info.cBPP; // one of the pitches absolute value must be BPP if (abs(Info.cbyPitch) < abs(Info.cbxPitch)) { if (abs(Info.cbxPitch) < Info.cyHeight*Info.cBPP && abs(Info.cbxPitch) >= Info.cxWidth*Info.cBPP) //swapped gapi resolution SwapInt(&Info.cxWidth,&Info.cyHeight); Info.ffFormat |= kfLandscape; Info.cbyPitch = Info.cbyPitch<0 ? -Info.cBPP : Info.cBPP; } else { if (abs(Info.cbyPitch) < Info.cxWidth*Info.cBPP && abs(Info.cbyPitch) >= Info.cyHeight*Info.cBPP) //swapped gapi resolution SwapInt(&Info.cxWidth,&Info.cyHeight); Info.ffFormat &= ~kfLandscape; Info.cbxPitch = Info.cbxPitch<0 ? -Info.cBPP : Info.cBPP; } p->Overlay.Output.Format.Video.Width = Info.cxWidth; p->Overlay.Output.Format.Video.Height = Info.cyHeight; // we need the physical start of the framebuffer p->AdjustPtr = 0; if (Info.cbxPitch<0) p->AdjustPtr += (Info.cbxPitch * (Info.cxWidth-1)) >> 3; if (Info.cbyPitch<0) p->AdjustPtr += (Info.cbyPitch * (Info.cyHeight-1)) >> 3; if (Info.ffFormat & kfLandscape) { p->Overlay.Output.Format.Video.Direction |= DIR_SWAPXY; p->Overlay.Output.Format.Video.Pitch = abs(Info.cbxPitch) >> 3; SwapInt(&p->Overlay.Output.Format.Video.Width,&p->Overlay.Output.Format.Video.Height); if (Info.cbxPitch<0) p->Overlay.Output.Format.Video.Direction |= DIR_MIRRORUPDOWN; if (Info.cbyPitch<0) p->Overlay.Output.Format.Video.Direction |= DIR_MIRRORLEFTRIGHT; }
bool_t Context_Init(const tchar_t* Name,const tchar_t* Version,int Id,const tchar_t* CmdLine,void* Application) { context* p = malloc(sizeof(context)); if (!p) return 0; #ifdef PREALLOC { int i; for (i=0;i<PREALLOC;++i) q[i] = malloc(65536); } #endif memset(p,0,sizeof(context)); p->Version = CONTEXT_VERSION; p->ProgramId = Id; p->ProgramName = Name; p->ProgramVersion = Version; p->CmdLine = CmdLine; p->Lang = DefaultLang(); p->StartUpMemory = AvailMemory(); p->LowMemory = p->StartUpMemory < LOWMEMORY_LIMIT; p->Application = Application; SetContext(p); Mem_Init(); DynCode_Init(); String_Init(); PCM_Init(); Blit_Init(); Node_Init(); Platform_Init(); Stream_Init(); Advanced_Init(); Flow_Init(); Codec_Init(); Audio_Init(); Video_Init(); Format_Init(); Playlist_Init(); FormatBase_Init(); NullOutput_Init(); RawAudio_Init(); RawImage_Init(); Timer_Init(); IDCT_Init(); Overlay_Init(); M3U_Init(); PLS_Init(); ASX_Init(); WaveOut_Init(); SoftIDCT_Init(); #if defined(CONFIG_SUBS) SubTitle_Init(); #endif #if defined(TARGET_PALMOS) OverlayHIRES_Init(); //Win_Init(); //About_Init(); //BenchResult_Init(); //MediaInfo_Init(); //Settings_Init(); ASF_Init(); AVI_Init(); WAV_Init(); MP4_Init(); MPG_Init(); NSV_Init(); Law_Init(); ADPCM_Init(); #elif defined(TARGET_WIN32) || defined(TARGET_WINCE) #if defined(TARGET_WINCE) if (QueryPlatform(PLATFORM_TYPENO) != TYPE_SMARTPHONE) { OverlayRAW_Init(); OverlayGAPI_Init(); } else { OverlayGAPI_Init(); // prefer GAPI with smartphones (Sagem MyS-7 crashes with Raw FrameBuffer?) OverlayRAW_Init(); } OverlayDirect_Init(); OverlayS1D13806_Init(); #else OverlayConsole_Init(); #endif OverlayXScale_Init(); OverlayDDraw_Init(); // after GAPI and RAW and XScale OverlayFlyTV_Init(); OverlayGDI_Init(); #elif defined(TARGET_SYMBIAN) OverlaySymbian_Init(); #endif #ifdef NO_PLUGINS Static_Init(); #else Plugins_Init(); #endif Association_Init(); // after all formats are registered Color_Init(); Equalizer_Init(); Player_Init(); // after all output drivers are registered return 1; }