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

📄 fbm_api.c

📁 tuner扫描
💻 C
📖 第 1 页 / 共 5 页
字号:

   msg[0] = FBM_MSG_FREEZE;
   msg[1] = in_freeze_mode;
  
   returnVal = tmosalQueueSend(GV_fbm_qid, msg, sizeof(FBM_QUEUE_MSG), &lv_timeout, tmosalQueueSendFlagNone);

   if (returnVal != TM_OK)
   {
      switch (returnVal)
      {
         case TMOSAL_ERR_QUE_TIMEOUT:
            DV_DBG_STORE_EVENT(IPVD_DBG_EV_TIMEOUT, IPVD_DBG_QUEUE_TIMEOUT_LEVEL,1, 0,0,0);
            break;

         default:
            DV_DBG_STORE_EVENT(IPVD_DBG_EV_TMOSAL_ERROR,
                               IPVD_DBG_MAJOR_BEHAVIOR_LEVEL,
                               IPVD_QUEUE_SEND, returnVal, msg[0], 0); // Log the error
            break;

      } /* End switch */
   }

   return(MV_FBM_OK);

} /* MV_FBM_freeze()*/

/*MPF=======================================================================*/
/*
    FUNCTION NAME: MV_FBM_api_abort_decoding	

    DESCRIPTION:
    Abort decoding triggered by the application

    RETURNS:
        MV_FBM_OK
	MV_FBM_NOT_OK

    CALLING SEQUENCE:
*/
extern int
MV_FBM_api_abort_decoding(
void
)
/*EMP=======================================================================*/
{
   Int32            lv_timeout = MV_CFG_QUEUE_TIMEOUT;
   tmErrorCode_t returnVal;

   /****************-----------------------------------------------!*********
   ****************!      Variable declarations                    !*********
   ****************!-----------------------------------------------*********/

   /* Declaration for sending messages */

   FBM_QUEUE_MSG    msg;

   /****************-----------------------------------------------!*********
   ****************!      Execution				  !*********
   ****************!------------------------------------------------********/

   msg[0] = FBM_MSG_ABORT_DECODING;

   returnVal = tmosalQueueSend(GV_fbm_qid, msg, sizeof(FBM_QUEUE_MSG), &lv_timeout, tmosalQueueSendFlagNone);

   if (returnVal != TM_OK)
   {
      switch (returnVal)
      {
         case TMOSAL_ERR_QUE_TIMEOUT:
            DV_DBG_STORE_EVENT(IPVD_DBG_EV_TIMEOUT, IPVD_DBG_QUEUE_TIMEOUT_LEVEL,1, 0,0,0);
            break;

         default:
            DV_DBG_STORE_EVENT(IPVD_DBG_EV_TMOSAL_ERROR,
                               IPVD_DBG_MAJOR_BEHAVIOR_LEVEL,
                               IPVD_QUEUE_SEND, returnVal, msg[0], 0); // Log the error
            break;

      } /* End switch */
   }

   return(MV_FBM_OK);

}

/*MPF=======================================================================*/
/*
    FUNCTION NAME: MV_FBM_soft_reset

    DESCRIPTION:
    soft reset triggered by the application

    RETURNS:
        MV_FBM_OK
	MV_FBM_NOT_OK

    CALLING SEQUENCE:
*/
extern int
MV_FBM_soft_reset(
void
)
/*EMP=======================================================================*/
{
   Int32            lv_timeout = MV_CFG_QUEUE_TIMEOUT;
   tmErrorCode_t returnVal;

   /****************-----------------------------------------------!*********
   ****************!      Variable declarations                    !*********
   ****************!-----------------------------------------------*********/

   /* Declaration for sending messages */

   FBM_QUEUE_MSG    msg;

   /****************-----------------------------------------------!*********
   ****************!      Execution				  !*********
   ****************!------------------------------------------------********/

   msg[0] = FBM_MSG_SOFT_RESET;

   returnVal = tmosalQueueSend(GV_fbm_qid, msg, sizeof(FBM_QUEUE_MSG), &lv_timeout, tmosalQueueSendFlagNone);

   if (returnVal != TM_OK)
   {
      switch (returnVal)
      {
         case TMOSAL_ERR_QUE_TIMEOUT:
            DV_DBG_STORE_EVENT(IPVD_DBG_EV_TIMEOUT, IPVD_DBG_QUEUE_TIMEOUT_LEVEL,1, 0,0,0);
            break;

         default:
            DV_DBG_STORE_EVENT(IPVD_DBG_EV_TMOSAL_ERROR,
                               IPVD_DBG_MAJOR_BEHAVIOR_LEVEL,
                               IPVD_QUEUE_SEND, returnVal, msg[0], 0); // Log the error
            break;

      } /* End switch */
   }
   
   return(MV_FBM_OK);

}

