/*
 * Class:     com_dvb_DvbSystemSetting
 * Method:    setAspect
 * Signature: (I)Z
 */
JNIEXPORT jboolean JNICALL Java_DvbSystemSetting_setAspect
  (JNIEnv *env, jclass cls, jint value) {
	LOGD("%s,%d value = %d ",__FUNCTION__,__LINE__, value);

	enum TVMode eTVAspect;
	enum DisplayMode e169DisplayMode;

	if (value == 2) {
		eTVAspect = TV_16_9;
		e169DisplayMode = NORMAL_SCALE;
	}
	else if( value == 1 ) {
		e169DisplayMode = VERTICALCUT;
		eTVAspect = TV_4_3;
	}
	else {
		e169DisplayMode = PILLBOX;
		eTVAspect = TV_4_3;
	}


	if(vpo_aspect_mode( (struct vpo_device *)dev_get_by_id(HLD_DEV_TYPE_DIS, 0), eTVAspect, e169DisplayMode) == 0)
		return 1;
	else
		return 0;

}
Exemplo n.º 2
0
void sys_data_set_display_mode(AV_Set *av_set)
{
	enum TVMode eTVAspect;
	enum DisplayMode e169DisplayMode;

	if (av_set->tv_ratio == TV_ASPECT_RATIO_169)
		eTVAspect = TV_16_9;
	else
	// if(av_set->tv_ratio==TV_ASPECT_RATIO_43)
		eTVAspect = TV_4_3;


	if (av_set->tv_ratio == TV_ASPECT_RATIO_AUTO)
		e169DisplayMode = NORMAL_SCALE;
	else if (av_set->display_mode == DISPLAY_MODE_LETTERBOX)
		e169DisplayMode = LETTERBOX;
	else if (av_set->display_mode == DISPLAY_MODE_PANSCAN)
		e169DisplayMode = PANSCAN;
	else
		e169DisplayMode = NORMAL_SCALE;

	//if(eTVAspect == TV_16_9)
	if (av_set->tv_ratio == TV_ASPECT_RATIO_169)
		e169DisplayMode = PILLBOX;

	vpo_aspect_mode((struct vpo_device*)dev_get_by_id(HLD_DEV_TYPE_DIS, 0),  \
		eTVAspect, e169DisplayMode);

}
Exemplo n.º 3
0
static PRESULT map_display_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	//UINT8	focusID = OSD_GetFocusID( pObj);
	UINT8 back_saved;
	OSD_RECT rect = {PREVIEW_L, PREVIEW_T, PREVIEW_W, PREVIEW_H};
	struct  YCbCrColor bgcolor;

	switch(event)
	{
		case EVN_PRE_OPEN:
			vdec_stop((struct vdec_device *)dev_get_by_type(NULL, HLD_DEV_TYPE_DECV), 0, 0);
			OSD_ClearScreen();//-a by wangyang 2011-09-20
			win_media_player_init_ex(mp_apcallback, 1);
			bMapDownloading = FALSE;
			zoom_level = 12;
			//api_set_preview_vpo_color(TRUE);
			bgcolor.uY = 16;
			bgcolor.uCb = 128;
			bgcolor.uCr = 128;		
			api_set_vpo_bgcolor(&bgcolor);
			image_restore_vpo_rect();//TODO
#if 0			
			vpo_aspect_mode((struct vpo_device *)dev_get_by_id(HLD_DEV_TYPE_DIS,0), TV_4_3, NORMAL_SCALE);
#ifdef DUAL_VIDEO_OUTPUT
			vpo_aspect_mode((struct vpo_device *)dev_get_by_id(HLD_DEV_TYPE_DIS,1), TV_4_3, NORMAL_SCALE);
#endif
			osal_task_sleep(30);
			
			if(is_cur_decoder_avc())
			{
				h264_decoder_select(0, hde_get_mode() == VIEW_MODE_PREVIEW);
			}
#endif			
//			system_state = SYS_STATE_USB_MP;
	      	  	//osal_cache_flush_all();
	      	  	image_abort();
			//map_show(rect);
			break;
       	case EVN_POST_OPEN:
			//wincom_open_subtitle(pObj,RS_MAP,0);
			wincom_open_help_trans(pObj, map_display_helpinfo, 2);
			map_show(rect, param2);
			break;
		case EVN_POST_CLOSE:
			map_download_abort(s_mapdisp_dl_handle);
			s_mapdisp_dl_handle = 0;
			media_player_release_ex();
#ifdef LOGO_IN_RAM
			api_show_Test_logo_2(internet_osd4,get_logo_h_file_size(6));
#else
			api_show_Test_logo( LOGO_ID_TYPE|0X0200|7);
#endif
			wincom_close_subtitle();
			break;
		case EVN_MSG_GOT:
			if (param1 == CTRL_MSG_SUBTYPE_STATUS_DOWNLOAD_FINISH)
			{
				bMapDownloading = FALSE;
				map_download_abort(s_mapdisp_dl_handle);
				s_mapdisp_dl_handle = 0;
				if ((int)param2 >= 0)
				{	
					win_compopup_smsg_restoreback();
					map_show(rect, param2);
				}
			}
			break;
		default:
			break;
	}

	return ret;
}
Exemplo n.º 4
0
static PRESULT slide_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT16 slide_interval;
	PlayListLoopType loop_type;
    struct osd_device *osd_dev;
    struct OSDRect pRect;
   	struct OSDPara OpenPara;    
    UINT32 region_id =0;

	VACTION unact;
	FileInfo file_node;
	char image_name[FULL_PATH_SIZE];
	int next_image;
	static UINT8 timer_start_flag = 0;
	UINT32 file_idx;
	SYSTEM_DATA *sys_cfg = sys_data_get();

	switch(event)
	{
    case EVN_PRE_OPEN:
		imageslide_timer_id = OSAL_INVALID_ID;
		imageslide_proc_id = OSAL_INVALID_ID;

		if(from_imagepreview == TRUE)
		{
			imageslide_pause_state = IMG_PAUSE_STATE;
		}
		else
		{
			imageslide_pause_state = IMG_UNPAUSE_STATE;
		}
		win_imageslide_showpause();
		api_set_preview_vpo_color(FALSE);
		vpo_aspect_mode((struct vpo_device *)dev_get_by_id(HLD_DEV_TYPE_DIS,0), TV_4_3, NORMAL_SCALE);
#ifdef DUAL_VIDEO_OUTPUT
		vpo_aspect_mode((struct vpo_device *)dev_get_by_id(HLD_DEV_TYPE_DIS,1), TV_4_3, NORMAL_SCALE);
#endif
		break;
    case EVN_POST_OPEN:
		image_rot_ang = ANG_ORI;
		
		loop_type = image_slide_setting.bRepeat ? PLAY_LIST_REPEAT : PlAY_LIST_SEQUENCE;
		set_play_list_info(cur_playlist_image,&cur_image_idx,&loop_type);

		get_file_from_play_list(cur_playlist_image, cur_image_idx, &file_node);
		win_get_fullname(image_name, file_node.path, file_node.name);
//        while(jpeg_decoder_task_not_over)
//        {
//            libc_printf("error condition!\n");
//            osal_task_sleep(20);
//        }
        image_abort();
        timer_slide = osal_get_tick();
		win_image_file_play(image_name, image_rot_ang);
		slideidx_display(TRUE);
		decode_finish_flag = FALSE;        
        break;
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);
		ret = win_imageslide_unkown_act_proc(unact);
		break;
	case EVN_PRE_CLOSE:
		g_from_imageslide = TRUE;
		imagedec_ioctl(1, IMAGEDEC_IO_CMD_CLEAN_FRM, TRUE);	//when quit win_slide, clean 2 frm buffer
		
		if(image_folderloop_flag == 1)//filelist
		{
			get_file_from_play_list(cur_playlist_image, cur_image_idx, &file_node);
			win_get_fullname(image_name, file_node.path, file_node.name);
			usblist_set_filelist_param(image_name);
		}
		image_abort();
