Skip to content

Commit

Permalink
video: enable pts calculation when hold video state changes [1/1]
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rui Wang authored and kongsuozt committed May 14, 2019
1 parent 768c100 commit e98d6d3
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions drivers/amlogic/media/video_sink/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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) &&
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit e98d6d3

Please sign in to comment.