regevent.c
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:22k
- /*****************************************************************************
- File name : regevent.c
- Description: Events related functions used by all test applications.
- COPYRIGHT (C) 2004 STMicroelectronics
- ******************************************************************************/
- /* Includes ---------------------------------------------------------------- */
- #include <time.h>
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- #include <task.h>
- /* STAPI header------------------------------------------------------------- */
- #include "stddefs.h"
- #include "stlite.h"
- #include "stcommon.h"
- #include "stdevice.h"
- #include "sttbx.h"
- #include "stpti.h"
- #include "stpti_hal.h"
- #include "vid.h"
- #include "aud.h"
- #include "errors.h"
- #include "evt.h"
- #include "regevent.h"
- #ifdef TTX_SUPPORT
- #include "ttx.h"
- #endif /* TTX_SUPPORT */
- /* Private Types------------------------------------------------------------ */
- /* Private Constant--------------------------------------------------------- */
- /* Private Variables ------------------------------------------------------- */
- /* Required for Video */
- U32 VideoEvent_STVID_NEW_PICTURE_TO_BE_DISPLAYED_EVT_Count = 0;
- U32 VideoEvent_Errors_Count = 0;
- STEVT_EventConstant_t VideoEvent_NextToPrint = 0;
- semaphore_t AspectRatioChangedSem;
- STGXOBJ_AspectRatio_t DisplayAspectRatio;
- /* Required for Audio */
- U32 AudioEvent_STAUD_NEW_FRAME_EVT_Count = 0;
- U32 AudioEvent_Errors_Count = 0;
- STEVT_EventConstant_t AudioEvent_NextToPrint = 0;
- /* Required for PTI */
- U32 StptiEvent_Errors_Count = 0;
- STEVT_EventConstant_t StptiEvent_NextToPrint = 0;
- #ifdef TTX_SUPPORT
- /* Required for Tele Text */
- U32 TeletextEvent_Errors_Count = 0;
- STEVT_EventConstant_t TTXEvent_NextToPrint = 0;
- #endif /* TTX_SUPPORT */
- /* Private Functions prototypes --------------------------------------------------- */
- /* video events */
- static void VideoEvent_CallbackProc(STEVT_CallReason_t Reason, STEVT_EventConstant_t Event, const void *EventData );
- /* audio events */
- static void AudioEvent_CallbackProc(STEVT_CallReason_t Reason, STEVT_EventConstant_t Event, const void *EventData );
- /* stpti events */
- static void StptiEvent_CallbackProc(STEVT_CallReason_t Reason, STEVT_EventConstant_t Event, const void *EventData );
- #ifdef TTX_SUPPORT
- /* ttx events */
- static void TTXEvent_CallbackProc(STEVT_CallReason_t Reason, STEVT_EventConstant_t Event, const void *EventData );
- #endif /* TTX_SUPPORT */
- /*=========================================================================*/
- /* Function description */
- /*-------------------------------------------------------------------------
- * Function : RegisterEvents
- *
- * Input : None
- * Output :
- * Return : only returns if error when starting up.
- * ----------------------------------------------------------------------*/
- ST_ErrorCode_t RegisterEvents(void)
- {
- ST_ErrorCode_t ST_ErrorCode = ST_NO_ERROR;
- STEVT_SubscribeParams_t STEVT_SubscribeParams;
- STVID_ConfigureEventParams_t VID_EvtParams;
- U32 Event;
- /* subscribe to stpti events */
- STEVT_SubscribeParams.NotifyCallback = StptiEvent_CallbackProc;
- for(Event = STPTI_EVENT_BASE; Event <= (int) STPTI_EVENT_TC_CODE_FAULT_EVT; Event++)
- {
- ST_ErrorCode = STEVT_Subscribe(g_KB_EVTHandle[KB_EVT_PTI], Event, &STEVT_SubscribeParams);
- if ( ST_ErrorCode != ST_NO_ERROR )
- {
- STTBX_Print(("EVT_Subscribe(%d, STPTI)=%sn", Event, KB_ErrorGetText(ST_ErrorCode) ));
- return ST_ErrorCode;
- }
- }
- /* subscribe to audio events */
- STEVT_SubscribeParams.NotifyCallback = AudioEvent_CallbackProc;
- for(Event = STAUD_NEW_FRAME_EVT; Event <= STAUD_LOW_DATA_LEVEL_EVT; Event++)
- {
- ST_ErrorCode = STEVT_Subscribe(g_KB_EVTHandle[KB_EVT_AUD], Event, &STEVT_SubscribeParams);
- if ( ST_ErrorCode != ST_NO_ERROR )
- {
- STTBX_Print(("EVT_Subscribe(%d, AUDIO)=%sn", Event, KB_ErrorGetText(ST_ErrorCode) ));
- return ST_ErrorCode;
- }
- }
- /* init the Aspect ratio semaphore */
- semaphore_init_fifo_timeout ( &AspectRatioChangedSem, 0 );
- /* subscribe to video events */
- VID_EvtParams.Enable = TRUE;
- VID_EvtParams.NotificationsToSkip = 0;
- STEVT_SubscribeParams.NotifyCallback = VideoEvent_CallbackProc;
- for(Event = STVID_ASPECT_RATIO_CHANGE_EVT; Event <= STVID_SYNCHRONISATION_CHECK_EVT; Event++)
- {
- /* STVID_NEW_PICTURE_TO_BE_DISPLAYED_EVT is to be removed as and when the STVID API removes it.*/
- if ((Event == STVID_NEW_PICTURE_DECODED_EVT) ||
- (Event == STVID_NEW_PICTURE_TO_BE_DISPLAYED_EVT) ||
- (Event == STVID_DISPLAY_NEW_FRAME_EVT) ||
- (Event == STVID_SYNCHRONISATION_CHECK_EVT))
- {
- ST_ErrorCode = STVID_ConfigureEvent(VID_Handle, Event, &VID_EvtParams);
- if ( ST_ErrorCode != ST_NO_ERROR )
- {
- STTBX_Print(("STVID_ConfigureEvent(%d, VIDEO)=%sn", Event, KB_ErrorGetText(ST_ErrorCode) ));
- return ST_ErrorCode;
- }
- }
- ST_ErrorCode = STEVT_Subscribe(g_KB_EVTHandle[KB_EVT_VTG], Event, &STEVT_SubscribeParams);
- if ( ST_ErrorCode != ST_NO_ERROR )
- {
- STTBX_Print(("EVT_Subscribe(%d, VIDEO)=%sn", Event, KB_ErrorGetText(ST_ErrorCode) ));
- return ST_ErrorCode;
- }
- }
- #ifdef TTX_SUPPORT
- /* subscribe to ttx events */
- STEVT_SubscribeParams.NotifyCallback = TTXEvent_CallbackProc;
- for(Event = STTTX_EVENT_PES_LOST; Event <= STTTX_EVENT_DATA_OVERFLOW; Event++)
- {
- ST_ErrorCode = STEVT_Subscribe(g_KB_EVTHandle[KB_EVT_TTX], Event, &STEVT_SubscribeParams);
- if ( ST_ErrorCode != ST_NO_ERROR )
- {
- STTBX_Print(("EVT_Subscribe(%d, TTX)=%sn", Event, KB_ErrorGetText(ST_ErrorCode) ));
- return ST_ErrorCode;
- }
- }
- #endif
- return ST_ErrorCode;
- }
- /*-------------------------------------------------------------------------
- * Function : VideoEvent_CallbackProc
- * Input : Event data
- * Output :
- * Return : nothing
- * ----------------------------------------------------------------------*/
- static void VideoEvent_CallbackProc(STEVT_CallReason_t Reason, STEVT_EventConstant_t Event, const void *EventData )
- {
- if (Reason == CALL_REASON_NOTIFY_CALL)
- {
- switch(Event)
- {
- case STVID_NEW_PICTURE_TO_BE_DISPLAYED_EVT:
- VideoEvent_STVID_NEW_PICTURE_TO_BE_DISPLAYED_EVT_Count++;
- AVHandleNewVideoFrame(Reason, Event, EventData);
- break;
- case STVID_SYNCHRONISATION_CHECK_EVT:
- {
- STVID_SynchronisationInfo_t *SynchronisationInfo_p;
- SynchronisationInfo_p = (STVID_SynchronisationInfo_t *)EventData;
- if ((SynchronisationInfo_p->IsSynchronisationOk == TRUE) &&
- (SynchronisationInfo_p->ClocksDifference != 0))
- {
- (void) STAUD_DRSetSyncOffset(AUD_Handle,
- STAUD_OBJECT_DECODER_COMPRESSED1,
- SynchronisationInfo_p->ClocksDifference/90);
- }
- }
- break;
- /* no reporting on these events */
- case STVID_DISPLAY_NEW_FRAME_EVT: /* This Event Should be scraped. As it uses old types */
- case STVID_NEW_PICTURE_DECODED_EVT:
- case STVID_USER_DATA_EVT:
- case STVID_SEQUENCE_INFO_EVT:
- case STVID_SYNCHRO_EVT:
- break;
- /* general report on these events with error count */
- case STVID_IMPOSSIBLE_WITH_MEM_PROFILE_EVT:
- /* STTBX_Print(("n STVID_IMPOSSIBLE_WITH_MEM_PROFILE_EVT n"));*/
- case STVID_DATA_ERROR_EVT:
- /*STTBX_Print(("n STVID_DATA_ERROR_EVT n"));*/
- case STVID_DATA_OVERFLOW_EVT:
- /*STTBX_Print(("n STVID_DATA_OVERFLOW_EVT n"));*/
- case STVID_DATA_UNDERFLOW_EVT:
- /*STTBX_Print(("n STVID_DATA_UNDERFLOW_EVT n"));*/
- case STVID_PICTURE_DECODING_ERROR_EVT:
- /*STTBX_Print(("n STVID_PICTURE_DECODING_ERROR_EVT n"));*/
- VideoEvent_Errors_Count++;
- /* fall through (to report on other events below, without error counting) */
- case STVID_BACK_TO_SYNC_EVT:
- case STVID_DIGINPUT_WIN_CHANGE_EVT:
- case STVID_FRAME_RATE_CHANGE_EVT:
- case STVID_RESOLUTION_CHANGE_EVT:
- case STVID_SPEED_DRIFT_THRESHOLD_EVT:
- case STVID_STOPPED_EVT:
- case STVID_OUT_OF_SYNC_EVT:
- /* only process if last Event printed out */
- if (VideoEvent_NextToPrint == LAST_EVENT_TO_PROCESS) VideoEvent_NextToPrint = Event;
- break;
- case STVID_ASPECT_RATIO_CHANGE_EVT:
- DisplayAspectRatio = *((STGXOBJ_AspectRatio_t *)EventData);
- semaphore_signal ( &AspectRatioChangedSem );
- break;
- case STVID_SCAN_TYPE_CHANGE_EVT:
- {
- /* Layer & Mixer are set to Interlaced scan type in their corresponding setups.
- Progressive scan type is not handled */
- }
- break;
- default:
- break;
- }
- //STTBX_Print(("nVID Event: %s n", VideoEvent_EventToStr(Event)));
- }
- }
- /*-------------------------------------------------------------------------
- * Function : AudioEvent_CallbackProc
- * Input : Event data
- * Output :
- * Return : nothing
- * ----------------------------------------------------------------------*/
- static void AudioEvent_CallbackProc(STEVT_CallReason_t Reason, STEVT_EventConstant_t Event, const void *EventData )
- {
- if (Reason == CALL_REASON_NOTIFY_CALL)
- {
- switch(Event)
- {
- case STAUD_NEW_FRAME_EVT:
- AudioEvent_STAUD_NEW_FRAME_EVT_Count++;
- break;
- /* no reporting on these events */
- case STAUD_EMPHASIS_EVT:
- case STAUD_PREPARED_EVT:
- case STAUD_RESUME_EVT:
- case STAUD_PCM_BUF_COMPLETE_EVT:
- break;
- /* general report on these events with error count */
- case STAUD_DATA_ERROR_EVT:
- case STAUD_SYNC_ERROR_EVT:
- AudioEvent_Errors_Count++;
- /* fall through (to report on other events below, without error counting) */
- case STAUD_STOPPED_EVT:
- case STAUD_NEW_ROUTING_EVT:
- case STAUD_NEW_FREQUENCY_EVT:
- case STAUD_LOW_DATA_LEVEL_EVT:
- case STAUD_PCM_UNDERFLOW_EVT:
- case STAUD_FIFO_OVERF_EVT:
- case STAUD_CDFIFO_UNDERFLOW_EVT:
- /* only process if last Event printed out */
- if (AudioEvent_NextToPrint == LAST_EVENT_TO_PROCESS) AudioEvent_NextToPrint = Event;
- break;
- default:
- break;
- }
- }
- }
- /*-------------------------------------------------------------------------
- * Function : StptiEvent_CallbackProc
- * Input : Event data
- * Output :
- * Return : nothing
- * ----------------------------------------------------------------------*/
- static void StptiEvent_CallbackProc(STEVT_CallReason_t Reason, STEVT_EventConstant_t Event, const void *EventData )
- {
- if (Reason == CALL_REASON_NOTIFY_CALL)
- {
- switch(Event)
- {
- /* no reporting on these events */
- #ifdef STPTI_CAROUSEL_SUPPORT
- case STPTI_EVENT_CAROUSEL_CYCLE_COMPLETE_EVT:
- case STPTI_EVENT_CAROUSEL_ENTRY_TIMEOUT_EVT:
- case STPTI_EVENT_CAROUSEL_TIMED_ENTRY_EVT:
- #endif
- #ifdef STPTI_INDEX_SUPPORT
- case STPTI_EVENT_INDEX_MATCH_EVT:
- #endif
- #ifdef STPTI_DTV_SUPPORT
- case STPTI_EVENT_CWP_BLOCK_EVT:
- #endif
- case STPTI_EVENT_CLEAR_TO_SCRAMBLED_EVT:
- case STPTI_EVENT_DMA_COMPLETE_EVT:
- case STPTI_EVENT_PCR_RECEIVED_EVT:
- case STPTI_EVENT_SCRAMBLED_TO_CLEAR_EVT:
- break;
- /* general report on these events with error count */
- case STPTI_EVENT_CC_ERROR_EVT:
- (void) STPTI_EnableErrorEvent(KB_PTI_DeviceName, STPTI_EVENT_CC_ERROR_EVT);
- /* fall through to increment the error count */
- case STPTI_EVENT_BUFFER_OVERFLOW_EVT:
- case STPTI_EVENT_INTERRUPT_FAIL_EVT:
- case STPTI_EVENT_INVALID_DESCRAMBLE_KEY_EVT:
- case STPTI_EVENT_INVALID_LINK_EVT:
- case STPTI_EVENT_INVALID_PARAMETER_EVT:
- case STPTI_EVENT_PACKET_ERROR_EVT:
- case STPTI_EVENT_SECTIONS_DISCARDED_ON_CRC_CHECK_EVT:
- case STPTI_EVENT_TC_CODE_FAULT_EVT:
- StptiEvent_Errors_Count++;
- /* only process if last Event printed out */
- if (StptiEvent_NextToPrint == LAST_EVENT_TO_PROCESS) StptiEvent_NextToPrint = Event;
- break;
- default:
- break;
- }
- }
- }
- #ifdef TTX_SUPPORT
- /*-------------------------------------------------------------------------
- * Function : TTXEvent_CallbackProc
- * Input : event data
- * Output :
- * Return : nothing
- * ----------------------------------------------------------------------*/
- static void TTXEvent_CallbackProc(STEVT_CallReason_t Reason, STEVT_EventConstant_t Event, const void *EventData )
- {
- if (Reason == CALL_REASON_NOTIFY_CALL)
- {
- switch(Event)
- {
- /* no reporting on these events */
- case STTTX_EVENT_PACKET_DISCARDED:
- case STTTX_EVENT_PACKET_CONSUMED:
- case STTTX_EVENT_PES_AVAILABLE:
- break;
- /* report on other events below (without error counting) */
- case STTTX_EVENT_PES_LOST:
- case STTTX_EVENT_PES_NOT_CONSUMED:
- case STTTX_EVENT_PES_INVALID:
- case STTTX_EVENT_DATA_OVERFLOW:
- TeletextEvent_Errors_Count ++;
- if (TTXEvent_NextToPrint == 0) TTXEvent_NextToPrint = Event; /* only process if last event printed out */
- break;
- default:
- break;
- }
- }
- }
- #endif /* TTX_SUPPORT */
- /*-------------------------------------------------------------------------
- * Function : VideoEvent_EventToStr
- * Input : Event data
- * Output :
- * Return : string
- * ----------------------------------------------------------------------*/
- char *VideoEvent_EventToStr(STEVT_EventConstant_t Event)
- {
- switch(Event)
- {
- case STVID_DISPLAY_NEW_FRAME_EVT:
- return("STVID_DISPLAY_NEW_FRAME_EVT");
- case STVID_IMPOSSIBLE_WITH_MEM_PROFILE_EVT:
- return("STVID_IMPOSSIBLE_WITH_MEM_PROFILE_EVT");
- case STVID_DATA_ERROR_EVT:
- return("STVID_DATA_ERROR_EVT");
- case STVID_DATA_OVERFLOW_EVT:
- return("STVID_DATA_OVERFLOW_EVT");
- case STVID_DATA_UNDERFLOW_EVT:
- return("STVID_DATA_UNDERFLOW_EVT");
- case STVID_PICTURE_DECODING_ERROR_EVT:
- return("STVID_PICTURE_DECODING_ERROR_EVT");
- case STVID_ASPECT_RATIO_CHANGE_EVT:
- return("STVID_ASPECT_RATIO_CHANGE_EVT");
- case STVID_BACK_TO_SYNC_EVT:
- return("STVID_BACK_TO_SYNC_EVT");
- case STVID_DIGINPUT_WIN_CHANGE_EVT:
- return("STVID_DIGINPUT_WIN_CHANGE_EVT");
- case STVID_FRAME_RATE_CHANGE_EVT:
- return("STVID_FRAME_RATE_CHANGE_EVT");
- case STVID_NEW_PICTURE_TO_BE_DISPLAYED_EVT:
- return("STVID_NEW_PICTURE_TO_BE_DISPLAYED_EVT");
- case STVID_NEW_PICTURE_DECODED_EVT:
- return("STVID_NEW_PICTURE_DECODED_EVT");
- case STVID_RESOLUTION_CHANGE_EVT:
- return("STVID_RESOLUTION_CHANGE_EVT");
- case STVID_SCAN_TYPE_CHANGE_EVT:
- return("STVID_SCAN_TYPE_CHANGE_EVT");
- case STVID_SEQUENCE_INFO_EVT:
- return("STVID_SEQUENCE_INFO_EVT");
- case STVID_SPEED_DRIFT_THRESHOLD_EVT:
- return("STVID_SPEED_DRIFT_THRESHOLD_EVT");
- case STVID_STOPPED_EVT:
- return("STVID_STOPPED_EVT");
- case STVID_OUT_OF_SYNC_EVT:
- return("STVID_OUT_OF_SYNC_EVT");
- case STVID_SYNCHRO_EVT:
- return("STVID_SYNCHRO_EVT");
- case STVID_USER_DATA_EVT:
- return("STVID_USER_DATA_EVT");
- case STVID_SYNCHRONISATION_CHECK_EVT:
- return("STVID_SYNCHRONISATION_CHECK_EVT");
- default:
- break;
- }
- return("VID?");
- }
- /*-------------------------------------------------------------------------
- * Function : AudioEvent_EventToStr
- * Input : Event data
- * Output :
- * Return : string
- * ----------------------------------------------------------------------*/
- char *AudioEvent_EventToStr(STEVT_EventConstant_t Event)
- {
- switch(Event)
- {
- case STAUD_NEW_FRAME_EVT:
- return("STAUD_NEW_FRAME_EVT");
- case STAUD_DATA_ERROR_EVT:
- return("STAUD_DATA_ERROR_EVT");
- case STAUD_EMPHASIS_EVT:
- return("STAUD_EMPHASIS_EVT");
- case STAUD_PREPARED_EVT:
- return("STAUD_PREPARED_EVT");
- case STAUD_RESUME_EVT:
- return("STAUD_RESUME_EVT");
- case STAUD_STOPPED_EVT:
- return("STAUD_STOPPED_EVT");
- case STAUD_PCM_UNDERFLOW_EVT:
- return("STAUD_PCM_UNDERFLOW_EVT");
- case STAUD_PCM_BUF_COMPLETE_EVT:
- return("STAUD_PCM_BUF_COMPLETE_EVT");
- case STAUD_FIFO_OVERF_EVT:
- return("STAUD_FIFO_OVERF_EVT");
- case STAUD_NEW_ROUTING_EVT:
- return("STAUD_NEW_ROUTING_EVT");
- case STAUD_NEW_FREQUENCY_EVT:
- return("STAUD_NEW_FREQUENCY_EVT");
- case STAUD_CDFIFO_UNDERFLOW_EVT:
- return("STAUD_CDFIFO_UNDERFLOW_EVT");
- case STAUD_SYNC_ERROR_EVT:
- return("STAUD_SYNC_ERROR_EVT");
- case STAUD_LOW_DATA_LEVEL_EVT:
- return("STAUD_LOW_DATA_LEVEL_EVT");
- default:
- break;
- }
- return("AUD?");
- }
- /*-------------------------------------------------------------------------
- * Function : StptiEvent_EventToStr
- * Input : Event data
- * Output :
- * Return : string
- * ----------------------------------------------------------------------*/
- char *StptiEvent_EventToStr(STEVT_EventConstant_t Event)
- {
- switch(Event)
- {
- case STPTI_EVENT_BUFFER_OVERFLOW_EVT:
- return("STPTI_EVENT_BUFFER_OVERFLOW_EVT");
- #ifdef STPTI_CAROUSEL_SUPPORT
- case STPTI_EVENT_CAROUSEL_CYCLE_COMPLETE_EVT:
- return("STPTI_EVENT_CAROUSEL_CYCLE_COMPLETE_EVT");
- case STPTI_EVENT_CAROUSEL_ENTRY_TIMEOUT_EVT:
- return("STPTI_EVENT_CAROUSEL_ENTRY_TIMEOUT_EVT");
- case STPTI_EVENT_CAROUSEL_TIMED_ENTRY_EVT:
- return("STPTI_EVENT_CAROUSEL_TIMED_ENTRY_EVT");
- #endif
- case STPTI_EVENT_CC_ERROR_EVT:
- return("STPTI_EVENT_CC_ERROR_EVT");
- case STPTI_EVENT_CLEAR_TO_SCRAMBLED_EVT:
- return("STPTI_EVENT_CLEAR_TO_SCRAMBLED_EVT");
- #ifdef STPTI_DTV_SUPPORT
- case STPTI_EVENT_CWP_BLOCK_EVT:
- return("STPTI_EVENT_CWP_BLOCK_EVT");
- #endif
- case STPTI_EVENT_DMA_COMPLETE_EVT:
- return("STPTI_EVENT_DMA_COMPLETE_EVT");
- #ifdef STPTI_INDEX_SUPPORT
- case STPTI_EVENT_INDEX_MATCH_EVT:
- return("STPTI_EVENT_INDEX_MATCH_EVT");
- #endif
- case STPTI_EVENT_INTERRUPT_FAIL_EVT:
- return("STPTI_EVENT_INTERRUPT_FAIL_EVT");
- case STPTI_EVENT_INVALID_DESCRAMBLE_KEY_EVT:
- return("STPTI_EVENT_INVALID_DESCRAMBLE_KEY_EVT");
- case STPTI_EVENT_INVALID_LINK_EVT:
- return("STPTI_EVENT_INVALID_LINK_EVT");
- case STPTI_EVENT_INVALID_PARAMETER_EVT:
- return("STPTI_EVENT_INVALID_PARAMETER_EVT");
- case STPTI_EVENT_PACKET_ERROR_EVT:
- return("STPTI_EVENT_PACKET_ERROR_EVT");
- case STPTI_EVENT_PCR_RECEIVED_EVT:
- return("STPTI_EVENT_PCR_RECEIVED_EVT");
- case STPTI_EVENT_SCRAMBLED_TO_CLEAR_EVT:
- return("STPTI_EVENT_SCRAMBLED_TO_CLEAR_EVT");
- case STPTI_EVENT_SECTIONS_DISCARDED_ON_CRC_CHECK_EVT:
- return("STPTI_EVENT_SECTIONS_DISCARDED_ON_CRC_CHECK_EVT");
- case STPTI_EVENT_TC_CODE_FAULT_EVT:
- return("STPTI_EVENT_TC_CODE_FAULT_EVT");
- default:
- break;
- }
- return("STPTI?");
- }
- #ifdef TTX_SUPPORT
- /*-------------------------------------------------------------------------
- * Function : TTXEvent_EventToStr
- * Input : event data
- * Output :
- * Return : string
- * ----------------------------------------------------------------------*/
- char *TTXEvent_EventToStr(STEVT_EventConstant_t Event)
- {
- switch(Event)
- {
- case STTTX_EVENT_PES_LOST:
- return("STTTX_EVENT_PES_LOST");
- case STTTX_EVENT_PES_NOT_CONSUMED:
- return("STTTX_EVENT_PES_NOT_CONSUMED");
- case STTTX_EVENT_PES_INVALID:
- return("STTTX_EVENT_PES_INVALID");
- case STTTX_EVENT_PES_AVAILABLE:
- return("STTTX_EVENT_PES_AVAILABLE");
- case STTTX_EVENT_PACKET_DISCARDED:
- return("STTTX_EVENT_PACKET_DISCARDED");
- case STTTX_EVENT_PACKET_CONSUMED:
- return("STTTX_EVENT_PACKET_CONSUMED");
- case STTTX_EVENT_DATA_OVERFLOW:
- return("STTTX_EVENT_DATA_OVERFLOW");
- default:
- break;
- }
- return("TTX?");
- }
- #endif /* TTX_SUPPORT */
- /* EOF --------------------------------------------------------------------- */