X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Futil.cc;h=a3c8c50820d3c5bca94f13e0fb52935eb933167d;hb=62f9b78a2eb5f0fc6b9028264bac6ad501d83309;hp=24ea42b8f2e0e945a31488a414e42ca1f4017f57;hpb=f99a3b6b778428033308db0210fe6466fc40ff16;p=dcpomatic.git diff --git a/src/lib/util.cc b/src/lib/util.cc index 24ea42b8f..a3c8c5082 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -54,11 +54,13 @@ #include #include #include +DCPOMATIC_DISABLE_WARNINGS extern "C" { #include #include #include } +DCPOMATIC_ENABLE_WARNINGS #include #include #include @@ -949,7 +951,7 @@ void emit_subtitle_image (ContentTimePeriod period, dcp::SubtitleImage sub, dcp::Size size, shared_ptr decoder) { /* XXX: this is rather inefficient; decoding the image just to get its size */ - FFmpegImageProxy proxy (sub.png_image(), VideoRange::FULL); + FFmpegImageProxy proxy (sub.png_image()); auto image = proxy.image().image; /* set up rect with height and width */ dcpomatic::Rect rect(0, 0, image->size().width / double(size.width), image->size().height / double(size.height)); @@ -1040,7 +1042,7 @@ show_jobs_on_console (bool progress) /** XXX: could use mmap? */ void -copy_in_bits (boost::filesystem::path from, boost::filesystem::path to, boost::function progress) +copy_in_bits (boost::filesystem::path from, boost::filesystem::path to, std::function progress) { auto f = fopen_boost (from, "rb"); if (!f) { @@ -1167,3 +1169,30 @@ default_font_file () 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 +