///*
#ifdef  DUAL_ENABLE
#ifdef  PNG_GIF_TEST  

        pRect.uLeft =136;
	    pRect.uTop = 40;
	    pRect.uWidth = 1008;//OSD_MAX_WIDTH;//608;
	    pRect.uHeight = 640;//OSD_MAX_HEIGHT;//430;	
    
        OpenPara.eMode = OSD_HD_ARGB1555;
        OpenPara.uGAlpha = 0x0f;
        OpenPara.uGAlphaEnable = 0;
        OpenPara.uPalletteSel = 0;
        osd_dev = (struct osd_device *)dev_get_by_id(HLD_DEV_TYPE_OSD, 0);
        if (osd_dev != NULL)
	    {		
            OSDDrv_Close((HANDLE)osd_dev);
            //AD_GIF_PRINTF("%s() OSD_layer2 is closed!\n", __FUNCTION__);
        }
        OSDDrv_Open((HANDLE)osd_dev, &OpenPara);
        osal_task_sleep(20);
        //trans_color = OSD_GetTransColor(OpenPara.eMode,TRUE);
	    OSDDrv_IoCtl((HANDLE)osd_dev, OSD_IO_SET_TRANS_COLOR, 0x00);
	    OSDDrv_CreateRegion((HANDLE)osd_dev, region_id, &pRect, NULL);
        pRect.uLeft = pRect.uTop = 0;
        OSDDrv_RegionFill((HANDLE)osd_dev,region_id,&pRect,0x00);   
        OSDDrv_ShowOnOff((HANDLE)osd_dev, TRUE); 
            
