ffmpeg_options = {}
return (('ffmpeg-cdist', '1d4a1a4', ffmpeg_options),
- ('libdcp', '11777d1'),
+ ('libdcp', '943af65'),
('libsub', '067c21c'))
def configure_options(target):
void
AudioDecoderStream::audio (shared_ptr<const AudioBuffers> data, ContentTime time)
{
- _log->log (String::compose ("ADS receives %1 %2", time, data->frames ()), LogEntry::TYPE_DEBUG_DECODE);
+ _log->log (String::compose ("ADS receives %1 %2", to_string(time), data->frames ()), LogEntry::TYPE_DEBUG_DECODE);
if (_resampler) {
data = _resampler->run (data);
#ifndef STRING_COMPOSE_H
#define STRING_COMPOSE_H
+#include <dcp/locale_convert.h>
#include <boost/filesystem.hpp>
#include <string>
#include <list>
}
}
- template <typename T>
- inline void write(std::string& s, const T& obj)
- {
- /* Assume anything not specialized has a to_string() method */
- s += to_string (obj);
- }
-
- template <>
- inline void write(std::string& s, const int32_t& obj)
- {
- char buffer[64];
-#ifdef DCPOMATIC_WINDOWS
- __mingw_snprintf(buffer, 64, "%" PRId32, obj);
-#else
- snprintf(buffer, 64, "%" PRId32, obj);
-#endif
- s += buffer;
- }
-
- template <>
- inline void write(std::string& s, const uint32_t& obj)
- {
- char buffer[64];
-#ifdef DCPOMATIC_WINDOWS
- __mingw_snprintf(buffer, 64, "%" PRIu32, obj);
-#else
- snprintf(buffer, 64, "%" PRIu32, obj);
-#endif
- s += buffer;
- }
-
- template <>
- inline void write(std::string& s, const int64_t& obj)
- {
- char buffer[64];
-#ifdef DCPOMATIC_WINDOWS
- __mingw_snprintf(buffer, 64, "%" PRId64, obj);
-#else
- snprintf(buffer, 64, "%" PRId64, obj);
-#endif
- s += buffer;
- }
-
- template <>
- inline void write(std::string& s, const uint64_t& obj)
- {
- char buffer[64];
-#ifdef DCPOMATIC_WINDOWS
- __mingw_snprintf(buffer, 64, "%" PRIu64, obj);
-#else
- snprintf(buffer, 64, "%" PRIu64, obj);
-#endif
- s += buffer;
- }
-
- template <>
- inline void write(std::string& s, const float& obj)
- {
- char buffer[64];
- snprintf(buffer, 64, "%f", obj);
- s += buffer;
- }
-
- template <>
- inline void write(std::string& s, const char& obj)
- {
- s += obj;
- }
-
- template <>
- inline void write(std::string& s, const double& obj)
- {
- char buffer[64];
- snprintf(buffer, 64, "%f", obj);
- s += buffer;
- }
-
- template <>
- inline void write(std::string& s, char const * const & obj)
- {
- s += obj;
- }
-
- template <>
- inline void write(std::string& s, char* const & obj)
- {
- s += obj;
- }
-
- template <>
- inline void write(std::string& s, const std::string& obj)
- {
- s += obj;
- }
-
- template <>
- inline void write(std::string& s, const boost::filesystem::path & obj)
- {
- s += obj.string();
- }
-
// implementation of class Composition
template <typename T>
inline Composition &Composition::arg(const T &obj)
{
- write(os, obj);
+ os += dcp::locale_convert<std::string>(obj);
if (!os.empty()) { // manipulators don't produce output
for (specification_map::const_iterator i = specs.lower_bound(arg_no), end = specs.upper_bound(arg_no); i != end; ++i) {
CreateProcess (0, cmd, 0, 0, FALSE, 0, 0, 0, &startup_info, &process_info);
#endif
}
+
+int
+thread_id ()
+{
+ return (int) pthread_self ();
+}
extern FILE * fopen_boost (boost::filesystem::path, std::string);
extern int dcpomatic_fseek (FILE *, int64_t, int);
extern void start_batch_converter (boost::filesystem::path dcpomatic);
+extern int thread_id ();
/** @class Waker
* @brief A class which tries to keep the computer awake on various operating systems.
socket->write ((uint8_t *) xml.c_str(), xml.length() + 1);
/* Send binary data */
- LOG_TIMING("start-remote-send thread=%1", boost::this_thread::get_id());
+ LOG_TIMING("start-remote-send thread=%1", thread_id ());
_frame->send_binary (socket);
/* Read the response (JPEG2000-encoded data); this blocks until the data
is ready and sent back.
*/
- LOG_TIMING("start-remote-encode thread=%1", boost::this_thread::get_id ());
+ LOG_TIMING("start-remote-encode thread=%1", thread_id ());
Data e (socket->read_uint32 ());
- LOG_TIMING("start-remote-receive thread=%1", boost::this_thread::get_id ());
+ LOG_TIMING("start-remote-receive thread=%1", thread_id ());
socket->read (e.data().get(), e.size());
- LOG_TIMING("finish-remote-receive thread=%1", boost::this_thread::get_id ());
+ LOG_TIMING("finish-remote-receive thread=%1", thread_id ());
LOG_DEBUG_ENCODE (N_("Finished remotely-encoded frame %1"), _index);
try
{
if (server) {
- LOG_TIMING ("start-encoder-thread thread=%1 server=%2", boost::this_thread::get_id (), server->host_name ());
+ LOG_TIMING ("start-encoder-thread thread=%1 server=%2", thread_id (), server->host_name ());
} else {
- LOG_TIMING ("start-encoder-thread thread=%1 server=localhost", boost::this_thread::get_id ());
+ LOG_TIMING ("start-encoder-thread thread=%1 server=localhost", thread_id ());
}
/* Number of seconds that we currently wait between attempts
while (true) {
- LOG_TIMING ("encoder-sleep thread=%1", boost::this_thread::get_id());
+ LOG_TIMING ("encoder-sleep thread=%1", thread_id ());
boost::mutex::scoped_lock lock (_queue_mutex);
while (_queue.empty ()) {
_empty_condition.wait (lock);
}
- LOG_TIMING ("encoder-wake thread=%1 queue=%2", boost::this_thread::get_id(), _queue.size());
+ LOG_TIMING ("encoder-wake thread=%1 queue=%2", thread_id(), _queue.size());
shared_ptr<DCPVideo> vf = _queue.front ();
- LOG_TIMING ("encoder-pop thread=%1 frame=%2 eyes=%3", boost::this_thread::get_id(), vf->index(), (int) vf->eyes ());
+ LOG_TIMING ("encoder-pop thread=%1 frame=%2 eyes=%3", thread_id(), vf->index(), (int) vf->eyes ());
_queue.pop_front ();
lock.unlock ();
} else {
try {
- LOG_TIMING ("start-local-encode thread=%1 frame=%2", boost::this_thread::get_id(), vf->index());
+ LOG_TIMING ("start-local-encode thread=%1 frame=%2", thread_id(), vf->index());
encoded = vf->encode_locally (boost::bind (&Log::dcp_log, _film->log().get(), _1, _2));
- LOG_TIMING ("finish-local-encode thread=%1 frame=%2", boost::this_thread::get_id(), vf->index());
+ LOG_TIMING ("finish-local-encode thread=%1 frame=%2", thread_id(), vf->index());
} catch (std::exception& e) {
LOG_ERROR (N_("Local encode failed (%1)"), e.what ());
throw;
frame_done ();
} else {
lock.lock ();
- LOG_GENERAL (N_("[%1] Encoder thread pushes frame %2 back onto queue after failure"), boost::this_thread::get_id(), vf->index());
+ LOG_GENERAL (N_("[%1] Encoder thread pushes frame %2 back onto queue after failure"), thread_id(), vf->index());
_queue.push_front (vf);
lock.unlock ();
}