vlc_linux/vlc-3.0.16/modules/stream_out/chromecast/chromecast_ctrl.cpp
/**
 * @brief Process a message received from the Chromecast
 * @param msg the CastMessage to process
 * @return 0 if the message has been successfuly processed else -1
 */
@brief Process a message received from the Chromecast
@param msg the CastMessage to process
@return 0 if the message has been successfuly processed else -1
@brief Process a message received from the Chromecast @param msg the CastMessage to process @return 0 if the message has been successfuly processed else - 1
bool intf_sys_t::processMessage(const castchannel::CastMessage &msg)
{
    const std::string & namespace_ = msg.namespace_();
#ifndef NDEBUG
    msg_Dbg( m_module, "processMessage: %s->%s %s", namespace_.c_str(), msg.destination_id().c_str(), msg.payload_utf8().c_str());
#endif
    bool ret = true;
    if (namespace_ == NAMESPACE_DEVICEAUTH)
        processAuthMessage( msg );
    else if (namespace_ == NAMESPACE_HEARTBEAT)
        processHeartBeatMessage( msg );
    else if (namespace_ == NAMESPACE_RECEIVER)
        ret = processReceiverMessage( msg );
    else if (namespace_ == NAMESPACE_MEDIA)
        processMediaMessage( msg );
    else if (namespace_ == NAMESPACE_CONNECTION)
        processConnectionMessage( msg );
    else
    {
        msg_Err( m_module, "Unknown namespace: %s", msg.namespace_().c_str());
    }
    return ret;
}
bool intf_sys_t :: processMessage ( const castchannel :: CastMessage & msg ) { const std :: string & namespace_ = msg . namespace_ ( ) ; #ifndef NDEBUG msg_Dbg ( m_module , " " , namespace_ . c_str ( ) , msg . destination_id ( ) . c_str ( ) , msg . payload_utf8 ( ) . c_str ( ) ) ; #endif bool ret = true ; if ( namespace_ == NAMESPACE_DEVICEAUTH ) processAuthMessage ( msg ) ; else if ( namespace_ == NAMESPACE_HEARTBEAT ) processHeartBeatMessage ( msg ) ; else if ( namespace_ == NAMESPACE_RECEIVER ) ret = processReceiverMessage ( msg ) ; else if ( namespace_ == NAMESPACE_MEDIA ) processMediaMessage ( msg ) ; else if ( namespace_ == NAMESPACE_CONNECTION ) processConnectionMessage ( msg ) ; else { msg_Err ( m_module , " " , msg . namespace_ ( ) . c_str ( ) ) ; } return ret ; }
@brief Process a message received from the Chromecast
 @param msg the CastMessage to process
 @return 0 if the message has been successfuly processed else -1
@brief Process a message received from the Chromecast @param msg the CastMessage to process @return 0 if the message has been successfuly processed else - 1