#else
log()->log ("libdcp built in optimised mode.");
#endif
+ pair<string, int> const c = cpu_info ();
+ log()->log (String::compose ("CPU: %1, %2 processors", c.first, c.second));
if (format() == 0) {
throw MissingSettingError ("format");
return (ext == ".tif" || ext == ".tiff" || ext == ".jpg" || ext == ".jpeg" || ext == ".png");
}
+
+/** @return A pair containing CPU model name and the number of processors */
+pair<string, int>
+cpu_info ()
+{
+ pair<string, int> info;
+ info.second = 0;
+
+#ifdef DVDOMATIC_POSIX
+ ifstream f ("/proc/cpuinfo");
+ while (f.good ()) {
+ string l;
+ getline (f, l);
+ if (boost::algorithm::starts_with (l, "model name")) {
+ string::size_type const c = l.find (':');
+ if (c != string::npos) {
+ info.first = l.substr (c + 2);
+ }
+ } else if (boost::algorithm::starts_with (l, "processor")) {
+ ++info.second;
+ }
+ }
+#endif
+
+ return info;
+}
extern int64_t video_frames_to_audio_frames (SourceFrame v, float audio_sample_rate, float frames_per_second);
extern bool still_image_file (std::string);
+extern std::pair<std::string, int> cpu_info ();
#endif