try { auto messagePtr = serialization::unpack(packet->data); if (typeid(*messagePtr) == typeid(const sinftech::msg::tv::StartVideo)) { auto startVideoMsg = reinterpret_cast<sinftech::msg::tv::StartVideo*>(&(*messagePtr)); if (startVideoMsg->settings.resolution.width == 426 && startVideoMsg->settings.resolution.height == 240 && startVideoMsg->settings.fps == 1) { //std::ofstream ofs("startVideo.txt", std::ios::app); //ofs << "start Video, width:" << startVideoMsg->settings.resolution.width // << ", height:" << startVideoMsg->settings.resolution.height // << ", fps:" << (int)startVideoMsg->settings.fps // << ", packet->messageType:" << (int)packet->messageType // << std::endl; //ofs.close(); return; } } }