#endif            
#endif
//*/        
		api_stop_timer(&imageslide_timer_id);
		api_stop_timer(&imageslide_proc_id);
        timer_start_flag = 0;
		imageslide_timer_id = OSAL_INVALID_ID;
		imageslide_proc_id = OSAL_INVALID_ID;
		win_set_image_multiview_firstidx();
		sys_cfg = sys_data_get();
		sys_data_set_display_mode(&(sys_cfg->avset));

		OSD_ClearObject((POBJECT_HEAD)&imageslide_idx,C_UPDATE_ALL);
		OSD_ClearObject((POBJECT_HEAD)&imageslide_pause,C_UPDATE_ALL);
		OSD_ClearObject((POBJECT_HEAD)&decode_txt_progress,C_UPDATE_ALL);
		OSD_ClearObject((POBJECT_HEAD)&decode_bmp_progress,C_UPDATE_ALL);
		break;
	case EVN_POST_CLOSE:
		image_restore_vpo_rect();//TODO
		break;
	case EVN_MSG_GOT:
        if(param1 == CTRL_MSG_SUBTYPE_CMD_STO && param2 == USB_STATUS_OVER)
        {
			//storage_dev_mount_hint(1);
			file_list_check_storage_device(FALSE, FALSE);
        }
		else if(param1 == CTRL_MSG_SUBTYPE_STATUS_IMAGEOVER)
		{
            if(param2 > timer_slide)
            {
    			image_abort();
            }
            else
            {
                libc_printf("slide @@@@@@@@@@@@@@ es case\n");
                break;
            }
			decode_finish_flag = TRUE;
			if(imageslide_pause_state == IMG_UNPAUSE_STATE)
		    {
				slide_interval = (image_slide_setting.uTime_gap * 1000);
				if(0 != slide_interval)
					imageslide_timer_id = api_start_timer("IMAGESLIDE",slide_interval,win_imageslide_handler);
				else
				{
					imageslide_pause_state = IMG_PAUSE_STATE;
					win_imageslide_showpause();
				}
			}
		}
		else if (param1 == CTRL_MSG_SUBTYPE_STATUS_IMGTOOVER) // timer timeouts
		{
			//TODO: play next
			
//            while(jpeg_decoder_task_not_over)
//            {
//                libc_printf("\n%%%%%%%%%%%%%%%%%%%%%%%%%\n");
//                osal_task_sleep(20);
//            }
			image_abort();
			next_image = get_next_index_from_play_list(cur_playlist_image);
			
			if (next_image != -1)
			{
				cur_image_idx = next_image;
				set_play_list_info(cur_playlist_image,&cur_image_idx,NULL);
				get_file_from_play_list(cur_playlist_image, cur_image_idx, &file_node);
				win_get_fullname(image_name, file_node.path, file_node.name);
				win_image_file_play(image_name, image_rot_ang);
				decode_finish_flag = FALSE;
				ap_send_msg(CTRL_MSG_SUBTYPE_CMD_UPDATE_VIEW, 0, TRUE);
			}
			else
			{
				ap_send_msg(CTRL_MSG_SUBTYPE_CMD_EXIT, 0,TRUE);
			}
		}
		else if(param1 == CTRL_MSG_SUBTYPE_CMD_EXIT)
		{
			if(from_imagepreview == TRUE)
				back_to_filelist = TRUE;
			ret = PROC_LEAVE;
		}
		else if(param1 == CTRL_MSG_SUBTYPE_CMD_UPDATE_VIEW)
		{
			slideidx_display(TRUE);
			ret = PROC_LOOP;
		}
		else if(param1 == CTRL_MSG_SUBTYPE_STATUS_MP3OVER)
		{
			win_play_next_music_ex();
		}
		else if(param1 == CTRL_MSG_SUBTYPE_STATUS_PROC_UPDATE)
		{
			OSD_SetBitmapContent(&decode_bmp_progress, loading_bmp_ids[proc_cnt]);
			OSD_DrawObject((POBJECT_HEAD)&decode_bmp_progress,C_UPDATE_ALL);
			proc_cnt ++;
			if(proc_cnt >= LOADING_MAX)
				proc_cnt = 0;
		}		
		
		if ((param1 == CTRL_MSG_SUBTYPE_STATUS_JPEG_DEC_PROCESS) || (param1 == CTRL_MSG_SUBTYPE_STATUS_IMAGEOVER))
		{
			if ((param2 < 100) && (param1 == CTRL_MSG_SUBTYPE_STATUS_JPEG_DEC_PROCESS))
			{
				loading_progress = (param2 * LOADING_MAX)/100;
				if (loading_progress > LOADING_MAX - 1)
					loading_progress = LOADING_MAX - 1;

				if(0 == timer_start_flag)
				{
					imageslide_proc_id = OSAL_INVALID_ID;
					imageslide_proc_id = api_start_cycletimer("SLIDE_PROC", 200, win_imageslide_proc_handler);
					timer_start_flag = 1;
				}
			//	OSD_SetBitmapContent(&decode_bmp_progress, loading_bmp_ids[loading_progress]);
			//	OSD_DrawObject((POBJECT_HEAD)&decode_bmp_progress,C_UPDATE_ALL);
			}
			else if((param2 >= 100) || (param1 == CTRL_MSG_SUBTYPE_STATUS_IMAGEOVER))
			{
				OSD_ClearObject((POBJECT_HEAD)&decode_bmp_progress,C_UPDATE_ALL);
				api_stop_timer(&imageslide_proc_id);
				imageslide_proc_id = OSAL_INVALID_ID;
				timer_start_flag = 0;
				proc_cnt = 0;
			//	imageslide_proc_id = OSAL_INVALID_ID;
			}
		}
		break;
	default:
		break;
	}

	return ret;
}
Exemplo n.º 5
0
static PRESULT map_display_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT8 back_saved;
	OSD_RECT rect = {PREVIEW_L, PREVIEW_T, PREVIEW_W, PREVIEW_H};
	struct  YCbCrColor bgcolor;

	switch(event)
	{
		case EVN_PRE_OPEN:
			OSD_ClearScreen();//-a by wangyang 2011-09-20
			win_media_player_init_ex(mp_apcallback, 1);
			bMapDownloading = FALSE;
			zoom_level = 12;
			//api_set_preview_vpo_color(TRUE);
			bgcolor.uY = 16;
			bgcolor.uCb = 128;
			bgcolor.uCr = 128;		
			api_set_vpo_bgcolor(&bgcolor);
			image_restore_vpo_rect();//TODO
#if 0			
			vpo_aspect_mode((struct vpo_device *)dev_get_by_id(HLD_DEV_TYPE_DIS,0), TV_4_3, NORMAL_SCALE);
#ifdef DUAL_VIDEO_OUTPUT
			vpo_aspect_mode((struct vpo_device *)dev_get_by_id(HLD_DEV_TYPE_DIS,1), TV_4_3, NORMAL_SCALE);
#endif
			osal_task_sleep(30);
			
			if(is_cur_decoder_avc())
			{
				h264_decoder_select(0, hde_get_mode() == VIEW_MODE_PREVIEW);
			}
#endif			
//			system_state = SYS_STATE_USB_MP;
	      	  	//osal_cache_flush_all();
	      	  	image_abort();
			//map_show(rect);
			break;
       		case EVN_POST_OPEN:
			//wincom_open_subtitle(pObj,RS_MAP,0);
			wincom_open_help_OK_list_small(pObj, map_display_helpinfo, 2);
			//wincom_open_help(pObj, map_display_helpinfo, 2);
			libc_printf("map_dl_param2 = %d\n", param2);
			map_show(rect, param2);
			break;
		case EVN_PRE_CLOSE://-a by wangyang 2011-09-20
			map_download_abort(s_mapdisp_dl_handle);
			s_mapdisp_dl_handle = 0;
			media_player_release_ex();
			imagedec_ioctl(1, IMAGEDEC_IO_CMD_CLEAN_FRM, TRUE);	//when quit win_slide, clean 2 frm buffer
	      	  	image_abort();
			break;
		case EVN_POST_CLOSE:
			wincom_close_subtitle();
			image_restore_vpo_rect();//-a by wangyang 2011-09-20
			break;
		case EVN_MSG_GOT:
			if (param1 == CTRL_MSG_SUBTYPE_STATUS_DOWNLOAD_FINISH)
			{
				bMapDownloading = FALSE;
				map_download_abort(s_mapdisp_dl_handle);
				s_mapdisp_dl_handle = 0;
				if ((int)param2 >= 0)
				{	
					win_compopup_smsg_restoreback();
					map_show(rect, param2);
				}
			}
			break;
		default:
			break;
	}

	return ret;
}