Supporter.
[dcpomatic.git] / src / lib / dcp_video_frame.cc
index 6cf987648773031a5cb2ed859f3fe4596446fe04..bb7eaa064194e238ec66656b75e8caa7abc65088 100644 (file)
@@ -34,7 +34,6 @@
 #include <stdexcept>
 #include <cstdio>
 #include <iomanip>
-#include <sstream>
 #include <iostream>
 #include <fstream>
 #include <unistd.h>
@@ -42,7 +41,6 @@
 #include <boost/array.hpp>
 #include <boost/asio.hpp>
 #include <boost/filesystem.hpp>
-#include <openssl/md5.h>
 #include <libdcp/rec709_linearised_gamma_lut.h>
 #include <libdcp/srgb_linearised_gamma_lut.h>
 #include <libdcp/gamma_lut.h>
@@ -68,7 +66,6 @@
 #include "i18n.h"
 
 using std::string;
-using std::stringstream;
 using std::cout;
 using boost::shared_ptr;
 using libdcp::Size;
@@ -134,21 +131,6 @@ DCPVideoFrame::encode_locally ()
                matrix
                );
 
-       {
-               MD5_CTX md5_context;
-               MD5_Init (&md5_context);
-               MD5_Update (&md5_context, xyz->data(0), 1998 * 1080 * 4);
-               MD5_Update (&md5_context, xyz->data(1), 1998 * 1080 * 4);
-               MD5_Update (&md5_context, xyz->data(2), 1998 * 1080 * 4);
-               unsigned char digest[MD5_DIGEST_LENGTH];
-               MD5_Final (digest, &md5_context);
-               
-               stringstream s;
-               for (int i = 0; i < MD5_DIGEST_LENGTH; ++i) {
-                       s << std::hex << std::setfill('0') << std::setw(2) << ((int) digest[i]);
-               }
-       }
-
        /* Set the max image and component sizes based on frame_rate */
        int max_cs_len = ((float) _j2k_bandwidth) / 8 / _frames_per_second;
        if (_frame->eyes() == EYES_LEFT || _frame->eyes() == EYES_RIGHT) {
@@ -298,10 +280,9 @@ DCPVideoFrame::encode_remotely (ServerDescription serv)
        LOG_GENERAL (N_("Sending frame %1 to remote"), _index);
        
        /* Send XML metadata */
-       stringstream xml;
-       doc.write_to_stream (xml, "UTF-8");
-       socket->write (xml.str().length() + 1);
-       socket->write ((uint8_t *) xml.str().c_str(), xml.str().length() + 1);
+       string xml = doc.write_to_string ("UTF-8");
+       socket->write (xml.length() + 1);
+       socket->write ((uint8_t *) xml.c_str(), xml.length() + 1);
 
        /* Send binary data */
        _frame->send_binary (socket);