summaryrefslogtreecommitdiff
path: root/src/lib/dcp_video_frame.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-05-12 00:57:51 +0100
committerCarl Hetherington <cth@carlh.net>2014-05-12 00:57:51 +0100
commitdf085fc0ea4f1a3f009de5a7a5bf9f241173bcba (patch)
tree597ff1fe90446aa684e5fede3a72217b0b5c3d1a /src/lib/dcp_video_frame.cc
parent1b576d63f5b5babda35c3995dd375e39baa16947 (diff)
Remove LocaleGuard and lexical_cast<> in favour of libdcp::raw_convert,
which should get things right with both decimal and thousands separators; LocaleGuard fixed decimal separators ok but not, it appears, thousands ones.
Diffstat (limited to 'src/lib/dcp_video_frame.cc')
-rw-r--r--src/lib/dcp_video_frame.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/dcp_video_frame.cc b/src/lib/dcp_video_frame.cc
index 54531a0f9..1c12eb7fd 100644
--- a/src/lib/dcp_video_frame.cc
+++ b/src/lib/dcp_video_frame.cc
@@ -42,13 +42,13 @@
#include <boost/array.hpp>
#include <boost/asio.hpp>
#include <boost/filesystem.hpp>
-#include <boost/lexical_cast.hpp>
#include <libdcp/rec709_linearised_gamma_lut.h>
#include <libdcp/srgb_linearised_gamma_lut.h>
#include <libdcp/gamma_lut.h>
#include <libdcp/xyz_frame.h>
#include <libdcp/rgb_xyz.h>
#include <libdcp/colour_matrix.h>
+#include <libdcp/raw_convert.h>
#include <libcxml/cxml.h>
#include "film.h"
#include "dcp_video_frame.h"
@@ -67,8 +67,8 @@ using std::string;
using std::stringstream;
using std::cout;
using boost::shared_ptr;
-using boost::lexical_cast;
using libdcp::Size;
+using libdcp::raw_convert;
#define DCI_COEFFICENT (48.0 / 52.37)
@@ -276,7 +276,7 @@ DCPVideoFrame::encode_remotely (ServerDescription serv)
{
boost::asio::io_service io_service;
boost::asio::ip::tcp::resolver resolver (io_service);
- boost::asio::ip::tcp::resolver::query query (serv.host_name(), boost::lexical_cast<string> (Config::instance()->server_port_base ()));
+ boost::asio::ip::tcp::resolver::query query (serv.host_name(), raw_convert<string> (Config::instance()->server_port_base ()));
boost::asio::ip::tcp::resolver::iterator endpoint_iterator = resolver.resolve (query);
shared_ptr<Socket> socket (new Socket);
@@ -286,9 +286,9 @@ DCPVideoFrame::encode_remotely (ServerDescription serv)
xmlpp::Document doc;
xmlpp::Element* root = doc.create_root_node ("EncodingRequest");
- root->add_child("Version")->add_child_text (lexical_cast<string> (SERVER_LINK_VERSION));
- root->add_child("Width")->add_child_text (lexical_cast<string> (_image->size().width));
- root->add_child("Height")->add_child_text (lexical_cast<string> (_image->size().height));
+ root->add_child("Version")->add_child_text (raw_convert<string> (SERVER_LINK_VERSION));
+ root->add_child("Width")->add_child_text (raw_convert<string> (_image->size().width));
+ root->add_child("Height")->add_child_text (raw_convert<string> (_image->size().height));
add_metadata (root);
stringstream xml;
@@ -312,7 +312,7 @@ DCPVideoFrame::encode_remotely (ServerDescription serv)
void
DCPVideoFrame::add_metadata (xmlpp::Element* el) const
{
- el->add_child("Frame")->add_child_text (lexical_cast<string> (_frame));
+ el->add_child("Frame")->add_child_text (raw_convert<string> (_frame));
switch (_eyes) {
case EYES_BOTH:
@@ -330,9 +330,9 @@ DCPVideoFrame::add_metadata (xmlpp::Element* el) const
_conversion.as_xml (el->add_child("ColourConversion"));
- el->add_child("FramesPerSecond")->add_child_text (lexical_cast<string> (_frames_per_second));
- el->add_child("J2KBandwidth")->add_child_text (lexical_cast<string> (_j2k_bandwidth));
- el->add_child("Resolution")->add_child_text (lexical_cast<string> (int (_resolution)));
+ el->add_child("FramesPerSecond")->add_child_text (raw_convert<string> (_frames_per_second));
+ el->add_child("J2KBandwidth")->add_child_text (raw_convert<string> (_j2k_bandwidth));
+ el->add_child("Resolution")->add_child_text (raw_convert<string> (int (_resolution)));
}
EncodedData::EncodedData (int s)