Thread and misc adjustments.
Add limit to producer frame queue.
Add logging function.