Commit 823ea19a authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '39975acc'

* commit '39975acc':
  rtpenc_jpeg: check for color_range too
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents e925a82e 39975acc
......@@ -29,7 +29,7 @@ void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size)
RTPMuxContext *s = s1->priv_data;
const uint8_t *qtables = NULL;
int nb_qtables = 0;
uint8_t type = 1; /* default pixel format is AV_PIX_FMT_YUVJ420P */
uint8_t type;
uint8_t w, h;
uint8_t *p;
int off = 0; /* fragment offset of the current JPEG frame */
......@@ -43,10 +43,14 @@ void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size)
w = s1->streams[0]->codec->width >> 3;
h = s1->streams[0]->codec->height >> 3;
/* check if pixel format is not the normal 420 case */
if (s1->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUVJ422P) {
/* get the pixel format type or fail */
if (s1->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUVJ422P ||
(s1->streams[0]->codec->color_range == AVCOL_RANGE_JPEG &&
s1->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUV422P)) {
type = 0;
} else if (s1->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUVJ420P) {
} else if (s1->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUVJ420P ||
(s1->streams[0]->codec->color_range == AVCOL_RANGE_JPEG &&
s1->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUV420P)) {
type = 1;
} else {
av_log(s1, AV_LOG_ERROR, "Unsupported pixel format\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment