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
f028b7af
Commit
f028b7af
authored
May 30, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avutil/opt: add opt_size()
If people want, this could be exported as av_opt_size()
parent
c4d88311
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
opt.c
libavutil/opt.c
+22
-0
No files found.
libavutil/opt.c
View file @
f028b7af
...
...
@@ -1517,6 +1517,28 @@ void *av_opt_ptr(const AVClass *class, void *obj, const char *name)
return
(
uint8_t
*
)
obj
+
opt
->
offset
;
}
static
int
opt_size
(
enum
AVOptionType
type
)
{
switch
(
type
)
{
case
AV_OPT_TYPE_INT
:
case
AV_OPT_TYPE_FLAGS
:
return
sizeof
(
int
);
case
AV_OPT_TYPE_DURATION
:
case
AV_OPT_TYPE_CHANNEL_LAYOUT
:
case
AV_OPT_TYPE_INT64
:
return
sizeof
(
int64_t
);
case
AV_OPT_TYPE_DOUBLE
:
return
sizeof
(
double
);
case
AV_OPT_TYPE_FLOAT
:
return
sizeof
(
float
);
case
AV_OPT_TYPE_STRING
:
return
sizeof
(
uint8_t
*
);
case
AV_OPT_TYPE_VIDEO_RATE
:
case
AV_OPT_TYPE_RATIONAL
:
return
sizeof
(
AVRational
);
case
AV_OPT_TYPE_BINARY
:
return
sizeof
(
uint8_t
*
)
+
sizeof
(
int
);
case
AV_OPT_TYPE_IMAGE_SIZE
:
return
sizeof
(
int
[
2
]);
case
AV_OPT_TYPE_PIXEL_FMT
:
return
sizeof
(
enum
AVPixelFormat
);
case
AV_OPT_TYPE_SAMPLE_FMT
:
return
sizeof
(
enum
AVSampleFormat
);
case
AV_OPT_TYPE_COLOR
:
return
4
;
}
return
0
;
}
int
av_opt_query_ranges
(
AVOptionRanges
**
ranges_arg
,
void
*
obj
,
const
char
*
key
,
int
flags
)
{
int
ret
;
...
...
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