The socket branch is good enough for a review. There are still lots of debug statements and little issues to fix, but I thought it would be good to get some feedback on the overall design before I go any further.
Broad overview: A SocketServer class listens for incoming connections on a specified port (the port is not yet configurable in iv UI). When a new connection is made, the server calls a callback with the incoming file name (the file name should end in ".socket"). In the case of iv, this callback is used to create a new SocketInput by way of the ImageCache. The ImageCache does an initial iteration over the "tiles" of the SocketInput which is wasteful because the tiles have not arrived yet. These queries are simply ignored, but it might be nice if we could somehow convey to the ImageCache that certain image plugins should skip the initial iteration. When a tile arrives, the SocketInput class calls a tile_changed_callback, which triggers the ImageCache to call get_native_tile with a data pointer for the SocketInput class to fill. I still need to implement multi-layer images. On the driver side I will need to convert from the tile-per-layer format that arnold provides to OIIO's layering at the pixel level. are there any utility functions for this conversion? I've also glazed over 3-dimensional images for now in the code that handles converting "cropped tiles" to full, native tiles. You can merge this Pull Request by running: git pull https://github.com/chadrik/oiio sockets Or you can view, comment on it, or merge it online at: https://github.com/OpenImageIO/oiio/pull/402 -- Commit Summary -- * begin work on socket images for iv * Merge branch 'master' of https://github.com/OpenImageIO/oiio into sockets * added SocketInput::get_header_from_client and SocketInput:send_header_to_server. these are used both to send the image spec on connection and to send each tile spec * various small improvements and debug statements. trying to get async_read to work, but realized that more radical changes need to occur * Added a Server class. Improved SocketInput compatibility with ImageCache. * Successfully reading tile data asynchronously. * Fixed the garbage in the received headers * Add a few remaining fixes * Added a tile_changed_callback to ImageCacheFile, which SocketInput calls on the arrival of each new tile. This successfully triggers ImageInput::read_native_tile by way of the ImageCache. The next step is to load real tile data into the cache. * Fix a bug from the last commit. Theoretically data is now being reloaded into the cache but iv is not displaying it yet. * Added ImageCacheImpl::invalidate_tile() which is called in ImageCacheFile::tile_changed_callback() in order to force a re-cache the tile. * First working prototype: GL update is now successfully triggered during socket render. * Add new ImageCacheImpl::get_tile() overload for getting a tile when you already have a TileID. * Properly compute the bytes being sent and received over the socket. This now properly takes into consideration the size of cropped tiles when transmitting over the socket, however, it still does not yet correctly remap this to uncropped tiles in read_native_tile. * Merge remote-tracking branch 'oiio/master' into sockets * Started work on handling cropped edge tiles by implementing write_rectangle. * Modify Server so that it can handle multiple connections simultaneously and enable repeat renders. * Ensure that file sent ends in .socket. Clean up code. * Further code cleanup in preparation for review. * Further code cleanup in preparation for review. * More code cleanup. Fixed some bugs related to progressive rendering in Maya. * Add the arnold code to src/contrib/arnold and add it to the cmake build system. * Merge remote-tracking branch 'origin/sockets' into sockets -- File Changes -- M src/CMakeLists.txt (1) A src/cmake/modules/FindArnold.cmake (19) A src/contrib/CMakeLists.txt (1) A src/contrib/arnold/CMakeLists.txt (10) A src/contrib/arnold/README (22) A src/contrib/arnold/driver_socket.cpp (210) A src/contrib/arnold/test.ass (103) M src/include/CMakeLists.txt (2) M src/include/imagecache.h (9) M src/include/imageio.h (9) A src/include/server.h (132) M src/iv/imageviewer.cpp (88) M src/iv/imageviewer.h (23) M src/libOpenImageIO/CMakeLists.txt (1) A src/libOpenImageIO/server.cpp (230) M src/libtexture/imagecache.cpp (81) M src/libtexture/imagecache_pvt.h (8) M src/socket.imageio/socket_pvt.cpp (37) M src/socket.imageio/socket_pvt.h (59) M src/socket.imageio/socketinput.cpp (290) M src/socket.imageio/socketoutput.cpp (144) -- Patch Links -- https://github.com/OpenImageIO/oiio/pull/402.patch https://github.com/OpenImageIO/oiio/pull/402.diff --- Reply to this email directly or view it on GitHub: https://github.com/OpenImageIO/oiio/pull/402 _______________________________________________ Oiio-dev mailing list [email protected] http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
