void ms_set_cpu_count(unsigned int c) { ms_factory_set_cpu_count(ms_factory_get_fallback(),c); }
void ms_factory_init(MSFactory *obj){ int i; long num_cpu=1; char *debug_log_enabled = NULL; char *tags; #ifdef _WIN32 SYSTEM_INFO sysinfo; #endif #if defined(ENABLE_NLS) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); #endif #ifndef MS2_WINDOWS_UNIVERSAL debug_log_enabled=getenv("MEDIASTREAMER_DEBUG"); #endif if (debug_log_enabled!=NULL && (strcmp("1",debug_log_enabled)==0) ){ ortp_set_log_level_mask(ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR|ORTP_FATAL); } ms_message("Mediastreamer2 factory " MEDIASTREAMER_VERSION " (git: " GIT_VERSION ") initialized."); /* register builtin MSFilter's */ for (i=0;ms_base_filter_descs[i]!=NULL;i++){ ms_factory_register_filter(obj,ms_base_filter_descs[i]); } #ifdef _WIN32 /*fixme to be tested*/ GetNativeSystemInfo( &sysinfo ); num_cpu = sysinfo.dwNumberOfProcessors; #elif __APPLE__ || __linux num_cpu = sysconf( _SC_NPROCESSORS_CONF); /*check the number of processors configured, not just the one that are currently active.*/ #elif __QNX__ num_cpu = _syspage_ptr->num_cpu; #else #warning "There is no code that detects the number of CPU for this platform." #endif ms_factory_set_cpu_count(obj,num_cpu); ms_factory_set_mtu(obj,MS_MTU_DEFAULT); #ifdef _WIN32 ms_factory_add_platform_tag(obj, "win32"); #ifdef MS2_WINDOWS_PHONE ms_factory_add_platform_tag(obj, "windowsphone"); #endif #ifdef MS2_WINDOWS_UNIVERSAL ms_factory_add_platform_tag(obj, "windowsuniversal"); #endif #endif #ifdef __APPLE__ ms_factory_add_platform_tag(obj, "apple"); #endif #ifdef __linux ms_factory_add_platform_tag(obj, "linux"); #endif #ifdef __QNX__ ms_factory_add_platform_tag(obj, "qnx"); #endif #ifdef ANDROID ms_factory_add_platform_tag(obj, "android"); #endif #ifdef TARGET_OS_IPHONE ms_factory_add_platform_tag(obj, "ios"); #endif #if defined(__arm__) || defined(_M_ARM) ms_factory_add_platform_tag(obj, "arm"); #else ms_factory_add_platform_tag(obj, "x86"); #endif #if defined(ANDROID) || (TARGET_OS_IPHONE == 1) || defined(__arm__) || defined(_M_ARM) ms_factory_add_platform_tag(obj, "embedded"); #else ms_factory_add_platform_tag(obj, "desktop"); #endif tags = ms_factory_get_platform_tags_as_string(obj); ms_message("ms_factory_init() done: platform_tags=%s", tags); ms_free(tags); }