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

📄 fbm_api.c

📁 tuner扫描
💻 C
📖 第 1 页 / 共 5 页
字号:
/*==========================================================================*/
/*     (Copyright (C) 2003 Koninklijke Philips Electronics N.V.             */
/*     All rights reserved.                                                 */
/*     This source code and any compilation or derivative thereof is the    */
/*     proprietary information of Koninklijke Philips Electronics N.V.      */
/*     and is confidential in nature.                                       */
/*     Under no circumstances is this software to be exposed to or placed   */
/*     under an Open Source License of any type without the expressed       */
/*     written permission of Koninklijke Philips Electronics N.V.           */
/*==========================================================================*/
/*==========================================================================*/
/*                                                                          
       SOURCE_FILE:    $RCSfile: fbm_api.c,v $
       APPLICATION:                                                         
       PACKAGE:        Video Output  
       COMPONENT:      MPEG Video       
       VERSION:        $Revision: 1.11 $
       DATE:           $Date: 1998/08/04 14:26:31 $
                                                                            
       (C) 1997: Philips Export B.V.                                  
                                                                            
       All rights are reserved. Reproduction in whole or in part is         
       prohibited without the prior written consent of the copyright        
       owner. The information presented in this document does not           
       form part of any quotation or contract, is believed to be            
       accurate and reliable and may be changed without notice.             
       No liability will be accepted by the publisher for any               
       consequence of its use. Publication thereof does not convey          
       nor imply any license under patent- or other industrial or           
       intellectual property rights.                                        
*/                                                                          
/*==========================================================================*/

/*==========================================================================*/
/*       I N C L U D E S                                                    */ 
/*==========================================================================*/

#include "standard.h"
#include "tmosal.h"

#include "mv_dec.h"
#include "mv_decl.h"
#include "mv_inpl.h"
#include "ipvd_cfg.h"
#include "ipvd_dbgl.h"
# include "mv_drv.h"
# include "mv_itvl.h"
# include "fbm_sw.h"
# include "fbm_api.h"
# include "fbm_msg.h"

# include "dv_syn.h"
# include "dv_dbg.h"

#ifdef FBM_TASK
#  undef FBM_IN_ISR_ONLY
#else
#  define FBM_IN_ISR_ONLY
#endif

/*==========================================================================*/
/*       G L O B A L   D A T A   D E C L A R A T I O N S                    */
/*==========================================================================*/


/*==========================================================================*/
/*       L O C A L   S Y M B O L   D E F I N I T I O N S                    */
/*==========================================================================*/
/* Definitions for task creation */

#define UFAT		0x10000

#define FBM_NAME    "FBMd"
#define FBM_PRIOR   (tmosalTaskPriority_t)50 /* 1 < PRIOR  < 63*/
#define FBM_FLAGS   (tmosalTaskCreateFlags_t)tmosalTaskStarted
#define USTK        (UInt32)4000
#define SSTK	    0x4000

typedef UInt32 FBM_QUEUE_MSG[4];

/*==========================================================================*/
/*       L O C A L   F U N C T I O N S   P R O T O T Y P E S                */
/*==========================================================================*/
#ifndef FBM_IN_ISR_ONLY
static void  LF_FBM_task(void);
#endif
static void  LF_FBM_event_handler      (void);
static void  LF_FBM_Vs_handler         (void);
static void  LF_FBM_error_handler       (void);
static void  LF_FBM_eoph_handler        (void);
static void  LF_FBM_eopd_handler        (void);

/*==========================================================================*/
/*       L O C A L   D A T A   D E C L A R A T I O N S                      */
/*==========================================================================*/

#ifndef FBM_IN_ISR_ONLY
/* variable for fbm task */
static tmosalTaskHandle_t      GV_FbmTaskHandle;
#endif

/* variable for fbm message queue */
static tmosalQueueHandle_t        GV_fbm_qid;

/* Flag to enable logging of buffer full event */
static BOOLEAN             LV_buffer_full_log = TRUE;

/* FBM status variable */
static FBM_STATUS           LV_fbm_status;
static FBM_STATUS          *LV_fbm_status_ptr;

/* variable for VS count with same read pointer */
/* those variable are read abd written under isr */
static unsigned long LV_vs_nb_without_rdpt_change = 0;

/*==========================================================================*/
/*       G L O B A L  F U N C T I O N S                                     */ 
/*==========================================================================*/

/*MPF=======================================================================*/
/*
    FUNCTION NAME: MV_FBM_change_channel	

    DESCRIPTION:
    FBM freezes on current channel. Returns when FBM ready to handle data
    form new channel
            
    RETURNS:
        MV_FBM_OK
	MV_FBM_NOT_OK

    CALLING SEQUENCE:
*/
extern int
MV_FBM_change_channel(
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_CHANGE_CHANNEL;

   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);

} /* End MV_FBM_change_channel()*/

/*MPF=======================================================================*/
/*
    FUNCTION NAME: MV_FBM_dec_to_disp	

    DESCRIPTION:
    Program to FBM dec_to_disp param 

    RETURNS:
        MV_FBM_OK
	MV_FBM_NOT_OK

    CALLING SEQUENCE:
*/
extern int
MV_FBM_dec_to_disp(
MV_DEC_TO_DISP in_dec_to_disp
)
/*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_DEC_TO_DISP;
   msg[1] = in_dec_to_disp;

   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);

} /* FBM_dec_to_disp()*/

/*MPF=======================================================================*/
/*
    FUNCTION NAME: MV_FBM_play	

    DESCRIPTION:
    Launch play command to FBM

    RETURNS:
        MV_FBM_OK
	MV_FBM_NOT_OK

    CALLING SEQUENCE:
*/
extern int
MV_FBM_play(
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_PLAY;

   /* PR244 : Streams without DTS */
   GV_MV_DEC_status.dec_first_pict = TRUE;

   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_play()*/

/*MPF=======================================================================*/
/*
    FUNCTION NAME: MV_FBM_scan	

    DESCRIPTION:
    Launch scan command to FBM

    RETURNS:
        MV_FBM_OK
	MV_FBM_NOT_OK

    CALLING SEQUENCE:
*/
extern int
MV_FBM_scan(
MV_DEC_SCAN_MODE in_scan_mode
)
/*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_SCAN;
   msg[1] = in_scan_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_scan()*/

/*MPF=======================================================================*/
/*
    FUNCTION NAME: MV_FBM_freeze	

    DESCRIPTION:
    Launch freeze command to FBM

    RETURNS:
        MV_FBM_OK
	MV_FBM_NOT_OK

    CALLING SEQUENCE:
*/
extern int
MV_FBM_freeze(
MV_DEC_FREEZE_MODE in_freeze_mode
)
/*EMP=======================================================================*/
{
   Int32            lv_timeout = MV_CFG_QUEUE_TIMEOUT;
   tmErrorCode_t returnVal;

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

   /* Declaration for sending messages */

   FBM_QUEUE_MSG    msg;

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

⌨️ 快捷键说明

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