common: Integrate the codes of cleaning up video output handler.