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

📄 osd_util.c

📁 SAMSUNG 5009的源代码
💻 C
📖 第 1 页 / 共 3 页
字号:
		case ZOOM_3X:
			strcpy(text, "\032 3X");
			break;
		case ZOOM_4X:
			strcpy(text,"\032 4X");
			break;
		case ZOOM_8X:
			strcpy(text, "\032 8X");
			break;
		case ZOOM_16X:
			strcpy(text, "\032 16X");
			break;
		//case ZOOM_NONE :
		default:
			isZoom = FALSE;
			break;
	}
#else
	switch(GetZoomFactorState())
	{
		case ZOOM_DIV_4:
			strcpy(text, "1/4X");
			break;
		case ZOOM_DIV_3:
			strcpy(text, "1/3X");
			break;
		case ZOOM_DIV_2:
			strcpy(text, "1/2X");
			break;
		case ZOOM_2X:
			strcpy(text, "2X");
			break;
		case ZOOM_3X:
			strcpy(text, "3X");
			break;
		case ZOOM_4X:
			strcpy(text,"4X");
			break;
		case ZOOM_8X:
			strcpy(text, "8X");
			break;
		case ZOOM_16X:
			strcpy(text, "16X");
			break;
			
		//case ZOOM_NONE :
		default:
			isZoom = FALSE;
			break;
	}
#endif

	return isZoom;
}
#endif	/*_APP_CAP_OSD_ZOOM_ICON_KEEPING*/

// Qian liping 060331
/******************************************************************************
 *  Function name : GfxShowNoticeBox
 *  Arguments     : 
 *  Return        : VOID
 *  By            : Yanglu
 *  Description   : Make a graphics for cursor message osd
 ******************************************************************************
 */

