本文整理汇总了C++中OMXReader::GetRelativeIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ OMXReader::GetRelativeIndex方法的具体用法?C++ OMXReader::GetRelativeIndex怎么用?C++ OMXReader::GetRelativeIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OMXReader
的用法示例。
在下文中一共展示了OMXReader::GetRelativeIndex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
}
}
if(m_buffer_empty)
{
clock_gettime(CLOCK_REALTIME, &endtime);
if((endtime.tv_sec - starttime.tv_sec) > 1)
{
m_buffer_empty = false;
m_av_clock->OMXResume();
//printf("buffering timed out\n");
}
}
}
if(!m_omx_pkt)
m_omx_pkt = m_omx_reader.Read();
if(m_has_video && m_omx_pkt && m_omx_reader.IsActive(OMXSTREAM_VIDEO, m_omx_pkt->stream_index))
{
if(m_player_video.AddPacket(m_omx_pkt))
m_omx_pkt = NULL;
else
OMXClock::OMXSleep(10);
if(m_tv_show_info)
{
char response[80];
vc_gencmd(response, sizeof response, "render_bar 4 video_fifo %d %d %d %d",
m_player_video.GetDecoderBufferSize()-m_player_video.GetDecoderFreeSpace(),
0 , 0, m_player_video.GetDecoderBufferSize());
vc_gencmd(response, sizeof response, "render_bar 5 audio_fifo %d %d %d %d",
(int)(100.0*m_player_audio.GetDelay()), 0, 0, 100*AUDIO_BUFFER_SECONDS);
}
}
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_has_subtitle && m_omx_pkt &&
m_omx_pkt->codec_type == AVMEDIA_TYPE_SUBTITLE)
{
auto result = m_player_subtitles.AddPacket(m_omx_pkt,
m_omx_reader.GetRelativeIndex(m_omx_pkt->stream_index));
if (result)
m_omx_pkt = NULL;
else
OMXClock::OMXSleep(10);
}
else
{
if(m_omx_pkt)
{
m_omx_reader.FreePacket(m_omx_pkt);
m_omx_pkt = NULL;
}
}
}
do_exit:
printf("\n");
if(!m_stop && !g_abort)
{
if(m_has_audio)
m_player_audio.WaitCompletion();
else if(m_has_video)
m_player_video.WaitCompletion();
}
if(m_has_video && m_refresh && tv_state.display.hdmi.group && tv_state.display.hdmi.mode)
{
m_BcmHost.vc_tv_hdmi_power_on_explicit_new(HDMI_MODE_HDMI, (HDMI_RES_GROUP_T)tv_state.display.hdmi.group, tv_state.display.hdmi.mode);
}
m_av_clock->OMXStop();
m_av_clock->OMXStateIdle();
m_player_subtitles.Close();
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;
}