diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-10-15 23:31:49 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-10-15 23:31:49 +0100 |
| commit | bd9906422fe59126a27a3002b2bb4ce497eef508 (patch) | |
| tree | 9976e8b4d90267168f898d3ea5888d5403c78694 | |
| parent | e946a66554185459043af2a8bdae575e255c743d (diff) | |
Add a sub to the client/server test and fix an exposed bug.
| -rw-r--r-- | src/lib/server.cc | 2 | ||||
| -rw-r--r-- | test/test.cc | 18 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/lib/server.cc b/src/lib/server.cc index 2d19d06be..d40325db0 100644 --- a/src/lib/server.cc +++ b/src/lib/server.cc @@ -127,7 +127,7 @@ Server::process (shared_ptr<Socket> socket) shared_ptr<Subtitle> sub; if (subtitle_position.x != -1) { - shared_ptr<Image> subtitle_image (new AlignedImage (pixel_format, subtitle_size)); + shared_ptr<Image> subtitle_image (new AlignedImage (PIX_FMT_RGBA, subtitle_size)); subtitle_image->read_from_socket (socket); sub.reset (new Subtitle (subtitle_position, subtitle_image)); } diff --git a/test/test.cc b/test/test.cc index a7023b841..730aa8d3e 100644 --- a/test/test.cc +++ b/test/test.cc @@ -282,7 +282,6 @@ do_remote_encode (shared_ptr<DCPVideoFrame> frame, ServerDescription* descriptio BOOST_AUTO_TEST_CASE (client_server_test) { shared_ptr<Image> image (new CompactImage (PIX_FMT_RGB24, Size (1998, 1080))); - uint8_t* p = image->data()[0]; for (int y = 0; y < 1080; ++y) { @@ -293,16 +292,29 @@ BOOST_AUTO_TEST_CASE (client_server_test) } } + shared_ptr<Image> sub_image (new CompactImage (PIX_FMT_RGBA, Size (100, 200))); + p = sub_image->data()[0]; + for (int y = 0; y < 200; ++y) { + for (int x = 0; x < 100; ++x) { + *p++ = y % 256; + *p++ = x % 256; + *p++ = (x + y) % 256; + *p++ = 1; + } + } + + shared_ptr<Subtitle> subtitle (new Subtitle (Position (50, 60), sub_image)); + FileLog log ("build/test/client_server_test.log"); shared_ptr<DCPVideoFrame> frame ( new DCPVideoFrame ( image, - shared_ptr<Subtitle> (), + subtitle, Size (1998, 1080), 0, 0, - 0, + 1, Scaler::from_id ("bicubic"), 0, 24, |
