2 Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include "compose.hpp"
24 #include <dcp/version.h>
25 #include <libssh/libssh.h>
26 #ifdef DCPOMATIC_IMAGE_MAGICK
27 #include <magick/MagickCore.h>
29 #include <magick/common.h>
30 #include <magick/magick_config.h>
32 #include <magick/version.h>
34 #include <libavcodec/avcodec.h>
35 #include <libavformat/avformat.h>
36 #include <libswscale/swscale.h>
37 #include <libavfilter/avfiltergraph.h>
38 #include <libavutil/pixfmt.h>
40 #include <boost/thread.hpp>
44 #define LOG_GENERAL(...) log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
45 #define LOG_GENERAL_NC(...) log->log (__VA_ARGS__, LogEntry::TYPE_GENERAL);
50 using boost::shared_ptr;
52 /** @param v Version as used by FFmpeg.
53 * @return A string representation of v.
57 ffmpeg_version_to_string (int v)
60 s << ((v & 0xff0000) >> 16) << N_(".") << ((v & 0xff00) >> 8) << N_(".") << (v & 0xff);
65 /** Return a user-readable string summarising the versions of our dependencies */
68 dependency_version_summary ()
71 s << N_("libavcodec ") << ffmpeg_version_to_string (avcodec_version()) << N_(", ")
72 << N_("libavfilter ") << ffmpeg_version_to_string (avfilter_version()) << N_(", ")
73 << N_("libavformat ") << ffmpeg_version_to_string (avformat_version()) << N_(", ")
74 << N_("libavutil ") << ffmpeg_version_to_string (avutil_version()) << N_(", ")
75 << N_("libswscale ") << ffmpeg_version_to_string (swscale_version()) << N_(", ")
76 << MagickVersion << N_(", ")
77 << N_("libssh ") << ssh_version (0) << N_(", ")
78 << N_("libdcp ") << dcp::version << N_(" git ") << dcp::git_commit;
84 environment_info (shared_ptr<Log> log)
86 LOG_GENERAL ("DCP-o-matic %1 git %2 using %3", dcpomatic_version, dcpomatic_git_commit, dependency_version_summary());
90 gethostname (buffer, sizeof (buffer));
91 LOG_GENERAL ("Host name %1", buffer);
94 #ifdef DCPOMATIC_DEBUG
95 LOG_GENERAL_NC ("DCP-o-matic built in debug mode.");
97 LOG_GENERAL_NC ("DCP-o-matic built in optimised mode.");
100 LOG_GENERAL_NC ("libdcp built in debug mode.");
102 LOG_GENERAL_NC ("libdcp built in optimised mode.");
105 #ifdef DCPOMATIC_WINDOWS
107 info.dwOSVersionInfoSize = sizeof (info);
108 GetVersionEx (&info);
109 LOG_GENERAL ("Windows version %1.%2.%3 SP %4", info.dwMajorVersion, info.dwMinorVersion, info.dwBuildNumber, info.szCSDVersion);
114 LOG_GENERAL_NC ("Built for 64-bit");
116 LOG_GENERAL_NC ("Built for 32-bit");
120 LOG_GENERAL ("CPU: %1, %2 processors", cpu_info(), boost::thread::hardware_concurrency ());
121 list<pair<string, string> > const m = mount_info ();
122 for (list<pair<string, string> >::const_iterator i = m.begin(); i != m.end(); ++i) {
123 LOG_GENERAL ("Mount: %1 %2", i->first, i->second);