if (hdmi) {
- TV_SUPPORTED_MODE_T all_supp_modes[TV_MAX_SUPPORTED_MODES];
+ TV_SUPPORTED_MODE_T all_supp_modes[200];
HDMI_RES_GROUP_T pref_group;
TV_SUPPORTED_MODE_T *mymode=NULL;
TV_SUPPORTED_MODE_T *mymode_second_best=NULL;
uint32_t pref_mode;
HDMI_RES_GROUP_T group=HDMI_RES_GROUP_CEA;
int all_my_modes=vc_tv_hdmi_get_supported_modes(HDMI_RES_GROUP_CEA,
- all_supp_modes,TV_MAX_SUPPORTED_MODES,
+ all_supp_modes,200,
&pref_group,&pref_mode);
if (all_my_modes<=0) {
group=HDMI_RES_GROUP_DMT;
all_my_modes=vc_tv_hdmi_get_supported_modes(HDMI_RES_GROUP_DMT,
- all_supp_modes,TV_MAX_SUPPORTED_MODES,
+ all_supp_modes,200,
&pref_group,&pref_mode);
Log::getInstance()->log("Video", Log::NOTICE, "No CEA fall back to DMT modes ");
}
Demuxer* demux=Demuxer::getInstance();
dodeint=false;
- deint_first_frame=false;
+ first_frame=true;
Log::getInstance()->log("Video", Log::NOTICE, "Allocate Codecs OMX");
//Clock, move later to audio including events
Log::getInstance()->log("Video", Log::NOTICE, "VideoType %d x %d i: %d", demux->getHorizontalSize(),demux->getVerticalSize(),demux->getInterlaced());
if (deinterlace!=0 && /*(demux->getHorizontalSize()<=720 ) &&*/ demux->getInterlaced()) { //only deinterlace SD material
dodeint=true;
- deint_first_frame=true;
+
Log::getInstance()->log("Video", Log::NOTICE, "Deinterlacing activated %d",deinterlace);
}
-void VideoOMX::DeinterlaceFix()
+void VideoOMX::FirstFrameFix()
{
int oldcancelstate;
int oldcanceltype;
&& port_def_type.format.video.nFrameHeight == demux->getVerticalSize()){
Log::getInstance()->log("Video", Log::DEBUG,
"Deinit first frame fix");
- deint_first_frame=false;
+ first_frame=false;
WaitForEvent(omx_vid_dec,OMX_EventPortSettingsChanged);
DisablePort(omx_vid_dec,omx_codec_output_port,false);
DisablePort(omx_vid_sched,omx_shed_input_port,false);
- DisablePort(omx_vid_deint,omx_deint_output_port,false);
- DisablePort(omx_vid_deint,omx_deint_input_port,false);
+ if (dodeint) {
+ DisablePort(omx_vid_deint,omx_deint_output_port,false);
+ DisablePort(omx_vid_deint,omx_deint_input_port,false);
- port_def_type.nPortIndex=omx_deint_input_port;
- error = OMX_SetParameter(omx_vid_deint, OMX_IndexParamPortDefinition,
- &port_def_type);
- if (error != OMX_ErrorNone) {
- Log::getInstance()->log("Video", Log::DEBUG,
- "Set OMX_IndexParamPortDefinition1 failed %x", error);
- clock_mutex.Unlock();
- pthread_setcancelstate(oldcancelstate, NULL);
- pthread_setcanceltype(oldcanceltype, NULL);
- return;
- }
- port_def_type.nPortIndex=omx_deint_output_port;
- error = OMX_SetParameter(omx_vid_deint, OMX_IndexParamPortDefinition,
- &port_def_type);
- if (error != OMX_ErrorNone) {
- Log::getInstance()->log("Video", Log::DEBUG,
- "Set OMX_IndexParamPortDefinition2 failed %x", error);
- clock_mutex.Unlock();
- pthread_setcancelstate(oldcancelstate, NULL);
- pthread_setcanceltype(oldcanceltype, NULL);
- return;
+ port_def_type.nPortIndex=omx_deint_input_port;
+ error = OMX_SetParameter(omx_vid_deint, OMX_IndexParamPortDefinition,
+ &port_def_type);
+ if (error != OMX_ErrorNone) {
+ Log::getInstance()->log("Video", Log::DEBUG,
+ "Set OMX_IndexParamPortDefinition1 failed %x", error);
+ clock_mutex.Unlock();
+ pthread_setcancelstate(oldcancelstate, NULL);
+ pthread_setcanceltype(oldcanceltype, NULL);
+ return;
+ }
+
+ port_def_type.nPortIndex=omx_deint_output_port;
+ error = OMX_SetParameter(omx_vid_deint, OMX_IndexParamPortDefinition,
+ &port_def_type);
+ if (error != OMX_ErrorNone) {
+ Log::getInstance()->log("Video", Log::DEBUG,
+ "Set OMX_IndexParamPortDefinition2 failed %x", error);
+ clock_mutex.Unlock();
+ pthread_setcancelstate(oldcancelstate, NULL);
+ pthread_setcanceltype(oldcanceltype, NULL);
+ return;
+ }
}
EnablePort(omx_vid_dec,omx_codec_output_port,false);
- EnablePort(omx_vid_deint,omx_deint_input_port,false);
- EnablePort(omx_vid_deint,omx_deint_output_port,false);
+ if (dodeint) {
+ EnablePort(omx_vid_deint,omx_deint_input_port,false);
+ EnablePort(omx_vid_deint,omx_deint_output_port,false);
+ }
EnablePort(omx_vid_sched,omx_shed_input_port,false);
}
clock_mutex.Unlock();
Log::getInstance()->log("Video", Log::DEBUG,
"OMX_EmptyThisBuffer failed %x", error);
}
- if (deint_first_frame && dodeint) DeinterlaceFix();
+ if (first_frame) FirstFrameFix();
}