/* Set string to be redrawed(keeping osd), according to main status */
OwNotice_type CursorDrawIconOnState(NCHAR*	text, BOOL*	isState )
{
	OwNotice_type 	type_nt =NOTICE_TYPE_DEFAULT;	
	ScanCtrl_t		scan;
	SetMainState_t	main_state;

	DiscType_t	disc = GetDiscState();
	/*Jiangshanbin for dvda  060323*/
	if( disc==DUMMY_DISC ||disc ==UNKNOWN_DISC|| 
		disc==NO_USB || disc == NO_FX ||
	     ((disc ==DVDV_DISC||disc ==DVDA_DISC) && GetMainState() == MAIN_STOP && GetDvdRegionCodeMatched() == FALSE) || 
		disc==NO_DISC 
#if _APP_CAP_FUNC_SLIDE_SHOW_PAUSE	
		||IsMmnCursorMsgOn()
#else/*_APP_CAP_FUNC_SLIDE_SHOW_PAUSE*/
		||S5H_GetAppType() == APP_MMN
#endif/*_APP_CAP_FUNC_SLIDE_SHOW_PAUSE*/
		)
	{
		*isState = FALSE;
		return NOTICE_TYPE_DEFAULT;
	}

	*isState = TRUE;

	main_state=GetMainState(); 
	
	if(main_state == MAIN_STOP)
	{
		if( IsResumeStopState() )
#if _APP_CAP_OSD_ENSURE_MESSAGE
			strcpy(text, (NCHAR *) gRStop_Ensure_Msg[MENU_LANG]);
#else/* _APP_CAP_OSD_ENSURE_MESSAGE*/
			strcpy(text, (NCHAR *) gpResumestop[MENU_LANG]);
#endif/* _APP_CAP_OSD_ENSURE_MESSAGE*/
		else
			strcpy(text, (NCHAR *) gpStop[MENU_LANG]);
			
			return NOTICE_TYPE_STOP;			
		
	}

/* <<< @: 5008CHN-XXX.QQ 050802:make the pause string disappeared in info -> album transmittion*/
#if _APP_CAP_FUNC_SLIDE_SHOW_PAUSE	//BY QQ 050906
#if _APP_CAP_FUNC_PAUSE_KEEPING // Qian liping 060331
	if(S5H_GetAppType() == APP_MMN 
	&& gOSD_state.etCur_dsp != DISPLAY_IMAGE_ALBUM 
	&& GetMmpImageMode() == PARAM_PB_NORMAL 
	&& GetMmpFileType() == MMP_IMAGE_FILE)//OSD_GetMainState() == DISPLAY_IMAGE_INFO		// Qianliping 20060410
		goto JPEG_PAUSE;
#endif/* _APP_CAP_FUNC_PAUSE_KEEPING */
/* <<< @: 5008CHN-XXX.QQ 050808:unless jpeg pause in jpeg slide show , osd will clear all other status displaying*/	
	if((S5H_GetAppType() == APP_MMN)&&GetMmpFileType()!=MMP_VIDEO_FILE)		//(weilf)20060405
	{
		*isState = FALSE;
		return NOTICE_TYPE_DEFAULT;
	}
/* >>> @: 5008CHN-XXX.QQ 050808 */
#endif/*_APP_CAP_FUNC_SLIDE_SHOW_PAUSE*/	
/* >>> @: 5008CHN-XXX.QQ 050802 */

	switch(main_state)
	{
		/* From here, the Stop/R.Stop only for CDDA */
		case MAIN_STOP:
			strcpy(text, (NCHAR *) gpStop[MENU_LANG]);
			type_nt = NOTICE_TYPE_STOP;
			break;			
		/*
		case MAIN_RESUMESTOP:
			strcpy(text, (NCHAR *) gOsd_str_static[MENU_LANG][ID_STRS_RESUME_STOP]);
			type_nt = NOTICE_TYPE_STOP;
			break;			
		*/
		
		case MAIN_STEP:			
			strcpy(text, (NCHAR *) gpStep[MENU_LANG]);
			type_nt = NOTICE_TYPE_STEP;	
			break;
				
#if _APP_CAP_FUNC_PAUSE_KEEPING
		case MAIN_PAUSE:
JPEG_PAUSE:
			strcpy(text, (NCHAR *)  gpPause[MENU_LANG]);
			type_nt = NOTICE_TYPE_PAUSE;
			break;
#endif/* _APP_CAP_FUNC_PAUSE_KEEPING */
		case MAIN_FF:
		case MAIN_FR:
		case MAIN_SF:
		case MAIN_SR:
			GetScanControlState( &scan );
			switch( scan.speed )
			{
				//case PM_SPEED_X1: sprintf( text, " X1 " ); break; // Qian liping 060524: not show x1
				case PM_SPEED_X2: sprintf( text, " X2  " ); break;
				case PM_SPEED_X4: sprintf( text, " X4  " ); break;				
				case PM_SPEED_X8: sprintf( text, " X8  " ); break;
				case PM_SPEED_X16: sprintf( text, " X16 " ); break;
				case PM_SPEED_X32: sprintf( text, " X32" ); break;
				case PM_SPEED_X128: sprintf( text, " X128" ); break;
				case PM_SPEED_X1_2: sprintf(text, "X1/2"); break;
				case PM_SPEED_X1_4: sprintf(text, "X1/4"); break;
				case PM_SPEED_X1_8: sprintf(text, "X1/8"); break;
				case PM_SPEED_X1_16: sprintf(text, "X1/16"); break;
				case PM_SPEED_X1_32: sprintf(text, "X1/32"); break;
								
				default: sprintf( text, "        " ); break;
			}
			
			if( scan.speed == PM_SPEED_X1 )
				type_nt = NOTICE_TYPE_DEFAULT ;
			else if(scan.direction == PM_DIR_FORWARD)	/* Yanglu 05.03.15 */
			{
				if(scan.speed > PM_SPEED_X1)
					type_nt = NOTICE_TYPE_FF;
				else
					type_nt = NOTICE_TYPE_SF;
			}
			else
			{
				if(scan.speed > PM_SPEED_X1)
					type_nt = NOTICE_TYPE_FR;
				else
					type_nt = NOTICE_TYPE_SR;
			}
			break;
		default:
			*isState = FALSE;
			break;
	}
	
	if(IS_INVALID_STATUS_IN_LRSTERO(main_state) && gOSD_state.etCur_dsp == DISPLAY_STEREO)
		OSD_SetMainDisplay(DISPLAY_OFF, SYS_NO_WAIT);
	
	return type_nt;
	
}

