- s << "encode "
- << _input->size().width << " " << _input->size().height << " "
- << _input->pixel_format() << " "
- << _out_size.width << " " << _out_size.height << " "
- << _padding << " "
- << _subtitle_offset << " "
- << _subtitle_scale << " "
- << _scaler->id () << " "
- << _frame << " "
- << _frames_per_second << " "
- << (_post_process.empty() ? "none" : _post_process) << " "
- << Config::instance()->colour_lut_index () << " "
- << Config::instance()->j2k_bandwidth () << " ";
-
- socket.write ((uint8_t *) s.str().c_str(), s.str().length() + 1, 30);
-
- for (int i = 0; i < _input->components(); ++i) {
- socket.write (_input->data()[i], _input->line_size()[i] * _input->lines(i), 30);
+ s << "encode please\n"
+ << "input_width " << _input->size().width << "\n"
+ << "input_height " << _input->size().height << "\n"
+ << "input_pixel_format " << _input->pixel_format() << "\n"
+ << "output_width " << _out_size.width << "\n"
+ << "output_height " << _out_size.height << "\n"
+ << "padding " << _padding << "\n"
+ << "subtitle_offset " << _subtitle_offset << "\n"
+ << "subtitle_scale " << _subtitle_scale << "\n"
+ << "scaler " << _scaler->id () << "\n"
+ << "frame " << _frame << "\n"
+ << "frames_per_second " << _frames_per_second << "\n";
+
+ if (!_post_process.empty()) {
+ s << "post_process " << _post_process << "\n";
+ }
+
+ s << "colour_lut " << _colour_lut << "\n"
+ << "j2k_bandwidth " << _j2k_bandwidth << "\n";
+
+ if (_subtitle) {
+ s << "subtitle_x " << _subtitle->position().x << "\n"
+ << "subtitle_y " << _subtitle->position().y << "\n"
+ << "subtitle_width " << _subtitle->image()->size().width << "\n"
+ << "subtitle_height " << _subtitle->image()->size().height << "\n";
+ }
+
+ _log->log (String::compose (
+ "Sending to remote; pixel format %1, components %2, lines (%3,%4,%5), line sizes (%6,%7,%8)",
+ _input->pixel_format(), _input->components(),
+ _input->lines(0), _input->lines(1), _input->lines(2),
+ _input->line_size()[0], _input->line_size()[1], _input->line_size()[2]
+ ));
+
+ socket->write ((uint8_t *) s.str().c_str(), s.str().length() + 1, 30);
+
+ _input->write_to_socket (socket);
+ if (_subtitle) {
+ _subtitle->image()->write_to_socket (socket);