/*MPF=======================================================================*/
/*
    FUNCTION NAME: MV_FBM_vs_notification	

    DESCRIPTION:
    Notify FBM that a Vs has occurred    

    RETURNS:
        MV_FBM_OK
	MV_FBM_NOT_OK

    CALLING SEQUENCE:
*/
extern int
MV_FBM_vs_notification(
void
)
/*EMP=======================================================================*/
{
#ifndef FBM_IN_ISR_ONLY
   Int32            lv_timeout = MV_CFG_QUEUE_TIMEOUT;
   tmErrorCode_t returnVal;
#endif

   /****************-----------------------------------------------!*********
    ****************!      Variable declarations                    !*********
    ****************!-----------------------------------------------*********/

   /* Declaration for sending messages */

   FBM_QUEUE_MSG    lv_msg;
   UInt32           tmp;
   Int32           timeout = 0;

   /****************-----------------------------------------------!*********
    ****************!      Execution				  !*********
    ****************!------------------------------------------------********/

   /*-----------------------------------------!
     ! 	 Re-enable logging of some events      !
     !-----------------------------------------*/

   /*-----------------!
     !  Buffer full     !
     !-----------------*/

   LV_buffer_full_log = TRUE;
  
   /* Enable 'Buffer full' event to create an interrupt */
   MV_drv_set_fbm_event_enable(MV_drv_fbm_event_enable()
                               | MV_FBM_EVENT_BUFFER_FULL);
   
   /* Send MSG_VS to FBM */

   lv_msg[0] = FBM_MSG_VS;


#ifndef FBM_IN_ISR_ONLY
   returnVal = tmosalQueueSend(GV_fbm_qid, lv_msg, sizeof(FBM_QUEUE_MSG), &lv_timeout, tmosalQueueSendFlagNone);

   if (returnVal != TM_OK)
   {
      switch (returnVal)
      {
         case TMOSAL_ERR_QUE_TIMEOUT:
            DV_DBG_STORE_EVENT(IPVD_DBG_EV_TIMEOUT, IPVD_DBG_QUEUE_TIMEOUT_LEVEL,1, 0,0,0);
            break;

         default:
            DV_DBG_STORE_EVENT(IPVD_DBG_EV_TMOSAL_ERROR,
                               IPVD_DBG_MAJOR_BEHAVIOR_LEVEL,
                               IPVD_QUEUE_SEND, returnVal, lv_msg[0], 0); // Log the error
            break;

      } /* End switch */
   }

#else 
   MV_FBM_supervisor(lv_msg,LV_fbm_status_ptr);	

   /*-----------------------------------------------------!
     !  Take API calls from the application into account    !
     !-----------------------------------------------------*/

   while(1)
   {
      tmErrorCode_t lv_return_value;

      lv_return_value = tmosalQueueReceive(GV_fbm_qid, lv_msg, &tmp, &timeout, tmosalQueueReceiveFlagNone);

      if(lv_return_value == TM_OK )
         /* there is a message in the queue */
      {
         MV_FBM_supervisor(lv_msg,LV_fbm_status_ptr);
      }
      else if (lv_return_value == TMOSAL_ERR_QUE_TIMEOUT)
      {
         break;
      }
      else
      {
         DV_DBG_STORE_EVENT(IPVD_DBG_EV_TMOSAL_ERROR,
                            IPVD_DBG_MAJOR_BEHAVIOR_LEVEL,
                            IPVD_QUEUE_RECEIVE, lv_return_value, lv_msg[0], 0); // Log the error
      }

   } /* End loop reading all the messages in GV_fbm_qid queue */

#endif

   return(MV_FBM_OK);

} /* End MV_FBM_vs_notification */

