From 362068b534ffefcb87debd4d56b56645f3e25f21 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 24 Jun 2013 16:02:52 +0100 Subject: Add logging of mount formats in Linux. --- src/lib/cross.cc | 29 +++++++++++++++++++++++++++++ src/lib/cross.h | 3 ++- src/lib/film.cc | 5 +++++ 3 files changed, 36 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib/cross.cc b/src/lib/cross.cc index a642915f4..895fb0ac2 100644 --- a/src/lib/cross.cc +++ b/src/lib/cross.cc @@ -24,6 +24,7 @@ #include "log.h" #ifdef DVDOMATIC_POSIX #include +#include #endif #ifdef DVDOMATIC_WINDOWS #include @@ -35,8 +36,10 @@ #endif using std::pair; +using std::list; using std::ifstream; using std::string; +using std::make_pair; using boost::shared_ptr; void @@ -156,3 +159,29 @@ run_ffprobe (boost::filesystem::path content, boost::filesystem::path out, share system (ffprobe.c_str ()); #endif } + +list > +mount_info () +{ + list > m; + +#ifdef DVDOMATIC_POSIX + FILE* f = setmntent ("/etc/mtab", "r"); + if (!f) { + return m; + } + + while (1) { + struct mntent* mnt = getmntent (f); + if (!mnt) { + break; + } + + m.push_back (make_pair (mnt->mnt_dir, mnt->mnt_type)); + } + + endmntent (f); +#endif + + return m; +} diff --git a/src/lib/cross.h b/src/lib/cross.h index 1a7a8cb4d..d9cc2d12f 100644 --- a/src/lib/cross.h +++ b/src/lib/cross.h @@ -26,6 +26,7 @@ class Log; #define WEXITSTATUS(w) (w) #endif -void dvdomatic_sleep (int); +extern void dvdomatic_sleep (int); extern std::pair cpu_info (); extern void run_ffprobe (boost::filesystem::path, boost::filesystem::path, boost::shared_ptr); +extern std::list > mount_info (); diff --git a/src/lib/film.cc b/src/lib/film.cc index 3d9b3eeb4..c4dc9d830 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -68,6 +68,7 @@ using std::setfill; using std::min; using std::make_pair; using std::endl; +using std::list; using boost::shared_ptr; using boost::lexical_cast; using boost::to_upper_copy; @@ -329,6 +330,10 @@ Film::make_dcp () #endif pair const c = cpu_info (); log()->log (String::compose ("CPU: %1, %2 processors", c.first, c.second)); + list > const m = mount_info (); + for (list >::const_iterator i = m.begin(); i != m.end(); ++i) { + log()->log (String::compose ("Mount: %1 %2", i->first, i->second)); + } if (format() == 0) { throw MissingSettingError (_("format")); -- cgit v1.2.3 From 75305b8c7630c28d520d4c9006a5c4df7216cf82 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 28 Jun 2013 10:40:23 +0100 Subject: Use our own DirPicker on GTK 2.24.17 (which seems to have a bugs in its GtkFileChooserButton). --- src/wx/new_film_dialog.cc | 10 +++++++--- src/wx/new_film_dialog.h | 9 ++++++--- src/wx/wscript | 2 ++ wscript | 2 ++ 4 files changed, 17 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/wx/new_film_dialog.cc b/src/wx/new_film_dialog.cc index 191482a7c..91caa4963 100644 --- a/src/wx/new_film_dialog.cc +++ b/src/wx/new_film_dialog.cc @@ -21,7 +21,7 @@ #include #include "lib/config.h" #include "new_film_dialog.h" -#ifdef __WXMSW__ +#if defined(__WXMSW__) || (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION == 24 && GTK_MICRO_VERSION == 17) #include "dir_picker_ctrl.h" #endif #include "wx_util.h" @@ -46,8 +46,12 @@ NewFilmDialog::NewFilmDialog (wxWindow* parent) table->Add (_name, 1, wxEXPAND); add_label_to_sizer (table, this, _("Create in folder")); -#ifdef __WXMSW__ - _folder = new DirPickerCtrl (this); + + /* GTK 2.24.17 has a buggy GtkFileChooserButton and it was put in Ubuntu 13.04. + Use our own dir picker as this is the least bad option I can think of. + */ +#if defined(__WXMSW__) || (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION == 24 && GTK_MICRO_VERSION == 17) + _folder = new DirPickerCtrl (this); #else _folder = new wxDirPickerCtrl (this, wxDD_DIR_MUST_EXIST); #endif diff --git a/src/wx/new_film_dialog.h b/src/wx/new_film_dialog.h index bfcbd423c..70bb7945b 100644 --- a/src/wx/new_film_dialog.h +++ b/src/wx/new_film_dialog.h @@ -19,6 +19,9 @@ #include #include +#ifdef __WXGTK__ +#include +#endif class DirPickerCtrl; @@ -32,10 +35,10 @@ public: private: wxTextCtrl* _name; -#ifdef __WXMSW__ +#if defined(__WXMSW__) || (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION == 24 && GTK_MICRO_VERSION == 17) DirPickerCtrl* _folder; -#else +#else wxDirPickerCtrl* _folder; -#endif +#endif static boost::optional _directory; }; diff --git a/src/wx/wscript b/src/wx/wscript index 9213d7220..4bc79d6bb 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -52,6 +52,8 @@ def build(bld): obj.includes = [ '..' ] obj.export_includes = ['.'] obj.uselib = 'WXWIDGETS' + if bld.env.TARGET_LINUX: + obj.uselib += ' GTK' obj.use = 'libdvdomatic' obj.source = sources obj.target = 'dvdomatic-wx' diff --git a/wscript b/wscript index cfbaa09dd..db4d93e4d 100644 --- a/wscript +++ b/wscript @@ -112,6 +112,8 @@ def configure(conf): if conf.env.TARGET_LINUX: conf.check_cfg(package='liblzma', args='--cflags --libs', uselib_store='LZMA', mandatory=True) + # On Linux we need to be able to include to check GTK's version + conf.check_cfg(package='gtk+-2.0', args='--cflags', uselib_store='GTK', mandatory=True) conf.check_cfg(package = '', path = conf.options.magickpp_config, args = '--cppflags --cxxflags --libs', uselib_store = 'MAGICK', mandatory = True) -- cgit v1.2.3 From 1151383f93f1322409d533da203c6d517268b3ed Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 28 Jun 2013 13:12:28 +0100 Subject: Log state of use_content_audio when starting a DCP transcode. --- src/lib/film.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/lib/film.cc b/src/lib/film.cc index 6bc503dc1..ab0e6218e 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -318,6 +318,11 @@ Film::make_dcp () log()->log (String::compose ("Content at %1 fps, DCP at %2 fps", source_frame_rate(), dcp_frame_rate())); log()->log (String::compose ("%1 threads", Config::instance()->num_local_encoding_threads())); log()->log (String::compose ("J2K bandwidth %1", j2k_bandwidth())); + if (use_content_audio()) { + log()->log ("Using content's audio"); + } else { + log()->log (String::compose ("Using external audio (%1 files)", external_audio().size())); + } #ifdef DVDOMATIC_DEBUG log()->log ("DVD-o-matic built in debug mode."); #else -- cgit v1.2.3 From 1f6db0a540a160911cd6c73259a807bf0ba36be4 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 28 Jun 2013 14:40:27 +0100 Subject: A few OS X build/script fixes. --- platform/osx/waf | 6 +++--- run/makedcp-osx | 2 +- src/lib/cross.cc | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/platform/osx/waf b/platform/osx/waf index 7423eb973..dda678542 100755 --- a/platform/osx/waf +++ b/platform/osx/waf @@ -2,10 +2,10 @@ set -e -ENV=/Users/carl/Environments/osx/10.8 -DEPS=/Users/carl/cdist +ENV=/Users/carl/Environments/osx/64 +DEPS=/Users/carl/cdist/64 -export PKG_CONFIG_PATH=$DEPS/lib/pkgconfig:$ENV/lib/pkgconfig +export PKG_CONFIG_PATH=$DEPS/lib/pkgconfig:$ENV/lib/pkgconfig:/usr/lib/pkgconfig export LINKFLAGS="-L$ENV/lib" export CXXFLAGS="-I$ENV/include" export PATH=$PATH:$ENV/bin diff --git a/run/makedcp-osx b/run/makedcp-osx index 1b95ecc5d..03756f524 100755 --- a/run/makedcp-osx +++ b/run/makedcp-osx @@ -1,6 +1,6 @@ #!/bin/bash -export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:build/src/lib:build/src:/Users/carl/Environments/osx/10.8/lib +export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:build/src/lib:build/src:/Users/carl/Environments/osx/64/lib if [ "$1" == "--debug" ]; then shift gdb --args build/src/tools/makedcp "$@" diff --git a/src/lib/cross.cc b/src/lib/cross.cc index 86146c1b1..86b657432 100644 --- a/src/lib/cross.cc +++ b/src/lib/cross.cc @@ -22,7 +22,7 @@ #include "cross.h" #include "compose.hpp" #include "log.h" -#ifdef DVDOMATIC_POSIX +#ifdef DVDOMATIC_LINUX #include #include #endif @@ -165,7 +165,7 @@ mount_info () { list > m; -#ifdef DVDOMATIC_POSIX +#ifdef DVDOMATIC_LINUX FILE* f = setmntent ("/etc/mtab", "r"); if (!f) { return m; -- cgit v1.2.3 From 84fa37fa81adee2ab61a987d8f8f5bce0276e16a Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 28 Jun 2013 15:25:28 +0100 Subject: Some more logging for Mikkel. --- src/lib/film.cc | 6 ++++-- src/wx/film_editor.cc | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib/film.cc b/src/lib/film.cc index ab0e6218e..217673a7f 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -143,13 +143,13 @@ Film::Film (string d, bool must_exist) _sndfile_stream = SndfileStream::create (); + _log.reset (new FileLog (file ("log"))); + if (must_exist) { read_metadata (); } else { write_metadata (); } - - _log.reset (new FileLog (file ("log"))); } Film::Film (Film const & o) @@ -694,6 +694,8 @@ Film::read_metadata () } _dirty = false; + + _log->log (String::compose ("Loaded film with use_content_audio = %1", use_content_audio ())); } libdcp::Size diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index 6456ae247..dd952e22a 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -37,6 +37,7 @@ #include "lib/filter.h" #include "lib/config.h" #include "lib/ffmpeg_decoder.h" +#include "lib/log.h" #include "filter_dialog.h" #include "wx_util.h" #include "film_editor.h" @@ -765,6 +766,7 @@ FilmEditor::film_changed (Film::Property p) setup_frame_rate_description (); break; case Film::USE_CONTENT_AUDIO: + _film->log()->log (String::compose ("Film::USE_CONTENT_AUDIO changed; setting GUI using %1", _film->use_content_audio ())); checked_set (_use_content_audio, _film->use_content_audio()); checked_set (_use_external_audio, !_film->use_content_audio()); setup_dcp_name (); -- cgit v1.2.3