Skip to content

Commit

Permalink
media: s5p-mfc: copy timestamp and timecode in encoder output
Browse files Browse the repository at this point in the history
Signed-off-by: memeka <mihailescu2m@gmail.com>
  • Loading branch information
mihailescu2m committed Oct 23, 2019
1 parent 6d12433 commit 98a6cbc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,7 @@ static int enc_post_frame_start(struct s5p_mfc_ctx *ctx)
{
struct s5p_mfc_dev *dev = ctx->dev;
struct s5p_mfc_buf *mb_entry;
struct s5p_mfc_buf *dst_buf;
unsigned long enc_y_addr = 0, enc_c_addr = 0;
unsigned long mb_y_addr, mb_c_addr;
int slice_type;
Expand All @@ -1227,8 +1228,12 @@ static int enc_post_frame_start(struct s5p_mfc_ctx *ctx)
&mb_entry->b->vb2_buf, 0);
mb_c_addr = vb2_dma_contig_plane_dma_addr(
&mb_entry->b->vb2_buf, 1);
dst_buf = list_entry(ctx->dst_queue.next,
struct s5p_mfc_buf, list);
if ((enc_y_addr == mb_y_addr) &&
(enc_c_addr == mb_c_addr)) {
dst_buf->b->timecode = mb_entry->b->timecode;
dst_buf->b->vb2_buf.timestamp = mb_entry->b->vb2_buf.timestamp;
list_del(&mb_entry->list);
ctx->src_queue_cnt--;
vb2_buffer_done(&mb_entry->b->vb2_buf,
Expand All @@ -1241,8 +1246,12 @@ static int enc_post_frame_start(struct s5p_mfc_ctx *ctx)
&mb_entry->b->vb2_buf, 0);
mb_c_addr = vb2_dma_contig_plane_dma_addr(
&mb_entry->b->vb2_buf, 1);
dst_buf = list_entry(ctx->dst_queue.next,
struct s5p_mfc_buf, list);
if ((enc_y_addr == mb_y_addr) &&
(enc_c_addr == mb_c_addr)) {
dst_buf->b->timecode = mb_entry->b->timecode;
dst_buf->b->vb2_buf.timestamp = mb_entry->b->vb2_buf.timestamp;
list_del(&mb_entry->list);
ctx->ref_queue_cnt--;
vb2_buffer_done(&mb_entry->b->vb2_buf,
Expand Down

0 comments on commit 98a6cbc

Please sign in to comment.