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
8a1759ad
Commit
8a1759ad
authored
Jan 16, 2017
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/exr: export writer info into frame metadata
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
546e29d1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
exr.c
libavcodec/exr.c
+13
-2
No files found.
libavcodec/exr.c
View file @
8a1759ad
...
...
@@ -1303,8 +1303,9 @@ static int check_header_variable(EXRContext *s,
return
var_size
;
}
static
int
decode_header
(
EXRContext
*
s
)
static
int
decode_header
(
EXRContext
*
s
,
AVFrame
*
frame
)
{
AVDictionary
*
metadata
=
NULL
;
int
magic_number
,
version
,
i
,
flags
,
sar
=
0
;
int
layer_match
=
0
;
...
...
@@ -1576,6 +1577,14 @@ static int decode_header(EXRContext *s)
return
AVERROR_PATCHWELCOME
;
}
continue
;
}
else
if
((
var_size
=
check_header_variable
(
s
,
"writer"
,
"string"
,
1
))
>=
0
)
{
uint8_t
key
[
256
]
=
{
0
};
bytestream2_get_buffer
(
&
s
->
gb
,
key
,
FFMIN
(
sizeof
(
key
)
-
1
,
var_size
));
av_dict_set
(
&
metadata
,
"writer"
,
key
,
0
);
continue
;
}
...
...
@@ -1612,6 +1621,8 @@ static int decode_header(EXRContext *s)
return
AVERROR_INVALIDDATA
;
}
av_frame_set_metadata
(
frame
,
metadata
);
// aaand we are done
bytestream2_skip
(
&
s
->
gb
,
1
);
return
0
;
...
...
@@ -1631,7 +1642,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
bytestream2_init
(
&
s
->
gb
,
avpkt
->
data
,
avpkt
->
size
);
if
((
ret
=
decode_header
(
s
))
<
0
)
if
((
ret
=
decode_header
(
s
,
picture
))
<
0
)
return
ret
;
switch
(
s
->
pixel_type
)
{
...
...
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