void aml_permissions() { if (!aml_present()) return; // most all aml devices are already rooted. int ret = system("ls /system/xbin/su"); if (ret != 0) { CLog::Log(LOGWARNING, "aml_permissions: missing su, playback might fail"); } else { // certain aml devices have 664 permission, we need 666. system("su -c chmod 666 /dev/amvideo"); system("su -c chmod 666 /dev/amstream*"); system("su -c chmod 666 /sys/class/video/axis"); system("su -c chmod 666 /sys/class/video/screen_mode"); system("su -c chmod 666 /sys/class/video/disable_video"); system("su -c chmod 666 /sys/class/tsync/pts_pcrscr"); system("su -c chmod 666 /sys/class/audiodsp/digital_raw"); system("su -c chmod 666 /sys/class/ppmgr/ppmgr_3d_mode"); system("su -c chmod 666 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq"); system("su -c chmod 666 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"); system("su -c chmod 666 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"); CLog::Log(LOGINFO, "aml_permissions: permissions changed"); } }
void aml_set_audio_passthrough(bool passthrough) { if (aml_present()) { int raw = aml_get_cputype() < 3 ? 1:2; aml_set_sysfs_int("/sys/class/audiodsp/digital_raw", passthrough ? raw:0); } }
bool CSysInfo::HWSupportsStereo(const int mode) { #if defined(TARGET_ANDROID) if (aml_present()) return aml_supports_stereo(mode); else if (SysfsUtils::Has("/sys/class/graphics/fb0/3d_present")) // AFTV return true; #endif return false; }
void aml_set_audio_passthrough(bool passthrough) { if ( aml_present() && aml_get_device_type() != AML_DEVICE_TYPE_UNKNOWN && aml_get_device_type() <= AML_DEVICE_TYPE_M8) { // m1 uses 1, m3 and above uses 2 int raw = aml_get_device_type() == AML_DEVICE_TYPE_M1 ? 1:2; SysfsUtils::SetInt("/sys/class/audiodsp/digital_raw", passthrough ? raw:0); } }
bool CEGLNativeTypeAmlAndroid::CheckCompatibility() { if (aml_present()) { if (SysfsUtils::HasRW("/sys/class/display/mode")) return true; else CLog::Log(LOGERROR, "AMLEGL: no rw on /sys/class/display/mode"); } return false; }
void CLinuxInputDevice::SetupKeyboardAutoRepeat(int fd) { bool enable = true; #if defined(HAS_LIBAMCODEC) if (aml_present()) { // ignore the native aml driver named 'key_input', // it is the dedicated power key handler (am_key_input) if (strncmp(m_deviceName, "key_input", strlen("key_input")) == 0) return; // ignore the native aml driver named 'aml_keypad', // it is the dedicated IR remote handler (amremote) else if (strncmp(m_deviceName, "aml_keypad", strlen("aml_keypad")) == 0) return; // turn off any keyboard autorepeat, there is a kernel bug // where if the cpu is max'ed then key up is missed and // we get a flood of EV_REP that never stop until next // key down/up. Very nasty when seeking during video playback. enable = false; } #endif if (enable) { int kbdrep[2] = { 400, 80 }; ioctl(fd, EVIOCSREP, kbdrep); } else { struct input_event event; memset(&event, 0, sizeof(event)); gettimeofday(&event.time, NULL); event.type = EV_REP; event.code = REP_DELAY; event.value = 0; write(fd, &event, sizeof(event)); gettimeofday(&event.time, NULL); event.type = EV_REP; event.code = REP_PERIOD; event.value = 0; write(fd, &event, sizeof(event)); CLog::Log(LOGINFO, "CLinuxInputDevice: auto key repeat disabled on device '%s'\n", m_deviceName); } }
void CSysInfo::HWSetStereoMode(const int mode, const int view) { #if defined(TARGET_ANDROID) if (aml_present()) aml_set_stereo_mode(mode, view); else if (SysfsUtils::Has("/sys/class/graphics/fb0/3d_present")) // AFTV { switch(mode) { default: SysfsUtils::SetInt("/sys/class/graphics/fb0/format_3d", 0); break; case RENDER_STEREO_MODE_SPLIT_VERTICAL: SysfsUtils::SetInt("/sys/class/graphics/fb0/format_3d", 1); break; case RENDER_STEREO_MODE_SPLIT_HORIZONTAL: SysfsUtils::SetInt("/sys/class/graphics/fb0/format_3d", 2); break; } } #endif }
bool aml_permissions() { if (!aml_present()) return false; static int permissions_ok = -1; if (permissions_ok == -1) { permissions_ok = 1; if (!SysfsUtils::HasRW("/dev/amvideo")) { CLog::Log(LOGERROR, "AML: no rw on /dev/amvideo"); permissions_ok = 0; } if (!SysfsUtils::HasRW("/dev/amstream_mpts")) { CLog::Log(LOGERROR, "AML: no rw on /dev/amstream*"); permissions_ok = 0; } if (!SysfsUtils::HasRW("/sys/class/video/axis")) { CLog::Log(LOGERROR, "AML: no rw on /sys/class/video/axis"); permissions_ok = 0; } if (!SysfsUtils::HasRW("/sys/class/video/screen_mode")) { CLog::Log(LOGERROR, "AML: no rw on /sys/class/video/screen_mode"); permissions_ok = 0; } if (!SysfsUtils::HasRW("/sys/class/video/disable_video")) { CLog::Log(LOGERROR, "AML: no rw on /sys/class/video/disable_video"); permissions_ok = 0; } if (!SysfsUtils::HasRW("/sys/class/tsync/pts_pcrscr")) { CLog::Log(LOGERROR, "AML: no rw on /sys/class/tsync/pts_pcrscr"); permissions_ok = 0; } if (!SysfsUtils::HasRW("/sys/class/audiodsp/digital_raw")) { CLog::Log(LOGERROR, "AML: no rw on /sys/class/audiodsp/digital_raw"); } if (!SysfsUtils::HasRW("/sys/class/ppmgr/ppmgr_3d_mode")) { CLog::Log(LOGERROR, "AML: no rw on /sys/class/ppmgr/ppmgr_3d_mode"); } #ifndef TARGET_ANDROID if (!SysfsUtils::HasRW("/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq")) { CLog::Log(LOGERROR, "AML: no rw on /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq"); } if (!SysfsUtils::HasRW("/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq")) { CLog::Log(LOGERROR, "AML: no rw on /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"); } if (!SysfsUtils::HasRW("/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor")) { CLog::Log(LOGERROR, "AML: no rw on /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"); } #endif } return permissions_ok == 1; }
bool CAESinkALSA::Initialize(AEAudioFormat &format, std::string &device) { CAEChannelInfo channelLayout; m_initDevice = device; m_initFormat = format; /* if we are raw, correct the data format */ if (AE_IS_RAW(format.m_dataFormat)) { channelLayout = GetChannelLayout(format); format.m_dataFormat = AE_FMT_S16NE; m_passthrough = true; } else { channelLayout = GetChannelLayout(format); m_passthrough = false; } #if defined(HAS_LIBAMCODEC) if (aml_present()) { aml_set_audio_passthrough(m_passthrough); device = "default"; } #endif if (channelLayout.Count() == 0) { CLog::Log(LOGERROR, "CAESinkALSA::Initialize - Unable to open the requested channel layout"); return false; } format.m_channelLayout = channelLayout; AEDeviceType devType = AEDeviceTypeFromName(device); std::string AESParams; /* digital interfaces should have AESx set, though in practice most * receivers don't care */ if (m_passthrough || devType == AE_DEVTYPE_HDMI || devType == AE_DEVTYPE_IEC958) GetAESParams(format, AESParams); CLog::Log(LOGINFO, "CAESinkALSA::Initialize - Attempting to open device \"%s\"", device.c_str()); /* get the sound config */ snd_config_t *config; snd_config_copy(&config, snd_config); if (!OpenPCMDevice(device, AESParams, channelLayout.Count(), &m_pcm, config)) { CLog::Log(LOGERROR, "CAESinkALSA::Initialize - failed to initialize device \"%s\"", device.c_str()); snd_config_delete(config); return false; } /* get the actual device name that was used */ device = snd_pcm_name(m_pcm); m_device = device; CLog::Log(LOGINFO, "CAESinkALSA::Initialize - Opened device \"%s\"", device.c_str()); /* free the sound config */ snd_config_delete(config); if (!InitializeHW(format) || !InitializeSW(format)) return false; // we want it blocking snd_pcm_nonblock(m_pcm, 0); snd_pcm_prepare (m_pcm); m_format = format; m_formatSampleRateMul = 1.0 / (double)m_format.m_sampleRate; return true; }
void aml_set_audio_passthrough(bool passthrough) { if (aml_present()) aml_set_sysfs_int("/sys/class/audiodsp/digital_raw", passthrough ? 1:0); }
bool CAESinkALSA::Initialize(AEAudioFormat &format, std::string &device) { m_initDevice = device; m_initFormat = format; /* if we are raw, correct the data format */ if (AE_IS_RAW(format.m_dataFormat)) { m_channelLayout = GetChannelLayout(format); format.m_dataFormat = AE_FMT_S16NE; m_passthrough = true; } else { m_channelLayout = GetChannelLayout(format); m_passthrough = false; } #if defined(HAS_AMLPLAYER) if (aml_present()) { aml_set_audio_passthrough(m_passthrough); device = "default"; } #endif if (m_channelLayout.Count() == 0) { CLog::Log(LOGERROR, "CAESinkALSA::Initialize - Unable to open the requested channel layout"); return false; } format.m_channelLayout = m_channelLayout; AEDeviceType devType = AEDeviceTypeFromName(device); std::string AESParams; /* digital interfaces should have AESx set, though in practice most * receivers don't care */ if (m_passthrough || devType == AE_DEVTYPE_HDMI || devType == AE_DEVTYPE_IEC958) GetAESParams(format, AESParams); CLog::Log(LOGINFO, "CAESinkALSA::Initialize - Attempting to open device \"%s\"", device.c_str()); /* get the sound config */ snd_config_t *config; snd_config_copy(&config, snd_config); snd_config_t *dmixRateConf; long dmixRate; if (snd_config_search(config, "defaults.pcm.dmix.rate", &dmixRateConf) < 0 || snd_config_get_integer(dmixRateConf, &dmixRate) < 0) dmixRate = 48000; /* assume default */ /* Prefer dmix for non-passthrough stereo when sample rate matches */ if (!OpenPCMDevice(device, AESParams, m_channelLayout.Count(), &m_pcm, config, format.m_sampleRate == (unsigned int) dmixRate && !m_passthrough)) { CLog::Log(LOGERROR, "CAESinkALSA::Initialize - failed to initialize device \"%s\"", device.c_str()); snd_config_delete(config); return false; } /* get the actual device name that was used */ device = snd_pcm_name(m_pcm); m_device = device; CLog::Log(LOGINFO, "CAESinkALSA::Initialize - Opened device \"%s\"", device.c_str()); /* free the sound config */ snd_config_delete(config); if (!InitializeHW(format) || !InitializeSW(format)) return false; snd_pcm_nonblock(m_pcm, 1); snd_pcm_prepare (m_pcm); m_format = format; m_formatSampleRateMul = 1.0 / (double)m_format.m_sampleRate; return true; }
bool CPivosPowerSyscall::HasPivosPowerSyscall() { return aml_present(); }
void CSettingConditions::Initialize() { if (!m_simpleConditions.empty()) return; // add simple conditions m_simpleConditions.insert("true"); #ifdef HAS_UPNP m_simpleConditions.insert("has_upnp"); #endif #ifdef HAS_AIRPLAY m_simpleConditions.insert("has_airplay"); #endif #ifdef HAVE_X11 m_simpleConditions.insert("have_x11"); #endif #ifdef HAVE_WAYLAND m_simpleConditions.insert("have_wayland"); #endif #ifdef HAS_GL m_simpleConditions.insert("has_gl"); #endif #ifdef HAS_GLES m_simpleConditions.insert("has_gles"); #endif #if HAS_GLES >= 2 m_simpleConditions.insert("has_glesv2"); #endif #ifdef HAS_TIME_SERVER m_simpleConditions.insert("has_time_server"); #endif #ifdef HAS_WEB_SERVER m_simpleConditions.insert("has_web_server"); #endif #ifdef HAS_FILESYSTEM_SMB m_simpleConditions.insert("has_filesystem_smb"); #endif #ifdef HAS_ZEROCONF m_simpleConditions.insert("has_zeroconf"); #endif #ifdef HAVE_LIBVA m_simpleConditions.insert("have_libva"); #endif #ifdef HAVE_LIBVDPAU m_simpleConditions.insert("have_libvdpau"); #endif #ifdef TARGET_ANDROID m_simpleConditions.insert("has_mediacodec"); #endif #ifdef TARGET_DARWIN m_simpleConditions.insert("HasVTB"); #endif #ifdef TARGET_DARWIN_OSX m_simpleConditions.insert("have_osx"); #endif #ifdef TARGET_DARWIN_IOS m_simpleConditions.insert("have_ios"); #endif #ifdef HAS_LIBAMCODEC if (aml_present()) m_simpleConditions.insert("have_amcodec"); #endif #if defined(TARGET_WINDOWS) m_simpleConditions.insert("has_dx"); m_simpleConditions.insert("hasdxva2"); #endif #ifdef HAVE_LCMS2 m_simpleConditions.insert("have_lcms2"); #endif #ifdef TARGET_ANDROID m_simpleConditions.insert("isstandalone"); #else if (g_application.IsStandAlone()) m_simpleConditions.insert("isstandalone"); #endif m_simpleConditions.insert("has_ae_quality_levels"); #ifdef HAS_WEB_SERVER if(CWebServer::WebServerSupportsSSL()) m_simpleConditions.insert("webserver_has_ssl"); #endif // add complex conditions m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("addonhassettings", AddonHasSettings)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("checkmasterlock", CheckMasterLock)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("hasperipherals", HasPeripherals)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("hasperipherallibraries", HasPeripheralLibraries)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("hasrumblefeature", HasRumbleFeature)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("hasrumblecontroller", HasRumbleController)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("haspowerofffeature", HasPowerOffFeature)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("isfullscreen", IsFullscreen)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("ismasteruser", IsMasterUser)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("isusingttfsubtitles", IsUsingTTFSubtitles)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilecanwritedatabase", ProfileCanWriteDatabase)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilecanwritesources", ProfileCanWriteSources)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilehasaddons", ProfileHasAddons)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilehasdatabase", ProfileHasDatabase)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilehassources", ProfileHasSources)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilehasaddonmanagerlocked", ProfileHasAddonManagerLocked)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilehasfileslocked", ProfileHasFilesLocked)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilehasmusiclocked", ProfileHasMusicLocked)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilehaspictureslocked", ProfileHasPicturesLocked)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilehasprogramslocked", ProfileHasProgramsLocked)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilehassettingslocked", ProfileHasSettingsLocked)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilehasvideoslocked", ProfileHasVideosLocked)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilelockmode", ProfileLockMode)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("aesettingvisible", ActiveAE::CActiveAESettings::IsSettingVisible)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("gt", GreaterThan)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("gte", GreaterThanOrEqual)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("lt", LessThan)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("lte", LessThanOrEqual)); }
void CSettingConditions::Initialize() { if (!m_simpleConditions.empty()) return; // add simple conditions m_simpleConditions.insert("true"); #ifdef HAS_UPNP m_simpleConditions.insert("has_upnp"); #endif #ifdef HAS_AIRPLAY m_simpleConditions.insert("has_airplay"); #endif #ifdef HAS_EVENT_SERVER m_simpleConditions.insert("has_event_server"); #endif #ifdef HAVE_X11 m_simpleConditions.insert("have_x11"); #endif #ifdef HAS_GL m_simpleConditions.insert("has_gl"); #endif #ifdef HAS_GLX m_simpleConditions.insert("has_glx"); #endif #ifdef HAS_GLES m_simpleConditions.insert("has_gles"); #endif #if HAS_GLES == 2 m_simpleConditions.insert("has_glesv2"); #endif #ifdef HAS_SDL_JOYSTICK m_simpleConditions.insert("has_sdl_joystick"); #endif #ifdef HAS_TOUCH_SKIN m_simpleConditions.insert("has_touch_skin"); #endif #ifdef HAS_TIME_SERVER m_simpleConditions.insert("has_time_server"); #endif #ifdef HAS_WEB_SERVER m_simpleConditions.insert("has_web_server"); #endif #ifdef HAS_ZEROCONF m_simpleConditions.insert("has_zeroconf"); #endif #ifdef HAVE_LIBOPENMAX m_simpleConditions.insert("have_libopenmax"); #endif #ifdef HAS_OMXPLAYER m_simpleConditions.insert("has_omxplayer"); #endif #ifdef HAVE_LIBVA m_simpleConditions.insert("have_libva"); #endif #ifdef HAVE_LIBVDPAU m_simpleConditions.insert("have_libvdpau"); #endif #ifdef TARGET_ANDROID m_simpleConditions.insert("has_mediacodec"); #endif #ifdef HAS_LIBSTAGEFRIGHT m_simpleConditions.insert("have_libstagefrightdecoder"); #endif #if defined(TARGET_DARWIN_IOS) && !defined(TARGET_DARWIN_TVOS) m_simpleConditions.insert("have_videotoolboxdecoder"); m_simpleConditions.insert("hasvideotoolboxdecoder"); #endif #ifdef TARGET_DARWIN_OSX m_simpleConditions.insert("HasVDA"); #endif #ifdef HAS_LIBAMCODEC if (aml_present()) m_simpleConditions.insert("have_amcodec"); #endif #ifdef TARGET_DARWIN_OSX if (CDarwinUtils::IsSnowLeopard()) m_simpleConditions.insert("osxissnowleopard"); #endif #ifdef TARGET_DARWIN_IOS m_simpleConditions.insert("hasAVF"); #endif if (g_application.IsStandAlone()) m_simpleConditions.insert("isstandalone"); if(CAEFactory::SupportsQualitySetting()) m_simpleConditions.insert("has_ae_quality_levels"); // add complex conditions m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("addonhassettings", AddonHasSettings)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("checkmasterlock", CheckMasterLock)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("checkpvrparentalpin", CheckPVRParentalPin)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("hasperipherals", HasPeripherals)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("isfullscreen", IsFullscreen)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("ismasteruser", IsMasterUser)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("isusingttfsubtitles", IsUsingTTFSubtitles)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilecanwritedatabase", ProfileCanWriteDatabase)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilecanwritesources", ProfileCanWriteSources)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilehasaddons", ProfileHasAddons)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilehasdatabase", ProfileHasDatabase)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilehassources", ProfileHasSources)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilehasaddonmanagerlocked", ProfileHasAddonManagerLocked)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilehasfileslocked", ProfileHasFilesLocked)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilehasmusiclocked", ProfileHasMusicLocked)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilehaspictureslocked", ProfileHasPicturesLocked)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilehasprogramslocked", ProfileHasProgramsLocked)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilehassettingslocked", ProfileHasSettingsLocked)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilehasvideoslocked", ProfileHasVideosLocked)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("profilelockmode", ProfileLockMode)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("aesettingvisible", CAEFactory::IsSettingVisible)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("codecoptionvisible", CDVDVideoCodec::IsSettingVisible)); m_complexConditions.insert(std::pair<std::string, SettingConditionCheck>("enablemysqlgui", CAdvancedSettings::IsSettingVisible)); }
CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, unsigned int surfaces, const std::vector<ERenderFormat>& formats) { CDVDVideoCodec* pCodec = NULL; CDVDCodecOptions options; if(formats.empty()) options.m_formats.push_back(RENDER_FMT_YUV420P); else options.m_formats = formats; //when support for a hardware decoder is not compiled in //only print it if it's actually available on the platform CStdString hwSupport; #if defined(TARGET_DARWIN_OSX) hwSupport += "VDADecoder:yes "; #endif #if defined(HAVE_VIDEOTOOLBOXDECODER) && defined(TARGET_DARWIN) hwSupport += "VideoToolBoxDecoder:yes "; #elif defined(TARGET_DARWIN) hwSupport += "VideoToolBoxDecoder:no "; #endif #ifdef HAVE_LIBCRYSTALHD hwSupport += "CrystalHD:yes "; #else hwSupport += "CrystalHD:no "; #endif #if defined(HAS_LIBAMCODEC) hwSupport += "AMCodec:yes "; #else hwSupport += "AMCodec:no "; #endif #if defined(HAVE_LIBOPENMAX) && defined(TARGET_POSIX) hwSupport += "OpenMax:yes "; #elif defined(TARGET_POSIX) hwSupport += "OpenMax:no "; #endif #if defined(HAS_LIBSTAGEFRIGHT) hwSupport += "libstagefright:yes "; #elif defined(_LINUX) hwSupport += "libstagefright:no "; #endif #if defined(HAVE_LIBVDPAU) && defined(TARGET_POSIX) hwSupport += "VDPAU:yes "; #elif defined(TARGET_POSIX) && !defined(TARGET_DARWIN) hwSupport += "VDPAU:no "; #endif #if defined(TARGET_WINDOWS) && defined(HAS_DX) hwSupport += "DXVA:yes "; #elif defined(TARGET_WINDOWS) hwSupport += "DXVA:no "; #endif #if defined(HAVE_LIBVA) && defined(TARGET_POSIX) hwSupport += "VAAPI:yes "; #elif defined(TARGET_POSIX) && !defined(TARGET_DARWIN) hwSupport += "VAAPI:no "; #endif CLog::Log(LOGDEBUG, "CDVDFactoryCodec: compiled in hardware support: %s", hwSupport.c_str()); #if !defined(HAS_LIBAMCODEC) // dvd's have weird still-frames in it, which is not fully supported in ffmpeg if(hint.stills && (hint.codec == AV_CODEC_ID_MPEG2VIDEO || hint.codec == AV_CODEC_ID_MPEG1VIDEO)) { if( (pCodec = OpenCodec(new CDVDVideoCodecLibMpeg2(), hint, options)) ) return pCodec; } #endif #if defined(TARGET_DARWIN_OSX) if (!hint.software && CSettings::Get().GetBool("videoplayer.usevda")) { if (hint.codec == AV_CODEC_ID_H264 && !hint.ptsinvalid) { if ( (pCodec = OpenCodec(new CDVDVideoCodecVDA(), hint, options)) ) return pCodec; } } #endif #if defined(HAVE_VIDEOTOOLBOXDECODER) if (!hint.software && CSettings::Get().GetBool("videoplayer.usevideotoolbox")) { if (g_sysinfo.HasVideoToolBoxDecoder()) { switch(hint.codec) { case AV_CODEC_ID_H264: if (hint.codec == AV_CODEC_ID_H264 && hint.ptsinvalid) break; if ( (pCodec = OpenCodec(new CDVDVideoCodecVideoToolBox(), hint, options)) ) return pCodec; break; default: break; } } } #endif #if defined(HAVE_LIBCRYSTALHD) if (!hint.software && CSettings::Get().GetBool("videoplayer.usechd")) { if (CCrystalHD::GetInstance()->DevicePresent()) { switch(hint.codec) { case AV_CODEC_ID_VC1: case AV_CODEC_ID_WMV3: case AV_CODEC_ID_H264: case AV_CODEC_ID_MPEG2VIDEO: if (hint.codec == AV_CODEC_ID_H264 && hint.ptsinvalid) break; if (hint.codec == AV_CODEC_ID_MPEG2VIDEO && hint.width <= 720) break; if ( (pCodec = OpenCodec(new CDVDVideoCodecCrystalHD(), hint, options)) ) return pCodec; break; default: break; } } } #endif #if defined(HAS_LIBAMCODEC) if (!hint.software && aml_present()) { CLog::Log(LOGINFO, "Amlogic Video Decoder..."); if ( (pCodec = OpenCodec(new CDVDVideoCodecAmlogic(), hint, options)) ) return pCodec; } #endif #if defined(HAVE_LIBOPENMAX) if (CSettings::Get().GetBool("videoplayer.useomx") && !hint.software ) { if (hint.codec == AV_CODEC_ID_H264 || hint.codec == AV_CODEC_ID_MPEG2VIDEO || hint.codec == AV_CODEC_ID_VC1) { if ( (pCodec = OpenCodec(new CDVDVideoCodecOpenMax(), hint, options)) ) return pCodec; } } #endif #if defined(HAS_LIBSTAGEFRIGHT) if (CSettings::Get().GetBool("videoplayer.usestagefright") && !hint.software ) { switch(hint.codec) { case CODEC_ID_H264: case CODEC_ID_MPEG4: case CODEC_ID_MPEG2VIDEO: case CODEC_ID_VC1: case CODEC_ID_WMV3: case CODEC_ID_VP3: case CODEC_ID_VP6: case CODEC_ID_VP6F: case CODEC_ID_VP8: if ( (pCodec = OpenCodec(new CDVDVideoCodecStageFright(), hint, options)) ) return pCodec; break; default: break; } } #endif // try to decide if we want to try halfres decoding #if !defined(TARGET_POSIX) && !defined(TARGET_WINDOWS) float pixelrate = (float)hint.width*hint.height*hint.fpsrate/hint.fpsscale; if( pixelrate > 1400.0f*720.0f*30.0f ) { CLog::Log(LOGINFO, "CDVDFactoryCodec - High video resolution detected %dx%d, trying half resolution decoding ", hint.width, hint.height); options.m_keys.push_back(CDVDCodecOption("lowres","1")); } #endif CStdString value; value.Format("%d", surfaces); options.m_keys.push_back(CDVDCodecOption("surfaces", value)); if( (pCodec = OpenCodec(new CDVDVideoCodecFFmpeg(), hint, options)) ) return pCodec; return NULL; }
bool aml_permissions() { if (!aml_present()) return false; static int permissions_ok = -1; if (permissions_ok == -1) { permissions_ok = 1; if (!SysfsUtils::HasRW("/dev/amvideo")) { CLog::Log(LOGERROR, "AML: no rw on /dev/amvideo"); permissions_ok = 0; } if (!SysfsUtils::HasRW("/dev/amstream_mpts")) { CLog::Log(LOGERROR, "AML: no rw on /dev/amstream*"); permissions_ok = 0; } if (!SysfsUtils::HasRW("/sys/class/video/axis")) { CLog::Log(LOGERROR, "AML: no rw on /sys/class/video/axis"); permissions_ok = 0; } if (!SysfsUtils::HasRW("/sys/class/video/screen_mode")) { CLog::Log(LOGERROR, "AML: no rw on /sys/class/video/screen_mode"); permissions_ok = 0; } if (!SysfsUtils::HasRW("/sys/class/video/disable_video")) { CLog::Log(LOGERROR, "AML: no rw on /sys/class/video/disable_video"); permissions_ok = 0; } if (!SysfsUtils::HasRW("/sys/class/tsync/pts_pcrscr")) { CLog::Log(LOGERROR, "AML: no rw on /sys/class/tsync/pts_pcrscr"); permissions_ok = 0; } if (!SysfsUtils::HasRW("/dev/video10")) { CLog::Log(LOGERROR, "AML: no rw on /dev/video10"); permissions_ok = 0; } if (!SysfsUtils::HasRW("/sys/module/amvideo/parameters/omx_pts")) { CLog::Log(LOGERROR, "AML: no rw on /sys/module/amvideo/parameters/omx_pts"); permissions_ok = 0; } if (!SysfsUtils::HasRW("/sys/module/amlvideodri/parameters/freerun_mode")) { CLog::Log(LOGERROR, "AML: no rw on /sys/module/amlvideodri/parameters/freerun_mode"); permissions_ok = 0; } if (!SysfsUtils::HasRW("/sys/class/audiodsp/digital_raw")) { CLog::Log(LOGERROR, "AML: no rw on /sys/class/audiodsp/digital_raw"); } if (!SysfsUtils::HasRW("/sys/class/ppmgr/ppmgr_3d_mode")) { CLog::Log(LOGERROR, "AML: no rw on /sys/class/ppmgr/ppmgr_3d_mode"); } if (!SysfsUtils::HasRW("/sys/class/vfm/map")) { CLog::Log(LOGERROR, "AML: no rw on /sys/class/vfm/map"); } if (!SysfsUtils::HasRW("/sys/class/tsync/enable")) { CLog::Log(LOGERROR, "AML: no rw on /sys/class/tsync/enable"); } if (!SysfsUtils::HasRW("/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq")) { CLog::Log(LOGERROR, "AML: no rw on /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq"); } if (!SysfsUtils::HasRW("/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq")) { CLog::Log(LOGERROR, "AML: no rw on /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"); } if (!SysfsUtils::HasRW("/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor")) { CLog::Log(LOGERROR, "AML: no rw on /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"); } } return permissions_ok == 1; }