diff mbox

[FFmpeg-devel,3/8] avcodec/v4l2_m2m: log requested pixel formats

Message ID 20190822214741.12456-3-ffmpeg@tmm1.net
State Accepted
Commit 3a5bcb1d1374f26e4c569ee9b9c62c27477c5e8a
Headers show

Commit Message

Aman Karmani Aug. 22, 2019, 9:47 p.m. UTC
From: Aman Gupta <aman@tmm1.net>

Signed-off-by: Aman Gupta <aman@tmm1.net>
---
 libavcodec/v4l2_m2m.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox

Patch

diff --git a/libavcodec/v4l2_m2m.c b/libavcodec/v4l2_m2m.c
index be13f68707..334ba0a038 100644
--- a/libavcodec/v4l2_m2m.c
+++ b/libavcodec/v4l2_m2m.c
@@ -135,6 +135,7 @@  static int v4l2_configure_contexts(V4L2m2mContext* s)
 {
     void *log_ctx = s->avctx;
     int ret;
+    struct v4l2_format ofmt, cfmt;
 
     s->fd = open(s->devname, O_RDWR | O_NONBLOCK, 0);
     if (s->fd < 0)
@@ -144,6 +145,16 @@  static int v4l2_configure_contexts(V4L2m2mContext* s)
     if (ret < 0)
         goto error;
 
+    ofmt = s->output.format;
+    cfmt = s->capture.format;
+    av_log(log_ctx, AV_LOG_INFO, "requesting formats: output=%s capture=%s\n",
+                                 av_fourcc2str(V4L2_TYPE_IS_MULTIPLANAR(ofmt.type) ?
+                                               ofmt.fmt.pix_mp.pixelformat :
+                                               ofmt.fmt.pix.pixelformat),
+                                 av_fourcc2str(V4L2_TYPE_IS_MULTIPLANAR(cfmt.type) ?
+                                               cfmt.fmt.pix_mp.pixelformat :
+                                               cfmt.fmt.pix.pixelformat));
+
     ret = ff_v4l2_context_set_format(&s->output);
     if (ret) {
         av_log(log_ctx, AV_LOG_ERROR, "can't set v4l2 output format\n");