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
2093c1dc
Commit
2093c1dc
authored
Nov 09, 2014
by
Peter Ross
Committed by
Michael Niedermayer
Nov 13, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cinedec: report white balance gain coefficients using metadata
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
7a79c055
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
cinedec.c
libavformat/cinedec.c
+15
-1
No files found.
libavformat/cinedec.c
View file @
2093c1dc
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/intreadwrite.h"
#include "libavcodec/bmp.h"
#include "libavcodec/bmp.h"
#include "libavutil/intfloat.h"
#include "avformat.h"
#include "avformat.h"
#include "internal.h"
#include "internal.h"
...
@@ -78,6 +79,16 @@ static int set_metadata_int(AVDictionary **dict, const char *key, int value, int
...
@@ -78,6 +79,16 @@ static int set_metadata_int(AVDictionary **dict, const char *key, int value, int
return
0
;
return
0
;
}
}
static
int
set_metadata_float
(
AVDictionary
**
dict
,
const
char
*
key
,
float
value
,
int
allow_zero
)
{
if
(
value
!=
0
||
allow_zero
)
{
char
tmp
[
64
];
snprintf
(
tmp
,
sizeof
(
tmp
),
"%f"
,
value
);
return
av_dict_set
(
dict
,
key
,
tmp
,
0
);
}
return
0
;
}
static
int
cine_read_header
(
AVFormatContext
*
avctx
)
static
int
cine_read_header
(
AVFormatContext
*
avctx
)
{
{
AVIOContext
*
pb
=
avctx
->
pb
;
AVIOContext
*
pb
=
avctx
->
pb
;
...
@@ -177,7 +188,10 @@ static int cine_read_header(AVFormatContext *avctx)
...
@@ -177,7 +188,10 @@ static int cine_read_header(AVFormatContext *avctx)
set_metadata_int
(
&
st
->
metadata
,
"contrast"
,
avio_rl32
(
pb
),
1
);
set_metadata_int
(
&
st
->
metadata
,
"contrast"
,
avio_rl32
(
pb
),
1
);
set_metadata_int
(
&
st
->
metadata
,
"gamma"
,
avio_rl32
(
pb
),
1
);
set_metadata_int
(
&
st
->
metadata
,
"gamma"
,
avio_rl32
(
pb
),
1
);
avio_skip
(
pb
,
72
);
// Reserved1 .. WBView
avio_skip
(
pb
,
12
+
16
);
// Reserved1 .. AutoExpRect
set_metadata_float
(
&
st
->
metadata
,
"wbgain[0].r"
,
av_int2float
(
avio_rl32
(
pb
)),
1
);
set_metadata_float
(
&
st
->
metadata
,
"wbgain[0].b"
,
av_int2float
(
avio_rl32
(
pb
)),
1
);
avio_skip
(
pb
,
36
);
// WBGain[1].. WBView
st
->
codec
->
bits_per_coded_sample
=
avio_rl32
(
pb
);
st
->
codec
->
bits_per_coded_sample
=
avio_rl32
(
pb
);
...
...
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