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
9cbf17e9
Commit
9cbf17e9
authored
Feb 16, 2012
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc: introduce av_get_pcm_codec.
parent
4217dfe8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
2 deletions
+34
-2
APIchanges
doc/APIchanges
+3
-0
avcodec.h
libavcodec/avcodec.h
+8
-0
utils.c
libavcodec/utils.c
+21
-0
version.h
libavcodec/version.h
+2
-2
No files found.
doc/APIchanges
View file @
9cbf17e9
...
...
@@ -13,6 +13,9 @@ libavutil: 2011-04-18
API changes, most recent first:
2012-02-21 - xxxxxxx - lavc 54.4.100
Add av_get_pcm_codec() function.
2012-02-16 - xxxxxxx - libswr 0.7.100
Add swr_set_matrix() function.
...
...
libavcodec/avcodec.h
View file @
9cbf17e9
...
...
@@ -4055,6 +4055,14 @@ void avcodec_default_free_buffers(AVCodecContext *s);
*/
int
av_get_bits_per_sample
(
enum
CodecID
codec_id
);
/**
* Return the PCM codec associated with a sample format.
* @param be endianness, 0 for little, 1 for big,
* -1 (or anything else) for native
* @return CODEC_ID_PCM_* or CODEC_ID_NONE
*/
enum
CodecID
av_get_pcm_codec
(
enum
AVSampleFormat
fmt
,
int
be
);
/* frame parsing */
typedef
struct
AVCodecParserContext
{
void
*
priv_data
;
...
...
libavcodec/utils.c
View file @
9cbf17e9
...
...
@@ -1902,6 +1902,27 @@ int av_get_bits_per_sample(enum CodecID codec_id){
}
}
enum
CodecID
av_get_pcm_codec
(
enum
AVSampleFormat
fmt
,
int
be
)
{
static
const
enum
CodecID
map
[
AV_SAMPLE_FMT_NB
][
2
]
=
{
[
AV_SAMPLE_FMT_U8
]
=
{
CODEC_ID_PCM_U8
,
CODEC_ID_PCM_U8
},
[
AV_SAMPLE_FMT_S16
]
=
{
CODEC_ID_PCM_S16LE
,
CODEC_ID_PCM_S16BE
},
[
AV_SAMPLE_FMT_S32
]
=
{
CODEC_ID_PCM_S32LE
,
CODEC_ID_PCM_S32BE
},
[
AV_SAMPLE_FMT_FLT
]
=
{
CODEC_ID_PCM_F32LE
,
CODEC_ID_PCM_F32BE
},
[
AV_SAMPLE_FMT_DBL
]
=
{
CODEC_ID_PCM_F64LE
,
CODEC_ID_PCM_F64BE
},
[
AV_SAMPLE_FMT_U8P
]
=
{
CODEC_ID_PCM_U8
,
CODEC_ID_PCM_U8
},
[
AV_SAMPLE_FMT_S16P
]
=
{
CODEC_ID_PCM_S16LE
,
CODEC_ID_PCM_S16BE
},
[
AV_SAMPLE_FMT_S32P
]
=
{
CODEC_ID_PCM_S32LE
,
CODEC_ID_PCM_S32BE
},
[
AV_SAMPLE_FMT_FLTP
]
=
{
CODEC_ID_PCM_F32LE
,
CODEC_ID_PCM_F32BE
},
[
AV_SAMPLE_FMT_DBLP
]
=
{
CODEC_ID_PCM_F64LE
,
CODEC_ID_PCM_F64BE
},
};
if
(
fmt
<
0
||
fmt
>=
AV_SAMPLE_FMT_NB
)
return
CODEC_ID_NONE
;
if
(
be
<
0
||
be
>
1
)
be
=
AV_NE
(
1
,
0
);
return
map
[
fmt
][
be
];
}
#if !HAVE_THREADS
int
ff_thread_init
(
AVCodecContext
*
s
){
return
-
1
;
...
...
libavcodec/version.h
View file @
9cbf17e9
...
...
@@ -21,8 +21,8 @@
#define AVCODEC_VERSION_H
#define LIBAVCODEC_VERSION_MAJOR 54
#define LIBAVCODEC_VERSION_MINOR
3
#define LIBAVCODEC_VERSION_MICRO 10
1
#define LIBAVCODEC_VERSION_MINOR
4
#define LIBAVCODEC_VERSION_MICRO 10
0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
...
...
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