diff options
author | Limin Wang <lance.lmwang@gmail.com> | 2021-07-02 19:38:51 +0800 |
---|---|---|
committer | Limin Wang <lance.lmwang@gmail.com> | 2021-10-11 23:27:15 +0800 |
commit | f7823c9a3a2e51c94b166d5701f65642d5531889 (patch) | |
tree | b47fac44e6226344fe92153f40d03329fb9d5577 /libavformat/rtpdec_rfc4175.c | |
parent | 617cf44c8c56066e87f80c85218add82f1714ae0 (diff) | |
download | ffmpeg-f7823c9a3a2e51c94b166d5701f65642d5531889.tar.gz |
avformat/rtpdec_rfc4175: use av_get_bits_per_pixel()
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libavformat/rtpdec_rfc4175.c')
-rw-r--r-- | libavformat/rtpdec_rfc4175.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavformat/rtpdec_rfc4175.c b/libavformat/rtpdec_rfc4175.c index 4daff4da5a..e1e1452fef 100644 --- a/libavformat/rtpdec_rfc4175.c +++ b/libavformat/rtpdec_rfc4175.c @@ -43,8 +43,8 @@ struct PayloadContext { static int rfc4175_parse_format(AVStream *stream, PayloadContext *data) { enum AVPixelFormat pixfmt = AV_PIX_FMT_NONE; - int bits_per_sample = 0; int tag = 0; + const AVPixFmtDescriptor *desc; if (!strncmp(data->sampling, "YCbCr-4:2:2", 11)) { tag = MKTAG('U', 'Y', 'V', 'Y'); @@ -52,11 +52,9 @@ static int rfc4175_parse_format(AVStream *stream, PayloadContext *data) if (data->depth == 8) { data->pgroup = 4; - bits_per_sample = 16; pixfmt = AV_PIX_FMT_UYVY422; } else if (data->depth == 10) { data->pgroup = 5; - bits_per_sample = 20; pixfmt = AV_PIX_FMT_YUV422P10; } else { return AVERROR_INVALIDDATA; @@ -65,9 +63,10 @@ static int rfc4175_parse_format(AVStream *stream, PayloadContext *data) return AVERROR_INVALIDDATA; } + desc = av_pix_fmt_desc_get(pixfmt); stream->codecpar->format = pixfmt; stream->codecpar->codec_tag = tag; - stream->codecpar->bits_per_coded_sample = bits_per_sample; + stream->codecpar->bits_per_coded_sample = av_get_bits_per_pixel(desc); data->frame_size = data->width * data->height * data->pgroup / data->xinc; return 0; |