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
573ffbb3
Commit
573ffbb3
authored
Nov 24, 2011
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavu: add av_get_alt_sample_fmt().
parent
afb0470a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
11 deletions
+32
-11
APIchanges
doc/APIchanges
+3
-0
avutil.h
libavutil/avutil.h
+1
-1
samplefmt.c
libavutil/samplefmt.c
+20
-10
samplefmt.h
libavutil/samplefmt.h
+8
-0
No files found.
doc/APIchanges
View file @
573ffbb3
...
...
@@ -13,6 +13,9 @@ libavutil: 2011-04-18
API changes, most recent first:
2011-xx-xx - xxxxxxx - lavu 51.28.1
Add av_get_alt_sample_fmt() to samplefmt.h.
2011-11-03 - 96949da - lavu 51.23.0
Add av_strcasecmp() and av_strncasecmp() to avstring.h.
...
...
libavutil/avutil.h
View file @
573ffbb3
...
...
@@ -153,7 +153,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 51
#define LIBAVUTIL_VERSION_MINOR 2
7
#define LIBAVUTIL_VERSION_MINOR 2
8
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
...
...
libavutil/samplefmt.c
View file @
573ffbb3
...
...
@@ -26,20 +26,21 @@ typedef struct SampleFmtInfo {
char
name
[
4
];
int
bits
;
int
planar
;
enum
AVSampleFormat
altform
;
///< planar<->packed alternative form
}
SampleFmtInfo
;
/** this table gives more information about formats */
static
const
SampleFmtInfo
sample_fmt_info
[
AV_SAMPLE_FMT_NB
]
=
{
[
AV_SAMPLE_FMT_U8
]
=
{
.
name
=
"u8"
,
.
bits
=
8
,
.
planar
=
0
},
[
AV_SAMPLE_FMT_S16
]
=
{
.
name
=
"s16"
,
.
bits
=
16
,
.
planar
=
0
},
[
AV_SAMPLE_FMT_S32
]
=
{
.
name
=
"s32"
,
.
bits
=
32
,
.
planar
=
0
},
[
AV_SAMPLE_FMT_FLT
]
=
{
.
name
=
"flt"
,
.
bits
=
32
,
.
planar
=
0
},
[
AV_SAMPLE_FMT_DBL
]
=
{
.
name
=
"dbl"
,
.
bits
=
64
,
.
planar
=
0
},
[
AV_SAMPLE_FMT_U8P
]
=
{
.
name
=
"u8p"
,
.
bits
=
8
,
.
planar
=
1
},
[
AV_SAMPLE_FMT_S16P
]
=
{
.
name
=
"s16p"
,
.
bits
=
16
,
.
planar
=
1
},
[
AV_SAMPLE_FMT_S32P
]
=
{
.
name
=
"s32p"
,
.
bits
=
32
,
.
planar
=
1
},
[
AV_SAMPLE_FMT_FLTP
]
=
{
.
name
=
"fltp"
,
.
bits
=
32
,
.
planar
=
1
},
[
AV_SAMPLE_FMT_DBLP
]
=
{
.
name
=
"dblp"
,
.
bits
=
64
,
.
planar
=
1
},
[
AV_SAMPLE_FMT_U8
]
=
{
.
name
=
"u8"
,
.
bits
=
8
,
.
planar
=
0
,
.
altform
=
AV_SAMPLE_FMT_U8P
},
[
AV_SAMPLE_FMT_S16
]
=
{
.
name
=
"s16"
,
.
bits
=
16
,
.
planar
=
0
,
.
altform
=
AV_SAMPLE_FMT_S16P
},
[
AV_SAMPLE_FMT_S32
]
=
{
.
name
=
"s32"
,
.
bits
=
32
,
.
planar
=
0
,
.
altform
=
AV_SAMPLE_FMT_S32P
},
[
AV_SAMPLE_FMT_FLT
]
=
{
.
name
=
"flt"
,
.
bits
=
32
,
.
planar
=
0
,
.
altform
=
AV_SAMPLE_FMT_FLTP
},
[
AV_SAMPLE_FMT_DBL
]
=
{
.
name
=
"dbl"
,
.
bits
=
64
,
.
planar
=
0
,
.
altform
=
AV_SAMPLE_FMT_DBLP
},
[
AV_SAMPLE_FMT_U8P
]
=
{
.
name
=
"u8p"
,
.
bits
=
8
,
.
planar
=
1
,
.
altform
=
AV_SAMPLE_FMT_U8
},
[
AV_SAMPLE_FMT_S16P
]
=
{
.
name
=
"s16p"
,
.
bits
=
16
,
.
planar
=
1
,
.
altform
=
AV_SAMPLE_FMT_S16
},
[
AV_SAMPLE_FMT_S32P
]
=
{
.
name
=
"s32p"
,
.
bits
=
32
,
.
planar
=
1
,
.
altform
=
AV_SAMPLE_FMT_S32
},
[
AV_SAMPLE_FMT_FLTP
]
=
{
.
name
=
"fltp"
,
.
bits
=
32
,
.
planar
=
1
,
.
altform
=
AV_SAMPLE_FMT_FLT
},
[
AV_SAMPLE_FMT_DBLP
]
=
{
.
name
=
"dblp"
,
.
bits
=
64
,
.
planar
=
1
,
.
altform
=
AV_SAMPLE_FMT_DBL
},
};
const
char
*
av_get_sample_fmt_name
(
enum
AVSampleFormat
sample_fmt
)
...
...
@@ -59,6 +60,15 @@ enum AVSampleFormat av_get_sample_fmt(const char *name)
return
AV_SAMPLE_FMT_NONE
;
}
enum
AVSampleFormat
av_get_alt_sample_fmt
(
enum
AVSampleFormat
sample_fmt
,
int
planar
)
{
if
(
sample_fmt
<
0
||
sample_fmt
>=
AV_SAMPLE_FMT_NB
)
return
AV_SAMPLE_FMT_NONE
;
if
(
sample_fmt_info
[
sample_fmt
].
planar
==
planar
)
return
sample_fmt
;
return
sample_fmt_info
[
sample_fmt
].
altform
;
}
char
*
av_get_sample_fmt_string
(
char
*
buf
,
int
buf_size
,
enum
AVSampleFormat
sample_fmt
)
{
/* print header */
...
...
libavutil/samplefmt.h
View file @
573ffbb3
...
...
@@ -53,6 +53,14 @@ const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt);
*/
enum
AVSampleFormat
av_get_sample_fmt
(
const
char
*
name
);
/**
* Return the planar<->packed alternative form of the given sample format, or
* AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the
* requested planar/packed format, the format returned is the same as the
* input.
*/
enum
AVSampleFormat
av_get_alt_sample_fmt
(
enum
AVSampleFormat
sample_fmt
,
int
planar
);
/**
* Generate a string corresponding to the sample format with
* sample_fmt, or a header if sample_fmt is negative.
...
...
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