#include <magick/MagickCore.h>
#include <magick/version.h>
#include <libdcp/version.h>
+#include <libdcp/util.h>
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
void
dvdomatic_setup ()
{
+ libdcp::init ();
+
Format::setup_formats ();
DCPContentType::setup_dcp_content_types ();
Scaler::setup_scalers ();
return 96000;
}
+int
+dcp_audio_channels (int f)
+{
+ if (f == 1) {
+ /* The source is mono, so to put the mono channel into
+ the centre we need to generate a 5.1 soundtrack.
+ */
+ return 6;
+ }
+
+ return f;
+}
+
+
bool operator== (Size const & a, Size const & b)
{
return (a.width == b.width && a.height == b.height);
}
+bool operator!= (Size const & a, Size const & b)
+{
+ return !(a == b);
+}
+
bool operator== (Crop const & a, Crop const & b)
{
return (a.left == b.left && a.right == b.right && a.top == b.top && a.bottom == b.bottom);
void
Socket::connect (asio::ip::basic_resolver_entry<asio::ip::tcp> const & endpoint, int timeout)
{
+ _deadline.expires_from_now (posix_time::seconds (timeout));
system::error_code ec = asio::error::would_block;
_socket.async_connect (endpoint, lambda::var(ec) = lambda::_1);
do {
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;
+}