X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Futil.cc;h=0646a478772a086704cfcb6b7e4d2d87408ab18c;hb=fc4c3e7f0a08d9e2350edb56fa76258114042960;hp=2c01678296f489c8038c39160f83ebba6dfc7baf;hpb=b81f1396528f01bead8c1faf128a277820980025;p=dcpomatic.git diff --git a/src/lib/util.cc b/src/lib/util.cc index 2c0167829..0646a4787 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -22,6 +22,8 @@ * @brief Some utility functions and classes. */ +#define UNICODE 1 + #include "util.h" #include "exceptions.h" #include "dcp_content_type.h" @@ -54,11 +56,13 @@ #include #include #include +DCPOMATIC_DISABLE_WARNINGS extern "C" { #include #include #include } +DCPOMATIC_ENABLE_WARNINGS #include #include #include @@ -365,10 +369,12 @@ dcpomatic_setup () 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 @@ -595,7 +601,7 @@ short_audio_channel_name (int c) _("BsR"), _("DBP"), _("DBS"), - "", + _("Sign"), "" }; @@ -616,7 +622,7 @@ valid_image_file (boost::filesystem::path f) ext == ".tif" || ext == ".tiff" || ext == ".jpg" || ext == ".jpeg" || ext == ".png" || ext == ".bmp" || ext == ".tga" || ext == ".dpx" || ext == ".j2c" || ext == ".j2k" || ext == ".jp2" || ext == ".exr" || - ext == ".jpf" + ext == ".jpf" || ext == ".psd" ); } @@ -949,7 +955,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 +1046,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 +1173,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 +