revise the code of camera thread.