本文整理汇总了C++中DllBcmHost::vc_tv_hdmi_power_on_explicit_new方法的典型用法代码示例。如果您正苦于以下问题:C++ DllBcmHost::vc_tv_hdmi_power_on_explicit_new方法的具体用法?C++ DllBcmHost::vc_tv_hdmi_power_on_explicit_new怎么用?C++ DllBcmHost::vc_tv_hdmi_power_on_explicit_new使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DllBcmHost
的用法示例。
在下文中一共展示了DllBcmHost::vc_tv_hdmi_power_on_explicit_new方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: SetVideoMode
//.........这里部分代码省略.........
if (supported_modes)
{
num_modes = m_BcmHost.vc_tv_hdmi_get_supported_modes_new(group,
supported_modes, max_supported_modes, &prefer_group, &prefer_mode);
CLog::Log(LOGDEBUG, "EGL get supported modes (%d) = %d, prefer_group=%x, prefer_mode=%x\n",
group, num_modes, prefer_group, prefer_mode);
}
TV_SUPPORTED_MODE_NEW_T *tv_found = NULL;
if (num_modes > 0 && prefer_group != HDMI_RES_GROUP_INVALID)
{
uint32_t best_score = 1<<30;
uint32_t scan_mode = 0;
for (i=0; i<num_modes; i++)
{
TV_SUPPORTED_MODE_NEW_T *tv = supported_modes + i;
uint32_t score = 0;
uint32_t w = tv->width;
uint32_t h = tv->height;
uint32_t r = tv->frame_rate;
/* Check if frame rate match (equal or exact multiple) */
if(fabs(r - 1.0f*fps) / fps < 0.002f)
score += 0;
else if(fabs(r - 2.0f*fps) / fps < 0.002f)
score += 1<<8;
else
score += (1<<28)/r; // bad - but prefer higher framerate
/* Check size too, only choose, bigger resolutions */
if(width && height)
{
/* cost of too small a resolution is high */
score += max((int)(width -w), 0) * (1<<16);
score += max((int)(height-h), 0) * (1<<16);
/* cost of too high a resolution is lower */
score += max((int)(w-width ), 0) * (1<<4);
score += max((int)(h-height), 0) * (1<<4);
}
// native is good
if (!tv->native)
score += 1<<16;
// interlace is bad
if (scan_mode != tv->scan_mode)
score += (1<<16);
// wanting 3D but not getting it is a negative
if (is3d == CONF_FLAGS_FORMAT_SBS && !(tv->struct_3d_mask & HDMI_3D_STRUCT_SIDE_BY_SIDE_HALF_HORIZONTAL))
score += 1<<18;
if (is3d == CONF_FLAGS_FORMAT_TB && !(tv->struct_3d_mask & HDMI_3D_STRUCT_TOP_AND_BOTTOM))
score += 1<<18;
// prefer square pixels modes
float par = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio)*(float)tv->height/(float)tv->width;
score += fabs(par - 1.0f) * (1<<12);
/*printf("mode %dx%[email protected]%d %s%s:%x par=%.2f score=%d\n", tv->width, tv->height,
tv->frame_rate, tv->native?"N":"", tv->scan_mode?"I":"", tv->code, par, score);*/
if (score < best_score)
{
tv_found = tv;
best_score = score;
}
}
}
if(tv_found)
{
printf("Output mode %d: %dx%[email protected]%d %s%s:%x\n", tv_found->code, tv_found->width, tv_found->height,
tv_found->frame_rate, tv_found->native?"N":"", tv_found->scan_mode?"I":"", tv_found->code);
// if we are closer to ntsc version of framerate, let gpu know
int ifps = (int)(fps+0.5f);
bool ntsc_freq = fabs(fps*1001.0f/1000.0f - ifps) < fabs(fps-ifps);
char response[80];
vc_gencmd(response, sizeof response, "hdmi_ntsc_freqs %d", ntsc_freq);
/* inform TV of any 3D settings. Note this property just applies to next hdmi mode change, so no need to call for 2D modes */
HDMI_PROPERTY_PARAM_T property;
property.property = HDMI_PROPERTY_3D_STRUCTURE;
property.param1 = HDMI_3D_FORMAT_NONE;
property.param2 = 0;
if (is3d != CONF_FLAGS_FORMAT_NONE)
{
if (is3d == CONF_FLAGS_FORMAT_SBS && tv_found->struct_3d_mask & HDMI_3D_STRUCT_SIDE_BY_SIDE_HALF_HORIZONTAL)
property.param1 = HDMI_3D_FORMAT_SBS_HALF;
else if (is3d == CONF_FLAGS_FORMAT_TB && tv_found->struct_3d_mask & HDMI_3D_STRUCT_TOP_AND_BOTTOM)
property.param1 = HDMI_3D_FORMAT_TB_HALF;
m_BcmHost.vc_tv_hdmi_set_property(&property);
}
printf("ntsc_freq:%d %s%s\n", ntsc_freq, property.param1 == HDMI_3D_FORMAT_SBS_HALF ? "3DSBS":"", property.param1 == HDMI_3D_FORMAT_TB_HALF ? "3DTB":"");
m_BcmHost.vc_tv_hdmi_power_on_explicit_new(HDMI_MODE_HDMI, (HDMI_RES_GROUP_T)group, tv_found->code);
}
}