void CMediaStreamingServerProfile::onBufferReceived(const iviLink::Channel::tChannelId channel, iviLink::Buffer const& buffer) {
    LOG4CPLUS_TRACE_METHOD(msLogger, __PRETTY_FUNCTION__);
    if (mChannelID != channel) {
        LOG4CPLUS_INFO(msLogger, "mChannelID != channel_id");
        return;
    } else {
        LOG4CPLUS_INFO(msLogger, "mChannelID == channel_id");
    }

    UInt8 *incomingData = buffer.getBuffer();

    LOG4CPLUS_INFO(msLogger, "Procedure ID = " + convertIntegerToString(incomingData[0]));


    if(incomingData[0] == STREAMINGACCEPTED)
    {
        LOG4CPLUS_INFO(msLogger, "case STREAMINGACCEPTED");
        mpAppCallbacks->onStreamingServerAccepted(true);

    }
    else if(incomingData[0] == STREAMINGUNACCEPTED)
    {
        LOG4CPLUS_INFO(msLogger, "case STREAMINGUNACCEPTED");
        mpAppCallbacks->onStreamingServerUnaccepted(true);
    }
    else
    {
        LOG4CPLUS_INFO(msLogger, "unknown procedure ID");
    }

}
Пример #2
0
//from CChannelHandler
void CMediaSourceServerProfile::onBufferReceived(const iviLink::Channel::tChannelId channel, iviLink::Buffer const& buffer)
{
  LOG4CPLUS_TRACE_METHOD(msLogger, __PRETTY_FUNCTION__ );
   if (mChannelID != channel)
   {
      LOG4CPLUS_ERROR(msLogger, "mChannelID != channel_id");
      return;
   }
   else
   {
      LOG4CPLUS_INFO(msLogger, "mChannelID == channel_id");
   }
   
   UInt8 *incomingData = buffer.getBuffer();
   int read_size = buffer.getSize();

   LOG4CPLUS_INFO(msLogger, "Procedure ID = " + convertIntegerToString(incomingData[0]));

   if(incomingData[0] == REQUESTTRACKLIST)
   {
         LOG4CPLUS_INFO(msLogger, "case REQUESTTRACKLIST");
         mpAppCallbacks->onRequestTrackList(true);
   }
   else
   {
        LOG4CPLUS_INFO(msLogger, "unknown procedure ID");
   }

}
void CMediaStreamingClientProfile::onBufferReceived(const iviLink::Channel::tChannelId channel, iviLink::Buffer const& buffer) 
{
    LOG4CPLUS_TRACE_METHOD(msLogger, __PRETTY_FUNCTION__);
    if (mChannelID != channel) {
        LOG4CPLUS_INFO(msLogger, "mChannelID != channel_id");
        return;
    } else {
        LOG4CPLUS_INFO(msLogger, "mChannelID == channel_id");
    }

 
   UInt8 *incomingData = buffer.getBuffer();
   int read_size = buffer.getSize();

   LOG4CPLUS_INFO(msLogger, "Procedure ID = " + convertIntegerToString(incomingData[0]));


   if(incomingData[0] == SENDSTREAMINGINFO)
   {
        LOG4CPLUS_INFO(msLogger, "case SENDSTREAMINGINFO");
        std::string info((char*)(incomingData + 1), read_size - 1);
        LOG4CPLUS_INFO(msLogger, "info  = " + info);
        procInfo(info);
   }
   else
   {
        LOG4CPLUS_INFO(msLogger, "unknown procedure ID");
   }

}
Пример #4
0
void ReceiverProfile<T,I>::onBufferReceived(const iviLink::Channel::tChannelId channel, iviLink::Buffer const& buffer)
{
    LOG4CPLUS_TRACE_METHOD((logger<T,I>()), __PRETTY_FUNCTION__ );

    if (mChannelID != channel)
    {
        LOG4CPLUS_INFO((logger<T,I>()), "mChannelID != channel");
        return;
    }
    else
    {
        LOG4CPLUS_INFO((logger<T,I>()), "mChannelID == channel");
    }

    typename I::state_t st;
    if( st.deserialize(std::string((char*)buffer.getBuffer()) ) )
    {
        receive( st );
    }
    else
        LOG4CPLUS_ERROR( (logger<T,I>()), "Failed to deserialize state from buffer" );
}