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
5c73645d
Commit
5c73645d
authored
Mar 21, 2013
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavu/samplefmt: add av_samples_alloc_array_and_pointers()
parent
39aad434
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
1 deletion
+32
-1
APIchanges
doc/APIchanges
+3
-0
samplefmt.c
libavutil/samplefmt.c
+15
-0
samplefmt.h
libavutil/samplefmt.h
+13
-0
version.h
libavutil/version.h
+1
-1
No files found.
doc/APIchanges
View file @
5c73645d
...
...
@@ -15,6 +15,9 @@ libavutil: 2012-10-22
API changes, most recent first:
2013-03-30 - xxxxxxx - lavu 52.24.100 - samplefmt.h
Add av_samples_alloc_array_and_samples().
2013-03-29 - xxxxxxx - lavf 55.1.100 - avformat.h
Add av_guess_frame_rate()
...
...
libavutil/samplefmt.c
View file @
5c73645d
...
...
@@ -207,6 +207,21 @@ int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels,
#endif
}
int
av_samples_alloc_array_and_samples
(
uint8_t
***
audio_data
,
int
*
linesize
,
int
nb_channels
,
int
nb_samples
,
enum
AVSampleFormat
sample_fmt
,
int
align
)
{
int
ret
,
nb_planes
=
av_sample_fmt_is_planar
(
sample_fmt
)
?
nb_channels
:
1
;
*
audio_data
=
av_calloc
(
nb_planes
,
sizeof
(
*
audio_data
));
if
(
!*
audio_data
)
return
AVERROR
(
ENOMEM
);
ret
=
av_samples_alloc
(
*
audio_data
,
linesize
,
nb_channels
,
nb_samples
,
sample_fmt
,
align
);
if
(
ret
<
0
)
av_freep
(
audio_data
);
return
ret
;
}
int
av_samples_copy
(
uint8_t
**
dst
,
uint8_t
*
const
*
src
,
int
dst_offset
,
int
src_offset
,
int
nb_samples
,
int
nb_channels
,
enum
AVSampleFormat
sample_fmt
)
...
...
libavutil/samplefmt.h
View file @
5c73645d
...
...
@@ -209,10 +209,23 @@ int av_samples_fill_arrays(uint8_t **audio_data, int *linesize,
* @return >=0 on success or a negative error code on failure
* @todo return the size of the allocated buffer in case of success at the next bump
* @see av_samples_fill_arrays()
* @see av_samples_alloc_array_and_samples()
*/
int
av_samples_alloc
(
uint8_t
**
audio_data
,
int
*
linesize
,
int
nb_channels
,
int
nb_samples
,
enum
AVSampleFormat
sample_fmt
,
int
align
);
/**
* Allocate a data pointers array, samples buffer for nb_samples
* samples, and fill data pointers and linesize accordingly.
*
* This is the same as av_samples_alloc(), but also allocates the data
* pointers array.
*
* @see av_samples_alloc()
*/
int
av_samples_alloc_array_and_samples
(
uint8_t
***
audio_data
,
int
*
linesize
,
int
nb_channels
,
int
nb_samples
,
enum
AVSampleFormat
sample_fmt
,
int
align
);
/**
* Copy samples from src to dst.
*
...
...
libavutil/version.h
View file @
5c73645d
...
...
@@ -75,7 +75,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 52
#define LIBAVUTIL_VERSION_MINOR 2
3
#define LIBAVUTIL_VERSION_MINOR 2
4
#define LIBAVUTIL_VERSION_MICRO 100
#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