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>
26 #include <libssh/libssh.h>
27 #ifdef DCPOMATIC_IMAGE_MAGICK
28 #include <magick/MagickCore.h>
30 #include <magick/common.h>
31 #include <magick/magick_config.h>
33 #include <magick/version.h>
35 #include <libavcodec/avcodec.h>
36 #include <libavformat/avformat.h>
37 #include <libswscale/swscale.h>
38 #include <libavfilter/avfiltergraph.h>
39 #include <libavutil/pixfmt.h>
41 #include <boost/thread.hpp>
45 #define LOG_GENERAL(...) log->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL);
46 #define LOG_GENERAL_NC(...) log->log (__VA_ARGS__, Log::TYPE_GENERAL);
51 using boost::shared_ptr;
53 /** @param v Version as used by FFmpeg.
54 * @return A string representation of v.
58 ffmpeg_version_to_string (int v)
61 s << ((v & 0xff0000) >> 16) << N_(".") << ((v & 0xff00) >> 8) << N_(".") << (v & 0xff);
66 /** Return a user-readable string summarising the versions of our dependencies */
69 dependency_version_summary ()
72 s << N_("libopenjpeg ") << opj_version () << N_(", ")
73 << N_("libavcodec ") << ffmpeg_version_to_string (avcodec_version()) << N_(", ")
74 << N_("libavfilter ") << ffmpeg_version_to_string (avfilter_version()) << N_(", ")
75 << N_("libavformat ") << ffmpeg_version_to_string (avformat_version()) << N_(", ")
76 << N_("libavutil ") << ffmpeg_version_to_string (avutil_version()) << N_(", ")
77 << N_("libswscale ") << ffmpeg_version_to_string (swscale_version()) << N_(", ")
78 << MagickVersion << N_(", ")
79 << N_("libssh ") << ssh_version (0) << N_(", ")
80 << N_("libdcp ") << dcp::version << N_(" git ") << dcp::git_commit;
86 environment_info (shared_ptr<Log> log)
88 LOG_GENERAL ("DCP-o-matic %1 git %2 using %3", dcpomatic_version, dcpomatic_git_commit, dependency_version_summary());
92 gethostname (buffer, sizeof (buffer));
93 LOG_GENERAL ("Host name %1", buffer);
96 #ifdef DCPOMATIC_DEBUG
97 LOG_GENERAL_NC ("DCP-o-matic built in debug mode.");
99 LOG_GENERAL_NC ("DCP-o-matic built in optimised mode.");
102 LOG_GENERAL_NC ("libdcp built in debug mode.");
104 LOG_GENERAL_NC ("libdcp built in optimised mode.");
107 #ifdef DCPOMATIC_WINDOWS
109 info.dwOSVersionInfoSize = sizeof (info);
110 GetVersionEx (&info);
111 LOG_GENERAL ("Windows version %1.%2.%3 SP %4", info.dwMajorVersion, info.dwMinorVersion, info.dwBuildNumber, info.szCSDVersion);
116 LOG_GENERAL_NC ("Built for 64-bit");
118 LOG_GENERAL_NC ("Built for 32-bit");
122 LOG_GENERAL ("CPU: %1, %2 processors", cpu_info(), boost::thread::hardware_concurrency ());
123 list<pair<string, string> > const m = mount_info ();
124 for (list<pair<string, string> >::const_iterator i = m.begin(); i != m.end(); ++i) {
125 LOG_GENERAL ("Mount: %1 %2", i->first, i->second);