video: toggle first frame for netflix video peek
authorshuanglong.wang <shuanglong.wang@amlogic.com>
Wed, 22 Aug 2018 05:13:34 +0000 (13:13 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Tue, 11 Sep 2018 14:41:26 +0000 (07:41 -0700)
PD#172137 :toggle first frame for netflix video peek

Change-Id: I28b29cba40f621c71fd67f0cf0c8e80c835483cf
Signed-off-by: shuanglong.wang <shuanglong.wang@amlogic.com>
drivers/amlogic/media/video_sink/video.c
include/linux/amlogic/media/utils/amstream.h

index 36ae922..5c45f9a 100644 (file)
@@ -135,6 +135,7 @@ static int display_frame_count;
 static int omx_need_drop_frame_num;
 static bool omx_drop_done;
 static bool video_start_post;
+static bool videopeek;
 
 /*----omx_info  bit0: keep_last_frame, bit1~31: unused----*/
 static u32 omx_info = 0x1;
@@ -4167,6 +4168,12 @@ static inline bool vpts_expire(struct vframe_s *cur_vf,
        if (next_vf == NULL)
                return false;
 
+       if (videopeek) {
+               videopeek = false;
+               pr_info("video peek toogle the first frame\n");
+               return true;
+       }
+
        if (debug_flag & DEBUG_FLAG_TOGGLE_FRAME_PER_VSYNC)
                return true;
        if (/*(cur_vf == NULL) || (cur_dispbuf == &vf_local) ||*/ debugflags &
@@ -6614,6 +6621,7 @@ static void video_vf_unreg_provider(void)
        int keeped = 0;
        new_frame_count = 0;
        first_frame_toggled = 0;
+       videopeek = 0;
 
        atomic_set(&video_unreg_flag, 1);
        while (atomic_read(&video_inirq_flag) > 0)
@@ -7513,6 +7521,9 @@ static long amvideo_ioctl(struct file *file, unsigned int cmd, ulong arg)
                put_user(video_onoff_state, (u32 __user *)argp);
                break;
 
+       case AMSTREAM_IOC_SET_VIDEOPEEK:
+               videopeek = true;
+               break;
        default:
                return -EINVAL;
        }
@@ -7574,6 +7585,7 @@ static long amvideo_compat_ioctl(struct file *file, unsigned int cmd, ulong arg)
        case AMSTREAM_IOC_SET_VSYNC_UPINT:
        case AMSTREAM_IOC_SET_VSYNC_SLOW_FACTOR:
        case AMSTREAM_IOC_GLOBAL_SET_VIDEO_OUTPUT:
+       case AMSTREAM_IOC_SET_VIDEOPEEK:
                return amvideo_ioctl(file, cmd, arg);
        default:
                return -EINVAL;
index e5b7e50..3dfe61d 100644 (file)
 #define AMSTREAM_IOC_GET_OMX_VERSION _IOW((_A_M), 0xb1, int)
 #define AMSTREAM_IOC_GET_OMX_INFO    _IOR((_A_M), 0xb2, unsigned int)
 #define AMSTREAM_IOC_SET_HDR_INFO    _IOW((_A_M), 0xb3, int)
+#define AMSTREAM_IOC_SET_VIDEOPEEK   _IOW(_A_M, 0xbf, unsigned int)
 
 #define AMSTREAM_IOC_GET_TRICK_VPTS _IOR((_A_M), 0xf0, int)
 #define AMSTREAM_IOC_DISABLE_SLOW_SYNC _IOW((_A_M), 0xf1, int)