Exemple #1
0
bool Demux::update_pvr_stream(uint16_t pid)
{
  TSDemux::ElementaryStream* es = m_AVContext->GetStream(pid);
  if (!es)
    return false;

  const char* codec_name = es->GetStreamCodecName();
  xbmc_codec_t codec = CODEC->GetCodecByName(codec_name);
  if (g_bExtraDebug)
    XBMC->Log(LOG_DEBUG, LOGTAG "%s: update info PES %.4x %s", __FUNCTION__, es->pid, codec_name);

  CLockObject Lock(m_mutex);

  XbmcPvrStream* stream = m_streams.GetStreamById(es->pid);
  if (stream)
  {
    stream->iCodecId       = codec.codec_id;
    stream->iCodecType     = codec.codec_type;
    recode_language(es->stream_info.language, stream->strLanguage);
    stream->iIdentifier    = stream_identifier(es->stream_info.composition_id, es->stream_info.ancillary_id);
    stream->iFPSScale      = es->stream_info.fps_scale;
    stream->iFPSRate       = es->stream_info.fps_rate;
    stream->iHeight        = es->stream_info.height;
    stream->iWidth         = es->stream_info.width;
    stream->fAspect        = es->stream_info.aspect;
    stream->iChannels      = es->stream_info.channels;
    stream->iSampleRate    = es->stream_info.sample_rate;
    stream->iBlockAlign    = es->stream_info.block_align;
    stream->iBitRate       = es->stream_info.bit_rate;
    stream->iBitsPerSample = es->stream_info.bits_Per_sample;

    if (es->has_stream_info)
    {
      // Now stream is setup. Remove it from no setup set
      std::set<uint16_t>::iterator it = m_nosetup.find(es->pid);
      if (it != m_nosetup.end())
      {
        m_nosetup.erase(it);
        if (m_nosetup.empty())
          XBMC->Log(LOG_DEBUG, LOGTAG "%s: setup is completed", __FUNCTION__);
      }
    }
    return true;
  }
  return false;
}
Exemple #2
0
bool AVInfo::update_pvr_stream(uint16_t pid)
{
  TSDemux::ElementaryStream* es = m_AVContext->GetStream(pid);
  if (!es)
    return false;

  if (g_bExtraDebug)
    XBMC->Log(LOG_DEBUG, LOGTAG "%s: update info PES %.4x %s", __FUNCTION__, es->pid, es->GetStreamCodecName());

  if (es->has_stream_info)
  {
    // Now stream is setup. Remove it from no setup set
    std::set<uint16_t>::iterator it = m_nosetup.find(es->pid);
    if (it != m_nosetup.end())
    {
      m_nosetup.erase(it);
      if (m_nosetup.empty())
        XBMC->Log(LOG_DEBUG, LOGTAG "%s: setup is completed", __FUNCTION__);
    }
  }
  return true;
}