本文整理汇总了C++中OMXReader::IsActive方法的典型用法代码示例。如果您正苦于以下问题:C++ OMXReader::IsActive方法的具体用法?C++ OMXReader::IsActive怎么用?C++ OMXReader::IsActive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OMXReader
的用法示例。
在下文中一共展示了OMXReader::IsActive方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
{
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;
}
}
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);
示例2: main
//.........这里部分代码省略.........
{
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;
}
}
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_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);
示例3: startVideo
//.........这里部分代码省略.........
{
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;
}
}
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_omx_pkt && m_omx_reader.IsActive(OMXSTREAM_SUBTITLE, m_omx_pkt->stream_index))
{
if(m_omx_pkt->size && m_show_subtitle &&
(m_omx_pkt->hints.codec == CODEC_ID_TEXT ||
m_omx_pkt->hints.codec == CODEC_ID_SSA))
{
if(m_player_subtitles->AddPacket(m_omx_pkt))
m_omx_pkt = NULL;
else