Skip to content

Commit 33b1aee

Browse files
Xiaoming Suijianxinpan
authored andcommitted
video: timming gets error when switching channels [1/1]
PD#TV-3062 Problem: When switching channels, Hisense platform needs hold video, and the timming obtained at this time is wrong Solution: because we have add hold video function, so get width and height interface give the last video frame width and height, and so on change the video Verify: X301 Change-Id: I331a4589dcb5f5785dce7eea6d8cd03c92d733d2 Signed-off-by: Xiaoming Sui <[email protected]>
1 parent c254f9b commit 33b1aee

File tree

1 file changed

+16
-1
lines changed
  • drivers/amlogic/media/video_sink

1 file changed

+16
-1
lines changed

drivers/amlogic/media/video_sink/video.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ static int _videopip_set_disable(u32 val);
213213
static struct device *amvideo_dev;
214214
static struct device *amvideo_poll_dev;
215215

216+
static u32 cur_width;
217+
static u32 cur_height;
218+
216219
#define DRIVER_NAME "amvideo"
217220
#define MODULE_NAME "amvideo"
218221
#define DEVICE_NAME "amvideo"
@@ -3674,6 +3677,13 @@ static void vsync_toggle_frame(struct vframe_s *vf, int line)
36743677
timestamp_vpts_inc(-1);
36753678
}
36763679
}
3680+
if (vf->type & VIDTYPE_COMPRESS) {
3681+
cur_width = vf->compWidth;
3682+
cur_height = vf->compHeight;
3683+
} else {
3684+
cur_width = vf->width;
3685+
cur_height = vf->height;
3686+
}
36773687
video_vf_put(vf);
36783688
ATRACE_COUNTER(__func__, __LINE__);
36793689
return;
@@ -10591,7 +10601,8 @@ static ssize_t video_hold_store(struct class *cla,
1059110601
const char *buf, size_t count)
1059210602
{
1059310603
int r;
10594-
10604+
cur_width = 0;
10605+
cur_height = 0;
1059510606
if (debug_flag & DEBUG_FLAG_BLACKOUT)
1059610607
pr_info("%s(%s)\n", __func__, buf);
1059710608

@@ -10756,6 +10767,8 @@ static ssize_t frame_width_show(struct class *cla,
1075610767
struct class_attribute *attr,
1075710768
char *buf)
1075810769
{
10770+
if (hold_video == 1)
10771+
return sprintf(buf, "%d\n", cur_width);
1075910772
if (cur_dispbuf) {
1076010773
if (cur_dispbuf->type & VIDTYPE_COMPRESS)
1076110774
return sprintf(buf, "%d\n", cur_dispbuf->compWidth);
@@ -10769,6 +10782,8 @@ static ssize_t frame_width_show(struct class *cla,
1076910782
static ssize_t frame_height_show(struct class *cla,
1077010783
struct class_attribute *attr, char *buf)
1077110784
{
10785+
if (hold_video == 1)
10786+
return sprintf(buf, "%d\n", cur_height);
1077210787
if (cur_dispbuf) {
1077310788
if (cur_dispbuf->type & VIDTYPE_COMPRESS)
1077410789
return sprintf(buf, "%d\n", cur_dispbuf->compHeight);

0 commit comments

Comments
 (0)