Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
00759d71
Commit
00759d71
authored
May 30, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avutil/opt: add av_opt_copy()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
f028b7af
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
1 deletion
+48
-1
APIchanges
doc/APIchanges
+3
-0
opt.c
libavutil/opt.c
+42
-0
opt.h
libavutil/opt.h
+2
-0
version.h
libavutil/version.h
+1
-1
No files found.
doc/APIchanges
View file @
00759d71
...
@@ -15,6 +15,9 @@ libavutil: 2012-10-22
...
@@ -15,6 +15,9 @@ libavutil: 2012-10-22
API changes, most recent first:
API changes, most recent first:
2014-05-30 - xxxxxxx - lavu 52.89.100 - opt.h
Add av_opt_copy()
2014-04-xx - xxxxxxx - lavc 55.54.0 - avcodec.h
2014-04-xx - xxxxxxx - lavc 55.54.0 - avcodec.h
Add AVCodecContext.side_data_only_packets to allow encoders to output packets
Add AVCodecContext.side_data_only_packets to allow encoders to output packets
with only side data. This option may become mandatory in the future, so all
with only side data. This option may become mandatory in the future, so all
...
...
libavutil/opt.c
View file @
00759d71
...
@@ -1539,6 +1539,48 @@ static int opt_size(enum AVOptionType type)
...
@@ -1539,6 +1539,48 @@ static int opt_size(enum AVOptionType type)
return
0
;
return
0
;
}
}
int
av_opt_copy
(
void
*
dst
,
void
*
src
)
{
const
AVOption
*
o
=
NULL
;
const
AVClass
*
c
;
int
ret
=
0
;
if
(
!
src
)
return
0
;
c
=
*
(
AVClass
**
)
src
;
if
(
*
(
AVClass
**
)
dst
&&
c
!=
*
(
AVClass
**
)
dst
)
return
AVERROR
(
EINVAL
);
while
((
o
=
av_opt_next
(
src
,
o
)))
{
void
*
field_dst
=
((
uint8_t
*
)
dst
)
+
o
->
offset
;
void
*
field_src
=
((
uint8_t
*
)
src
)
+
o
->
offset
;
uint8_t
**
field_dst8
=
(
uint8_t
**
)
field_dst
;
uint8_t
**
field_src8
=
(
uint8_t
**
)
field_src
;
if
(
o
->
type
==
AV_OPT_TYPE_STRING
)
{
set_string
(
dst
,
o
,
*
field_src8
,
field_dst8
);
if
(
*
field_src8
&&
!*
field_dst8
)
ret
=
AVERROR
(
ENOMEM
);
}
else
if
(
o
->
type
==
AV_OPT_TYPE_BINARY
)
{
int
len
=
*
(
int
*
)(
field_src8
+
1
);
if
(
*
field_dst8
!=
*
field_src8
)
av_freep
(
field_dst8
);
*
field_dst8
=
av_memdup
(
*
field_src8
,
len
);
if
(
len
&&
!*
field_dst8
)
{
ret
=
AVERROR
(
ENOMEM
);
len
=
0
;
}
*
(
int
*
)(
field_dst8
+
1
)
=
len
;
}
else
if
(
o
->
type
==
AV_OPT_TYPE_CONST
)
{
// do nothing
}
else
{
memcpy
(
field_dst
,
field_src
,
opt_size
(
o
->
type
));
}
}
return
ret
;
}
int
av_opt_query_ranges
(
AVOptionRanges
**
ranges_arg
,
void
*
obj
,
const
char
*
key
,
int
flags
)
int
av_opt_query_ranges
(
AVOptionRanges
**
ranges_arg
,
void
*
obj
,
const
char
*
key
,
int
flags
)
{
{
int
ret
;
int
ret
;
...
...
libavutil/opt.h
View file @
00759d71
...
@@ -822,6 +822,8 @@ void av_opt_freep_ranges(AVOptionRanges **ranges);
...
@@ -822,6 +822,8 @@ void av_opt_freep_ranges(AVOptionRanges **ranges);
*/
*/
int
av_opt_query_ranges
(
AVOptionRanges
**
,
void
*
obj
,
const
char
*
key
,
int
flags
);
int
av_opt_query_ranges
(
AVOptionRanges
**
,
void
*
obj
,
const
char
*
key
,
int
flags
);
int
av_opt_copy
(
void
*
dest
,
void
*
src
);
/**
/**
* Get a default list of allowed ranges for the given option.
* Get a default list of allowed ranges for the given option.
*
*
...
...
libavutil/version.h
View file @
00759d71
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
*/
*/
#define LIBAVUTIL_VERSION_MAJOR 52
#define LIBAVUTIL_VERSION_MAJOR 52
#define LIBAVUTIL_VERSION_MINOR 8
8
#define LIBAVUTIL_VERSION_MINOR 8
9
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
...
...
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