📄 tvo_msg_handler.c
字号:
/*******************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2003
*
*******************************************************************************/
/*******************************************************************************
* Filename:
* ---------
* tvo_msg_handler.c
*
* Project:
* --------
* Maui
*
* Description:
* ------------
* This file includes message handle functions of tvout module.
*
* Author:
* -------
* -------
*
*==============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*==============================================================================
*******************************************************************************/
#ifndef MED_NOT_PRESENT
/*==== INCLUDES =========*/
/* system includes */
#include "kal_release.h"
#include "kal_trace.h"
#include "stack_common.h"
#include "stack_msgs.h"
#include "app_ltlcom.h" /* Task message communiction */
#include "syscomp_config.h"
#include "task_config.h" /* Task creation */
#include "app_buff_alloc.h" /* Declaration of buffer management API */
#include "stacklib.h" /* Basic type for dll, evshed, stacktimer */
#include "event_shed.h" /* Event scheduler */
#include "stack_timer.h" /* Stack timer */
/* global includes */
#include "l1audio.h"
#include "device.h"
#include "resource_audio.h"
#include "nvram_enums.h"
#include "nvram_struct.h"
#include "nvram_user_defs.h"
#include "nvram_data_items.h"
#include "custom_nvram_editor_data_item.h"
/* local includes */
#include "med_global.h"
#include "med_main.h"
#include "aud_defs.h"
#include "med_struct.h"
#include "med_api.h"
#include "med_context.h"
#include "med_utility.h"
#include "med_smalloc.h"
#include "tvo_main.h"
#include "aud_main.h"
#include "fat_fs.h"
#ifdef __TVO_TRACE_ON__
#include "med_trc.h"
#endif
#ifdef __MED_TVO_MOD__
#include "tv_out.h"
#include "tvo_main.h"
/*==== FUNCTIONS ===========*/
/*****************************************************************************
* FUNCTION
* tvo_tv_detect_check
* DESCRIPTION
* This function is to check the tv state.
* PARAMETERS
* arg [?]
* RETURNS
* void
*****************************************************************************/
void tvo_tv_detect_check(void *arg)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
switch (tvo_context_p->state)
{
case TVO_READY:
tvo_context_p->tv_connected = tv_set_detection();
TVO_VALUE_TRACE(tvo_context_p->tv_connected, tvo_context_p->state, __LINE__);
/* start a timer to periodically check TV connect status */
if (!tvo_context_p->tv_connected)
{
med_start_timer(TVO_CONNECT_POLLING_TIMER, TVO_TV_DETECT_PERIOD, tvo_tv_detect_check, 0);
}
break;
case TVO_UPDATE:
tvo_context_p->tv_connected = tv_set_detection();
TVO_VALUE_TRACE(tvo_context_p->tv_connected, tvo_context_p->state, __LINE__);
/* start a timer to periodically check TV connect status */
if (!tvo_context_p->tv_connected)
{
med_start_timer(TVO_CONNECT_POLLING_TIMER, TVO_TV_DETECT_PERIOD, tvo_tv_detect_check, 0);
}
else
{
enable_tv_output(KAL_TRUE);
aud_set_tv_out_aud_path(KAL_TRUE);
}
break;
}
}
/*****************************************************************************
* FUNCTION
* tvo_av_cable_detect_ind_hdlr
* DESCRIPTION
* This function is to handle the av cable detected indication.
* PARAMETERS
* ilm_ptr [?]
* RETURNS
* void
*****************************************************************************/
void tvo_av_cable_detect_ind_hdlr(ilm_struct *ilm_ptr)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
media_tvo_av_cable_detect_ind_struct *ind_p;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
ind_p = (media_tvo_av_cable_detect_ind_struct*) ilm_ptr->local_para_ptr;
if (ind_p->result == 1) /* plug-in */
{
switch (tvo_context_p->state)
{
case TVO_IDLE:
{
init_tv();
tvo_context_p->tv_connected = tv_set_detection();
TVO_VALUE_TRACE(tvo_context_p->tv_connected, tvo_context_p->state, __LINE__);
/* send message to inform MMI that TV is connected */
tvo_send_tv_connect_ind(KAL_TRUE);
/* start a timer to periodically check TV connect status */
if (!tvo_context_p->tv_connected)
{
med_start_timer(TVO_CONNECT_POLLING_TIMER, TVO_TV_DETECT_PERIOD, tvo_tv_detect_check, 0);
}
TVO_ENTER_STATE(TVO_READY);
aud_set_tv_out_aud_path(KAL_TRUE);
break;
}
default:
break;
}
}
else /* plug-out */
{
switch (tvo_context_p->state)
{
case TVO_READY:
{
deinit_tv();
med_stop_timer(TVO_CONNECT_POLLING_TIMER);
/* send message to inform MMI that TV is disconnected */
tvo_send_tv_connect_ind(KAL_FALSE);
TVO_ENTER_STATE(TVO_IDLE);
aud_set_tv_out_aud_path(KAL_FALSE);
break;
}
case TVO_UPDATE:
{
deinit_tv();
med_stop_timer(TVO_CONNECT_POLLING_TIMER);
/* send message to inform MMI that TV is disconnected */
tvo_send_tv_connect_ind(KAL_FALSE);
TVO_ENTER_STATE(TVO_IDLE);
aud_set_tv_out_aud_path(KAL_FALSE);
break;
}
default:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -