* @brief Some utility functions and classes.
*/
-#include "util.h"
-#include "exceptions.h"
-#include "dcp_content_type.h"
-#include "filter.h"
+
+#define UNICODE 1
+
+
+#include "audio_buffers.h"
+#include "audio_processor.h"
#include "cinema_sound_processor.h"
+#include "compose.hpp"
#include "config.h"
-#include "ratio.h"
-#include "job.h"
#include "cross.h"
-#include "video_content.h"
-#include "rect.h"
-#include "digester.h"
-#include "audio_processor.h"
#include "crypto.h"
-#include "compose.hpp"
-#include "audio_buffers.h"
-#include "string_text.h"
-#include "font.h"
-#include "render_text.h"
+#include "dcp_content_type.h"
+#include "digester.h"
+#include "exceptions.h"
#include "ffmpeg_image_proxy.h"
+#include "filter.h"
+#include "font.h"
#include "image.h"
-#include "text_decoder.h"
+#include "job.h"
#include "job_manager.h"
+#include "ratio.h"
+#include "rect.h"
+#include "render_text.h"
+#include "string_text.h"
+#include "text_decoder.h"
+#include "util.h"
+#include "video_content.h"
#include "warnings.h"
#include <dcp/decrypted_kdm.h>
#include <dcp/locale_convert.h>
#include <dcp/sound_asset.h>
#include <dcp/subtitle_asset.h>
#include <dcp/atmos_asset.h>
+DCPOMATIC_DISABLE_WARNINGS
extern "C" {
#include <libavfilter/avfilter.h>
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
}
+DCPOMATIC_ENABLE_WARNINGS
#include <curl/curl.h>
#include <glib.h>
#include <pangomm/init.h>
#include "i18n.h"
-using std::string;
-using std::wstring;
-using std::setfill;
-using std::ostream;
+
+using std::bad_alloc;
+using std::cout;
using std::endl;
-using std::vector;
-using std::min;
-using std::max;
-using std::map;
-using std::list;
-using std::multimap;
using std::istream;
+using std::list;
+using std::make_pair;
+using std::make_shared;
+using std::map;
+using std::min;
+using std::ostream;
using std::pair;
-using std::cout;
-using std::bad_alloc;
using std::set_terminate;
-using std::make_pair;
using std::shared_ptr;
-using std::make_shared;
+using std::string;
+using std::vector;
+using std::wstring;
using boost::thread;
using boost::optional;
using boost::lexical_cast;
using dcp::locale_convert;
using namespace dcpomatic;
+
/** Path to our executable, required by the stacktrace stuff and filled
* in during App::onInit().
*/
SetUnhandledExceptionFilter(exception_handler);
#endif
+#ifdef DCPOMATIC_HAVE_AVREGISTER
DCPOMATIC_DISABLE_WARNINGS
av_register_all ();
avfilter_register_all ();
DCPOMATIC_ENABLE_WARNINGS
+#endif
#ifdef DCPOMATIC_OSX
/* Add our library directory to the libltdl search path so that
list<StringText> subs;
dcp::SubtitleString ss(
optional<string>(), false, false, false, dcp::Colour(), 42, 1, dcp::Time(), dcp::Time(), 0, dcp::HAlign::CENTER, 0, dcp::VAlign::CENTER, dcp::Direction::LTR,
- "Hello dolly", dcp::Effect::NONE, dcp::Colour(), dcp::Time(), dcp::Time()
+ "Hello dolly", dcp::Effect::NONE, dcp::Colour(), dcp::Time(), dcp::Time(), 0
);
subs.push_back (StringText(ss, 0));
render_text (subs, list<shared_ptr<Font>>(), dcp::Size(640, 480), DCPTime(), 24);
_("BsR"),
_("DBP"),
_("DBS"),
- "",
+ _("Sign"),
""
};
emit_subtitle_image (ContentTimePeriod period, dcp::SubtitleImage sub, dcp::Size size, shared_ptr<TextDecoder> decoder)
{
/* XXX: this is rather inefficient; decoding the image just to get its size */
- FFmpegImageProxy proxy (sub.png_image(), VideoRange::FULL);
- auto image = proxy.image().image;
+ FFmpegImageProxy proxy (sub.png_image());
+ auto image = proxy.image(Image::Alignment::PADDED).image;
/* set up rect with height and width */
dcpomatic::Rect<double> rect(0, 0, image->size().width / double(size.width), image->size().height / double(size.height));
/** XXX: could use mmap? */
void
-copy_in_bits (boost::filesystem::path from, boost::filesystem::path to, boost::function<void (float)> progress)
+copy_in_bits (boost::filesystem::path from, boost::filesystem::path to, std::function<void (float)> progress)
{
auto f = fopen_boost (from, "rb");
if (!f) {
dcp::Size
-scale_for_display (dcp::Size s, dcp::Size display_container, dcp::Size film_container)
+scale_for_display (dcp::Size s, dcp::Size display_container, dcp::Size film_container, PixelQuanta quanta)
{
/* Now scale it down if the display container is smaller than the film container */
if (display_container != film_container) {
s.width = lrintf (s.width * scale);
s.height = lrintf (s.height * scale);
+ s = quanta.round (s);
}
return s;
return liberation_normal;
}
+
+
+string
+to_upper (string s)
+{
+ transform (s.begin(), s.end(), s.begin(), ::toupper);
+ return s;
+}
+
+
+/* Set to 1 to print the IDs of some of our threads to stdout on creation */
+#define DCPOMATIC_DEBUG_THREADS 0
+
+#if DCPOMATIC_DEBUG_THREADS
+void
+start_of_thread (string name)
+{
+ std::cout << "THREAD:" << name << ":" << std::hex << pthread_self() << "\n";
+}
+#else
+void
+start_of_thread (string)
+{
+
+}
+#endif
+