video: dv: Change omx pts upper and lower threshold for dv [3/3]

PD#SWPL-2465

Problem:
DV av-sync test diff between audio and video too big

Solution:
Change omx pts upper and lower threshold

Verify:
Test pass by S905X2-U212

Change-Id: I916773300b29a9b6368d7e2283effae2a6440d14
Signed-off-by: Lifeng Cao <lifeng.cao@amlogic.com>
This commit is contained in:
Lifeng Cao
2018-12-12 11:22:07 +08:00
committed by Jianxin Pan
parent 3ef4f47864
commit 7de4b8f887

View File

@@ -123,8 +123,12 @@ static u32 omx_pts;
static u32 omx_pts_set_index;
static bool omx_run;
static u32 omx_version = 3;
#define OMX_PTS_DV_DEFAULT_UPPER 2500
#define OMX_PTS_DV_DEFAULT_LOWER -1600
static int omx_pts_interval_upper = 11000;
static int omx_pts_interval_lower = -5500;
static int omx_pts_dv_upper = OMX_PTS_DV_DEFAULT_UPPER;
static int omx_pts_dv_lower = OMX_PTS_DV_DEFAULT_LOWER;
static int omx_pts_set_from_hwc_count;
static bool omx_check_previous_session;
static u32 omx_cur_session = 0xffffffff;
@@ -5355,6 +5359,10 @@ static irqreturn_t vsync_isr_in(int irq, void *dev_id)
/*1500(60fps) 3000(30fps) 3750(24fps) for some video*/
/*that pts is not evenly*/
timestamp_pcrscr_set(omx_pts + DURATION_GCD);
} else if (is_dolby_vision_enable()
&& ((diff - omx_pts_dv_upper) > 0
|| (diff - omx_pts_dv_lower) < 0)) {
timestamp_pcrscr_set(omx_pts + DURATION_GCD);
}
} else
omx_pts = 0;
@@ -7120,13 +7128,19 @@ static int video_receiver_event_fun(int type, void *data, void *private_data)
}
} else if (type == VFRAME_EVENT_PROVIDER_FR_HINT) {
#ifdef CONFIG_AM_VOUT
if ((data != NULL) && (video_seek_flag == 0))
if ((data != NULL) && (video_seek_flag == 0)) {
set_vframe_rate_hint((unsigned long)data);
omx_pts_dv_upper = DUR2PTS((unsigned long)data) * 3 / 2;
omx_pts_dv_lower = 0 - DUR2PTS((unsigned long)data);
}
#endif
} else if (type == VFRAME_EVENT_PROVIDER_FR_END_HINT) {
#ifdef CONFIG_AM_VOUT
if (video_seek_flag == 0)
if (video_seek_flag == 0) {
set_vframe_rate_end_hint();
omx_pts_dv_upper = OMX_PTS_DV_DEFAULT_UPPER;
omx_pts_dv_lower = OMX_PTS_DV_DEFAULT_LOWER;
}
#endif
} else if (type == VFRAME_EVENT_PROVIDER_QUREY_DISPLAY_INFO) {
get_display_info(data);