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
38a41321
Commit
38a41321
authored
Mar 12, 2019
by
Vittorio Giovara
Committed by
James Almer
Mar 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libdav1d: Add support for reading hdr10 metadata
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
36bb2cc2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
libdav1d.c
libavcodec/libdav1d.c
+28
-0
No files found.
libavcodec/libdav1d.c
View file @
38a41321
...
...
@@ -22,6 +22,7 @@
#include <dav1d/dav1d.h>
#include "libavutil/avassert.h"
#include "libavutil/mastering_display_metadata.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
...
...
@@ -274,6 +275,33 @@ FF_ENABLE_DEPRECATION_WARNINGS
return
AVERROR_INVALIDDATA
;
}
if
(
p
->
mastering_display
)
{
AVMasteringDisplayMetadata
*
mastering
=
av_mastering_display_metadata_create_side_data
(
frame
);
if
(
!
mastering
)
return
AVERROR
(
ENOMEM
);
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
mastering
->
display_primaries
[
i
][
0
]
=
av_make_q
(
p
->
mastering_display
->
primaries
[
i
][
0
],
1
<<
16
);
mastering
->
display_primaries
[
i
][
1
]
=
av_make_q
(
p
->
mastering_display
->
primaries
[
i
][
1
],
1
<<
16
);
}
mastering
->
white_point
[
0
]
=
av_make_q
(
p
->
mastering_display
->
white_point
[
0
],
1
<<
16
);
mastering
->
white_point
[
1
]
=
av_make_q
(
p
->
mastering_display
->
white_point
[
1
],
1
<<
16
);
mastering
->
max_luminance
=
av_make_q
(
p
->
mastering_display
->
max_luminance
,
1
<<
8
);
mastering
->
min_luminance
=
av_make_q
(
p
->
mastering_display
->
min_luminance
,
1
<<
14
);
mastering
->
has_primaries
=
1
;
mastering
->
has_luminance
=
1
;
}
if
(
p
->
content_light
)
{
AVContentLightMetadata
*
light
=
av_content_light_metadata_create_side_data
(
frame
);
if
(
!
light
)
return
AVERROR
(
ENOMEM
);
light
->
MaxCLL
=
p
->
content_light
->
max_content_light_level
;
light
->
MaxFALL
=
p
->
content_light
->
max_frame_average_light_level
;
}
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