Writing C++ code for video players