Manager::Manager() : defaultPrecachedFramesCount(8), workMutex(new Mutex()), audioInterfaceFactory(NULL) { std::string message = "Initializing Theoraplayer Video Playback Library (" + this->getVersionString() + ")\n"; #ifdef _USE_THEORA message += " - libtheora version: " + std::string(th_version_string()) + "\n" + " - libvorbis version: " + std::string(vorbis_version_string()) + "\n"; #endif #ifdef _ANDROID uint64_t features = libtheoraplayer_android_getCpuFeaturesExt(); char s[128] = { 0 }; sprintf(s, " - Android: CPU Features: %u\n", (unsigned int)features); message += s; if ((features & ANDROID_CPU_ARM_FEATURE_NEON) == 0) { message += " - Android: NEON features NOT SUPPORTED by CPU\n"; } else { message += " - Android: Detected NEON CPU features\n"; } #endif log(message + "------------------------------------"); // for CPU based yuv2rgb decoding initYUVConversionModule(); }
TheoraVideoManager::TheoraVideoManager(int num_worker_threads) : mDefaultNumPrecachedFrames(8) { if (num_worker_threads < 1) throw TheoraGenericException("Unable to create TheoraVideoManager, at least one worker thread is reqired"); g_ManagerSingleton = this; std::string msg = "Initializing Theora Playback Library (" + getVersionString() + ")\n"; #ifdef __THEORA msg += " - libtheora version: " + std::string(th_version_string()) + "\n" + " - libvorbis version: " + std::string(vorbis_version_string()) + "\n"; #endif #ifdef _ANDROID uint64_t features = android_getCpuFeaturesExt(); char s[128]; sprintf(s, " - Android: CPU Features: %u\n", (unsigned int) features); msg += s; if ((features & ANDROID_CPU_ARM_FEATURE_NEON) == 0) msg += " - Android: NEON features NOT SUPPORTED by CPU\n"; else msg += " - Android: Detected NEON CPU features\n"; #endif #ifdef __AVFOUNDATION msg += " - using Apple AVFoundation classes.\n"; #endif #ifdef __FFMPEG msg += " - using FFmpeg library.\n"; #endif logMessage(msg + "------------------------------------"); mAudioFactory = NULL; mWorkMutex = new TheoraMutex(); // for CPU based yuv2rgb decoding initYUVConversionModule(); createWorkerThreads(num_worker_threads); }