icfans

Camera 回显界面来电话,挂断后回到Preview界面

0
阅读(255) 评论(0)

[DESCRIPTION]
Camera 回显界面来电的时候,挂断后回到Preview界面,希望可以不回到Preview界面,还回到回显界面
[KEYWORD]
Camera MMI
[SOLUTION]来自半导体社区
在保存确认界面,拍照的后encode的jpeg图片是存在一个buffer中的,如果此时来电,则会退出camera,buffer也会被
释放。所以必须在来电前把jpeg buffer保存下来,并且设好flag,当来电结束,再次进入camera时,根据flag来判断
是否进入保存确认界面,显示图片时使用备份的jpeg buffer即可。具体修改方法如下:
1、在CameraApp.c中定义如下全局变量:
int myflag=0;
S32 mywidth;
S32 myheight;
U32 my_capture_size;
PU8 myptr;
2、mmi_camera_entry_app_screen_internal函数中进行如下修改:
else
{
/* entry preview */
if (myflag==1)
{
CAMERA_ENTER_STATE(CAMERA_STATE_SAVE_CONFIRM);
}
else
{
CAMERA_ENTER_STATE(CAMERA_STATE_PREVIEW);
}
}
3、mmi_camera_entry_save_confirm_state函数中进行如下修改:
if (g_camera_cntx.is_tileshot)
{
#ifdef __CAMERA_FEATURE_CONT_SHOT_TILE__
#ifdef __CAMERA_FEATURE_SELF_CAPTURE__
/* draw sublcd icon */
mmi_camera_sublcd_draw_icon();
#endif /* __CAMERA_FEATURE_SELF_CAPTURE__ */
if (g_camera_cntx.osd_rotate == CAMERA_DISPLAY_ROTATE_0 && g_camera_cntx.setting.add_frame != 0)
gdi_layer_set_blt_layer(
g_camera_cntx.tileshot_result_layer_handle,
g_camera_cntx.add_frame_layer_handle,
g_camera_cntx.osd_layer_handle0,
0);
else
gdi_layer_set_blt_layer(g_camera_cntx.tileshot_result_layer_handle,
g_camera_cntx.osd_layer_handle0, 0, 0);
#else /* __CAMERA_FEATURE_CONT_SHOT_TILE__ */
MMI_ASSERT(0);
#endif /* __CAMERA_FEATURE_CONT_SHOT_TILE__ */
}
else
{
/* clear base layer background */
mmi_camera_preview_clear_background();
gdi_layer_set_blt_layer(g_camera_cntx.base_layer_handle, g_camera_cntx.osd_layer_handle0, 0, 0);
//以下有改动:
if (myflag==1)
{
g_camera_cntx.capture_size=my_capture_size;
image_width=mywidth;
image_height=myheight;
result = 1;
}
else
{
/* get file dimension */
result = gdi_image_jpeg_get_dimension(
g_camera_cntx.capture_buf_ptr,
g_camera_cntx.capture_size,
&image_width,
&image_height);
mywidth=image_width;
myheight=image_height;
my_capture_size=g_camera_cntx.capture_size;
myptr=(U8*)med_alloc_ext_mem(my_capture_size);
memcpy(myptr,g_camera_cntx.capture_buf_ptr,my_capture_size);
kal_prompt_trace(MOD_BT,"width1=%d",mywidth);
myflag=1;
}
/* set clip region as content region */
gdi_layer_reset_clip();
#if 0
//DRV_JPG_ENC_DIRECT_COUPLE_SUPPORT
if (g_camera_cntx.is_direct_couple == TRUE)
{
PU8