summaryrefslogtreecommitdiff
authorjunliang zhou <junliang.zhou@amlogic.com>2020-03-30 06:53:51 (GMT)
committer Shen Liu <shen.liu@amlogic.com>2020-06-03 12:12:42 (GMT)
commit61a93630bc877d9f9cc93c8912e1927d4ec4d3a2 (patch)
treea64a3839a0ca025aaba3352d4c4a14e2497b5b91
parent0ca31b983fb154c1320005df9d95853d2668b830 (diff)
downloadcommon-61a93630bc877d9f9cc93c8912e1927d4ec4d3a2.zip
common-61a93630bc877d9f9cc93c8912e1927d4ec4d3a2.tar.gz
common-61a93630bc877d9f9cc93c8912e1927d4ec4d3a2.tar.bz2
Video: add pts rollback detect [1/1]
PD#SWPL-23306 Problem: For the OTT-9111, when application start playing before dvb stream rollback, the video pts is bigger than audio because audio has been dropped the tail of the stream. Video can`t toggle frame in A-master mode. Solution: Force video toggle the video frame if meet the tail frame of the stream.I made a parameter to set the threshold between the audio and video pts. This solution Will influence the stream which has pts error, need QA to verify that stream on DVB environment. Verify: S905X2 Change-Id: Idc8f050cdb9f5d8c878f3570e2213a5e1f309ca1 Signed-off-by: junliang zhou <junliang.zhou@amlogic.com>
Diffstat
-rw-r--r--drivers/amlogic/media/video_sink/video.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/amlogic/media/video_sink/video.c b/drivers/amlogic/media/video_sink/video.c
index 450f4d2..02701ca 100644
--- a/drivers/amlogic/media/video_sink/video.c
+++ b/drivers/amlogic/media/video_sink/video.c
@@ -546,6 +546,7 @@ struct video_dev_s *get_video_cur_dev(void)
}
static int cur_dev_idx;
+static u32 pts_rollback_threshold = 20;
#ifdef CONFIG_PM
struct video_pm_state_s {
int event;
@@ -563,6 +564,7 @@ struct video_pm_state_s {
#define PTS_THROTTLE
/* #define PTS_TRACE_DEBUG */
/* #define PTS_TRACE_START */
+#define PTS_ROLLBACK
#ifdef PTS_TRACE_DEBUG
static int pts_trace_his[16];
@@ -4609,6 +4611,19 @@ static inline bool vpts_expire(struct vframe_s *cur_vf,
}
#endif
+#ifdef PTS_ROLLBACK
+ if (show_first_frame_nosync == 0 &&
+ show_first_picture == 0 &&
+ expired == false &&
+ tsync_get_mode() == TSYNC_MODE_AMASTER &&
+ first_frame_toggled == 1 &&
+ systime < pts &&
+ (pts - systime) > pts_rollback_threshold * 90000) {
+ expired = true;
+ pr_info("pts roll back and force toggle, pts:%x\n", pts);
+ }
+#endif
+
#ifdef PTS_LOGGING
if (pts_enforce_pulldown) {
/* Perform Pulldown if needed*/
@@ -10947,6 +10962,9 @@ module_param(toggle_count, uint, 0664);
MODULE_PARM_DESC(vpp_hold_line, "\n vpp_hold_line\n");
module_param(vpp_hold_line, uint, 0664);
+MODULE_PARM_DESC(pts_rollback_threshold, "\n pts_rollback_threshold\n");
+module_param(pts_rollback_threshold, uint, 0664);
+
MODULE_DESCRIPTION("AMLOGIC video output driver");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Tim Yao <timyao@amlogic.com>");