本文整理汇总了C++中OMXReader::CanSeek方法的典型用法代码示例。如果您正苦于以下问题:C++ OMXReader::CanSeek方法的具体用法?C++ OMXReader::CanSeek怎么用?C++ OMXReader::CanSeek使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OMXReader
的用法示例。
在下文中一共展示了OMXReader::CanSeek方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
if(!m_av_clock->OMXInitialize(m_has_video, m_has_audio))
goto do_exit;
if(m_hdmi_clock_sync && !m_av_clock->HDMIClockSync())
goto do_exit;
m_omx_reader.GetHints(OMXSTREAM_AUDIO, m_hints_audio);
m_omx_reader.GetHints(OMXSTREAM_VIDEO, m_hints_video);
if(m_audio_index_use != -1)
m_omx_reader.SetActiveStream(OMXSTREAM_AUDIO, m_audio_index_use);
if(m_has_video && m_refresh)
{
memset(&tv_state, 0, sizeof(TV_DISPLAY_STATE_T));
m_BcmHost.vc_tv_get_display_state(&tv_state);
SetVideoMode(m_hints_video.width, m_hints_video.height, m_hints_video.fpsrate, m_hints_video.fpsscale, m_3d);
}
// get display aspect
TV_DISPLAY_STATE_T current_tv_state;
memset(¤t_tv_state, 0, sizeof(TV_DISPLAY_STATE_T));
m_BcmHost.vc_tv_get_display_state(¤t_tv_state);
if(current_tv_state.state & ( VC_HDMI_HDMI | VC_HDMI_DVI )) {
//HDMI or DVI on
m_display_aspect = get_display_aspect_ratio((HDMI_ASPECT_T)current_tv_state.display.hdmi.aspect_ratio);
} else {
//composite on
m_display_aspect = get_display_aspect_ratio((SDTV_ASPECT_T)current_tv_state.display.sdtv.display_options.aspect);
}
m_display_aspect *= (float)current_tv_state.display.hdmi.height/(float)current_tv_state.display.hdmi.width;
// seek on start
if (m_seek_pos !=0 && m_omx_reader.CanSeek()) {
printf("Seeking start of video to %i seconds\n", m_seek_pos);
m_omx_reader.SeekTime(m_seek_pos * 1000.0f, 0, &startpts); // from seconds to DVD_TIME_BASE
}
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;
{
std::vector<Subtitle> external_subtitles;
if(m_has_external_subtitles &&
!ReadSrt(m_external_subtitles_path, external_subtitles))
{
puts("Unable to read the subtitle file.");
goto do_exit;
}
if(m_has_subtitle &&
!m_player_subtitles.Open(m_omx_reader.SubtitleStreamCount(),
std::move(external_subtitles),
m_font_path,
m_font_size,
m_centered,
m_subtitle_lines,
m_av_clock))
goto do_exit;
}
if(m_has_subtitle)
{
if(!m_has_external_subtitles)
{
示例2: main
//.........这里部分代码省略.........
case 'o':
if(m_omx_reader.GetChapterCount() > 0)
{
m_omx_reader.SeekChapter(m_omx_reader.GetChapter() + 1, &startpts);
FlushStreams(startpts);
}
else
{
m_incr = 600.0;
}
break;
case 'n':
if(m_omx_reader.GetSubtitleIndex() > 0)
{
m_omx_reader.SetActiveStream(OMXSTREAM_SUBTITLE, m_omx_reader.GetSubtitleIndex() - 1);
m_player_video.FlushSubtitles();
}
break;
case 'm':
if(m_omx_reader.GetSubtitleIndex() > 0)
{
m_omx_reader.SetActiveStream(OMXSTREAM_SUBTITLE, m_omx_reader.GetSubtitleIndex() + 1);
m_player_video.FlushSubtitles();
}
break;
case 's':
m_show_subtitle = !m_show_subtitle;
break;
case 'q':
m_stop = true;
goto do_exit;
break;
case 0x5b44: // key left
if(m_omx_reader.CanSeek()) m_incr = -30.0;
break;
case 0x5b43: // key right
if(m_omx_reader.CanSeek()) m_incr = 30.0;
break;
case 0x5b41: // key up
if(m_omx_reader.CanSeek()) m_incr = 600.0;
break;
case 0x5b42: // key down
if(m_omx_reader.CanSeek()) m_incr = -600.0;
break;
case ' ':
case 'p':
m_Pause = !m_Pause;
if(m_Pause)
{
SetSpeed(OMX_PLAYSPEED_PAUSE);
m_av_clock->OMXPause();
}
else
{
SetSpeed(OMX_PLAYSPEED_NORMAL);
m_av_clock->OMXResume();
}
break;
case '-':
m_player_audio.SetCurrentVolume(m_player_audio.GetCurrentVolume() - 50);
printf("Current Volume: %.2fdB\n", m_player_audio.GetCurrentVolume() / 100.0f);
break;
case '+':
m_player_audio.SetCurrentVolume(m_player_audio.GetCurrentVolume() + 50);
printf("Current Volume: %.2fdB\n", m_player_audio.GetCurrentVolume() / 100.0f);
break;
示例3: startVideo
//.........这里部分代码省略.........
if(m_hdmi_clock_sync && !m_av_clock->HDMIClockSync())
#if 0
goto do_exit;
#endif
return 0;
m_omx_reader.GetHints(OMXSTREAM_AUDIO, m_hints_audio);
m_omx_reader.GetHints(OMXSTREAM_VIDEO, m_hints_video);
if(m_audio_index_use != -1)
m_omx_reader.SetActiveStream(OMXSTREAM_AUDIO, m_audio_index_use);
if(m_has_video && m_refresh)
{
memset(&tv_state, 0, sizeof(TV_GET_STATE_RESP_T));
m_BcmHost.vc_tv_get_state(&tv_state);
if(m_filename.find("3DSBS") != string::npos)
m_3d = true;
SetVideoMode(m_hints_video.width, m_hints_video.height, m_hints_video.fpsrate, m_hints_video.fpsscale, m_3d);
}
// get display aspect
TV_GET_STATE_RESP_T current_tv_state;
memset(¤t_tv_state, 0, sizeof(TV_GET_STATE_RESP_T));
m_BcmHost.vc_tv_get_state(¤t_tv_state);
if(current_tv_state.width && current_tv_state.height)
m_display_aspect = (float)current_tv_state.width / (float)current_tv_state.height;
// seek on start
if (m_seek_pos !=0 && m_omx_reader.CanSeek()) {
printf("Seeking start of video to %i seconds\n", m_seek_pos);
m_omx_reader.SeekTime(m_seek_pos * 1000.0f, 0, &startpts); // from seconds to DVD_TIME_BASE
}
LOG_VERBOSE(LOG_TAG, "Opening video using OMX...");
uint textureId;
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))
#if 0
goto do_exit;
#endif
return 0;
LOG_VERBOSE(LOG_TAG, "Opening subtitles using OMX...");
if(m_has_subtitle &&
!m_player_subtitles->Open(m_font_path, m_font_size, m_centered, m_av_clock))
#if 0
goto do_exit;
#endif
return 0;
// This is an upper bound check on the subtitle limits. When we pulled the subtitle
// index from the user we check to make sure that the value is larger than zero, but
// we couldn't know without scanning the file if it was too high. If this is the case
// then we replace the subtitle index with the maximum value possible.
if(m_has_subtitle && m_subtitle_index > (m_omx_reader.SubtitleStreamCount() - 1))
{
m_subtitle_index = m_omx_reader.SubtitleStreamCount() - 1;
}
// Here we actually enable the subtitle streams if we have one available.
if (m_show_subtitle && m_has_subtitle && m_subtitle_index <= (m_omx_reader.SubtitleStreamCount() - 1))