⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mv_inp.c

📁 tuner扫描
💻 C
📖 第 1 页 / 共 3 页
字号:
   )
/*EMP=======================================================================*/
{
   GV_MV_INP_status.function_ptr = in_function_ptr;

} /* End of MV_INP_install_notify */

/*MPF=======================================================================*/
/*  
    FUNCTION NAME:     MV_INP_enable_notification

    PACKAGE:           INP

    SCOPE:             PLATEFORM

    DESCRIPTION:
    This function enables the events for which a notification will be given.
    When an event  occurs, the notify function is called that is installed
    for the event.
    By default, no events are enabled. 

    NOTES:
    Notify functions themselves are not part of the API but must be provided
    by the application.   

    PRECONDITIONS:
    Notify functions for the events are installed via MV_INP_install_notify().

    POSTCONDITIONS:
    None
    
    CALLING SEQUENCE:
*/
void
MV_INP_enable_notification(    
   MV_INP_EVENT        in_events
   )
/*EMP=======================================================================*/
{
   /* Add event to mask */
   GV_MV_INP_status.inp_event_enabled |= in_events;
   
} /* End of MV_INP_enable_notification */

/*MPF=======================================================================*/
/*  
    FUNCTION NAME:     MV_INP_disable_notification

    PACKAGE:           INP

    SCOPE:             PLATEFORM

    DESCRIPTION:
    This function disables that a notification is given for the specified
    events. The notification can be enabled via the MV_INP_enable_notification.
    Note that notify functions themselves are not part of the API but must
    be provided by the application.

    PRECONDITIONS:
    Notify functions for the events are installed via MV_INP_install_notify().

    POSTCONDITIONS:
    None
    
    CALLING SEQUENCE:
*/
void
MV_INP_disable_notification(    
   MV_INP_EVENT        in_events
   )
/*EMP=======================================================================*/
{
   GV_MV_INP_status.inp_event_enabled &= ~in_events;
   
} /* End of MV_INP_disable_notification */


/*==========================================================================*/
/*       L O C A L  F U N C T I O N S                                       */ 
/*==========================================================================*/
/*LPF=======================================================================*/
/*
    FUNCTION NAME: LF_VIDEO_FIFO_UNDER_handler	

    DESCRIPTION:
    The video buffer fullness has fallen below the 'underflow' warning level.
    Notify the application when event masked.
        
    CALLING SEQUENCE:
*/
static void 
LF_VIDEO_FIFO_UNDER_handler(
   void
   )
/*EMP=======================================================================*/
{
#ifdef DV_DEBUG
   register unsigned long lv_info0 = MV_drv_video_fifo_bfmo_cur();
   register unsigned long lv_info1 = MV_drv_video_fifo_bfmu_cur();
   register unsigned long lv_info2 = MV_drv_video_fifo_under();
   register unsigned long lv_info3 = 0;
#endif
   
   DV_DBG_STORE_EVENT(IPVD_DBG_EV_ISR, IPVD_DBG_ISR_BEGIN_LEVEL,IPVD_FIFO_UNDER_ISR, 0, 0, 0);

   DV_DBG_STORE_EVENT(IPVD_DBG_EV_VIDEO_FIFO_UNDER, IPVD_DBG_MAJOR_BEHAVIOR_LEVEL,lv_info0,lv_info1,lv_info2,lv_info3);
                  
   if (GV_MV_INP_status.inp_event_enabled & MV_INP_BUFFER_UNDER_EVENT)
   {
      /* Notify the application. */
      GV_MV_INP_status.function_ptr(MV_INP_BUFFER_UNDER_EVENT);
   }

   /* Enable VIDEO_FIFO_EMPTY irpt */
   MV_ITV_isr_enable_irpt(MV_ITV_VIDEO_FIFO_EMPTY);

   DV_DBG_STORE_EVENT(IPVD_DBG_EV_ISR, IPVD_DBG_ISR_END_LEVEL,IPVD_FIFO_UNDER_ISR, 0, 0, 0);

} /* End of LF_VIDEO_FIFO_UNDER_handler */

/*LPF=======================================================================*/
/*
    FUNCTION NAME: LF_VIDEO_FIFO_OVER_handler	

    DESCRIPTION:
    The video buffer fullnes has reached the 'overflow' level.
    When the BUFFER_CONTROLLED play mode is selected start the video decoding.
    Notify the application when event masked.
    
    CALLING SEQUENCE:
*/
static void 
LF_VIDEO_FIFO_OVER_handler(
   void
   )
