summaryrefslogtreecommitdiff
authorRui Wang <rui.wang@amlogic.com>2019-05-14 05:22:58 (GMT)
committer Tao Zeng <tao.zeng@amlogic.com>2019-05-14 10:41:12 (GMT)
commite98d6d344ec645ff74466c91a1b4e3ed817f79c2 (patch)
tree9a6466c5b6a08fb649878ec53148764838b9de2e
parent768c10065d3b79b1eaa755efb3e6ac44ccf5a8ba (diff)
downloadcommon-e98d6d344ec645ff74466c91a1b4e3ed817f79c2.zip
common-e98d6d344ec645ff74466c91a1b4e3ed817f79c2.tar.gz
common-e98d6d344ec645ff74466c91a1b4e3ed817f79c2.tar.bz2
video: enable pts calculation when hold video state changes [1/1]
PD#TV-3999 Problem: dtmb individual channel switching speed is slow, it takes about 16s Solution: enable pts calculation when hold video state changes. Verify: X301 Change-Id: I4c8eda3af3df894d8116461abf63c3dda45c8ce3 Signed-off-by: Rui Wang <rui.wang@amlogic.com>
Diffstat
-rw-r--r--drivers/amlogic/media/video_sink/video.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/amlogic/media/video_sink/video.c b/drivers/amlogic/media/video_sink/video.c
index 38a9c64..458f60c 100644
--- a/drivers/amlogic/media/video_sink/video.c
+++ b/drivers/amlogic/media/video_sink/video.c
@@ -157,6 +157,7 @@ static bool omx_drop_done;
static bool video_start_post;
static bool videopeek;
static bool nopostvideostart;
+static int hold_property_changed;
static struct video_frame_detect_s video_frame_detect;
static struct timeval time_setomxpts = {
.tv_sec = 0,
@@ -5390,11 +5391,14 @@ static inline bool vpts_expire(struct vframe_s *cur_vf,
systime = timestamp_pcrscr_get();
pts = next_vf->pts;
- if (((pts == 0) && (cur_dispbuf != &vf_local))
+ if (((pts == 0) && ((cur_dispbuf != &vf_local)
+ || (hold_property_changed == 1)))
|| (freerun_mode == FREERUN_DUR)) {
pts =
timestamp_vpts_get() +
(cur_vf ? DUR2PTS(cur_vf->duration) : 0);
+ if (hold_property_changed == 1)
+ hold_property_changed = 0;
}
/* check video PTS discontinuity */
else if ((enable_video_discontinue_report) &&
@@ -8361,6 +8365,7 @@ static void video_vf_unreg_provider(void)
first_frame_toggled = 0;
videopeek = 0;
nopostvideostart = false;
+ hold_property_changed = 0;
atomic_set(&video_unreg_flag, 1);
while (atomic_read(&video_inirq_flag) > 0)
@@ -10893,15 +10898,21 @@ static ssize_t video_hold_store(struct class *cla,
const char *buf, size_t count)
{
int r;
+ unsigned int value;
+
cur_width = 0;
cur_height = 0;
if (debug_flag & DEBUG_FLAG_BLACKOUT)
pr_info("%s(%s)\n", __func__, buf);
- r = kstrtoint(buf, 0, &hold_video);
+ r = kstrtoint(buf, 0, &value);
if (r < 0)
return -EINVAL;
+ if (value == 0 && hold_video == 1)
+ hold_property_changed = 1;
+
+ hold_video = value;
return count;
}