Skip to content

Commit 7b13d17

Browse files
wang-binquink-black
authored andcommitted
avdevice/android_camera: Set image linesize aligment to 1
Can't read alignment from packet, codecpar or decoded frame linesizes, so don't set it. My test device redmi k60 produces images in 4624x3472, not 32 aligned Signed-off-by: Zhao Zhili <[email protected]>
1 parent 291ec0f commit 7b13d17

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libavdevice/android_camera.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ static void image_available(void *context, AImageReader *reader)
421421
}
422422
}
423423

424-
pkt_buffer_size = av_image_get_buffer_size(ctx->image_format, ctx->width, ctx->height, 32);
424+
pkt_buffer_size = av_image_get_buffer_size(ctx->image_format, ctx->width, ctx->height, 1);
425425
AImage_getTimestamp(image, &image_timestamp);
426426

427427
AImage_getPlaneRowStride(image, 0, &image_linestrides[0]);
@@ -460,7 +460,7 @@ static void image_available(void *context, AImageReader *reader)
460460
av_image_copy_to_buffer(pkt.data, pkt_buffer_size,
461461
(const uint8_t * const *) image_plane_data,
462462
image_linestrides, ctx->image_format,
463-
ctx->width, ctx->height, 32);
463+
ctx->width, ctx->height, 1);
464464

465465
ret = av_thread_message_queue_send(ctx->input_queue, &pkt, AV_THREAD_MESSAGE_NONBLOCK);
466466

0 commit comments

Comments
 (0)