History

lavfi/abuffersink: add sample_rates field to AVABufferSinkParams

Allow to select sample rates.

Stefano Sabatini committed 13 years ago

Commit b59cd081 parent 5085b464 files · +19 −1Browse files

Unified · Split

4 files
  1. doc/APIchanges +3 −0
  2. libavfilter/buffersink.h +1 −0
  3. libavfilter/sink_buffer.c +14 −0
  4. libavfilter/version.h +1 −1
doc/APIchanges+3−0
@@ -15,6 +15,9 @@ libavutil: 2012-10-22 · 14 unmodified lines
15 15
16API changes, most recent first:16API changes, most recent first:
17 17
182013-02-24 - xxxxxx - lavfi 3.41.100 - buffersink.h
19 Add sample_rates field to AVABufferSinkParams.
20
182013-01-17 - a1a707f - lavf 54.61.100212013-01-17 - a1a707f - lavf 54.61.100
19 Add av_codec_get_tag2().22 Add av_codec_get_tag2().
20 23
libavfilter/buffersink.h+1−0
@@ -48,6 +48,7 @@ typedef struct { · 47 unmodified lines
48 const int64_t *channel_layouts; ///< list of allowed channel layouts, terminated by -148 const int64_t *channel_layouts; ///< list of allowed channel layouts, terminated by -1
49 const int *channel_counts; ///< list of allowed channel counts, terminated by -149 const int *channel_counts; ///< list of allowed channel counts, terminated by -1
50 int all_channel_counts; ///< if not 0, accept any channel count or layout50 int all_channel_counts; ///< if not 0, accept any channel count or layout
51 int *sample_rates; ///< list of allowed sample rates, terminated by -1
51} AVABufferSinkParams;52} AVABufferSinkParams;
52 53
53/**54/**
libavfilter/sink_buffer.c+14−0
@@ -62,6 +62,7 @@ typedef struct { · 61 unmodified lines
62 enum AVSampleFormat *sample_fmts; ///< list of accepted sample formats, terminated by AV_SAMPLE_FMT_NONE62 enum AVSampleFormat *sample_fmts; ///< list of accepted sample formats, terminated by AV_SAMPLE_FMT_NONE
63 int64_t *channel_layouts; ///< list of accepted channel layouts, terminated by -163 int64_t *channel_layouts; ///< list of accepted channel layouts, terminated by -1
64 int all_channel_counts;64 int all_channel_counts;
65 int *sample_rates; ///< list of accepted sample rates, terminated by -1
65} BufferSinkContext;66} BufferSinkContext;
66 67
67#define FIFO_INIT_SIZE 868#define FIFO_INIT_SIZE 8
@@ -303,6 +304,11 @@ static av_cold int asink_init(AVFilterContext *ctx, const char *args, void *opaq · 235 unmodified lines
303 if (!buf->sample_fmts)304 if (!buf->sample_fmts)
304 return AVERROR(ENOMEM);305 return AVERROR(ENOMEM);
305 }306 }
307 if (params && params->sample_rates) {
308 buf->sample_rates = ff_copy_int_list(params->sample_rates);
309 if (!buf->sample_rates)
310 return AVERROR(ENOMEM);
311 }
306 if (params && (params->channel_layouts || params->channel_counts)) {312 if (params && (params->channel_layouts || params->channel_counts)) {
307 if (params->all_channel_counts) {313 if (params->all_channel_counts) {
308 av_log(ctx, AV_LOG_ERROR,314 av_log(ctx, AV_LOG_ERROR,
@@ -324,6 +330,7 @@ static av_cold void asink_uninit(AVFilterContext *ctx) · 15 unmodified lines
324 BufferSinkContext *buf = ctx->priv;330 BufferSinkContext *buf = ctx->priv;
325 331
326 av_freep(&buf->sample_fmts);332 av_freep(&buf->sample_fmts);
333 av_freep(&buf->sample_rates);
327 av_freep(&buf->channel_layouts);334 av_freep(&buf->channel_layouts);
328 common_uninit(ctx);335 common_uninit(ctx);
329}336}
@@ -348,6 +355,13 @@ static int asink_query_formats(AVFilterContext *ctx) · 18 unmodified lines
348 ff_set_common_channel_layouts(ctx, layouts);355 ff_set_common_channel_layouts(ctx, layouts);
349 }356 }
350 357
358 if (buf->sample_rates) {
359 formats = ff_make_format_list(buf->sample_rates);
360 if (!formats)
361 return AVERROR(ENOMEM);
362 ff_set_common_samplerates(ctx, formats);
363 }
364
351 return 0;365 return 0;
352}366}
353 367
libavfilter/version.h+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
29#include "libavutil/avutil.h"29#include "libavutil/avutil.h"
30 30
31#define LIBAVFILTER_VERSION_MAJOR 331#define LIBAVFILTER_VERSION_MAJOR 3
32#define LIBAVFILTER_VERSION_MINOR 4032#define LIBAVFILTER_VERSION_MINOR 41
33#define LIBAVFILTER_VERSION_MICRO 10033#define LIBAVFILTER_VERSION_MICRO 100
34 34
35#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \35#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t