- 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 << N_("encode please\n")
+ << N_("input_width ") << _input->size().width << N_("\n")
+ << N_("input_height ") << _input->size().height << N_("\n")
+ << N_("input_pixel_format ") << _input->pixel_format() << N_("\n")
+ << N_("output_width ") << _out_size.width << N_("\n")
+ << N_("output_height ") << _out_size.height << N_("\n")
+ << N_("padding ") << _padding << N_("\n")
+ << N_("subtitle_offset ") << _subtitle_offset << N_("\n")
+ << N_("subtitle_scale ") << _subtitle_scale << N_("\n")
+ << N_("scaler ") << _scaler->id () << N_("\n")
+ << N_("frame ") << _frame << N_("\n")
+ << N_("frames_per_second ") << _frames_per_second << N_("\n");
+
+ if (!_post_process.empty()) {
+ s << N_("post_process ") << _post_process << N_("\n");
+ }
+
+ s << N_("colour_lut ") << _colour_lut << N_("\n")
+ << N_("j2k_bandwidth ") << _j2k_bandwidth << N_("\n");
+
+ if (_subtitle) {
+ s << N_("subtitle_x ") << _subtitle->position().x << N_("\n")
+ << N_("subtitle_y ") << _subtitle->position().y << N_("\n")
+ << N_("subtitle_width ") << _subtitle->image()->size().width << N_("\n")
+ << N_("subtitle_height ") << _subtitle->image()->size().height << N_("\n");