Added threaded worker logic for the C++ encoding pipeline