/*MPF=======================================================================*/
/*
    FUNCTION NAME: MV_FBM_insync_notification	

    DESCRIPTION:
    Notify FBM that a in_sync has occurred    

    RETURNS:
        MV_FBM_OK
	MV_FBM_NOT_OK

    CALLING SEQUENCE:
*/
extern int
MV_FBM_in_sync_notification(
void
)
/*EMP=======================================================================*/
{
#ifndef FBM_IN_ISR_ONLY
   Int32            lv_timeout = MV_CFG_QUEUE_TIMEOUT;
   tmErrorCode_t returnVal;
#endif

   /****************-----------------------------------------------!*********
   ****************!      Variable declarations                    !*********
   ****************!-----------------------------------------------*********/

   /* Declaration for sending messages */

   FBM_QUEUE_MSG    lv_msg;

   /****************-----------------------------------------------!*********
   ****************!      Execution				  !*********
   ****************!------------------------------------------------********/

   /* Send MSG_VS to FBM */

   lv_msg[0] = FBM_MSG_VIDEO_IN_SYNC;

#ifndef FBM_IN_ISR_ONLY
   returnVal = tmosalQueueSend(GV_fbm_qid, lv_msg, sizeof(FBM_QUEUE_MSG), &lv_timeout, tmosalQueueSendFlagNone);

   if (returnVal != TM_OK)
   {
      switch (returnVal)
      {
         case TMOSAL_ERR_QUE_TIMEOUT:
            DV_DBG_STORE_EVENT(IPVD_DBG_EV_TIMEOUT, IPVD_DBG_QUEUE_TIMEOUT_LEVEL,1, 0,0,0);
            break;

         default:
            DV_DBG_STORE_EVENT(IPVD_DBG_EV_TMOSAL_ERROR,
                               IPVD_DBG_MAJOR_BEHAVIOR_LEVEL,
                               IPVD_QUEUE_SEND, returnVal, lv_msg[0], 0); // Log the error
            break;

      } /* End switch */
   }
#else 
   MV_FBM_supervisor(lv_msg,LV_fbm_status_ptr);	
#endif

   return(MV_FBM_OK);

}

/*MPF=======================================================================*/
/*
    FUNCTION NAME: MV_FBM_set_error_concealment_copy	


    DESCRIPTION:
                  

    RETURNS:
        MV_FBM_OK
	MV_FBM_NOT_OK

    CALLING SEQUENCE:
*/
extern int
MV_FBM_set_error_concealment_copy(
USHORT    in_error_case
)
/*EMP=======================================================================*/
{
   /****************-----------------------------------------------!*********
   ****************!      Variable declarations                    !*********
   ****************!-----------------------------------------------*********/

   BOOLEAN lv_valid_input_parameter = TRUE;

   /****************-----------------------------------------------!*********
   ****************!      Execution				  !*********
   ****************!------------------------------------------------********/
   switch (in_error_case)
   {
      case MV_FBM_MEDIUM_FLAGED_ERROR:
         MV_drv_set_medium_flaged_error_lock(MV_BIT_OFF);
         break;

      case MV_FBM_LOW_FLAGED_ERROR:
         MV_drv_set_low_flaged_error_lock(MV_BIT_OFF);
         break;

      case MV_FBM_VLC_COEF_ERROR:
         MV_drv_set_vlc_coef_error_lock(MV_BIT_OFF);
         break;

      case MV_FBM_VLC_EOB_MISS_ERROR:
         MV_drv_set_vlc_eob_miss_error_lock(MV_BIT_OFF);
         break;

      case MV_FBM_VLC_MB_ERROR:
         MV_drv_set_vlc_mb_error_lock(MV_BIT_OFF);
         break;

      case MV_FBM_VECT_ERROR:
         MV_drv_set_vect_error_lock(MV_BIT_OFF);
         break;

      default:
         lv_valid_input_parameter = FALSE;
         break;

   } /* End switch */


   if(lv_valid_input_parameter == TRUE)
   {
      return(MV_FBM_OK);
   }
   else
   {

⌨️ 快捷键说明

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