#include "audio_decoder.h"
#include "audio_buffers.h"
#include "audio_content.h"
+#include "dcpomatic_log.h"
#include "log.h"
#include "resampler.h"
#include "compose.hpp"
#include "i18n.h"
-#define LOG_GENERAL(...) dcpomatic_log->log (String::compose(__VA_ARGS__), LogEntry::TYPE_GENERAL);
-
using std::cout;
using std::map;
using std::pair;
#include "player.h"
#include "util.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "cross.h"
#include "compose.hpp"
#include "exceptions.h"
#include <boost/weak_ptr.hpp>
#include <boost/shared_ptr.hpp>
-#define LOG_TIMING(...) _log->log (String::compose(__VA_ARGS__), LogEntry::TYPE_TIMING);
-#define LOG_WARNING(...) _log->log (String::compose(__VA_ARGS__), LogEntry::TYPE_WARNING);
-
using std::cout;
using std::pair;
using std::make_pair;
*/
Butler::Butler (
shared_ptr<Player> player,
- shared_ptr<Log> log,
AudioMapping audio_mapping,
int audio_channels,
function<AVPixelFormat (AVPixelFormat)> pixel_format,
bool fast
)
: _player (player)
- , _log (log)
, _prepare_work (new boost::asio::io_service::work (_prepare_service))
, _pending_seek_accurate (false)
, _suspended (0)
multi-thread JPEG2000 decoding.
*/
- if (_log) {
- LOG_TIMING("start-prepare-threads %1", boost::thread::hardware_concurrency() * 2);
- }
+ LOG_TIMING("start-prepare-threads %1", boost::thread::hardware_concurrency() * 2);
for (size_t i = 0; i < boost::thread::hardware_concurrency() * 2; ++i) {
_prepare_pool.create_thread (bind (&boost::asio::io_service::run, &_prepare_service));
(__FILE__, __LINE__, String::compose ("Butler audio buffers reached %1 frames (video is %2)", _audio.size(), _video.size()));
}
- if (_video.size() >= MAXIMUM_VIDEO_READAHEAD * 2 && _log) {
+ if (_video.size() >= MAXIMUM_VIDEO_READAHEAD * 2) {
LOG_WARNING ("Butler video buffers reached %1 frames (audio is %2)", _video.size(), _audio.size());
}
- if (_audio.size() >= MAXIMUM_AUDIO_READAHEAD * 2 && _log) {
+ if (_audio.size() >= MAXIMUM_AUDIO_READAHEAD * 2) {
LOG_WARNING ("Butler audio buffers reached %1 frames (video is %2)", _audio.size(), _video.size());
}
shared_ptr<PlayerVideo> video = weak_video.lock ();
/* If the weak_ptr cannot be locked the video obviously no longer requires any work */
if (video) {
- if (_log) {
- LOG_TIMING("start-prepare in %1", thread_id());
- }
-
+ LOG_TIMING("start-prepare in %1", thread_id());
video->prepare (_pixel_format, _aligned, _fast);
-
- if (_log) {
- LOG_TIMING("finish-prepare in %1", thread_id());
- }
+ LOG_TIMING("finish-prepare in %1", thread_id());
}
}
class Player;
class PlayerVideo;
-class Log;
class Butler : public ExceptionStore, public boost::noncopyable
{
public:
Butler (
boost::shared_ptr<Player> player,
- boost::shared_ptr<Log> log,
AudioMapping map,
int audio_channels,
boost::function<AVPixelFormat (AVPixelFormat)> pixel_format,
void seek_unlocked (DCPTime position, bool accurate);
boost::shared_ptr<Player> _player;
- boost::shared_ptr<Log> _log;
boost::thread* _thread;
/** mutex to protect _video, _audio and _closed_caption for when we are clearing them and they all need to be
#include "emailer.h"
#include "compose.hpp"
#include "log.h"
+#include "dcpomatic_log.h"
#include <zip.h>
#include <boost/foreach.hpp>
* @param filename_format Format of filenames to use.
* @param name_values Values to substitute into \p container_name_format and \p filename_format.
* @param cpl_name Name of the CPL that the KDMs are for.
- * @param log Log to write email session transcript to, or 0.
*/
void
CinemaKDMs::email (
dcp::NameFormat container_name_format,
dcp::NameFormat filename_format,
dcp::NameFormat::Map name_values,
- string cpl_name,
- shared_ptr<Log> log
+ string cpl_name
)
{
Config* config = Config::instance ();
email.send (c->mail_server(), c->mail_port(), c->mail_user(), c->mail_password());
} catch (...) {
boost::filesystem::remove (zip_file);
- if (log) {
- log->log ("Email content follows", LogEntry::TYPE_DEBUG_EMAIL);
- log->log (email.email(), LogEntry::TYPE_DEBUG_EMAIL);
- log->log ("Email session follows", LogEntry::TYPE_DEBUG_EMAIL);
- log->log (email.notes(), LogEntry::TYPE_DEBUG_EMAIL);
- }
+ dcpomatic_log->log ("Email content follows", LogEntry::TYPE_DEBUG_EMAIL);
+ dcpomatic_log->log (email.email(), LogEntry::TYPE_DEBUG_EMAIL);
+ dcpomatic_log->log ("Email session follows", LogEntry::TYPE_DEBUG_EMAIL);
+ dcpomatic_log->log (email.notes(), LogEntry::TYPE_DEBUG_EMAIL);
throw;
}
boost::filesystem::remove (zip_file);
- if (log) {
- log->log ("Email content follows", LogEntry::TYPE_DEBUG_EMAIL);
- log->log (email.email(), LogEntry::TYPE_DEBUG_EMAIL);
- log->log ("Email session follows", LogEntry::TYPE_DEBUG_EMAIL);
- log->log (email.notes(), LogEntry::TYPE_DEBUG_EMAIL);
- }
+ dcpomatic_log->log ("Email content follows", LogEntry::TYPE_DEBUG_EMAIL);
+ dcpomatic_log->log (email.email(), LogEntry::TYPE_DEBUG_EMAIL);
+ dcpomatic_log->log ("Email session follows", LogEntry::TYPE_DEBUG_EMAIL);
+ dcpomatic_log->log (email.notes(), LogEntry::TYPE_DEBUG_EMAIL);
}
}
dcp::NameFormat container_name_format,
dcp::NameFormat filename_format,
dcp::NameFormat::Map name_values,
- std::string cpl_name,
- boost::shared_ptr<Log> log
+ std::string cpl_name
);
boost::shared_ptr<Cinema> cinema;
#include "video_mxf_content.h"
#include "film.h"
#include "log_entry.h"
+#include "dcpomatic_log.h"
#include "log.h"
#include "compose.hpp"
#include <libcxml/cxml.h>
using boost::shared_ptr;
using boost::optional;
-#define LOG_GENERAL(...) dcpomatic_log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-
/** Create a Content object from an XML node.
* @param node XML description.
* @param version XML state version.
#include "cross.h"
#include "compose.hpp"
#include "log.h"
+#include "dcpomatic_log.h"
#include "config.h"
#include "exceptions.h"
extern "C" {
#include "i18n.h"
-#define LOG_GENERAL(...) log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-#define LOG_ERROR(...) log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_ERROR);
-#define LOG_ERROR_NC(...) log->log (__VA_ARGS__, LogEntry::TYPE_ERROR);
-
using std::pair;
using std::list;
using std::ifstream;
}
void
-run_ffprobe (boost::filesystem::path content, boost::filesystem::path out, shared_ptr<Log> log)
+run_ffprobe (boost::filesystem::path content, boost::filesystem::path out)
{
#ifdef DCPOMATIC_WINDOWS
SECURITY_ATTRIBUTES security;
void dcpomatic_sleep (int);
extern std::string cpu_info ();
-extern void run_ffprobe (boost::filesystem::path, boost::filesystem::path, boost::shared_ptr<Log>);
+extern void run_ffprobe (boost::filesystem::path, boost::filesystem::path);
extern std::list<std::pair<std::string, std::string> > mount_info ();
extern boost::filesystem::path openssl_path ();
#ifdef DCPOMATIC_OSX
#include "config.h"
#include "film.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "compose.hpp"
#include "dcp_content.h"
#include <dcp/dcp.h>
using std::string;
using boost::shared_ptr;
-#define LOG_GENERAL(...) dcpomatic_log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-
/** Find all the CPLs in our directories, cross-add assets and return the CPLs */
list<shared_ptr<dcp::CPL> >
DCP::cpls () const
#include "compose.hpp"
#include "dcp_decoder.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "text_content.h"
#include <dcp/dcp.h>
#include <dcp/raw_convert.h>
int const DCPContentProperty::TEXTS = 606;
int const DCPContentProperty::CPL = 607;
-#define LOG_GENERAL(...) dcpomatic_log->log(String::compose(__VA_ARGS__), LogEntry::TYPE_GENERAL);
-
DCPContent::DCPContent (boost::filesystem::path p)
: _encrypted (false)
, _needs_assets (false)
#include "dcpomatic_socket.h"
#include "image.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "cross.h"
#include "player_video.h"
#include "compose.hpp"
#include <iomanip>
#include <iostream>
-#define LOG_GENERAL(...) _log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-#define LOG_DEBUG_ENCODE(...) _log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_DEBUG_ENCODE);
-#define LOG_TIMING(...) _log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_TIMING);
-
#include "i18n.h"
using std::string;
* @param frame Input frame.
* @param index Index of the frame within the DCP.
* @param bw J2K bandwidth to use (see Config::j2k_bandwidth ())
- * @param l Log to write to.
*/
DCPVideo::DCPVideo (
- shared_ptr<const PlayerVideo> frame, int index, int dcp_fps, int bw, Resolution r, shared_ptr<Log> l
+ shared_ptr<const PlayerVideo> frame, int index, int dcp_fps, int bw, Resolution r
)
: _frame (frame)
, _index (index)
, _frames_per_second (dcp_fps)
, _j2k_bandwidth (bw)
, _resolution (r)
- , _log (l)
{
}
-DCPVideo::DCPVideo (shared_ptr<const PlayerVideo> frame, shared_ptr<const cxml::Node> node, shared_ptr<Log> log)
+DCPVideo::DCPVideo (shared_ptr<const PlayerVideo> frame, shared_ptr<const cxml::Node> node)
: _frame (frame)
- , _log (log)
{
_index = node->number_child<int> ("Index");
_frames_per_second = node->number_child<int> ("FramesPerSecond");
* @return Encoded data.
*/
Data
-DCPVideo::encode_locally (dcp::NoteHandler note)
+DCPVideo::encode_locally ()
{
Data enc = compress_j2k (
- convert_to_xyz (_frame, note),
+ convert_to_xyz (_frame, boost::bind(&Log::dcp_log, dcpomatic_log.get(), _1, _2)),
_j2k_bandwidth,
_frames_per_second,
_frame->eyes() == EYES_LEFT || _frame->eyes() == EYES_RIGHT,
class DCPVideo : public boost::noncopyable
{
public:
- DCPVideo (boost::shared_ptr<const PlayerVideo>, int, int, int, Resolution, boost::shared_ptr<Log>);
- DCPVideo (boost::shared_ptr<const PlayerVideo>, cxml::ConstNodePtr, boost::shared_ptr<Log>);
+ DCPVideo (boost::shared_ptr<const PlayerVideo>, int, int, int, Resolution);
+ DCPVideo (boost::shared_ptr<const PlayerVideo>, cxml::ConstNodePtr);
- dcp::Data encode_locally (dcp::NoteHandler note);
+ dcp::Data encode_locally ();
dcp::Data encode_remotely (EncodeServerDescription, int timeout = 30);
int index () const {
int _frames_per_second; ///< Frames per second that we will use for the DCP
int _j2k_bandwidth; ///< J2K bandwidth to use
Resolution _resolution; ///< Resolution (2K or 4K)
-
- boost::shared_ptr<Log> _log; ///< log
};
#include "player_video.h"
#include "compose.hpp"
#include "log.h"
+#include "dcpomatic_log.h"
#include "encoded_log_entry.h"
#include "version.h"
#include <dcp/raw_convert.h>
#include "i18n.h"
-#define LOG_GENERAL(...) _log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-#define LOG_GENERAL_NC(...) _log->log (__VA_ARGS__, LogEntry::TYPE_GENERAL);
-#define LOG_ERROR(...) _log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_ERROR);
-#define LOG_ERROR_NC(...) _log->log (__VA_ARGS__, LogEntry::TYPE_ERROR);
-
using std::string;
using std::vector;
using std::list;
using dcp::Data;
using dcp::raw_convert;
-EncodeServer::EncodeServer (shared_ptr<Log> log, bool verbose, int num_threads)
+EncodeServer::EncodeServer (bool verbose, int num_threads)
#if !defined(RUNNING_ON_VALGRIND) || RUNNING_ON_VALGRIND == 0
: Server (ENCODE_FRAME_PORT)
#else
: Server (ENCODE_FRAME_PORT, 2400)
#endif
- , _log (log)
, _verbose (verbose)
, _num_threads (num_threads)
{
shared_ptr<PlayerVideo> pvf (new PlayerVideo (xml, socket));
- DCPVideo dcp_video_frame (pvf, xml, _log);
+ DCPVideo dcp_video_frame (pvf, xml);
gettimeofday (&after_read, 0);
- Data encoded = dcp_video_frame.encode_locally (boost::bind (&Log::dcp_log, _log.get(), _1, _2));
+ Data encoded = dcp_video_frame.encode_locally ();
gettimeofday (&after_encode, 0);
cout << e->get() << "\n";
}
- _log->log (e);
+ dcpomatic_log->log (e);
}
_full_condition.notify_all ();
class EncodeServer : public Server, public ExceptionStore
{
public:
- EncodeServer (boost::shared_ptr<Log> log, bool verbose, int num_threads);
+ EncodeServer (bool verbose, int num_threads);
~EncodeServer ();
void run ();
std::list<boost::shared_ptr<Socket> > _queue;
boost::condition _full_condition;
boost::condition _empty_condition;
- boost::shared_ptr<Log> _log;
bool _verbose;
int _num_threads;
#include "i18n.h"
-#define LOG_GENERAL(...) log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-#define LOG_GENERAL_NC(...) log->log (__VA_ARGS__, LogEntry::TYPE_GENERAL);
-
using std::string;
using std::list;
using std::pair;
#include "exceptions.h"
#include "util.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "ffmpeg_subtitle_stream.h"
#include "ffmpeg_audio_stream.h"
#include "digester.h"
using dcp::raw_convert;
boost::mutex FFmpeg::_mutex;
-boost::weak_ptr<Log> FFmpeg::_ffmpeg_log;
FFmpeg::FFmpeg (boost::shared_ptr<const FFmpegContent> c)
: _ffmpeg_content (c)
char line[1024];
static int prefix = 0;
av_log_format_line (ptr, level, fmt, vl, line, sizeof (line), &prefix);
- shared_ptr<Log> log = _ffmpeg_log.lock ();
- if (log) {
- string str (line);
- boost::algorithm::trim (str);
- log->log (String::compose ("FFmpeg: %1", str), LogEntry::TYPE_GENERAL);
- } else {
- cerr << line;
- }
+ string str (line);
+ boost::algorithm::trim (str);
+ dcpomatic_log->log (String::compose ("FFmpeg: %1", str), LogEntry::TYPE_GENERAL);
}
void
#include "i18n.h"
-#define LOG_GENERAL(...) dcpomatic_log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-
using std::string;
using std::vector;
using std::list;
#include "image.h"
#include "util.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "ffmpeg_decoder.h"
#include "text_decoder.h"
#include "ffmpeg_audio_stream.h"
#include "i18n.h"
-#define LOG_GENERAL(...) dcpomatic_log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-#define LOG_ERROR(...) dcpomatic_log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_ERROR);
-#define LOG_WARNING_NC(...) dcpomatic_log->log (__VA_ARGS__, LogEntry::TYPE_WARNING);
-#define LOG_WARNING(...) dcpomatic_log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_WARNING);
using std::cout;
using std::string;
_film->video_frame_rate(),
_film->audio_frame_rate(),
mixdown_to_stereo ? 2 : film->audio_channels(),
- _film->log(),
format,
x264_crf,
_film->three_d(),
}
}
- _butler.reset (new Butler (_player, film->log(), map, _output_audio_channels, bind(&PlayerVideo::force, _1, FFmpegFileEncoder::pixel_format(format)), true, false));
+ _butler.reset (new Butler(_player, map, _output_audio_channels, bind(&PlayerVideo::force, _1, FFmpegFileEncoder::pixel_format(format)), true, false));
}
void
int video_frame_rate,
int audio_frame_rate,
int channels,
- shared_ptr<Log> log,
ExportFormat format,
int x264_crf,
bool three_d,
if (three_d) {
/// TRANSLATORS: L here is an abbreviation for "left", to indicate the left-eye part of a 3D export
_encoders[EYES_LEFT] = shared_ptr<FFmpegFileEncoder>(
- new FFmpegFileEncoder(video_frame_size, video_frame_rate, audio_frame_rate, channels, log, format, x264_crf, String::compose("%1_%2%3", output.string(), _("L"), extension))
+ new FFmpegFileEncoder(video_frame_size, video_frame_rate, audio_frame_rate, channels, format, x264_crf, String::compose("%1_%2%3", output.string(), _("L"), extension))
);
/// TRANSLATORS: R here is an abbreviation for "left", to indicate the left-eye part of a 3D export
_encoders[EYES_RIGHT] = shared_ptr<FFmpegFileEncoder>(
- new FFmpegFileEncoder(video_frame_size, video_frame_rate, audio_frame_rate, channels, log, format, x264_crf, String::compose("%1_%2%3", output.string(), _("R"), extension))
+ new FFmpegFileEncoder(video_frame_size, video_frame_rate, audio_frame_rate, channels, format, x264_crf, String::compose("%1_%2%3", output.string(), _("R"), extension))
);
} else {
_encoders[EYES_BOTH] = shared_ptr<FFmpegFileEncoder>(
- new FFmpegFileEncoder(video_frame_size, video_frame_rate, audio_frame_rate, channels, log, format, x264_crf, String::compose("%1%2", output.string(), extension))
+ new FFmpegFileEncoder(video_frame_size, video_frame_rate, audio_frame_rate, channels, format, x264_crf, String::compose("%1%2", output.string(), extension))
);
}
}
int video_frame_rate,
int audio_frame_rate,
int channels,
- boost::shared_ptr<Log> log,
ExportFormat,
int x264_crf,
bool three_d,
int video_frame_rate,
int audio_frame_rate,
int channels,
- shared_ptr<Log> log,
ExportFormat format,
int x264_crf,
boost::filesystem::path output
, _video_frame_size (video_frame_size)
, _video_frame_rate (video_frame_rate)
, _audio_frame_rate (audio_frame_rate)
- , _log (log)
{
_pixel_format = pixel_format (format);
int video_frame_rate,
int audio_frame_rate,
int channels,
- boost::shared_ptr<Log> log,
ExportFormat,
int x264_crf,
boost::filesystem::path output
dcp::Size _video_frame_size;
int _video_frame_rate;
int _audio_frame_rate;
- boost::shared_ptr<Log> _log;
boost::shared_ptr<AudioBuffers> _pending_audio;
#include "upload_job.h"
#include "null_log.h"
#include "file_log.h"
+#include "dcpomatic_log.h"
#include "exceptions.h"
#include "examine_content_job.h"
#include "config.h"
using boost::is_any_of;
using dcp::raw_convert;
-#define LOG_GENERAL(...) log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-#define LOG_GENERAL_NC(...) log()->log (__VA_ARGS__, LogEntry::TYPE_GENERAL);
-
string const Film::metadata_file = "metadata.xml";
/* 5 -> 6
Film::examine_and_add_content (shared_ptr<Content> content, bool disable_audio_analysis)
{
if (dynamic_pointer_cast<FFmpegContent> (content) && _directory) {
- run_ffprobe (content->path(0), file ("ffprobe.log"), _log);
+ run_ffprobe (content->path(0), file("ffprobe.log"));
}
shared_ptr<Job> j (new ExamineContentJob (shared_from_this(), content));
#include "util.h"
#include "film.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "config.h"
#include "dcp_video.h"
#include "cross.h"
#include "i18n.h"
-#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-#define LOG_GENERAL_NC(...) _film->log()->log (__VA_ARGS__, LogEntry::TYPE_GENERAL);
-#define LOG_ERROR(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_ERROR);
-#define LOG_TIMING(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_TIMING);
-#define LOG_DEBUG_ENCODE(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_DEBUG_ENCODE);
-
using std::list;
using std::cout;
using boost::shared_ptr;
LOG_GENERAL (N_("Encode left-over frame %1"), (*i)->index ());
try {
_writer->write (
- (*i)->encode_locally (boost::bind (&Log::dcp_log, _film->log().get(), _1, _2)),
- (*i)->index (),
- (*i)->eyes ()
+ (*i)->encode_locally(),
+ (*i)->index(),
+ (*i)->eyes()
);
frame_done ();
} catch (std::exception& e) {
position,
_film->video_frame_rate(),
_film->j2k_bandwidth(),
- _film->resolution(),
- _film->log()
+ _film->resolution()
)
));
} else {
try {
LOG_TIMING ("start-local-encode thread=%1 frame=%2", thread_id(), vf->index());
- encoded = vf->encode_locally (boost::bind (&Log::dcp_log, _film->log().get(), _1, _2));
+ encoded = vf->encode_locally ();
LOG_TIMING ("finish-local-encode thread=%1 frame=%2", thread_id(), vf->index());
} catch (std::exception& e) {
/* This is very bad, so don't cope with it, just pass it on */
#include "exceptions.h"
#include "film.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "compose.hpp"
#include <dcp/exceptions.h>
#include <sub/exceptions.h>
using boost::optional;
using boost::function;
-#define LOG_ERROR_NC(...) if (_film) { _film->log()->log (__VA_ARGS__, LogEntry::TYPE_ERROR); }
-#define LOG_GENERAL(...) if (_film) { _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL); }
-
/** @param film Associated film, or 0 */
Job::Job (shared_ptr<const Film> film)
: _film (film)
using std::cout;
using boost::shared_ptr;
-boost::shared_ptr<Log> dcpomatic_log;
-
Log::Log ()
: _types (0)
{
boost::signals2::scoped_connection _config_connection;
};
-extern boost::shared_ptr<Log> dcpomatic_log;
-
#endif
#include "i18n.h"
-#define LOG_GENERAL(...) dcpomatic_log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-
using std::list;
using std::cout;
using std::min;
#include "cross.h"
#include "job.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "digester.h"
#include "font.h"
#include "compose.hpp"
#include "i18n.h"
-#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-#define LOG_GENERAL_NC(...) _film->log()->log (__VA_ARGS__, LogEntry::TYPE_GENERAL);
-#define LOG_WARNING_NC(...) _film->log()->log (__VA_ARGS__, LogEntry::TYPE_WARNING);
-#define LOG_ERROR(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_ERROR);
-
using std::list;
using std::string;
using std::cout;
* @param filename_format Format to use for filenames.
* @param name_values Values to substitute into \p container_name_format and \p filename_format.
* @param cpl_name Name of the CPL that the KDMs are for.
- * @param log Log to write to, or 0.
*/
SendKDMEmailJob::SendKDMEmailJob (
list<CinemaKDMs> cinema_kdms,
dcp::NameFormat container_name_format,
dcp::NameFormat filename_format,
dcp::NameFormat::Map name_values,
- string cpl_name,
- shared_ptr<Log> log
+ string cpl_name
)
: Job (shared_ptr<Film>())
, _container_name_format (container_name_format)
, _name_values (name_values)
, _cpl_name (cpl_name)
, _cinema_kdms (cinema_kdms)
- , _log (log)
{
}
SendKDMEmailJob::run ()
{
set_progress_unknown ();
- CinemaKDMs::email (_cinema_kdms, _container_name_format, _filename_format, _name_values, _cpl_name, _log);
+ CinemaKDMs::email (_cinema_kdms, _container_name_format, _filename_format, _name_values, _cpl_name);
set_progress (1);
set_state (FINISHED_OK);
}
dcp::NameFormat container_name_format,
dcp::NameFormat filename_format,
dcp::NameFormat::Map name_values,
- std::string cpl_name,
- boost::shared_ptr<Log> log
+ std::string cpl_name
);
std::string name () const;
dcp::NameFormat::Map _name_values;
std::string _cpl_name;
std::list<CinemaKDMs> _cinema_kdms;
- boost::shared_ptr<Log> _log;
};
#include "film.h"
#include "encoder.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "compose.hpp"
#include <iostream>
#include <iomanip>
#include "i18n.h"
-#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-#define LOG_GENERAL_NC(...) _film->log()->log (__VA_ARGS__, LogEntry::TYPE_GENERAL);
-#define LOG_ERROR_NC(...) _film->log()->log (__VA_ARGS__, LogEntry::TYPE_ERROR);
-
using std::string;
using std::fixed;
using std::setprecision;
#include "upload_job.h"
#include "config.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "film.h"
#include "scp_uploader.h"
#include "curl_uploader.h"
#include "i18n.h"
-#define LOG_GENERAL_NC(...) _film->log()->log (__VA_ARGS__, LogEntry::TYPE_GENERAL);
-
using std::string;
using std::min;
using boost::shared_ptr;
#include "exceptions.h"
#include "frame_rate_change.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
#include "i18n.h"
-#define LOG_GENERAL(...) dcpomatic_log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-
int const VideoContentProperty::SIZE = 0;
int const VideoContentProperty::FRAME_TYPE = 1;
int const VideoContentProperty::CROP = 2;
#include "film.h"
#include "ratio.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "dcp_video.h"
#include "dcp_content_type.h"
#include "audio_mapping.h"
#include "i18n.h"
-#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-#define LOG_GENERAL_NC(...) _film->log()->log (__VA_ARGS__, LogEntry::TYPE_GENERAL);
-#define LOG_DEBUG_ENCODE(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_DEBUG_ENCODE);
-#define LOG_TIMING(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_TIMING);
-#define LOG_WARNING_NC(...) _film->log()->log (__VA_ARGS__, LogEntry::TYPE_WARNING);
-#define LOG_WARNING(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_WARNING);
-#define LOG_ERROR(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_ERROR);
-
/* OS X strikes again */
#undef set_key
dcp_subtitle_decoder.cc
dcp_text_track.cc
dcp_video.cc
+ dcpomatic_log.cc
dcpomatic_socket.cc
dcpomatic_time.cc
decoder.cc
#include "lib/audio_content.h"
#include "lib/check_content_change_job.h"
#include "lib/text_content.h"
+#include "lib/dcpomatic_log.h"
#include <dcp/exceptions.h>
#include <dcp/raw_convert.h>
#include <wx/generic/aboutdlgg.h>
film->set_name (path.filename().generic_string());
film->write_metadata ();
set_film (film);
+ dcpomatic_log = film->log ();
}
void load_film (boost::filesystem::path file)
#include "lib/ratio.h"
#include "lib/video_content.h"
#include "lib/audio_content.h"
+#include "lib/dcpomatic_log.h"
#include <dcp/version.h>
#include <boost/foreach.hpp>
#include <getopt.h>
exit (EXIT_SUCCESS);
}
+ dcpomatic_log = film->log ();
+
ContentList content = film->content ();
for (ContentList::const_iterator i = content.begin(); i != content.end(); ++i) {
vector<boost::filesystem::path> paths = (*i)->paths ();
}
pair<shared_ptr<Job>, int> result = _output->make (
- screen_kdms, decrypted.content_title_text(), _timing, bind (&DOMFrame::confirm_overwrite, this, _1), shared_ptr<Log> ()
+ screen_kdms, decrypted.content_title_text(), _timing, bind (&DOMFrame::confirm_overwrite, this, _1)
);
if (result.first) {
#include "lib/monitor_checker.h"
#include "lib/lock_file_checker.h"
#include "lib/ffmpeg_content.h"
+#include "lib/dcpomatic_log.h"
#include <dcp/dcp.h>
#include <dcp/raw_convert.h>
#include <dcp/exceptions.h>
#include "lib/log.h"
#include "lib/signaller.h"
#include "lib/cross.h"
+#include "lib/dcpomatic_log.h"
#include <wx/taskbar.h>
#include <wx/splash.h>
#include <wx/icon.h>
}
server_log.reset (new ServerLog);
+ dcpomatic_log = server_log;
Config::FailedToLoad.connect (boost::bind (&App::config_failed_to_load, this));
Config::Warning.connect (boost::bind (&App::config_warning, this, _1));
void main_thread ()
try {
- EncodeServer server (server_log, false, Config::instance()->server_encoding_threads());
+ EncodeServer server (false, Config::instance()->server_encoding_threads());
server.run ();
} catch (...) {
store_current ();
#include "lib/null_log.h"
#include "lib/version.h"
#include "lib/encode_server.h"
+#include "lib/dcpomatic_log.h"
#include <boost/array.hpp>
#include <boost/asio.hpp>
#include <boost/algorithm/string.hpp>
}
}
- shared_ptr<Log> log;
if (write_log) {
- log.reset (new FileLog ("dcpomatic_server_cli.log"));
- } else {
- log.reset (new NullLog);
+ dcpomatic_log.reset (new FileLog("dcpomatic_server_cli.log"));
}
- EncodeServer server (log, verbose, num_threads);
+ EncodeServer server (verbose, num_threads);
try {
server.run ();
static shared_ptr<Film> film;
static EncodeServerDescription* server;
-static shared_ptr<FileLog> log_ (new FileLog ("servomatictest.log"));
static int frame_count = 0;
void
process_video (shared_ptr<PlayerVideo> pvf)
{
- shared_ptr<DCPVideo> local (new DCPVideo (pvf, frame_count, film->video_frame_rate(), 250000000, RESOLUTION_2K, log_));
- shared_ptr<DCPVideo> remote (new DCPVideo (pvf, frame_count, film->video_frame_rate(), 250000000, RESOLUTION_2K, log_));
+ shared_ptr<DCPVideo> local (new DCPVideo (pvf, frame_count, film->video_frame_rate(), 250000000, RESOLUTION_2K));
+ shared_ptr<DCPVideo> remote (new DCPVideo (pvf, frame_count, film->video_frame_rate(), 250000000, RESOLUTION_2K));
cout << "Frame " << frame_count << ": ";
cout.flush ();
++frame_count;
- Data local_encoded = local->encode_locally (boost::bind (&Log::dcp_log, log_.get(), _1, _2));
+ Data local_encoded = local->encode_locally ();
Data remote_encoded;
string remote_error;
#include "lib/compose.hpp"
#include "lib/string_text_file_content.h"
#include "lib/string_text_file.h"
+#include "lib/dcpomatic_log.h"
#include <wx/wx.h>
#include <wx/notebook.h>
#include <wx/listctrl.h>
using boost::dynamic_pointer_cast;
using boost::optional;
-#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-
ContentPanel::ContentPanel (wxNotebook* n, shared_ptr<Film> film, weak_ptr<FilmViewer> viewer)
: _video_panel (0)
, _audio_panel (0)
map.set (dcp::RS, 1, 1 / sqrt(2)); // Rs -> Rt
}
- _butler.reset (new Butler(_player, _film->log(), map, _audio_channels, bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, true));
+ _butler.reset (new Butler(_player, map, _audio_channels, bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, true));
if (!Config::instance()->sound() && !_audio.isStreamOpen()) {
_butler->disable_audio ();
}
return;
}
- pair<shared_ptr<Job>, int> result = _output->make (screen_kdms, film->name(), _timing, bind (&KDMDialog::confirm_overwrite, this, _1), film->log());
+ pair<shared_ptr<Job>, int> result = _output->make (screen_kdms, film->name(), _timing, bind (&KDMDialog::confirm_overwrite, this, _1));
if (result.first) {
JobManager::instance()->add (result.first);
}
pair<shared_ptr<Job>, int>
KDMOutputPanel::make (
- list<ScreenKDM> screen_kdms, string name, KDMTimingPanel* timing, function<bool (boost::filesystem::path)> confirm_overwrite, shared_ptr<Log> log
+ list<ScreenKDM> screen_kdms, string name, KDMTimingPanel* timing, function<bool (boost::filesystem::path)> confirm_overwrite
)
{
list<CinemaKDMs> const cinema_kdms = CinemaKDMs::collect (screen_kdms);
_container_name_format->get(),
_filename_format->get(),
name_values,
- name,
- log
+ name
)
);
}
std::list<ScreenKDM> screen_kdms,
std::string name,
KDMTimingPanel* timing,
- boost::function<bool (boost::filesystem::path)> confirm_overwrite,
- boost::shared_ptr<Log> log
+ boost::function<bool (boost::filesystem::path)> confirm_overwrite
);
private:
map.set (i, i, 1);
}
- Butler butler (shared_ptr<Player>(new Player(film, film->playlist())), film->log(), map, 6, bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, false);
+ Butler butler (shared_ptr<Player>(new Player(film, film->playlist())), map, 6, bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, false);
BOOST_CHECK (butler.get_video().second == DCPTime());
BOOST_CHECK (butler.get_video().second == DCPTime::from_frames(1, 24));
/*
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
#include "lib/j2k_image_proxy.h"
#include "lib/encode_server_description.h"
#include "lib/file_log.h"
+#include "lib/dcpomatic_log.h"
#include <boost/test/unit_test.hpp>
#include <boost/thread.hpp>
p += sub_image->stride()[0];
}
- shared_ptr<FileLog> log (new FileLog ("build/test/client_server_test_rgb.log"));
+ dcpomatic_log.reset (new FileLog("build/test/client_server_test_rgb.log"));
shared_ptr<PlayerVideo> pvf (
new PlayerVideo (
0,
24,
200000000,
- RESOLUTION_2K,
- log
+ RESOLUTION_2K
)
);
- Data locally_encoded = frame->encode_locally (boost::bind (&Log::dcp_log, log.get(), _1, _2));
+ Data locally_encoded = frame->encode_locally ();
- EncodeServer* server = new EncodeServer (log, true, 2);
+ EncodeServer* server = new EncodeServer (true, 2);
thread* server_thread = new thread (boost::bind (&EncodeServer::run, server));
p += sub_image->stride()[0];
}
- shared_ptr<FileLog> log (new FileLog ("build/test/client_server_test_yuv.log"));
+ dcpomatic_log.reset (new FileLog("build/test/client_server_test_yuv.log"));
shared_ptr<PlayerVideo> pvf (
new PlayerVideo (
0,
24,
200000000,
- RESOLUTION_2K,
- log
+ RESOLUTION_2K
)
);
- Data locally_encoded = frame->encode_locally (boost::bind (&Log::dcp_log, log.get(), _1, _2));
+ Data locally_encoded = frame->encode_locally ();
- EncodeServer* server = new EncodeServer (log, true, 2);
+ EncodeServer* server = new EncodeServer (true, 2);
thread* server_thread = new thread (boost::bind (&EncodeServer::run, server));
}
}
- shared_ptr<FileLog> log (new FileLog ("build/test/client_server_test_j2k.log"));
+ dcpomatic_log.reset (new FileLog("build/test/client_server_test_j2k.log"));
shared_ptr<PlayerVideo> raw_pvf (
new PlayerVideo (
0,
24,
200000000,
- RESOLUTION_2K,
- log
+ RESOLUTION_2K
)
);
- Data raw_locally_encoded = raw_frame->encode_locally (boost::bind (&Log::dcp_log, log.get(), _1, _2));
+ Data raw_locally_encoded = raw_frame->encode_locally ();
shared_ptr<PlayerVideo> j2k_pvf (
new PlayerVideo (
0,
24,
200000000,
- RESOLUTION_2K,
- log
+ RESOLUTION_2K
)
);
- Data j2k_locally_encoded = j2k_frame->encode_locally (boost::bind (&Log::dcp_log, log.get(), _1, _2));
+ Data j2k_locally_encoded = j2k_frame->encode_locally ();
- EncodeServer* server = new EncodeServer (log, true, 2);
+ EncodeServer* server = new EncodeServer (true, 2);
thread* server_thread = new thread (boost::bind (&EncodeServer::run, server));
shared_ptr<Butler> butler (
new Butler(
shared_ptr<Player>(new Player(film, film->playlist())),
- shared_ptr<Log>(),
AudioMapping(6, 6),
6,
bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24),
player->set_always_burn_open_subtitles ();
player->set_play_referenced ();
- shared_ptr<Butler> butler (new Butler (player, film->log(), AudioMapping(), 2, bind(PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, true));
+ shared_ptr<Butler> butler (new Butler (player, AudioMapping(), 2, bind(PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, true));
butler->disable_audio();
for (int i = 0; i < 10; ++i) {
player->set_always_burn_open_subtitles ();
player->set_play_referenced ();
- shared_ptr<Butler> butler (new Butler(player, film->log(), AudioMapping(), 2, bind(PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, true));
+ shared_ptr<Butler> butler (new Butler(player, AudioMapping(), 2, bind(PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, true));
butler->disable_audio();
butler->seek(DCPTime::from_seconds(5), true);