/******************************************************************************
 *  Function name 	: GfxIconRedrawCheck
 *  Arguments     	: 
 *     IN           :  wNotice_type type_nt, NCHAR*	text 
*			
*     OUT       
*     I/O       
 *  Return         	:  VOID
 *				  
 *  By            	: Qian liping
 *  Description   	: Redraw cursor notice box, including drawing the keeping osd first time 
	Keeping osd include: 
	Main status:	 	Stop/R.Stop/Step/Pasue/FF/FR/SF/SR
	Repeat status:		Repeat:A-/Repeat:A-B/
	Mute,ZOOM
*  Revision       	 :  1.2  060601
 ******************************************************************************
*/
VOID CursorMessageOn( OwNotice_type type_nt, NCHAR*	text  )
{
	NCHAR			text1[20];
	BYTE1			i,j,num;
	BYTE2  			cursor_bg_y =  CURSOR_Y ;
	BYTE2			bg_x,bg_y, bg_w, bg_h;

	VOID (*GfxShowNoticeBox[])( NCHAR*  ) = { 
		GfxShowNoticeBoxTxt2,
		GfxShowNoticeBoxTxt3,
#if _APP_CAP_OSD_ZOOM_ICON_KEEPING		
		GfxShowNoticeBoxTxt4,
#endif	
	};

	BOOL (*CursorDrawIcon[])(NCHAR* ) = {
		CursorDrawIconOnRpt,
		CursorDrawIconOnMute,	
#if _APP_CAP_OSD_ZOOM_ICON_KEEPING		
		CursorDrawIconOnZoom,
#endif			
	};

	SysPrintf("\n[GFX] ON Cursor Message");
	
	if(IsMmnCursorMsgOn())
		return;
	
	// Reset the notice bg.
	if( IsTransNoticeBg())
	{
		// Case 1:If current have not set the notice bg, set  it;
		// Case 2:If current cursor layer size is not the shared cursor layer size, reset it
		SH_GfxGetCanvasSize(SH_CANV2,&bg_w, &bg_h);
		if(	!SH_GfxGetCanvasState(SH_CANV2)||
			bg_w != CURSOR_W ||
			bg_h != CURSOR_H 
			)
		{
			GfxShowNoticeBoxBg();
		}

		//If current is the WARNING icon, hide it .
		if( GetDisplayIconState()== ICON_WARNING )
			GfxHideNoticeBoxIcon();

#ifndef _MTK_STYLE
		if(	S5H_GetAppType()==APP_MMN && 
			GetMmpFileType()== MMP_IMAGE_FILE &&
			(GetDisplayMainState() == DISPLAY_IMAGE_INFO||GetDisplayMainState() == DISPLAY_OFF )
		  )
		{
			cursor_bg_y = CURSOR_Y + 30;
		}
		else 
#endif /*_MTK_STYLE */
			if(GetDisplayMainState() == DISPLAY_IMAGE_ALBUM )
		{
			bg_x = MMP_ALBUM_BG_X;
			bg_y = MMP_ALBUM_BG_Y;
			OwGetOsdCenterPosition( &bg_x,&bg_y, 580, 377 );
			cursor_bg_y = CURSOR_Y +( (SINT)bg_y - MMP_ALBUM_BG_Y );
		}
#if _APP_CAP_OSD_DIGEST
		else  if(GetDisplayMainState() == DISPLAY_DIGEST_MENU )
		{
			if(S5H_GetOutputTvMode() == OUTPUT_525_60)
				cursor_bg_y =CURSOR_525_DIGEST_Y;//clina 0608002
		    else
				cursor_bg_y = CURSOR_625_DIGEST_Y;
		}
#endif
		else
		{
			cursor_bg_y = CURSOR_Y;
		}
			
		MIX_SetGraphicPos(SH_CANV2, CURSOR_X, cursor_bg_y);
	}else 
	{
		return;
	}


	/* The case that display keeping osd, include redraw */
	if(*text==NULL)	
	{
		 GfxIconRedrawCheck();
	}
	else
	{
		// Clear-up the notice bg.
		SH_GfxGetCanvasSize(SH_CANV2,&bg_w, &bg_h);//clina 060802
		SH_GfxDrawRec(SH_CANV2, 0, 0, bg_w-100, bg_h, OSD_COLOR_TRANS );
		
#if _APP_CAP_OSD_ENSURE_MESSAGE
		if( type_nt == NOTICE_TYPE_ENSURE_MSG )
		{
			SH_GfxDrawRec(SH_CANV2, 0, 0, CURSOR_W-100, CURSOR_H, OSD_COLOR_TRANS );
			GfxShowNoticeBoxTxt1( type_nt, text);
			return;
		}
		else 
#endif 
		GfxShowNoticeBoxTxt1( type_nt, text);
		j = 2;
#if _APP_CAP_OSD_ZOOM_ICON_KEEPING	
		j ++;
#endif/*_APP_CAP_OSD_ZOOM_ICON_KEEPING*/	
	       num = 0;
		for( i = 0 ; i < j ; i ++ )
		{
			if((*CursorDrawIcon[ i ])( text1)) 
			{
                       	(*GfxShowNoticeBox[num])(text1);
						num ++;			
			}
		}
	}
}

VOID OsdHandlerSetupDspInit(VOID)
{
	gOSD_state.etSetup_dsp.depth = MENU_DOM_DEPTH_1;
	gOSD_state.etSetup_dsp.d1_list = MENU_D1_SUB_LANG;
	gOSD_state.etSetup_dsp.d2_list = MENU_D2_LANG_AUDIO;
	gOSD_state.etSetup_dsp.d3_list = MENU_D3_LANG_MENU_ENG;
	gOSD_state.etSetup_dsp.d4_list = OTH_LANG_CESKY;
	gOSD_state.etSetup_dsp.d5_list = MENU_D5_START;
	gOSD_state.etSetup_dsp.pass_step = PASSWD_SUB_NONE;
}

