diff mbox series

[FFmpeg-devel,v2,1/2] avdevice/v4l2: add support for HEVC payloads

Message ID 20200715072533.550579-1-dima.buzdyk@gmail.com
State New
Headers show
Series [FFmpeg-devel,v2,1/2] avdevice/v4l2: add support for HEVC payloads
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Dima Buzdyk July 15, 2020, 7:25 a.m. UTC
* Add mapping for V4L2_PIX_FMT_HEVC payloads
* Request bitstream parsing just like H264

Signed-off-by: Dima Buzdyk <dima.buzdyk@gmail.com>
---
 libavdevice/v4l2-common.c | 3 +++
 libavdevice/v4l2.c        | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavdevice/v4l2-common.c b/libavdevice/v4l2-common.c
index b5b4448a31..353e83efdd 100644
--- a/libavdevice/v4l2-common.c
+++ b/libavdevice/v4l2-common.c
@@ -55,6 +55,9 @@  const struct fmt_map ff_fmt_conversion_table[] = {
 #ifdef V4L2_PIX_FMT_H264
     { AV_PIX_FMT_NONE,    AV_CODEC_ID_H264,     V4L2_PIX_FMT_H264    },
 #endif
+#ifdef V4L2_PIX_FMT_HEVC
+    { AV_PIX_FMT_NONE,    AV_CODEC_ID_HEVC,     V4L2_PIX_FMT_HEVC    },
+#endif
 #ifdef V4L2_PIX_FMT_MPEG4
     { AV_PIX_FMT_NONE,    AV_CODEC_ID_MPEG4,    V4L2_PIX_FMT_MPEG4   },
 #endif
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 365bacd771..70e0f620f8 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -960,7 +960,7 @@  static int v4l2_read_header(AVFormatContext *ctx)
     if (codec_id == AV_CODEC_ID_RAWVIDEO)
         st->codecpar->codec_tag =
             avcodec_pix_fmt_to_codec_tag(st->codecpar->format);
-    else if (codec_id == AV_CODEC_ID_H264) {
+    else if (codec_id == AV_CODEC_ID_H264 || codec_id == AV_CODEC_ID_HEVC) {
         st->need_parsing = AVSTREAM_PARSE_FULL_ONCE;
     }
     if (desired_format == V4L2_PIX_FMT_YVU420)