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
472e0445
Commit
472e0445
authored
Sep 23, 2019
by
vectronic
Committed by
Derek Buitenhuis
Mar 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/mov: add ICC profile support for colr atom
Signed-off-by:
vectronic
<
hello.vectronic@gmail.com
>
parent
05d27f34
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
mov.c
libavformat/mov.c
+13
-2
No files found.
libavformat/mov.c
View file @
472e0445
...
...
@@ -1546,6 +1546,7 @@ static int mov_read_enda(MOVContext *c, AVIOContext *pb, MOVAtom atom)
static
int
mov_read_colr
(
MOVContext
*
c
,
AVIOContext
*
pb
,
MOVAtom
atom
)
{
AVStream
*
st
;
uint8_t
*
icc_profile
;
char
color_parameter_type
[
5
]
=
{
0
};
uint16_t
color_primaries
,
color_trc
,
color_matrix
;
int
ret
;
...
...
@@ -1558,12 +1559,22 @@ static int mov_read_colr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if
(
ret
<
0
)
return
ret
;
if
(
strncmp
(
color_parameter_type
,
"nclx"
,
4
)
&&
strncmp
(
color_parameter_type
,
"nclc"
,
4
))
{
strncmp
(
color_parameter_type
,
"nclc"
,
4
)
&&
strncmp
(
color_parameter_type
,
"prof"
,
4
))
{
av_log
(
c
->
fc
,
AV_LOG_WARNING
,
"unsupported color_parameter_type %s
\n
"
,
color_parameter_type
);
return
0
;
}
if
(
!
strncmp
(
color_parameter_type
,
"prof"
,
4
))
{
icc_profile
=
av_stream_new_side_data
(
st
,
AV_PKT_DATA_ICC_PROFILE
,
atom
.
size
-
4
);
if
(
!
icc_profile
)
return
AVERROR
(
ENOMEM
);
ret
=
ffio_read_size
(
pb
,
icc_profile
,
atom
.
size
-
4
);
if
(
ret
<
0
)
return
ret
;
}
else
{
color_primaries
=
avio_rb16
(
pb
);
color_trc
=
avio_rb16
(
pb
);
color_matrix
=
avio_rb16
(
pb
);
...
...
@@ -1592,7 +1603,7 @@ static int mov_read_colr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
st
->
codecpar
->
color_trc
=
color_trc
;
st
->
codecpar
->
color_space
=
color_matrix
;
av_log
(
c
->
fc
,
AV_LOG_TRACE
,
"
\n
"
);
}
return
0
;
}
...
...
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