#if _API_CAP_RLC_FUNCTION		//Lu Shuai 061016  // Qian liping 061031

//061011rlc
/* 
	return 1 & set value to v, when there is valid bits
	return 0, when there is no more bits
*/
int	gOption_Length = 4;
int	gOption_Run = 4;
int max_length = 15;
int max_one_pack = 8;
int rlc_byte_count=0;
int rld_byte_count=0;

int cur_valid_bits_counter = 0;
int cur_valid_value = 0;
int cur_w_valid_bits_counter = 0;
int cur_w_valid_value = 0;

int BIT_MASK[33] = 
{
	0x00000000,
	0x00000001,0x00000003,0x00000007,0x0000000F,0x0000001F,0x0000003F,0x0000007F,0x000000FF/* 8 bits*/,
	0x000001FF,0x000003FF,0x000007FF,0x00000FFF,0x00001FFF,0x00003FFF,0x00007FFF,0x0000FFFF/* 16 bits*/,
	0x0001FFFF,0x0003FFFF,0x0007FFFF,0x000FFFFF,0x001FFFFF,0x003FFFFF,0x007FFFFF,0x00FFFFFF/* 24 bits*/,
	0x01FFFFFF,0x03FFFFFF,0x07FFFFFF,0x0FFFFFFF,0x1FFFFFFF,0x3FFFFFFF,0x7FFFFFFF,0xFFFFFFFF/* 32 bits*/
};
int getpair(int *run/* value */, int *length /* count*/, UINT start_index)
{
	UINT tmp_v;
	char tmp_c;

	if(cur_valid_bits_counter < max_one_pack ) {
		/* if we need to read next bytes from input file */
		tmp_c = (char)gOsd_rlc_img_data_org[start_index+rlc_byte_count];
		rlc_byte_count++;
		cur_valid_value <<= 8;
		cur_valid_value |= (tmp_c & 0x0000FF );
		cur_valid_bits_counter += 8;
	}

	/* now, we have enough bits at cur_valid_value */

	tmp_v = cur_valid_value;
	tmp_v >>= (cur_valid_bits_counter - max_one_pack );

	*run = tmp_v & BIT_MASK[gOption_Run];
	tmp_v >>= gOption_Run;
	*length = tmp_v;

	cur_valid_bits_counter -= max_one_pack;

	/*make Zero bits which have read */
	//cur_valid_value <<= (32 - cur_valid_bits_counter); /* 32 bit is int-size at PC */
	//cur_valid_value >>= (32 - cur_valid_bits_counter);
	cur_valid_value &= BIT_MASK[cur_valid_bits_counter];

	if(*length == 0) {
		/* this is the last padding data */
		return 0;
	}
	return 1;
}

int putbis(int run /*value*/)
{
	UINT tmp_v;
	char tmp_c;
	char *tmp_data_img = (char *)((UINT)gOsd_rld_img_data_buffer );

	cur_w_valid_bits_counter += gOption_Run;
	cur_w_valid_value <<= gOption_Run;
	cur_w_valid_value |= run;

	/*check if we have to save or not */
	while( cur_w_valid_bits_counter >= 8) {
		/* save bytes here */
		tmp_v = cur_w_valid_value;

		tmp_v >>= (cur_w_valid_bits_counter - 8);
		/* save high 8 bits (tmp_v) */
		tmp_c = (tmp_v & 0x000000FF);
		tmp_data_img[rld_byte_count] = tmp_c;
		rld_byte_count++;

		cur_w_valid_bits_counter -= 8;
		/*make Zero bits which have read */
		cur_w_valid_value &= BIT_MASK[cur_w_valid_bits_counter];
	}

	return 0;
}

/* 
	real run length coding function 

	fgetc(realout, out_bin);
	fputc(realout, out_bin);

*/

int	rld(UINT start_index, BYTE2 image_width)
{
	int run = 0; /* value */
	int length = 0; /* counter */

	rlc_byte_count = 0;
	rld_byte_count = 0;
//	rld_data_h = 0;
//	rld_data_w = 0;
	/* init */
	while(getpair(&run, &length, start_index)){
		while(length--){
			putbis(run);
		}
	}

	/* check if byte aligned */
	while(cur_w_valid_bits_counter) {
		/*
			if it needs more bits for byte write, then padding Zero 
		*/
		putbis(0);
	}


	return 0;
}
#endif //_API_CAP_RLC_FUNCTION


⌨️ 快捷键说明

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