/*EMP=======================================================================*/
{
#ifdef DV_DEBUG
   register unsigned long lv_info0 = MV_drv_video_fifo_bfmo_cur();
   register unsigned long lv_info1 = MV_drv_video_fifo_bfmu_cur();
   register unsigned long lv_info2 = MV_drv_video_fifo_over();
#endif
   
   DV_DBG_STORE_EVENT(IPVD_DBG_EV_ISR, IPVD_DBG_ISR_BEGIN_LEVEL,IPVD_FIFO_OVER_ISR, 0, 0, 0);

   /* Disable MV_ITV_VIDEO_FIFO_OVER irpt to avoid cpu hang-up */ //JI 2005-06-05 11:08AM
   MV_ITV_isr_disable_irpt(MV_ITV_VIDEO_FIFO_OVER);

   DV_DBG_STORE_EVENT(IPVD_DBG_EV_VIDEO_FIFO_OVER, IPVD_DBG_MAJOR_BEHAVIOR_LEVEL,lv_info0,lv_info1,lv_info2,0);

   if (GV_MV_INP_status.inp_event_enabled & MV_INP_BUFFER_OVER_EVENT)
   {
      /* Notify the application. */
      GV_MV_INP_status.function_ptr(MV_INP_BUFFER_OVER_EVENT);
   }

   /* Enable VIDEO_FIFO_FULL irpt */
   MV_ITV_isr_enable_irpt(MV_ITV_VIDEO_FIFO_FULL);
   
   /* instruct decoding package of the overflow, by setting video
      buffer in mode "START" to begin decoding */
   if ((GV_cmd_buf_start == FALSE) && ((GV_MV_DEC_status.dec_sync_mode == MV_DEC_SYNC_MODE_BUF_CONTROLLED)))
   {
      MV_drv_set_video_fifo_disable(MV_BIT_OFF);
      MV_drv_set_video_synchronisation_mode(MV_VIDEO_BUF_CTRL_START);
      GV_cmd_buf_start = TRUE;

#ifdef DV_DEBUG
      lv_info0 = MV_drv_video_fifo_bfmo_cur();
      lv_info1 = MV_drv_video_fifo_bfmu_cur();
      lv_info2 = MV_drv_video_fifo_over();
#endif
      DV_DBG_STORE_EVENT(IPVD_DBG_EV_BUF_CMD_START, IPVD_DBG_MAJOR_BEHAVIOR_LEVEL,lv_info0,lv_info1,lv_info2,__LINE__);
            
      if (GV_MV_INP_status.inp_event_enabled & MV_INP_BUFFER_CMD_START_EVENT != 0)
      {
         /* Notify the application. */
         GV_MV_INP_status.function_ptr(MV_INP_BUFFER_CMD_START_EVENT);
      }
   }

   DV_DBG_STORE_EVENT(IPVD_DBG_EV_ISR, IPVD_DBG_ISR_END_LEVEL,IPVD_FIFO_OVER_ISR, 0, 0, 0);

} /* End of LF_VIDEO_FIFO_OVER_handler */

/*LPF=======================================================================*/
/*
    FUNCTION NAME: LF_VIDEO_FIFO_EMPTY_handler

    DESCRIPTION:
    The video buffer is empty.
    Notify the application when event masked.
    
    CALLING SEQUENCE:
*/
static void 
LF_VIDEO_FIFO_EMPTY_handler(
   void
   )
/*EMP=======================================================================*/
{
#ifdef DV_DEBUG
   register unsigned long lv_info0 = MV_drv_video_fifo_bfmo_cur();
   register unsigned long lv_info1 = MV_drv_video_fifo_bfmu_cur();
#endif
   
   DV_DBG_STORE_EVENT(IPVD_DBG_EV_ISR, IPVD_DBG_ISR_BEGIN_LEVEL,IPVD_FIFO_EMPTY_ISR, 0, 0, 0);

   /* Disable VIDEO_FIFO_EMPTY irpt to avoid cpu hang-up */
   MV_ITV_isr_disable_irpt(MV_ITV_VIDEO_FIFO_EMPTY);

   DV_DBG_STORE_EVENT(IPVD_DBG_EV_VIDEO_FIFO_EMPTY, IPVD_DBG_MAJOR_BEHAVIOR_LEVEL,lv_info0,lv_info1,0,0);

   if (GV_MV_INP_status.inp_event_enabled & MV_INP_BUFFER_EMPTY_EVENT)
   {
      /* Notify the application. */
      GV_MV_INP_status.function_ptr(MV_INP_BUFFER_EMPTY_EVENT);
   }

   DV_DBG_STORE_EVENT(IPVD_DBG_EV_ISR, IPVD_DBG_ISR_END_LEVEL,IPVD_FIFO_EMPTY_ISR, 0, 0, 0);

} /* End of LF_VIDEO_FIFO_EMPTY_handler */

