- stringstream s;
- s << "encode please\n"
- << "width " << _image->size().width << "\n"
- << "height " << _image->size().height << "\n"
- << "eyes " << static_cast<int> (_eyes) << "\n"
- << "frame " << _frame << "\n"
- << "frames_per_second " << _frames_per_second << "\n"
- << "j2k_bandwidth " << _j2k_bandwidth << "\n";
-
- _log->log (String::compose (
- N_("Sending to remote; pixel format %1, components %2, lines (%3,%4,%5), line sizes (%6,%7,%8)"),
- _image->pixel_format(), _image->components(),
- _image->lines(0), _image->lines(1), _image->lines(2),
- _image->line_size()[0], _image->line_size()[1], _image->line_size()[2]
- ));
-
- socket->write (s.str().length() + 1);
- socket->write ((uint8_t *) s.str().c_str(), s.str().length() + 1);
+ 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));
+ add_metadata (root);
+
+ stringstream xml;
+ doc.write_to_stream (xml, "UTF-8");
+
+ _log->log (String::compose (N_("Sending frame %1 to remote"), _frame));
+
+ socket->write (xml.str().length() + 1);
+ socket->write ((uint8_t *) xml.str().c_str(), xml.str().length() + 1);