当前位置: 首页>>代码示例>>C++>>正文


C++ OMXReader::IsEof方法代码示例

本文整理汇总了C++中OMXReader::IsEof方法的典型用法代码示例。如果您正苦于以下问题:C++ OMXReader::IsEof方法的具体用法?C++ OMXReader::IsEof怎么用?C++ OMXReader::IsEof使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OMXReader的用法示例。


在下文中一共展示了OMXReader::IsEof方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main


//.........这里部分代码省略.........
      seek_pos *= 1000.0f;

      m_incr = 0;

      if(m_omx_reader.SeekTime(seek_pos, seek_flags, &startpts))
        FlushStreams(startpts);

      m_player_video.Close();
      if(m_has_video && !m_player_video.Open(m_hints_video, m_av_clock, DestRect, m_Deinterlace, m_bMpeg,
                                         m_hdmi_clock_sync, m_thread_player, m_display_aspect))
        goto do_exit;

      m_av_clock->OMXStart(startpts);
      
      if(m_has_subtitle)
        m_player_subtitles.Resume();
    }

    /* player got in an error state */
    if(m_player_audio.Error())
    {
      printf("audio player error. emergency exit!!!\n");
      goto do_exit;
    }

    if(m_stats)
    {
      printf("V : %8.02f %8d %8d A : %8.02f %8.02f Cv : %8d Ca : %8d                            \r",
             m_av_clock->OMXMediaTime(), m_player_video.GetDecoderBufferSize(),
             m_player_video.GetDecoderFreeSpace(), m_player_audio.GetCurrentPTS() / DVD_TIME_BASE, 
             m_player_audio.GetDelay(), m_player_video.GetCached(), m_player_audio.GetCached());
    }

    if(m_omx_reader.IsEof() && !m_omx_pkt)
    {
      if (!m_player_audio.GetCached() && !m_player_video.GetCached())
        break;

      // Abort audio buffering, now we're on our own
      if (m_buffer_empty)
        m_av_clock->OMXResume();

      OMXClock::OMXSleep(10);
      continue;
    }

    /* when the audio buffer runs under 0.1 seconds we buffer up */
    if(m_has_audio)
    {
      if(m_player_audio.GetDelay() < 0.1f && !m_buffer_empty)
      {
        if(!m_av_clock->OMXIsPaused())
        {
          m_av_clock->OMXPause();
          //printf("buffering start\n");
          m_buffer_empty = true;
          clock_gettime(CLOCK_REALTIME, &starttime);
        }
      }
      if(m_player_audio.GetDelay() > (AUDIO_BUFFER_SECONDS * 0.75f) && m_buffer_empty)
      {
        if(m_av_clock->OMXIsPaused())
        {
          m_av_clock->OMXResume();
          //printf("buffering end\n");
          m_buffer_empty = false;
开发者ID:flavioalsoares,项目名称:omxplayer,代码行数:67,代码来源:omxplayer.cpp

示例2: main


//.........这里部分代码省略.........
    else if(m_has_audio && m_omx_pkt && m_omx_pkt->codec_type == AVMEDIA_TYPE_AUDIO)
    {
      if(m_player_audio.AddPacket(m_omx_pkt))
        m_omx_pkt = NULL;
      else
        OMXClock::OMXSleep(10);
    }
    else if(m_omx_pkt && m_omx_reader.IsActive(OMXSTREAM_SUBTITLE, m_omx_pkt->stream_index))
    {
      if(m_omx_pkt->size && (m_omx_pkt->hints.codec == CODEC_ID_TEXT || 
                             m_omx_pkt->hints.codec == CODEC_ID_SSA))
      {
        if(m_player_video.AddPacket(m_omx_pkt))
          m_omx_pkt = NULL;
        else
          OMXClock::OMXSleep(10);
      }
      else
      {
        m_omx_reader.FreePacket(m_omx_pkt);
        m_omx_pkt = NULL;
      }
    }
    else
    {
      if(m_omx_pkt)
      {
        m_omx_reader.FreePacket(m_omx_pkt);
        m_omx_pkt = NULL;
      }
    }

    /* player got in an error state */
    if(m_player_audio.Error())
    {
      printf("audio player error. emergency exit!!!\n");
      goto do_exit;
    }

    CStdString strSubTitle = m_player_video.GetText();
    if(strSubTitle.length() && m_show_subtitle)
    {
      if(last_sub != strSubTitle)
      {
        last_sub = strSubTitle;
        printf("Text : %s\n", strSubTitle.c_str());
      }
    }

    if(m_stats)
    {
      printf("V : %8.02f %8d %8d A : %8.02f %8.02f Cv : %8d Ca : %8d                            \r",
             m_player_video.GetCurrentPTS() / DVD_TIME_BASE, m_player_video.GetDecoderBufferSize(),
             m_player_video.GetDecoderFreeSpace(), m_player_audio.GetCurrentPTS() / DVD_TIME_BASE, 
             m_player_audio.GetDelay(), m_player_video.GetCached(), m_player_audio.GetCached());
    }
    if(m_omx_reader.IsEof())
        break;

  }

do_exit:
  printf("\n");

  if(!m_stop)
  {
    if(m_has_audio)
      m_player_audio.WaitCompletion();
    else if(m_has_video)
      m_player_video.WaitCompletion();
  }

  if(m_refresh)
  {
    m_BcmHost.vc_tv_hdmi_power_on_best(tv_state.width, tv_state.height, tv_state.frame_rate, HDMI_NONINTERLACED,
                                       (EDID_MODE_MATCH_FLAG_T)(HDMI_MODE_MATCH_FRAMERATE|HDMI_MODE_MATCH_RESOLUTION|HDMI_MODE_MATCH_SCANMODE));
  }

  m_av_clock->OMXStop();
  m_av_clock->OMXStateIdle();

  m_player_video.Close();
  m_player_audio.Close();

  if(m_omx_pkt)
  {
    m_omx_reader.FreePacket(m_omx_pkt);
    m_omx_pkt = NULL;
  }

  m_omx_reader.Close();

  vc_tv_show_info(0);

  g_OMX.Deinitialize();
  g_RBP.Deinitialize();

  printf("have a nice day ;)\n");
  return 1;
}
开发者ID:Bengt,项目名称:omxplayer,代码行数:101,代码来源:omxplayer.cpp

示例3: startVideo


//.........这里部分代码省略.........
            pts = m_av_clock->GetPTS();

            seek_pos = (pts / DVD_TIME_BASE) + m_incr;
            seek_flags = m_incr < 0.0f ? AVSEEK_FLAG_BACKWARD : 0;

            seek_pos *= 1000.0f;

            m_incr = 0;

            if(m_omx_reader.SeekTime(seek_pos, seek_flags, &startpts))
                FlushStreams(startpts);

            m_player_video->Close();
            if(m_has_video && !m_player_video->Open(m_hints_video, m_av_clock, textureId, m_Deinterlace,  m_bMpeg,
                                                    m_hdmi_clock_sync, m_thread_player, m_display_aspect))
                goto do_exit;
        }

        /* player got in an error state */
        if(m_player_audio->Error())
        {
            printf("audio player error. emergency exit!!!\n");
            goto do_exit;
        }

        if(m_stats)
        {
            printf("V : %8.02f %8d %8d A : %8.02f %8.02f Cv : %8d Ca : %8d                            \r",
                   m_av_clock->OMXMediaTime(), m_player_video->GetDecoderBufferSize(),
                   m_player_video->GetDecoderFreeSpace(), m_player_audio->GetCurrentPTS() / DVD_TIME_BASE,
                   m_player_audio->GetDelay(), m_player_video->GetCached(), m_player_audio->GetCached());
        }

        if(m_omx_reader.IsEof() && !m_omx_pkt)
        {
            if (!m_player_audio->GetCached() && !m_player_video->GetCached())
                break;

            // Abort audio buffering, now we're on our own
            if (m_buffer_empty)
                m_av_clock->OMXResume();

            OMXClock::OMXSleep(10);
            continue;
        }

        /* when the audio buffer runs under 0.1 seconds we buffer up */
        if(m_has_audio)
        {
            if(m_player_audio->GetDelay() < 0.1f && !m_buffer_empty)
            {
                if(!m_av_clock->OMXIsPaused())
                {
                    m_av_clock->OMXPause();
                    //printf("buffering start\n");
                    m_buffer_empty = true;
                    clock_gettime(CLOCK_REALTIME, &starttime);
                }
            }
            if(m_player_audio->GetDelay() > (AUDIO_BUFFER_SECONDS * 0.75f) && m_buffer_empty)
            {
                if(m_av_clock->OMXIsPaused())
                {
                    m_av_clock->OMXResume();
                    //printf("buffering end\n");
                    m_buffer_empty = false;
开发者ID:kirgene,项目名称:pi,代码行数:67,代码来源:omxplayer.cpp


注:本文中的OMXReader::IsEof方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。