/*LPF=======================================================================*/
/*
    FUNCTION NAME: LF_VIDEO_FIFO_FULL_handler

    DESCRIPTION:
    The video buffer is full.
    Notify the application when event masked.

    CALLING SEQUENCE:
*/
static void 
LF_VIDEO_FIFO_FULL_handler(
   void
   )
/*EMP=======================================================================*/
{
#ifdef DV_DEBUG
   register unsigned long lv_info0 = MV_drv_video_fifo_bfmo_cur();
   register unsigned long lv_info1 = MV_drv_video_fifo_bfmu_cur();
#endif
   
   DV_DBG_STORE_EVENT(IPVD_DBG_EV_ISR, IPVD_DBG_ISR_BEGIN_LEVEL,IPVD_FIFO_FULL_ISR, 0, 0, 0);

   /* this is a real fifo full, not due to HW reset */
   if ( MV_drv_video_fifo_bfmu_cur() > (MV_drv_video_fifo_size() - MV_INP_BFMO_BFMU_PIPELINE) )
   {
      /* Disable VIDEO_FIFO_FULL irpt to avoid cpu hang-up */
      MV_ITV_isr_disable_irpt(MV_ITV_VIDEO_FIFO_FULL);

      DV_DBG_STORE_EVENT(IPVD_DBG_EV_VIDEO_FIFO_FULL, IPVD_DBG_MAJOR_BEHAVIOR_LEVEL,lv_info0,lv_info1,0,0);

      if (GV_MV_INP_status.inp_event_enabled & MV_INP_BUFFER_FULL_EVENT)
      {
         /* Notify the application. */
         GV_MV_INP_status.function_ptr(MV_INP_BUFFER_FULL_EVENT);
      }
   }

   DV_DBG_STORE_EVENT(IPVD_DBG_EV_ISR, IPVD_DBG_ISR_END_LEVEL,IPVD_FIFO_FULL_ISR, 0, 0, 0);
            
} /* End of LF_VIDEO_FIFO_FULL_handler */

/*LPF=======================================================================*/
/*
    FUNCTION NAME: LF_VIDEO_FIFO_PTR_UPDATED_handler

    DESCRIPTION:
    The fifo pointers (RDPT, BFMU or BFMO) has been updated by hardware
    with the value filled in VIDEO_FIFO_NXT_VALUE register.
    Notify the application about this if event masked.
    
    CALLING SEQUENCE:
*/
static void 
LF_VIDEO_FIFO_PTR_UPDATED_handler(
   void
   )
/*EMP=======================================================================*/
{
   DV_DBG_STORE_EVENT(IPVD_DBG_EV_ISR, IPVD_DBG_ISR_BEGIN_LEVEL,IPVD_FIFO_PTR_UPDATED_ISR, 0, 0, 0);

   if (GV_MV_INP_status.inp_event_enabled & MV_INP_BUFFER_PTR_UPDATED_EVENT)
   {
      /* Notify the application. */
      GV_MV_INP_status.function_ptr(MV_INP_BUFFER_PTR_UPDATED_EVENT);
   }

   DV_DBG_STORE_EVENT(IPVD_DBG_EV_ISR, IPVD_DBG_ISR_END_LEVEL,IPVD_FIFO_PTR_UPDATED_ISR, 0, 0, 0);
   
} /* End of LF_VIDEO_FIFO_PTR_UPDATED_handler */

/*LPF=======================================================================*/
/*
  FUNCTION NAME: LF_SYSTEM_EVENT_handler

  DESCRIPTION:
  A system event occurs.
  Notify the application about this if event masked.    
        
  CALLING SEQUENCE:
  */
static void 
LF_SYSTEM_EVENT_handler(
   void
   )
