#include <iostream>
#include <stdint.h>
+#include <boost/lexical_cast.hpp>
extern "C" {
#include <libavfilter/avfiltergraph.h>
#include <libavfilter/buffersrc.h>
image->make_black ();
}
+ _log->microsecond_log ("Decoder emits " + lexical_cast<string> (_video_frame), Log::TIMING);
Video (image, _video_frame);
++_video_frame;
}
/* Wait until the queue has gone down a bit */
while (_queue.size() >= _worker_threads.size() * 2 && !_process_end) {
+ _log->microsecond_log ("Decoder sleeps", Log::TIMING);
_worker_condition.wait (lock);
+ _log->microsecond_log ("Decoder wakes", Log::TIMING);
}
if (_process_end) {
/* Only do the processing if we don't already have a file for this frame */
if (!boost::filesystem::exists (_opt->frame_out_path (frame, false))) {
pair<string, string> const s = Filter::ffmpeg_strings (_fs->filters);
+ _log->microsecond_log ("Adding to queue of " + boost::lexical_cast<string> (_queue.size ()), Log::TIMING);
_queue.push_back (boost::shared_ptr<DCPVideoFrame> (
new DCPVideoFrame (
yuv, _opt->out_size, _opt->padding, _fs->scaler, frame, _fs->frames_per_second, s.second,
while (1) {
boost::mutex::scoped_lock lock (_worker_mutex);
while (_queue.empty () && !_process_end) {
+ _log->microsecond_log ("Encoder thread sleeps", Log::TIMING);
_worker_condition.wait (lock);
+ _log->microsecond_log ("Encoder thread wakes", Log::TIMING);
}
if (_process_end) {
}
boost::shared_ptr<DCPVideoFrame> vf = _queue.front ();
+ _log->microsecond_log ("Encoder thread wakes with queue of " + boost::lexical_cast<string> (_queue.size ()), Log::TIMING);
_queue.pop_front ();
lock.unlock ();
} else {
try {
+ _log->microsecond_log ("Encoder thread begins local encode of " + lexical_cast<string> (vf->frame ()), Log::TIMING);
encoded = vf->encode_locally ();
+ _log->microsecond_log ("Encoder thread finishes local encode of " + lexical_cast<string> (vf->frame ()), Log::TIMING);
} catch (std::exception& e) {
stringstream s;
s << "Local encode failed " << e.what() << ".";
#include "version.h"
#include "cross.h"
#include "config.h"
+#include "log.h"
using namespace std;
using namespace boost;
string film_dir;
bool test_mode = false;
bool progress = true;
+ int log_level = 1;
int option_index = 0;
while (1) {
{ "config", no_argument, 0, 'c'},
{ "test", no_argument, 0, 't'},
{ "no-progress", no_argument, 0, 'n'},
+ { "log-level", required_argument, 0, 'l' },
{ 0, 0, 0, 0 }
};
- int c = getopt_long (argc, argv, "vhdctn", long_options, &option_index);
+ int c = getopt_long (argc, argv, "vhdctnl:", long_options, &option_index);
if (c == -1) {
break;
cout << "built in optimised mode\n";
#endif
exit (EXIT_SUCCESS);
+ case 'l':
+ log_level = atoi (optarg);
+ break;
}
}
exit (EXIT_FAILURE);
}
+ film->log()->set_level ((Log::Level) log_level);
+
cout << "\nMaking ";
if (film->dcp_ab ()) {
cout << "A/B ";