]> git.vomp.tv Git - vompclient-marten.git/commitdiff
Fixes for next firmware tree
authorMarten Richter <marten.richter@freenet.de>
Thu, 20 Dec 2012 07:25:02 +0000 (08:25 +0100)
committerMarten Richter <marten.richter@freenet.de>
Thu, 20 Dec 2012 07:25:02 +0000 (08:25 +0100)
videoomx.cc
videoomx.h

index 449437fa87fc2cc838a859d14a23ebfb35db5d82..f3b300214d32be746cccc984514665362f87fd2f 100644 (file)
@@ -395,7 +395,7 @@ void VideoOMX::selectVideoMode(int interlaced)
 
 
        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;
@@ -403,12 +403,12 @@ void VideoOMX::selectVideoMode(int interlaced)
                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 ");
                }
@@ -1002,7 +1002,7 @@ int VideoOMX::AllocateCodecsOMX()
        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
@@ -1010,7 +1010,7 @@ int VideoOMX::AllocateCodecsOMX()
        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);
 
@@ -2392,7 +2392,7 @@ void VideoOMX::ResetTimeOffsets() {
 }
 
 
-void VideoOMX::DeinterlaceFix()
+void VideoOMX::FirstFrameFix()
 {
        int oldcancelstate;
        int oldcanceltype;
@@ -2419,42 +2419,47 @@ void VideoOMX::DeinterlaceFix()
                        && 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();
@@ -2474,7 +2479,7 @@ void VideoOMX::PutBufferToPres(OMX_BUFFERHEADERTYPE* buffer)
                Log::getInstance()->log("Video", Log::DEBUG,
                                "OMX_EmptyThisBuffer failed %x", error);
        }
-       if (deint_first_frame && dodeint) DeinterlaceFix();
+       if (first_frame) FirstFrameFix();
 
 }
 
index 85c0a5b4b1b5b06b740644a541d7189261b3384e..7974e4a492c8a11085e03e1a0b3e1725b8a6b062 100644 (file)
@@ -233,8 +233,8 @@ class VideoOMX : public Video
           OMX_HANDLETYPE omx_clock;
           int clock_references;
           bool dodeint; //deinterlacer was activated in omx filtergraph
-          bool deint_first_frame; //handle frame change
-          void DeinterlaceFix();
+          bool first_frame; //handle frame change
+          void FirstFrameFix();
 
 
           OMX_U32 omx_codec_input_port;