mpeg12: CB2 fix output pts error in AndroidS CTS Test. [1/1]
authorgan.zhang <gan.zhang@amlogic.com>
Wed, 21 Jul 2021 08:36:13 +0000 (16:36 +0800)
committerliang ji <liang.ji@amlogic.com>
Thu, 9 Sep 2021 03:07:05 +0000 (03:07 +0000)
PD#SWPL-54626
BUG=199275310

Problem:
The pts information of the decoded B frame is 0, The backend will
calculate the pts of the B frame according to the duration, so that the
calculated pts information will be incorrect and cause the test to fail.

Solution:
The decoded output pts information uses the one provided by
the upper layer.

Verify:
Franklin

Change-Id: I8c273abc3e43b6777fc1bdab81208a769d52b2e5
Signed-off-by: gan.zhang <gan.zhang@amlogic.com>
drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c

index f2e274af8c905ca1f79d35dc6adb16eac97487e1..f4494199e8643b658ec4643c43ef5e1849515084 100644 (file)
@@ -2159,9 +2159,14 @@ static irqreturn_t vmpeg12_isr_thread_fn(struct vdec_s *vdec, int irq)
                                }
                        }
                } else {
-                       if (hw->chunk)
+                       if (hw->chunk) {
                                hw->last_chunk_pts = hw->chunk->pts;
-                       new_pic->pts_valid = false;
+                               new_pic->pts_valid = hw->chunk->pts_valid;
+                               new_pic->pts = hw->chunk->pts;
+                               new_pic->pts64 = hw->chunk->pts64;
+                       } else {
+                               new_pic->pts_valid = false;
+                       }
                }
 
                debug_print(DECODE_ID(hw), PRINT_FLAG_RUN_FLOW,
@@ -3482,8 +3487,8 @@ void (*callback)(struct vdec_s *, void *),
                u8 *data = NULL;
                if (hw->chunk)
                        debug_print(DECODE_ID(hw), PRINT_FLAG_RUN_FLOW,
-                               "run: chunk offset 0x%x, size %d\n",
-                               hw->chunk->offset, hw->chunk->size);
+                               "run: chunk offset 0x%x, size %d, pts %d, pts64 %lld\n",
+                               hw->chunk->offset, hw->chunk->size, hw->chunk->pts, hw->chunk->pts64);
 
                if (!hw->chunk->block->is_mapped)
                        data = codec_mm_vmap(hw->chunk->block->start +