void ui_ads_show_logo(void) { u32 cmd; ads_info_t ads_info = {0}; memset(g_ad_data_buf, 0, 64*KBYTES); ads_info.p_priv = g_ad_data_buf; ads_dvbad_set_type(ADS_AD_TYPE_LOGO,&cmd,&ads_info); ads_io_ctrl(g_adm_id,cmd,&ads_info); DEBUG(ADS,INFO,"ads_data_len=%d\n", ads_info.ads_data_len); DEBUG(ADS,INFO,"start show picture tickets2=%d\n", mtos_ticks_get()); if(ads_info.ads_data_len == 0) { DEBUG(ADS,INFO,"ads_show_logo no ad logo or logo is not mpeg\n"); return ; } else { RET_CODE ret = SUCCESS; void * p_video_dev = dev_find_identifier(NULL, DEV_IDT_TYPE, SYS_DEV_TYPE_VDEC_VSB); void * p_disp_dev = dev_find_identifier(NULL, DEV_IDT_TYPE, SYS_DEV_TYPE_DISPLAY); vdec_stop(p_video_dev); disp_layer_show(p_disp_dev, DISP_LAYER_ID_SUBTITL, FALSE); vdec_set_data_input(p_video_dev,1); ret = vdec_start(p_video_dev, VIDEO_MPEG, VID_UNBLANK_STABLE); MT_ASSERT(SUCCESS == ret); ret = vdec_dec_one_frame(p_video_dev, (u8 *)ads_info.p_priv, ads_info.ads_data_len); MT_ASSERT(SUCCESS == ret); ret = disp_layer_show(p_disp_dev, DISP_LAYER_ID_SUBTITL, TRUE); MT_ASSERT(SUCCESS == ret); } }
BOOL avc_av_stop(void *p_data) { RET_CODE ret = SUCCESS; avc_var_t *p_avc_data = (avc_var_t *)p_data; OS_PRINTF("--____________________--------->>avc av stop\n"); ret = vdec_stop(p_avc_data->p_video_dev); ret |= aud_stop_vsb(p_avc_data->p_audio_dev); return ret == SUCCESS ? TRUE : FALSE; }
static int drv_video_init(void) { RET_CODE ret; vdec_cfg_t vdec_cfg = {0}; void *p_video = NULL; u32 size = 0; u32 align = 0; ret = ATTACH_DRIVER(VDEC, concerto, default, default); MT_ASSERT(ret == SUCCESS); p_video = (void *)dev_find_identifier(NULL , DEV_IDT_TYPE, SYS_DEV_TYPE_VDEC_VSB); MT_ASSERT(NULL != p_video); vdec_cfg.is_autotest = FALSE; ret = dev_open(p_video, &vdec_cfg); MT_ASSERT(SUCCESS == ret); OS_PRINTF("Init Vdec success\n"); vdec_stop(p_video); #ifdef MIN_AV_64M #ifdef MIN_AV_SDONLY vdec_get_buf_requirement(p_video, VDEC_SDINPUT_ONLY, &size, &align); OS_PRINTF("VDEC_SDINPUT_ONLY vdec buffer size is : 0x%x\n",size); MT_ASSERT(VIDEO_FW_CFG_SIZE >= size); OS_PRINTF("VDEC_SDINPUT_ONLY :0x%x\n",VIDEO_FW_CFG_ADDR); vdec_set_buf(p_video, VDEC_SDINPUT_ONLY, VIDEO_FW_CFG_ADDR); #else vdec_get_buf_requirement(p_video, VDEC_BUFFER_AD_UNUSEPRESCALE, &size, &align); OS_PRINTF("VDEC_BUFFER_AD_UNUSEPRESCALE vdec buffer size is : 0x%x\n",size); MT_ASSERT(VIDEO_FW_CFG_SIZE >= size); OS_PRINTF("VDEC_BUFFER_AD_UNUSEPRESCALE :0x%x\n",VIDEO_FW_CFG_ADDR); vdec_set_buf(p_video, VDEC_BUFFER_AD_UNUSEPRESCALE, VIDEO_FW_CFG_ADDR); #endif #else vdec_get_buf_requirement(p_video, VDEC_QAULITY_AD_128M, &size, &align); OS_PRINTF("VDEC_QAULITY_AD_128M vdec buffer size is : 0x%x\n",size); MT_ASSERT(VIDEO_FW_CFG_SIZE >= size); OS_PRINTF("VIDEO_FW_CFG_ADDR :0x%x\n",VIDEO_FW_CFG_ADDR); vdec_set_buf(p_video, VDEC_QAULITY_AD_128M, VIDEO_FW_CFG_ADDR); #endif #ifndef WIN32 vdec_do_avsync_cmd(p_video,AVSYNC_NO_PAUSE_SYNC_CMD,0); #endif return ret; }
void ap_enter_tkgs_standby() { audio_device_t *p_audio_dev = NULL; video_device_t *p_video_dev = NULL; void * pDev = NULL; #ifdef SCART_ENABLE avc_cfg_scart_select_tv_master(class_get_handle_by_id(AVC_CLASS_ID), SCART_TERM_VCR); avc_cfg_scart_vcr_input(class_get_handle_by_id(AVC_CLASS_ID), SCART_TERM_TV); #endif p_video_dev = dev_find_identifier(NULL, DEV_IDT_TYPE, SYS_DEV_TYPE_VDEC_VSB); MT_ASSERT(NULL != p_video_dev); vdec_stop(p_video_dev); p_audio_dev = dev_find_identifier(NULL, DEV_IDT_TYPE, SYS_DEV_TYPE_AUDIO); MT_ASSERT(NULL != p_audio_dev); aud_mute_onoff_vsb(p_audio_dev,TRUE); pDev = dev_find_identifier(NULL, DEV_IDT_TYPE, SYS_DEV_TYPE_DISPLAY); MT_ASSERT(NULL != pDev); disp_cvbs_onoff(pDev, CVBS_GRP0, FALSE); if(disp_layer_is_show(pDev, DISP_LAYER_ID_OSD0)) disp_layer_show(pDev, DISP_LAYER_ID_OSD0, FALSE); if(disp_layer_is_show(pDev, DISP_LAYER_ID_OSD1)) disp_layer_show(pDev, DISP_LAYER_ID_OSD1, FALSE); pDev = dev_find_identifier(NULL, DEV_IDT_TYPE, SYS_DEV_TYPE_POW); MT_ASSERT(NULL != pDev); dev_close(pDev); mtos_close_printk(); mtos_task_delay_ms(100); }
void win_ci_on_transport_connect(UINT8 slot) { UINT8 i; struct nim_device *nim_dev; struct dmx_device *dmx_dev; struct vdec_device *vdec_dev; UINT32 scrm_flag; UINT8 dmx_id, nim_id, slot_id; #ifdef CI_BYPASS_ENABLE BOOL ci_bypass = FALSE; UINT8 lock = 0; #endif #ifdef NEW_DEMO_FRAME struct ts_route_info ts_route; INT32 ts_route_id; #endif static UINT8 m_ci_inited; if (!m_ci_inited) { api_ci_set_mode(SYS_CI_MODE); api_ci_set_dev(g_nim_dev, g_dmx_dev, 0); #if (CI_SLOT_NS > 1) api_ci_set_dev(g_nim_dev, g_dmx_dev, 1); #endif api_set_nim_ts_type(2, 0xff); m_ci_inited = 1; } if (CAM_STACK_ATTACH == api_ci_check_status(slot)) { #ifdef DVR_PVR_SUPPORT #ifdef CI_SLOT_DYNAMIC_DETECT api_set_ci_slot_attached(slot, TRUE); #endif #endif extern UINT8 g_ca_prog_reset_flag; g_ca_prog_reset_flag = 0; nim_id = 0; dmx_id = 0; #ifdef NEW_DEMO_FRAME ts_route_id = ts_route_check_ci(slot); if((ts_route_id >= 0) && (ts_route_get_by_id(ts_route_id, &ts_route) != RET_FAILURE)) { nim_id = ts_route.nim_id; dmx_id = ts_route.dmx_id; } #endif nim_dev = (struct nim_device*)dev_get_by_id(HLD_DEV_TYPE_NIM, nim_id); dmx_dev = (struct dmx_device*)dev_get_by_id(HLD_DEV_TYPE_DMX, dmx_id); api_ci_set_mode(sys_data_get_ci_mode()); api_ci_set_dev(nim_dev, dmx_dev, slot); #ifdef CI_BYPASS_ENABLE //for not scrambled program, bypass cam! if ((screen_back_state != SCREEN_BACK_MENU/*play tv/radio*/) #ifdef DVR_PVR_SUPPORT || (api_pvr_check_tsg_state()/*tsg*/) #endif ) { #ifdef DVR_PVR_SUPPORT if (api_pvr_check_tsg_state()) { ; } else #endif { nim_get_lock(nim_dev, &lock); //!scrambled program if (lock && dmx_dev != NULL && SUCCESS != dmx_io_control(dmx_dev, IS_AV_SCRAMBLED, (UINT32)&scrm_flag)) { ci_bypass = TRUE; } } } if (!ci_bypass) { api_set_nim_ts_type(3, 1<<slot); api_send_ca_pmt(slot); } #else //CI_BYPASS_ENABLE //always pass cam! api_set_nim_ts_type(3, 1<<slot); //fix BUG15594 api_send_ca_pmt(slot); #endif //CI_BYPASS_ENABLE #ifdef NEW_DEMO_FRAME if((1) #else if((get_cc_crnt_state() != 0) #endif #ifdef DVR_PVR_SUPPORT || (api_pvr_check_tsg_state()) #endif ) // CC_STATE_STOP { //when card in, need stop vdec to avoid masic. vdec_dev = (struct vdec_device*)dev_get_by_id(HLD_DEV_TYPE_DECV, 0); if (vdec_dev != NULL && dmx_dev != NULL && SUCCESS == dmx_io_control(dmx_dev, IS_AV_SCRAMBLED, (UINT32)&scrm_flag)) { //libc_printf("%s: reset vdec!!!\n",__FUNCTION__); //to avoid mosaic #ifdef NEW_DEMO_FRAME vdec_io_control(vdec_dev,VDEC_IO_REST_VBV_BUF,0); #else vdec_stop(vdec_dev, FALSE, FALSE); vdec_start(vdec_dev); #endif } } }
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; }
/* Set the View Mode of VPO Window */ void hde_set_mode(UINT32 mode) { struct MPSource_CallBack MPCallBack; struct PIPSource_CallBack PIPCallBack; struct VDec_StatusInfo vdec_info; struct VDecPIPInfo tInitInfo; UINT32 waittime=0, wait_total_time = 0; struct vdec_device *pDecvDevice = (struct vdec_device *)get_selected_decoder(); BOOL need_to_wait = FALSE; BOOL need_to_set_output = FALSE; UINT8 ulock = 0; struct nim_device *nim = (struct nim_device *)dev_get_by_id(HLD_DEV_TYPE_NIM, 0); struct vpo_device *pDisDevice = (struct vpo_device *)dev_get_by_type(NULL, HLD_DEV_TYPE_DIS); #ifdef DUAL_VIDEO_OUTPUT struct vpo_device *pDisDevice_O = (struct vpo_device *)dev_get_by_id(HLD_DEV_TYPE_DIS, 1); #endif struct vpo_io_get_info dis_info; switch(mode) { case VIEW_MODE_PREVIEW: if ((l_hde_mode != mode) || (l_hde_uIsPreviewResize == 1)) { ENTER_CCHDE_API(); #if( VDEC27_PREVIEW_SOLUTION == VDEC27_PREVIEW_VE_SCALE) #ifdef HDTV_SUPPORT /* Check Frame Size, If Input Frame is HD, Set VE to Dview Mode */ vpo_ioctl(pDisDevice, VPO_IO_GET_INFO, (UINT32) &dis_info); #ifdef DUAL_VIDEO_OUTPUT vpo_ioctl(pDisDevice_O, VPO_IO_GET_INFO, (UINT32) &dis_info); #endif if(is_cur_decoder_avc()) { vdec_io_control(pDecvDevice, VDEC_IO_GET_STATUS, (UINT32)&vdec_info); if(vdec_info.pic_width > 720 || vdec_info.pic_height > 576) { need_to_wait = TRUE; } else need_to_wait = FALSE; } else { need_to_wait = TRUE; vdec_stop(pDecvDevice,TRUE,TRUE); } if(need_to_wait) { tInitInfo.adv_setting.init_mode = 1; tInitInfo.adv_setting.out_sys = dis_info.tvsys; tInitInfo.adv_setting.bprogressive = dis_info.bprogressive; #ifdef DUAL_VIDEO_OUTPUT if(is_cur_decoder_avc()) #else if(0) #endif { vdec_set_output(pDecvDevice,DUAL_PREVIEW_MODE, &tInitInfo, &MPCallBack, &PIPCallBack); } else { vdec_set_output(pDecvDevice, DUAL_PREVIEW_MODE, &tInitInfo, &MPCallBack, &PIPCallBack); } } if(!is_cur_decoder_avc()) { vdec_start(pDecvDevice); } if(is_cur_decoder_avc() && need_to_wait) { struct dmx_device *dmx = (struct dmx_device *)dev_get_by_id(HLD_DEV_TYPE_DMX, 0); //For H264, we have to wait for 1st picture decoded, then call vpo_zoom, otherwise, it could cause below issue: //1. DE under run, because DE can scale down HD full size picture to preview size //2. In full screen mode, VE mapping is H264 mapping mode, in preview mode, VE mapping is MPEG2 mapping mode //--Michael Xie 2007/8/29 wait_total_time = VE_MODE_SWITCH_TIME; while(waittime<wait_total_time) { nim_get_lock(nim, &ulock); if(!ulock) break; if(RET_SUCCESS == dmx_io_control(dmx, IS_AV_SCRAMBLED, 0)) break; vdec_io_control(pDecvDevice, VDEC_IO_GET_STATUS, (UINT32)&vdec_info); if(vdec_info.uFirstPicShowed) { wait_total_time = H264_VE_MODE_SWITCH_TIME; } if(vdec_info.output_mode == PREVIEW_MODE) { osal_task_sleep(100); break; } osal_task_sleep(1); waittime++; } } vpo_zoom(pDisDevice, &l_hde_rectSrcFull_adjusted, &l_hde_rectScrnPreview); #ifdef DUAL_VIDEO_OUTPUT vpo_zoom(pDisDevice_O, &l_hde_rectSrcFull_adjusted, &l_hde_rectScrnPreview); #endif #else //Set Video Decoder Output Mode (PREVIEW_MODE) tInitInfo.src_rect.uStartX = l_hde_rectSrcFull_adjusted.uStartX>>1; tInitInfo.src_rect.uStartY= l_hde_rectSrcFull_adjusted.uStartY>>1; tInitInfo.src_rect.uWidth = PICTURE_WIDTH - 2*tInitInfo.src_rect.uStartX; tInitInfo.src_rect.uHeight = PICTURE_HEIGHT - 2*tInitInfo.src_rect.uStartY; tInitInfo.dst_rect.uStartX = l_hde_rectScrnPreview.uStartX; tInitInfo.dst_rect.uStartY= l_hde_rectScrnPreview.uStartY; tInitInfo.dst_rect.uWidth = l_hde_rectScrnPreview.uWidth; tInitInfo.dst_rect.uHeight = l_hde_rectScrnPreview.uHeight; vdec_set_output(pDecvDevice,PREVIEW_MODE, &tInitInfo, &MPCallBack,&PIPCallBack); //Wait Video Decoder Output Mode Switch to PREVIEW_MODE vdec_info.output_mode = VIEW_MODE_FULL; while((vdec_info.output_mode != PREVIEW_MODE)&&(waittime<VE_MODE_SWITCH_TIME)) { nim_get_lock(nim, &ulock); if(!ulock) break; osal_task_sleep(1); waittime++; vdec_io_control(pDecvDevice, VDEC_IO_GET_STATUS, (UINT32)&vdec_info); } //Switch Video Decoder Output Mode to PREVIEW_MODE Forcely if(vdec_info.output_mode != PREVIEW_MODE) { PRINTF("switch to preview forcely\n"); vdec_stop(pDecvDevice,sys_data_get_cur_chan_mode() == PROG_TV_MODE,FALSE); vdec_set_output(pDecvDevice,PREVIEW_MODE, &tInitInfo, &MPCallBack,&PIPCallBack); vdec_start(pDecvDevice); } #endif #elif(VDEC27_PREVIEW_SOLUTION == VDEC27_PREVIEW_DE_SCALE) //If is DE Scale Operation, then adjust VPO Full Srceen to Preview Screen directly if(0 == l_hde_preview_method) vpo_zoom(pDisDevice, &l_hde_rectSrcFull_adjusted, &l_hde_rectScrnPreview); //If is VE Scale Operation, first set Video Decoder Output Mode(PIP_MODE), //then adjust VPO Full Srceen to Preview Screen else if(1 == l_hde_preview_method) { if(l_hde_mode == VIEW_MODE_PREVIEW) { vpo_zoom(pDisDevice, &l_hde_rectSrcFull_adjusted, &l_hde_rectScrnPreview); } else { //Set Video Decoder Output Mode (IND_PIP_MODE) tInitInfo.src_rect.uStartX = l_hde_rectSrcFull_adjusted.uStartX>>1; tInitInfo.src_rect.uStartY= l_hde_rectSrcFull_adjusted.uStartY>>1; tInitInfo.src_rect.uWidth = PICTURE_WIDTH - 2*tInitInfo.src_rect.uStartX; tInitInfo.src_rect.uHeight = PICTURE_HEIGHT - 2*tInitInfo.src_rect.uStartY; tInitInfo.dst_rect.uStartX = l_hde_rectScrnPreview.uStartX; tInitInfo.dst_rect.uStartY= l_hde_rectScrnPreview.uStartY; tInitInfo.dst_rect.uWidth = l_hde_rectScrnPreview.uWidth; tInitInfo.dst_rect.uHeight = l_hde_rectScrnPreview.uHeight; tInitInfo.pipSize.uWidth=l_hde_rectScrnPreview.uWidth; tInitInfo.pipSize.uHeight=l_hde_rectScrnPreview.uHeight/5; vdec_set_output(pDecvDevice,IND_PIP_MODE, &tInitInfo, &MPCallBack,&PIPCallBack); //After Video Decoder Output Mode switch to PIP_MODE, then adjust VPO vdec_io_control(pDecvDevice, VDEC_IO_GET_STATUS, (UINT32)&vdec_info); if(VDEC27_STOPPED == vdec_info.uCurStatus) { vpo_zoom(pDisDevice, &l_hde_rectSrcFull_adjusted, &l_hde_rectScrnPreview); } else { waittime = 0; while((vdec_info.output_mode != PIP_MODE)&&(waittime<VE_MODE_SWITCH_TIME_29E)) { nim_get_lock(nim, &ulock); if(!ulock) break; osal_task_sleep(20); waittime += 20; vdec_io_control(pDecvDevice, VDEC_IO_GET_STATUS, (UINT32)&vdec_info); } if(vdec_info.output_mode != PIP_MODE) { vdec_stop(pDecvDevice,TRUE,FALSE); vdec_set_output(pDecvDevice,IND_PIP_MODE, &tInitInfo, &MPCallBack,&PIPCallBack); vdec_start(pDecvDevice); vpo_zoom(pDisDevice, &l_hde_rectSrcFull_adjusted, &l_hde_rectScrnPreview); } else { vpo_zoom(pDisDevice, &l_hde_rectSrcFull_adjusted, &l_hde_rectScrnPreview); } } vpo_ioctl(pDisDevice, VPO_IO_ADJUST_LM_IN_PREVIEW, 1); } } #endif } l_hde_uIsPreviewResize = 0; LEAVE_CCHDE_API(); break; case VIEW_MODE_MULTI: break; case VIEW_MODE_FULL: default: if (l_hde_mode != mode) { ENTER_CCHDE_API(); #if( VDEC27_PREVIEW_SOLUTION == VDEC27_PREVIEW_VE_SCALE) #ifdef HDTV_SUPPORT // convert VE to MP mode vpo_ioctl(pDisDevice, VPO_IO_GET_INFO, (UINT32) &dis_info); #ifdef DUAL_VIDEO_OUTPUT vpo_ioctl(pDisDevice_O, VPO_IO_GET_INFO, (UINT32) &dis_info); #endif need_to_set_output = FALSE; if(is_cur_decoder_avc()) { vdec_io_control(pDecvDevice, VDEC_IO_GET_STATUS, (UINT32)&vdec_info); if(vdec_info.pic_width > 720 || vdec_info.pic_height > 576) { need_to_wait = TRUE; } else if(vdec_info.pic_width == 0 || vdec_info.pic_height == 0) { need_to_set_output = TRUE; } else need_to_wait = FALSE; } else { need_to_wait = TRUE; vdec_stop(pDecvDevice,TRUE,TRUE); } if(need_to_wait || need_to_set_output) { tInitInfo.adv_setting.init_mode = 0; tInitInfo.adv_setting.out_sys = dis_info.tvsys; tInitInfo.adv_setting.bprogressive = dis_info.bprogressive; #ifdef DUAL_VIDEO_OUTPUT if(is_cur_decoder_avc()) #else if(0) #endif { vdec_set_output(pDecvDevice,DUAL_MODE, &tInitInfo, &MPCallBack, &PIPCallBack); } else { vdec_set_output(pDecvDevice,DUAL_MODE, &tInitInfo, &MPCallBack, &PIPCallBack); } } if(!is_cur_decoder_avc()) { vdec_start(pDecvDevice); } vpo_zoom(pDisDevice, &l_hde_rectSrcFull, &l_hde_rectScrnFull); #ifdef DUAL_VIDEO_OUTPUT vpo_zoom(pDisDevice_O, &l_hde_rectSrcFull, &l_hde_rectScrnFull); #endif osal_task_sleep(50); if(is_cur_decoder_avc() && need_to_wait) { struct dmx_device *dmx = (struct dmx_device *)dev_get_by_id(HLD_DEV_TYPE_DMX, 0); wait_total_time = VE_MODE_SWITCH_TIME; while(waittime<wait_total_time) { nim_get_lock(nim, &ulock); if(!ulock) break; if(RET_SUCCESS == dmx_io_control(dmx, IS_AV_SCRAMBLED, 0)) break; vdec_io_control(pDecvDevice, VDEC_IO_GET_STATUS, (UINT32)&vdec_info); if(vdec_info.uFirstPicShowed) { wait_total_time = H264_VE_MODE_SWITCH_TIME; } if(vdec_info.output_mode == MP_MODE) { break; } osal_task_sleep(1); waittime++; } } #else //Set Video Decoder Output Mode (MP_MODE) tInitInfo.buse_sml_buf = FALSE; tInitInfo.src_rect.uStartX = l_hde_rectSrcFull.uStartX; tInitInfo.src_rect.uStartY= l_hde_rectSrcFull.uStartY; tInitInfo.src_rect.uWidth = l_hde_rectSrcFull.uWidth; tInitInfo.src_rect.uHeight = l_hde_rectSrcFull.uHeight; tInitInfo.dst_rect.uStartX = l_hde_rectScrnFull.uStartX; tInitInfo.dst_rect.uStartY= l_hde_rectScrnFull.uStartY; tInitInfo.dst_rect.uWidth = l_hde_rectScrnFull.uWidth; tInitInfo.dst_rect.uHeight = l_hde_rectScrnFull.uHeight; vdec_set_output(pDecvDevice,MP_MODE, &tInitInfo, &MPCallBack,&PIPCallBack); //Wait Video Decoder Output Mode Switch to MP_MODE vdec_io_control(pDecvDevice, VDEC_IO_GET_STATUS, (UINT32)&vdec_info); while(((vdec_info.output_mode != MP_MODE)||(vdec_info.use_sml_buf))&&(waittime<VE_MODE_SWITCH_TIME)) { nim_get_lock(nim, &ulock); if(!ulock) break; osal_task_sleep(1); waittime++; vdec_io_control(pDecvDevice, VDEC_IO_GET_STATUS, (UINT32)&vdec_info); } //Switch Video Decoder Output Mode to MP_MODE Forcely if((vdec_info.output_mode != MP_MODE)||(vdec_info.use_sml_buf)) { PRINTF("switch to mp forcely\n"); vdec_stop(pDecvDevice,TRUE,FALSE); vdec_set_output(pDecvDevice,MP_MODE, &tInitInfo, &MPCallBack,&PIPCallBack); vdec_start(pDecvDevice); } #endif #elif(VDEC27_PREVIEW_SOLUTION == VDEC27_PREVIEW_DE_SCALE) //If is DE Scale Operation, then adjust VPO to Full Srceen directly if(0 == l_hde_preview_method) vpo_zoom(pDisDevice, &l_hde_rectSrcFull, &l_hde_rectScrnFull); //If is VE Scale Operation, first set Video Decoder Output Mode(MP_MODE), //then adjust VPO to Full Srceen else if(1 == l_hde_preview_method) { //Set Video Decoder Output Mode (MP_MODE) tInitInfo.src_rect.uStartX = l_hde_rectSrcFull.uStartX; tInitInfo.src_rect.uStartY= l_hde_rectSrcFull.uStartY; tInitInfo.src_rect.uWidth = l_hde_rectSrcFull.uWidth; tInitInfo.src_rect.uHeight = l_hde_rectSrcFull.uHeight; tInitInfo.dst_rect.uStartX = l_hde_rectScrnFull.uStartX; tInitInfo.dst_rect.uStartY= l_hde_rectScrnFull.uStartY; tInitInfo.dst_rect.uWidth = l_hde_rectScrnFull.uWidth; tInitInfo.dst_rect.uHeight = l_hde_rectScrnFull.uHeight; vdec_set_output(pDecvDevice,MP_MODE, &tInitInfo, &MPCallBack,&PIPCallBack); //After Video Decoder Output Mode switch to MP_MODE, then adjust VPO vdec_io_control(pDecvDevice, VDEC_IO_GET_STATUS, (UINT32)&vdec_info); if(VDEC27_STOPPED == vdec_info.uCurStatus) { vpo_zoom(pDisDevice, &l_hde_rectSrcFull, &l_hde_rectScrnFull); } else { waittime = 0; while((vdec_info.output_mode != MP_MODE)&&(waittime<VE_MODE_SWITCH_TIME_29E)) { nim_get_lock(nim, &ulock); if(!ulock) break; osal_task_sleep(20); waittime += 20; vdec_io_control(pDecvDevice, VDEC_IO_GET_STATUS, (UINT32)&vdec_info); } if(vdec_info.output_mode != MP_MODE) { vdec_stop(pDecvDevice,TRUE,FALSE); vdec_set_output(pDecvDevice,MP_MODE, &tInitInfo, &MPCallBack,&PIPCallBack); vdec_start(pDecvDevice); vpo_zoom(pDisDevice, &l_hde_rectSrcFull, &l_hde_rectScrnFull); } else { vpo_zoom(pDisDevice, &l_hde_rectSrcFull, &l_hde_rectScrnFull); } } vpo_ioctl(pDisDevice, VPO_IO_ADJUST_LM_IN_PREVIEW, 0); } #endif LEAVE_CCHDE_API(); } }
void ipanel_porting_av_stop(void) { RET_CODE ret_code; if(video_status == 1) { if(audioPid) { ret_code = deca_stop(g_deca_dev,0,ADEC_STOP_IMM); if (ret_code != RET_SUCCESS) { dprintf("[ipanel_porting_av_stop] cc2: deca_stop() fail..\n"); } else { dprintf("[ipanel_porting_av_stop] cc2: deca_stop() ok..\n"); audioPid = 0; } } if(videoPid) { ret_code = vdec_stop(g_decv_dev,TRUE,TRUE); if (ret_code == RET_BUSY) { ret_code = vdec_stop(g_decv_dev,TRUE,TRUE); } if (ret_code != RET_SUCCESS) { dprintf("[ipanel_porting_av_stop] cc2: Vdec_Stop() fail \n"); } else { dprintf("[ipanel_porting_av_stop] cc2: Vdec_Stop() ok \n"); videoPid = 0; } } pcrPid = 0; ret_code = dmx_io_control(g_dmx_dev,IO_STREAM_DISABLE,(UINT32)&io_parameter); if (ret_code != RET_SUCCESS) { dprintf("[ipanel_porting_av_stop] cc2: Dmx disable stream fail \n"); return; } else { dprintf("[ipanel_porting_av_stop] cc2: Dmx disable stream OK \n"); } ret_code = dmx_io_control(g_dmx_dev,IO_DELETE_AV_STREAM,(UINT32)&io_parameter); if(ret_code != RET_SUCCESS) { dprintf("[ipanel_porting_av_stop] dmx delete stream fail..\n"); } else { dprintf("[ipanel_porting_av_stop] dmx delete stream ok..\n"); } video_status = 0; if( progpos!=0xffff) { api_mcas_stop_transponder(); api_mcas_stop_service(); si_monitor_off(progpos); progpos=0xffff; } } }