예제 #1
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");
   }

}