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
b59cd089
Commit
b59cd089
authored
Feb 03, 2013
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/abuffersink: add sample_rates field to AVABufferSinkParams
Allow to select sample rates.
parent
5085b464
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
1 deletion
+19
-1
APIchanges
doc/APIchanges
+3
-0
buffersink.h
libavfilter/buffersink.h
+1
-0
sink_buffer.c
libavfilter/sink_buffer.c
+14
-0
version.h
libavfilter/version.h
+1
-1
No files found.
doc/APIchanges
View file @
b59cd089
...
...
@@ -15,6 +15,9 @@ libavutil: 2012-10-22
API changes, most recent first:
2013-02-24 - xxxxxx - lavfi 3.41.100 - buffersink.h
Add sample_rates field to AVABufferSinkParams.
2013-01-17 - a1a707f - lavf 54.61.100
Add av_codec_get_tag2().
...
...
libavfilter/buffersink.h
View file @
b59cd089
...
...
@@ -48,6 +48,7 @@ typedef struct {
const
int64_t
*
channel_layouts
;
///< list of allowed channel layouts, terminated by -1
const
int
*
channel_counts
;
///< list of allowed channel counts, terminated by -1
int
all_channel_counts
;
///< if not 0, accept any channel count or layout
int
*
sample_rates
;
///< list of allowed sample rates, terminated by -1
}
AVABufferSinkParams
;
/**
...
...
libavfilter/sink_buffer.c
View file @
b59cd089
...
...
@@ -62,6 +62,7 @@ typedef struct {
enum
AVSampleFormat
*
sample_fmts
;
///< list of accepted sample formats, terminated by AV_SAMPLE_FMT_NONE
int64_t
*
channel_layouts
;
///< list of accepted channel layouts, terminated by -1
int
all_channel_counts
;
int
*
sample_rates
;
///< list of accepted sample rates, terminated by -1
}
BufferSinkContext
;
#define FIFO_INIT_SIZE 8
...
...
@@ -303,6 +304,11 @@ static av_cold int asink_init(AVFilterContext *ctx, const char *args, void *opaq
if
(
!
buf
->
sample_fmts
)
return
AVERROR
(
ENOMEM
);
}
if
(
params
&&
params
->
sample_rates
)
{
buf
->
sample_rates
=
ff_copy_int_list
(
params
->
sample_rates
);
if
(
!
buf
->
sample_rates
)
return
AVERROR
(
ENOMEM
);
}
if
(
params
&&
(
params
->
channel_layouts
||
params
->
channel_counts
))
{
if
(
params
->
all_channel_counts
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
...
...
@@ -324,6 +330,7 @@ static av_cold void asink_uninit(AVFilterContext *ctx)
BufferSinkContext
*
buf
=
ctx
->
priv
;
av_freep
(
&
buf
->
sample_fmts
);
av_freep
(
&
buf
->
sample_rates
);
av_freep
(
&
buf
->
channel_layouts
);
common_uninit
(
ctx
);
}
...
...
@@ -348,6 +355,13 @@ static int asink_query_formats(AVFilterContext *ctx)
ff_set_common_channel_layouts
(
ctx
,
layouts
);
}
if
(
buf
->
sample_rates
)
{
formats
=
ff_make_format_list
(
buf
->
sample_rates
);
if
(
!
formats
)
return
AVERROR
(
ENOMEM
);
ff_set_common_samplerates
(
ctx
,
formats
);
}
return
0
;
}
...
...
libavfilter/version.h
View file @
b59cd089
...
...
@@ -29,7 +29,7 @@
#include "libavutil/avutil.h"
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR 4
0
#define LIBAVFILTER_VERSION_MINOR 4
1
#define LIBAVFILTER_VERSION_MICRO 100
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_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