Beispiel #1
0
namespace joynr
{

const SubscriptionStop SubscriptionStop::NULL_RESPONSE = SubscriptionStop();

SubscriptionStop::SubscriptionStop() : subscriptionId()
{
}

std::string SubscriptionStop::getSubscriptionId() const
{
    return subscriptionId;
}

void SubscriptionStop::setSubscriptionId(const std::string& subscriptionId)
{
    this->subscriptionId = subscriptionId;
}

bool SubscriptionStop::operator==(const SubscriptionStop& other) const
{
    return subscriptionId == other.getSubscriptionId();
}

bool SubscriptionStop::operator!=(const SubscriptionStop& other) const
{
    return !(*this == other);
}

} // namespace joynr
Beispiel #2
0
DemuxPacket* cHTSPDemux::Read()
{
  htsmsg_t *  msg;
  const char* method;
  while((msg = ReadStream()))
  {
    method = htsmsg_get_str(msg, "method");
    if(method == NULL)
      break;

    if     (strcmp("subscriptionStart",  method) == 0)
    {
      SubscriptionStart(msg);
      DemuxPacket* pkt  = PVR->AllocateDemuxPacket(0);
      pkt->iStreamId    = DMX_SPECIALID_STREAMCHANGE;
      htsmsg_destroy(msg);
      return pkt;
    }
    else if(strcmp("subscriptionStop",   method) == 0)
      SubscriptionStop (msg);
    else if(strcmp("subscriptionStatus", method) == 0)
      SubscriptionStatus(msg);
    else if(strcmp("queueStatus"       , method) == 0)
      cHTSPSession::ParseQueueStatus(msg, m_QueueStatus);
    else if(strcmp("signalStatus"       , method) == 0)
      cHTSPSession::ParseSignalStatus(msg, m_Quality);
    else if(strcmp("muxpkt"            , method) == 0)
    {
      uint32_t    index, duration, frametype;
      const void* bin;
      size_t      binlen;
      int64_t     ts;
      char        frametypechar[1];

      htsmsg_get_u32(msg, "frametype", &frametype);
      frametypechar[0] = static_cast<char>( frametype );
//      XBMC->Log(LOG_DEBUG, "%s - Frame type %c", __FUNCTION__, frametypechar[0]);

      if(htsmsg_get_u32(msg, "stream" , &index)  ||
         htsmsg_get_bin(msg, "payload", &bin, &binlen))
        break;

      DemuxPacket* pkt = PVR->AllocateDemuxPacket(binlen);
      memcpy(pkt->pData, bin, binlen);

      pkt->iSize = binlen;

      if(!htsmsg_get_u32(msg, "duration", &duration))
        pkt->duration = (double)duration * DVD_TIME_BASE / 1000000;

      if(!htsmsg_get_s64(msg, "dts", &ts))
        pkt->dts = (double)ts * DVD_TIME_BASE / 1000000;
      else
        pkt->dts = DVD_NOPTS_VALUE;

      if(!htsmsg_get_s64(msg, "pts", &ts))
        pkt->pts = (double)ts * DVD_TIME_BASE / 1000000;
      else
        pkt->pts = DVD_NOPTS_VALUE;

      pkt->iStreamId = -1;
      for(unsigned int i = 0; i < m_Streams.iStreamCount; i++)
      {
        if(m_Streams.stream[i].iPhysicalId == (unsigned int)index)
        {
          pkt->iStreamId = i;
          break;
        }
      }

      htsmsg_destroy(msg);
      return pkt;
    }

    break;
  }

  if(msg)
  {
    htsmsg_destroy(msg);
    DemuxPacket* pkt  = PVR->AllocateDemuxPacket(0);
    return pkt;
  }
  return NULL;
}