#include <dcp/openjpeg_image.h>
#include <dcp/rgb_xyz.h>
#include <dcp/j2k.h>
-#include <dcp/colour_matrix.h>
#include <libxml++/libxml++.h>
#include <boost/asio.hpp>
#include <boost/thread.hpp>
note
);
} else {
- xyz = dcp::xyz_to_xyz (image->data()[0], image->size(), image->stride()[0]);
+ xyz.reset (new dcp::OpenJPEGImage (image->data()[0], image->size(), image->stride()[0]));
}
return xyz;
/** Send this frame to a remote server for J2K encoding, then read the result.
* @param serv Server to send to.
+ * @param timeout timeout in seconds.
* @return Encoded data.
*/
Data
{
boost::asio::io_service io_service;
boost::asio::ip::tcp::resolver resolver (io_service);
- boost::asio::ip::tcp::resolver::query query (serv.host_name(), raw_convert<string> (Config::instance()->server_port_base ()));
+ boost::asio::ip::tcp::resolver::query query (serv.host_name(), raw_convert<string> (ENCODE_FRAME_PORT));
boost::asio::ip::tcp::resolver::iterator endpoint_iterator = resolver.resolve (query);
shared_ptr<Socket> socket (new Socket (timeout));
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);