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
481fdeee
Commit
481fdeee
authored
Nov 02, 2012
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavu/opt: add AV_OPT_SAMPLE_FMT option
parent
7be09a91
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
1 deletion
+33
-1
APIchanges
doc/APIchanges
+3
-0
opt.c
libavutil/opt.c
+28
-0
opt.h
libavutil/opt.h
+1
-0
version.h
libavutil/version.h
+1
-1
No files found.
doc/APIchanges
View file @
481fdeee
...
@@ -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:
2012-11-03 - xxxxxxx - lavu 52.3.100 - opt.h
Add AV_OPT_TYPE_SAMPLE_FMT value to AVOptionType enum.
2012-10-21 - xxxxxxx - lavc 54.68.100 - avcodec.h
2012-10-21 - xxxxxxx - lavc 54.68.100 - avcodec.h
lavfi 3.20.100 - avfilter.h
lavfi 3.20.100 - avfilter.h
Add AV_PKT_DATA_STRINGS_METADATA side data type, used to transmit key/value
Add AV_PKT_DATA_STRINGS_METADATA side data type, used to transmit key/value
...
...
libavutil/opt.c
View file @
481fdeee
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#include "parseutils.h"
#include "parseutils.h"
#include "pixdesc.h"
#include "pixdesc.h"
#include "mathematics.h"
#include "mathematics.h"
#include "samplefmt.h"
#if FF_API_FIND_OPT
#if FF_API_FIND_OPT
//FIXME order them and do a bin search
//FIXME order them and do a bin search
...
@@ -279,6 +280,22 @@ int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
...
@@ -279,6 +280,22 @@ int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
}
}
*
(
enum
AVPixelFormat
*
)
dst
=
ret
;
*
(
enum
AVPixelFormat
*
)
dst
=
ret
;
return
0
;
return
0
;
case
AV_OPT_TYPE_SAMPLE_FMT
:
if
(
!
val
||
!
strcmp
(
val
,
"none"
))
{
ret
=
AV_SAMPLE_FMT_NONE
;
}
else
{
ret
=
av_get_sample_fmt
(
val
);
if
(
ret
==
AV_SAMPLE_FMT_NONE
)
{
char
*
tail
;
ret
=
strtol
(
val
,
&
tail
,
0
);
if
(
*
tail
||
(
unsigned
)
ret
>=
AV_SAMPLE_FMT_NB
)
{
av_log
(
obj
,
AV_LOG_ERROR
,
"Unable to parse option value
\"
%s
\"
as sample format
\n
"
,
val
);
return
AVERROR
(
EINVAL
);
}
}
}
*
(
enum
AVSampleFormat
*
)
dst
=
ret
;
return
0
;
}
}
av_log
(
obj
,
AV_LOG_ERROR
,
"Invalid option type.
\n
"
);
av_log
(
obj
,
AV_LOG_ERROR
,
"Invalid option type.
\n
"
);
...
@@ -467,6 +484,9 @@ int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
...
@@ -467,6 +484,9 @@ int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
case
AV_OPT_TYPE_PIXEL_FMT
:
case
AV_OPT_TYPE_PIXEL_FMT
:
ret
=
snprintf
(
buf
,
sizeof
(
buf
),
"%s"
,
(
char
*
)
av_x_if_null
(
av_get_pix_fmt_name
(
*
(
enum
AVPixelFormat
*
)
dst
),
"none"
));
ret
=
snprintf
(
buf
,
sizeof
(
buf
),
"%s"
,
(
char
*
)
av_x_if_null
(
av_get_pix_fmt_name
(
*
(
enum
AVPixelFormat
*
)
dst
),
"none"
));
break
;
break
;
case
AV_OPT_TYPE_SAMPLE_FMT
:
ret
=
snprintf
(
buf
,
sizeof
(
buf
),
"%s"
,
(
char
*
)
av_x_if_null
(
av_get_sample_fmt_name
(
*
(
enum
AVSampleFormat
*
)
dst
),
"none"
));
break
;
default
:
default
:
return
AVERROR
(
EINVAL
);
return
AVERROR
(
EINVAL
);
}
}
...
@@ -642,6 +662,9 @@ static void opt_list(void *obj, void *av_log_obj, const char *unit,
...
@@ -642,6 +662,9 @@ static void opt_list(void *obj, void *av_log_obj, const char *unit,
case
AV_OPT_TYPE_PIXEL_FMT
:
case
AV_OPT_TYPE_PIXEL_FMT
:
av_log
(
av_log_obj
,
AV_LOG_INFO
,
"%-7s "
,
"<pix_fmt>"
);
av_log
(
av_log_obj
,
AV_LOG_INFO
,
"%-7s "
,
"<pix_fmt>"
);
break
;
break
;
case
AV_OPT_TYPE_SAMPLE_FMT
:
av_log
(
av_log_obj
,
AV_LOG_INFO
,
"%-7s "
,
"<sample_fmt>"
);
break
;
case
AV_OPT_TYPE_CONST
:
case
AV_OPT_TYPE_CONST
:
default
:
default
:
av_log
(
av_log_obj
,
AV_LOG_INFO
,
"%-7s "
,
""
);
av_log
(
av_log_obj
,
AV_LOG_INFO
,
"%-7s "
,
""
);
...
@@ -992,6 +1015,7 @@ typedef struct TestContext
...
@@ -992,6 +1015,7 @@ typedef struct TestContext
AVRational
rational
;
AVRational
rational
;
int
w
,
h
;
int
w
,
h
;
enum
AVPixelFormat
pix_fmt
;
enum
AVPixelFormat
pix_fmt
;
enum
AVSampleFormat
sample_fmt
;
}
TestContext
;
}
TestContext
;
#define OFFSET(x) offsetof(TestContext, x)
#define OFFSET(x) offsetof(TestContext, x)
...
@@ -1011,6 +1035,7 @@ static const AVOption test_options[]= {
...
@@ -1011,6 +1035,7 @@ static const AVOption test_options[]= {
{
"mu"
,
"set mu flag "
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
TEST_FLAG_MU
},
INT_MIN
,
INT_MAX
,
0
,
"flags"
},
{
"mu"
,
"set mu flag "
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
TEST_FLAG_MU
},
INT_MIN
,
INT_MAX
,
0
,
"flags"
},
{
"size"
,
"set size"
,
OFFSET
(
w
),
AV_OPT_TYPE_IMAGE_SIZE
,{
0
},
0
,
0
},
{
"size"
,
"set size"
,
OFFSET
(
w
),
AV_OPT_TYPE_IMAGE_SIZE
,{
0
},
0
,
0
},
{
"pix_fmt"
,
"set pixfmt"
,
OFFSET
(
pix_fmt
),
AV_OPT_TYPE_PIXEL_FMT
,{
0
},
0
,
0
},
{
"pix_fmt"
,
"set pixfmt"
,
OFFSET
(
pix_fmt
),
AV_OPT_TYPE_PIXEL_FMT
,{
0
},
0
,
0
},
{
"sample_fmt"
,
"set samplefmt"
,
OFFSET
(
sample_fmt
),
AV_OPT_TYPE_SAMPLE_FMT
,{
0
},
0
,
0
},
{
NULL
},
{
NULL
},
};
};
...
@@ -1058,6 +1083,9 @@ int main(void)
...
@@ -1058,6 +1083,9 @@ int main(void)
"pix_fmt=yuv420p"
,
"pix_fmt=yuv420p"
,
"pix_fmt=2"
,
"pix_fmt=2"
,
"pix_fmt=bogus"
,
"pix_fmt=bogus"
,
"sample_fmt=s16"
,
"sample_fmt=2"
,
"sample_fmt=bogus"
,
};
};
test_ctx
.
class
=
&
test_class
;
test_ctx
.
class
=
&
test_class
;
...
...
libavutil/opt.h
View file @
481fdeee
...
@@ -227,6 +227,7 @@ enum AVOptionType{
...
@@ -227,6 +227,7 @@ enum AVOptionType{
AV_OPT_TYPE_CONST
=
128
,
AV_OPT_TYPE_CONST
=
128
,
AV_OPT_TYPE_IMAGE_SIZE
=
MKBETAG
(
'S'
,
'I'
,
'Z'
,
'E'
),
///< offset must point to two consecutive integers
AV_OPT_TYPE_IMAGE_SIZE
=
MKBETAG
(
'S'
,
'I'
,
'Z'
,
'E'
),
///< offset must point to two consecutive integers
AV_OPT_TYPE_PIXEL_FMT
=
MKBETAG
(
'P'
,
'F'
,
'M'
,
'T'
),
AV_OPT_TYPE_PIXEL_FMT
=
MKBETAG
(
'P'
,
'F'
,
'M'
,
'T'
),
AV_OPT_TYPE_SAMPLE_FMT
=
MKBETAG
(
'S'
,
'F'
,
'M'
,
'T'
),
#if FF_API_OLD_AVOPTIONS
#if FF_API_OLD_AVOPTIONS
FF_OPT_TYPE_FLAGS
=
0
,
FF_OPT_TYPE_FLAGS
=
0
,
FF_OPT_TYPE_INT
,
FF_OPT_TYPE_INT
,
...
...
libavutil/version.h
View file @
481fdeee
...
@@ -75,7 +75,7 @@
...
@@ -75,7 +75,7 @@
*/
*/
#define LIBAVUTIL_VERSION_MAJOR 52
#define LIBAVUTIL_VERSION_MAJOR 52
#define LIBAVUTIL_VERSION_MINOR
2
#define LIBAVUTIL_VERSION_MINOR
3
#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