Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
39975acc
Commit
39975acc
authored
Jun 26, 2014
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtpenc_jpeg: check for color_range too
parent
f134b5ec
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
rtpenc_jpeg.c
libavformat/rtpenc_jpeg.c
+8
-4
No files found.
libavformat/rtpenc_jpeg.c
View file @
39975acc
...
@@ -29,7 +29,7 @@ void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size)
...
@@ -29,7 +29,7 @@ void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size)
RTPMuxContext
*
s
=
s1
->
priv_data
;
RTPMuxContext
*
s
=
s1
->
priv_data
;
const
uint8_t
*
qtables
=
NULL
;
const
uint8_t
*
qtables
=
NULL
;
int
nb_qtables
=
0
;
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
w
,
h
;
uint8_t
*
p
;
uint8_t
*
p
;
int
off
=
0
;
/* fragment offset of the current JPEG frame */
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)
...
@@ -43,10 +43,14 @@ void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size)
w
=
s1
->
streams
[
0
]
->
codec
->
width
>>
3
;
w
=
s1
->
streams
[
0
]
->
codec
->
width
>>
3
;
h
=
s1
->
streams
[
0
]
->
codec
->
height
>>
3
;
h
=
s1
->
streams
[
0
]
->
codec
->
height
>>
3
;
/* check if pixel format is not the normal 420 case */
/* get the pixel format type or fail */
if
(
s1
->
streams
[
0
]
->
codec
->
pix_fmt
==
AV_PIX_FMT_YUVJ422P
)
{
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
;
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
;
type
=
1
;
}
else
{
}
else
{
av_log
(
s1
,
AV_LOG_ERROR
,
"Unsupported pixel format
\n
"
);
av_log
(
s1
,
AV_LOG_ERROR
,
"Unsupported pixel format
\n
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment