#include <boost/algorithm/string.hpp>
#include <boost/scoped_array.hpp>
#include <boost/foreach.hpp>
+#ifdef HAVE_VALGRIND_H
+#include <valgrind/memcheck.h>
+#endif
#include <string>
#include <vector>
#include <iostream>
using dcp::raw_convert;
EncodeServer::EncodeServer (shared_ptr<Log> log, bool verbose, int num_threads)
+#if !defined(RUNNING_ON_VALGRIND) || RUNNING_ON_VALGRIND == 0
: Server (ENCODE_FRAME_PORT)
+#else
+ : Server (ENCODE_FRAME_PORT, 2400)
+#endif
, _log (log)
, _verbose (verbose)
, _num_threads (num_threads)
using boost::shared_ptr;
-Server::Server (int port)
+Server::Server (int port, int timeout)
: _terminate (false)
, _acceptor (_io_service, boost::asio::ip::tcp::endpoint (boost::asio::ip::tcp::v4(), port))
+ , _timeout (timeout)
{
}
}
}
- shared_ptr<Socket> socket (new Socket);
+ shared_ptr<Socket> socket (new Socket(_timeout));
_acceptor.async_accept (socket->socket (), boost::bind (&Server::handle_accept, this, socket, boost::asio::placeholders::error));
}
class Server : public boost::noncopyable
{
public:
- explicit Server (int port);
+ explicit Server (int port, int timeout = 30);
virtual ~Server ();
virtual void run ();
boost::asio::io_service _io_service;
boost::asio::ip::tcp::acceptor _acceptor;
+ int _timeout;
};
#endif
do_remote_encode (shared_ptr<DCPVideo> frame, EncodeServerDescription description, Data locally_encoded)
{
Data remotely_encoded;
- BOOST_REQUIRE_NO_THROW (remotely_encoded = frame->encode_remotely (description, 60));
+ BOOST_REQUIRE_NO_THROW (remotely_encoded = frame->encode_remotely (description, 1200));
BOOST_REQUIRE_EQUAL (locally_encoded.size(), remotely_encoded.size());
BOOST_CHECK_EQUAL (memcmp (locally_encoded.data().get(), remotely_encoded.data().get(), locally_encoded.size()), 0);
# Other stuff
conf.find_program('msgfmt', var='MSGFMT')
+ conf.check(header_name='valgrind/memcheck.h', mandatory=False)
datadir = conf.env.DATADIR
if not datadir: