History

Merge commit '39975acc699c83af0a87a7318c0f41e189142938'

* commit '39975acc699c83af0a87a7318c0f41e189142938': rtpenc_jpeg: check for color_range too

Michael Niedermayer committed 12 years ago

Commit 823ea192 parents e925a82 39975ac1 file · +8 −4Browse files

Unified · Split

libavformat/rtpenc_jpeg.c+8−4
@@ -29,7 +29,7 @@ void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size) · 28 unmodified lines
2929 RTPMuxContext *s = s1->priv_data;
3030 const uint8_t *qtables = NULL;
3131 int nb_qtables = 0;
32− uint8_t type = 1; /* default pixel format is AV_PIX_FMT_YUVJ420P */
32+ uint8_t type;
3333 uint8_t w, h;
3434 uint8_t *p;
3535 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) · 7 unmodified lines
4343 w = s1->streams[0]->codec->width >> 3;
4444 h = s1->streams[0]->codec->height >> 3;
4545
46− /* check if pixel format is not the normal 420 case */
47− if (s1->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUVJ422P) {
46+ /* get the pixel format type or fail */
47+ if (s1->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUVJ422P ||
48+ (s1->streams[0]->codec->color_range == AVCOL_RANGE_JPEG &&
49+ s1->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUV422P)) {
4850 type = 0;
49− } else if (s1->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUVJ420P) {
51+ } else if (s1->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUVJ420P ||
52+ (s1->streams[0]->codec->color_range == AVCOL_RANGE_JPEG &&
53+ s1->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUV420P)) {
5054 type = 1;
5155 } else {
5256 av_log(s1, AV_LOG_ERROR, "Unsupported pixel format\n");

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t