diff mbox series

[FFmpeg-devel] ffmpeg-rtpdec-4175-gray

Message ID 9499f21b-43a4-9470-c752-49117ca9b7b4@obninsk.ru
State New
Headers show
Series [FFmpeg-devel] ffmpeg-rtpdec-4175-gray | expand

Checks

Context Check Description
yinshiyou/configure_loongarch64 warning Failed to apply patch

Commit Message

Evgeny Oct. 25, 2022, 11:11 a.m. UTC

diff mbox series

Patch

Support of grayscale video (from IR-camera as example)

--- libavformat/rtpdec_rfc4175.c
+++ libavformat/rtpdec_rfc4175.c
@@ -96,6 +96,16 @@  static int rfc4175_parse_format(AVStream *stream, PayloadContext *data)
 		} else {
 			return AVERROR_INVALIDDATA;
 		}
+	} else if (!strncmp(data->sampling, "Gray", 3)) {
+		tag = MKTAG('Y', '8', ' ', ' ');
+		if (data->depth == 8) {
+			data->xinc = 1;
+			data->pgroup = 1;
+			pixfmt = AV_PIX_FMT_GRAY8;
+			stream->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO;
+		} else {
+			return AVERROR_INVALIDDATA;
+		}
 	} else {
 		return AVERROR_INVALIDDATA;
 	}