pipvideo: add frame drop mechanism [1/1]
authorjintao xu <jintao.xu@amlogic.com>
Fri, 10 May 2019 11:47:36 +0000 (19:47 +0800)
committerNick Xie <nick@khadas.com>
Mon, 5 Aug 2019 06:33:12 +0000 (14:33 +0800)
PD#OTT-3616

Problem:
when HDMI output is 30HZ, video is 60fps, pipvideo only can display 30fps,
need drop 30fps.

Solution:
drop frames when there is no time to display

Verify:
U212

Change-Id: I3c946aa49ccc40b8e69e6e7c5031df0b5af34454
Signed-off-by: jintao xu <jintao.xu@amlogic.com>
drivers/amlogic/media/video_processor/videosync/videosync.c
drivers/amlogic/media/video_sink/video.c

index 23b6d0b..f2eb0fe 100644 (file)
@@ -1002,10 +1002,16 @@ static int videosync_receiver_event_fun(int type, void *data,
                videosync_buffer_states(&states, dev_s);
                if (states.buf_queued_num + states.buf_ready_num > 0)
                        return RECEIVER_ACTIVE;
-
-               vp_print(dev_s->vf_receiver_name, 0,
+               else {
+                       vp_print(dev_s->vf_receiver_name, 0,
                                "buf queue empty!!\n");
-               return RECEIVER_ACTIVE;/*return RECEIVER_INACTIVE;*/
+                       if (vf_notify_receiver(
+                               dev_s->vf_provider_name,
+                               VFRAME_EVENT_PROVIDER_QUREY_STATE,
+                               NULL) == RECEIVER_ACTIVE)
+                               return RECEIVER_ACTIVE;
+                       return RECEIVER_INACTIVE;
+               }
        }
        return 0;
 }
index dbc6117..0b9dff3 100644 (file)
@@ -6787,10 +6787,12 @@ static irqreturn_t vsync_isr_in(int irq, void *dev_id)
 SET_FILTER:
 #ifdef VIDEO_PIP
        vf = pip_vf_peek();
+
        /* setting video display property in underflow mode */
        if ((!vf) && cur_pipbuf && (pip_property_changed))
                pip_toggle_frame(cur_pipbuf);
-       if (vf) {
+
+       while (vf) {
                vf = pip_vf_get();
                if (vf) {
                        if (!vf->frame_dirty)
@@ -6798,6 +6800,7 @@ SET_FILTER:
                        else
                                pip_vf_put(vf);
                }
+               vf = pip_vf_peek();
        }
 #endif
 #if defined(CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_VECM)