diff options
author | Limin Wang <lance.lmwang@gmail.com> | 2021-11-24 19:14:17 +0800 |
---|---|---|
committer | Limin Wang <lance.lmwang@gmail.com> | 2021-11-25 15:07:19 +0800 |
commit | 522f577d7eca66c65aece841610cb008a10c1a2e (patch) | |
tree | 855733e6fdd3a61682f73d2629ffbf02685f3bcb /libavformat/rtpdec_rfc4175.c | |
parent | 7b55f95f71559b2e76bdc6e7d6dcf12b3b5a8677 (diff) |
avformat/rtp: support RGB/BGR for rfc4175
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libavformat/rtpdec_rfc4175.c')
-rw-r--r-- | libavformat/rtpdec_rfc4175.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libavformat/rtpdec_rfc4175.c b/libavformat/rtpdec_rfc4175.c index 5a7058bc14..7feefd2fff 100644 --- a/libavformat/rtpdec_rfc4175.c +++ b/libavformat/rtpdec_rfc4175.c @@ -74,6 +74,26 @@ static int rfc4175_parse_format(AVStream *stream, PayloadContext *data) } else { return AVERROR_INVALIDDATA; } + } else if (!strncmp(data->sampling, "RGB", 3)) { + tag = MKTAG('R', 'G', 'B', 24); + if (data->depth == 8) { + data->xinc = 1; + data->pgroup = 3; + pixfmt = AV_PIX_FMT_RGB24; + stream->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO; + } else { + return AVERROR_INVALIDDATA; + } + } else if (!strncmp(data->sampling, "BGR", 3)) { + tag = MKTAG('B', 'G', 'R', 24); + if (data->depth == 8) { + data->xinc = 1; + data->pgroup = 3; + pixfmt = AV_PIX_FMT_BGR24; + stream->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO; + } else { + return AVERROR_INVALIDDATA; + } } else { return AVERROR_INVALIDDATA; } |