X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Futil.h;h=d3e6a67de9e1fd053783c65afd8effaef22ef001;hb=8aeb741ccbe2edb528e98a431bf55459a6836a9b;hp=70cb3bb0c9ec820973996c7573d3e4353b1f1bfa;hpb=f0d7baf0ce956fe5461caa91868c41d881b5f0dc;p=dcpomatic.git diff --git a/src/lib/util.h b/src/lib/util.h index 70cb3bb0c..d3e6a67de 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -51,6 +51,8 @@ extern "C" { /** The maximum number of audio channels that we can cope with */ #define MAX_AUDIO_CHANNELS 6 +#define DCPOMATIC_HELLO "Boys, you gotta learn not to talk to nuns that way" + namespace libdcp { class Signer; } @@ -65,8 +67,7 @@ extern double seconds (struct timeval); extern void dcpomatic_setup (); extern void dcpomatic_setup_gettext_i18n (std::string); extern std::vector split_at_spaces_considering_quotes (std::string); -extern std::string md5_digest (boost::filesystem::path); -extern std::string md5_digest_directory (boost::filesystem::path, boost::shared_ptr); +extern std::string md5_digest (std::vector, boost::shared_ptr); extern std::string md5_digest (void const *, int); extern void ensure_ui_thread (); extern std::string audio_channel_name (int); @@ -78,9 +79,9 @@ extern std::string tidy_for_filename (std::string); extern boost::shared_ptr make_signer (); extern libdcp::Size fit_ratio_within (float ratio, libdcp::Size); -struct FrameRateConversion +struct FrameRateChange { - FrameRateConversion (float, int); + FrameRateChange (float, int); /** @return factor by which to multiply a source frame rate to get the effective rate after any skip or repeat has happened. @@ -108,17 +109,24 @@ struct FrameRateConversion */ bool change_speed; + /** Amount by which the video is being sped-up in the DCP; e.g. for a + * 24fps source in a 25fps DCP this would be 25/24. + */ + float speed_up; + std::string description; }; extern int dcp_audio_frame_rate (int); extern int stride_round_up (int, int const *, int); +extern DCPTime time_round_up (DCPTime, DCPTime); extern std::multimap read_key_value (std::istream& s); extern int get_required_int (std::multimap const & kv, std::string k); extern float get_required_float (std::multimap const & kv, std::string k); extern std::string get_required_string (std::multimap const & kv, std::string k); extern int get_optional_int (std::multimap const & kv, std::string k); extern std::string get_optional_string (std::multimap const & kv, std::string k); +extern void* wrapped_av_malloc (size_t); /** @class Socket * @brief A class to wrap a boost::asio::ip::tcp::socket with some things @@ -131,13 +139,15 @@ class Socket { public: Socket (int timeout = 30); + ~Socket (); /** @return Our underlying socket */ boost::asio::ip::tcp::socket& socket () { return _socket; } - void connect (boost::asio::ip::basic_resolver_entry const & endpoint); + void connect (boost::asio::ip::tcp::endpoint); + void accept (int); void write (uint32_t n); void write (uint8_t const * data, int size); @@ -153,10 +163,11 @@ private: boost::asio::io_service _io_service; boost::asio::deadline_timer _deadline; boost::asio::ip::tcp::socket _socket; + boost::asio::ip::tcp::acceptor* _acceptor; int _timeout; }; -extern int64_t video_frames_to_audio_frames (VideoContent::Frame v, float audio_sample_rate, float frames_per_second); +extern int64_t video_frames_to_audio_frames (VideoFrame v, float audio_sample_rate, float frames_per_second); class LocaleGuard {