Beispiel #1
0
/*****************************************************
Interface : static PRESULT chapter_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2);
Function  : callback of chapter container
Author    : Wu Jianwen
Date      : 2010.8.25
Input     : 
Output    : NONE
Return    : 
******************************************************/
static PRESULT chapter_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT8 i;
	UINT16 wait_time = 0;
	UINT8 unact = 0;
	INT32 i_DestChapter = 0;        //dest chapter num
	INT32 i_DestChapStartTime;
	DEC_CHAPTER_INFO t_ChapterInfo;    //save chapter info of the stream

	switch(event)
	{
	case EVN_MSG_GOT:
		if(param1 ==  CTRL_MSG_SUBTYPE_CMD_EXIT)
		{
			ret = PROC_LEAVE;
		}
#ifdef USB_MP_SUPPORT
		else if(param1 == CTRL_MSG_SUBTYPE_STATUS_VIDEO_OVER)
		{
			ret = PROC_LEAVE;
			ap_send_msg(CTRL_MSG_SUBTYPE_STATUS_VIDEO_OVER,0,TRUE);
		}
#endif
		break;

	case EVN_PRE_OPEN:
        api_set_deo_layer(0);
        api_inc_wnd_count();

		for(i=0;i<CHAPTER_ITEM_NUMBER;i++)
		{
			p_chapter_track_str[i]=Chapter_track_str[i];
			p_chapter_track_idx[i]=Chapter_track_idx[i];
		}
		ListChapterInfoInit();
		break;		
		
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		if(VACT_ENTER == unact)
		{
			i_DestChapter = OSD_GetListCurPoint(&g_ls_chapter);  //get current chapter
			t_ChapterInfo.dst_chapter = i_DestChapter;
			MpgFileGetChapterInfo(&t_ChapterInfo);
			//i_DestChapStartTime = t_ChapterInfo.dst_start_time/1000;   //second
			i_DestChapStartTime = t_ChapterInfo.dst_start_time;   //ms
			if(t_ChapterInfo.dst_start_time > t_ChapterInfo.cur_start_time)  
			{
				//mpg_cmd_search_proc((DWORD)i_DestChapStartTime);
				mpg_cmd_search_ms_proc((DWORD)i_DestChapStartTime);
				while ((i_DestChapStartTime > MPGFileDecoderGetPlayTime()) && (wait_time < MP_TRICK_TIMEOUT))
				{
					osal_task_sleep(2);
					wait_time++;
				}
			}
			else                  //chapter18 to chapter1          
			{
				//mpg_cmd_search_proc((DWORD)i_DestChapStartTime);
				mpg_cmd_search_ms_proc((DWORD)i_DestChapStartTime);
				while ((i_DestChapStartTime + VIDEO_SEARCH_DLYS < MPGFileDecoderGetPlayTime()) && (wait_time < MP_TRICK_TIMEOUT))
				{
					osal_task_sleep(2);
					wait_time++;
				}
			}
			
			PlayProc();
			OSD_ObjClose(pObj,C_CLOSE_CLRBACK_FLG);
			return PROC_LEAVE;		
		}
		break;
		
	case EVN_PRE_CLOSE:
		ret = PROC_PASS;
        break;

	case EVN_POST_CLOSE:
        api_set_deo_layer(1);
        api_dec_wnd_count();
        break;
	default:
		break;
	}

	return ret;
}
Beispiel #2
0
static PRESULT subtitle_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	SYSTEM_DATA * sys;
	struct nim_device* nim_dev;	
	UINT8 i,lock;
	UINT8 unact;
	
	if(cur_tuner_idx == 0)
		nim_dev = g_nim_dev;
	else
		nim_dev = g_nim_dev2;
    	nim_get_lock(nim_dev,&lock);

	switch(event)
	{
	case EVN_PRE_OPEN:
        api_set_deo_layer(0);
        api_inc_wnd_count();

		for(i=0;i<SUBTITLE_ITEM_NUMBER;i++)
		{
			p_subtitle_track_str[i]=Subtitle_track_str[i];
			p_subtitle_track_idx[i]=Subtitle_track_idx[i];
		}
		win_subtitle_init_data();
		if(((0 == g_win_subtitle_count ) && (0 == g_win_ttx_subtitle_count)) || (!lock))
#if (DVR_PVR_SUPPORT_SUBTITLE)//temp disable
		if(((0 == g_win_subtitle_count ) && (0 == g_win_ttx_subtitle_count)) 
#ifdef DVR_PVR_SUPPORT
			|| ((!lock) && !api_pvr_is_playing())
#else
			|| (!lock)
#endif
			)
#endif
		{
			win_com_popup_open(WIN_POPUP_TYPE_SMSG,NULL, RS_DISPLAY_NO_DATA);			
			osal_task_sleep(1000);
			win_compopup_close();
            api_dec_wnd_count();
			return PROC_LEAVE;
		}
		break;		
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		if(VACT_ENTER == unact)
		{
			UINT16	cur_sel = OSD_GetListCurPoint(&g_ls_subtitle);
			sys = sys_data_get();
			if(g_win_subtitle_count + g_win_ttx_subtitle_count==cur_sel)
			{
				sys->osd_set.subtitle_display = 0;/*select off option*/
				sys->osd_set.subtitle_lang = 0xFF;
			}
			else if(cur_sel < g_win_ttx_subtitle_count)
			{
				sys->osd_set.subtitle_display = 1;/*subtitle on*/
				sys->osd_set.subtitle_lang = cur_sel;/*set_sub_lang_idx is used in api_osd_mode_change function*/
			}
			else if(cur_sel < g_win_subtitle_count + g_win_ttx_subtitle_count)
			{/*ttx_subtitle on the top then normal subtitle*/
				sys->osd_set.subtitle_display = 1;
				sys->osd_set.subtitle_lang = cur_sel;/*set_sub_lang_idx is used in api_osd_mode_change function*/
			}
			ret = PROC_LEAVE;
			api_osd_mode_change(OSD_NO_SHOW);
			//api_osd_mode_change(OSD_SUBTITLE);
		}
		break;
	case EVN_PRE_CLOSE:
		unact = (VACTION)(param1>>16);
		ret = PROC_PASS;
        break;

	case EVN_POST_CLOSE:
        api_set_deo_layer(1);
        api_dec_wnd_count();
        break;
	default:
		break;
	}

	return ret;
}
Beispiel #3
0
static PRESULT subtitle_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	SYSTEM_DATA * sys;
	struct nim_device* nim_dev;	
	UINT8 i,lock;
	UINT8 unact;
	
	if(cur_tuner_idx == 0)
		nim_dev = g_nim_dev;
	else
		nim_dev = g_nim_dev2;
    	nim_get_lock(nim_dev,&lock);

	switch(event)
	{
	case EVN_PRE_OPEN:
        #ifdef SUPPORT_CAS9
			if(0==get_mmi_showed())
				ShowSignalStatusOSDOnOff(0);
        #endif
        api_set_deo_layer(0);
        api_inc_wnd_count();

		for(i=0;i<SUBTITLE_ITEM_NUMBER;i++)
		{
			p_subtitle_track_str[i]=Subtitle_track_str[i];
			p_subtitle_track_idx[i]=Subtitle_track_idx[i];
		}

		if(system_state != SYS_STATE_USB_MP)//vic100507#1	
		{
			win_subtitle_init_data();
			if(((0 == g_win_subtitle_count ) && (0 == g_win_ttx_subtitle_count)) || (!lock))
			#if (DVR_PVR_SUPPORT_SUBTITLE)//temp disable
			if(((0 == g_win_subtitle_count ) && (0 == g_win_ttx_subtitle_count)) 
			#ifdef DVR_PVR_SUPPORT
				|| ((!lock) && !api_pvr_is_playing())
			#else
				|| (!lock)
			#endif
				)
			#endif
			{
				win_com_popup_open(WIN_POPUP_TYPE_SMSG,NULL, RS_DISPLAY_NO_DATA);			
				osal_task_sleep(1000);
				win_compopup_close();
	            api_dec_wnd_count();
				return PROC_LEAVE;
			}
		}
		else
		{
		#ifdef MP_SUBTITLE_SUPPORT	//vic100507#1			
			//TODO:
			//such like win_subtitle_init_data
			long resut;
			resut = win_mp_subtitle_init_data();
			if (resut < 0)
			{						
				return PROC_LEAVE;				
			}
			
		#endif				
		}
		break;		
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);

		if(system_state != SYS_STATE_USB_MP)//vic100507#1 
		{

			if(VACT_ENTER == unact)
			{
				UINT16	cur_sel = OSD_GetListCurPoint(&g_ls_subtitle);
				sys = sys_data_get();
				if(g_win_subtitle_count + g_win_ttx_subtitle_count==cur_sel)
				{
					sys->osd_set.subtitle_display = 0;/*select off option*/
					sys->osd_set.subtitle_lang = 0xFF;
				}
				else if(cur_sel < g_win_ttx_subtitle_count)
				{
					sys->osd_set.subtitle_display = 1;/*subtitle on*/
					sys->osd_set.subtitle_lang = cur_sel;/*set_sub_lang_idx is used in api_osd_mode_change function*/
				}
				else if(cur_sel < g_win_subtitle_count + g_win_ttx_subtitle_count)
				{/*ttx_subtitle on the top then normal subtitle*/
					sys->osd_set.subtitle_display = 1;
					sys->osd_set.subtitle_lang = cur_sel;/*set_sub_lang_idx is used in api_osd_mode_change function*/
				}
				ret = PROC_LEAVE;
				api_osd_mode_change(OSD_NO_SHOW);
				//api_osd_mode_change(OSD_SUBTITLE);
			}
		}
		else if(VACT_ENTER == unact)
		{
		//vic100507#1 begin
		#ifdef MP_SUBTITLE_SUPPORT	
			//TODO:
			//select language index
			if (!subtitle_handle)
			{
				return PROC_LEAVE;
			}
			long resut;
			UINT16	cur_sel = OSD_GetListCurPoint(&g_ls_subtitle);

			if(g_ext_subtitle_plugin)
				g_ext_subtitle_plugin->mps_change_language(subtitle_handle,cur_sel);
			
			OSD_ObjClose(pObj,C_CLOSE_CLRBACK_FLG);
			//if (resut < 0)
			{
				return PROC_LEAVE;
			}			
		#endif					
		//vic100507#1 end
		}
		break;
	case EVN_PRE_CLOSE:
		unact = (VACTION)(param1>>16);
		ret = PROC_PASS;
        break;

	case EVN_POST_CLOSE:
        #ifdef SUPPORT_CAS9
            restore_ca_msg_when_exit_win();
        #endif
        api_set_deo_layer(1);
        api_dec_wnd_count();
        break;
	default:
		break;
	}

	return ret;
}