/*EMP=======================================================================*/
{
   unsigned long   lv_system_event;

   DV_DBG_STORE_EVENT(IPVD_DBG_EV_ISR, IPVD_DBG_ISR_BEGIN_LEVEL,IPVD_SYSTEM_EVENT_ISR, 0, 0, 0);
 
   lv_system_event = GV_itv_system_event;

   if ((lv_system_event & MV_INP_SYSTEM_EVENT_NEED_DTS) != 0)
   {
      DV_DBG_STORE_EVENT(IPVD_DBG_EV_NEED_DTS, IPVD_DBG_MAJOR_BEHAVIOR_LEVEL,0,0,0,0);
   }  
   if ((lv_system_event & MV_INP_SYSTEM_EVENT_DTS_EMULATION) != 0)
   {
      DV_DBG_STORE_EVENT(IPVD_DBG_EV_EMULATION_DTS, IPVD_DBG_MAJOR_BEHAVIOR_LEVEL,0,0,0,0);
   }
   
   DV_DBG_STORE_EVENT(IPVD_DBG_EV_ISR, IPVD_DBG_ISR_END_LEVEL,IPVD_SYSTEM_EVENT_ISR, 0, 0, 0);
   
} /* End of LF_SYSTEM_EVENT_handler */

/*LPF=======================================================================*/
/*
    FUNCTION NAME: LF_NEW_VIDEO_DTS_handler

    DESCRIPTION:
    A new video DTS has been detected.

    CALLING SEQUENCE:
*/
static void 
LF_NEW_VIDEO_DTS_handler(
   void
   )
/*EMP=======================================================================*/
{  
   UInt32 lv_protection_level;

#ifdef DV_DEBUG
   register unsigned long lv_info0 = MV_drv_video_dts();
#endif

   DV_DBG_STORE_EVENT(IPVD_DBG_EV_ISR, IPVD_DBG_ISR_BEGIN_LEVEL,IPVD_NEW_DTS_ISR, 0, 0, 0);

   if ((MV_drv_video_synchronisation_mode() == MV_VIDEO_BUF_CTRL_DTS_LOCKED) && (GV_MV_DEC_status.dec_dts_found == FALSE))
   {
      tmosalDisableInterruptsNoSysCall(&lv_protection_level);
      GV_MV_DEC_status.dec_dts_found = TRUE;
      tmosalEnableInterruptsNoSysCall(lv_protection_level);
   }
   DV_DBG_STORE_EVENT(IPVD_DBG_EV_NEW_DTS_FOUND, IPVD_DBG_MAJOR_BEHAVIOR_LEVEL,lv_info0,0,0,0);
   
   DV_DBG_STORE_EVENT(IPVD_DBG_EV_ISR, IPVD_DBG_ISR_END_LEVEL,IPVD_NEW_DTS_ISR, 0, 0, 0);
   
} /* End of LF_NEW_VIDEO_DTS_handler */

/*LPF=======================================================================*/
/*
    FUNCTION NAME: LF_NEW_VIDEO_PTS_handler

    DESCRIPTION:
    A new video PTS has been detected.

    CALLING SEQUENCE:
*/
static void 
LF_NEW_VIDEO_PTS_handler(
   void
   )
/*EMP=======================================================================*/
{  
   UInt32 lv_protection_level;

#ifdef DV_DEBUG
   register unsigned long lv_info0 = MV_drv_video_pts();
#endif

   DV_DBG_STORE_EVENT(IPVD_DBG_EV_ISR, IPVD_DBG_ISR_BEGIN_LEVEL,IPVD_NEW_PTS_ISR, 0, 0, 0);

   if ((MV_drv_video_synchronisation_mode() == MV_VIDEO_BUF_CTRL_DTS_LOCKED) && (GV_MV_DEC_status.dec_dts_found == FALSE))

   {
      tmosalDisableInterruptsNoSysCall(&lv_protection_level);
      GV_MV_DEC_status.dec_pts_found = TRUE;
      tmosalEnableInterruptsNoSysCall(lv_protection_level);
   }
   
   DV_DBG_STORE_EVENT(IPVD_DBG_EV_NEW_PTS_FOUND, IPVD_DBG_MAJOR_BEHAVIOR_LEVEL,lv_info0,0,0,0);

   DV_DBG_STORE_EVENT(IPVD_DBG_EV_ISR, IPVD_DBG_ISR_END_LEVEL,IPVD_NEW_PTS_ISR, 0, 0, 0);
   
} /* End of LF_NEW_VIDEO_PTS_handler */

/*==========================================================================*/
/*        H I S T O R Y                                                     */
/*==========================================================================*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -