History

lavfi/buffersink: add accessors for the stream properties.

av_buffersink_get_frame_rate() did already exist; its argument becomes const.

Nicolas George committed 9 years ago

Commit dbe9dbe1 parent 0b66c454 files · +43 −9Browse files

Unified · Split

4 files
  1. doc/APIchanges +3 −0
  2. libavfilter/buffersink.c +19 −6
  3. libavfilter/buffersink.h +20 −2
  4. libavfilter/version.h +1 −1
doc/APIchanges+3−0
@@ -15,6 +15,9 @@ libavutil: 2015-08-28 · 14 unmodified lines
15 15
16API changes, most recent first:16API changes, most recent first:
17 17
182017-01-12 - xxxxxxx - lavfi 6.69.100- buffersink.h
19 Add av_buffersink_get_*() functions.
20
182017-01-06 - xxxxxxx - lavf 57.62.100- avio.h212017-01-06 - xxxxxxx - lavf 57.62.100- avio.h
19 Add avio_get_dyn_buf()22 Add avio_get_dyn_buf()
20 23
libavfilter/buffersink.c+19−6
@@ -279,14 +279,27 @@ void av_buffersink_set_frame_size(AVFilterContext *ctx, unsigned frame_size) · 278 unmodified lines
279 inlink->partial_buf_size = frame_size;279 inlink->partial_buf_size = frame_size;
280}280}
281 281
282AVRational av_buffersink_get_frame_rate(AVFilterContext *ctx)282#define MAKE_AVFILTERLINK_ACCESSOR(type, field) \
283{283type av_buffersink_get_##field(const AVFilterContext *ctx) { \
284 av_assert0( !strcmp(ctx->filter->name, "buffersink")284 av_assert0(ctx->filter->uninit == uninit); \
285 || !strcmp(ctx->filter->name, "ffbuffersink"));285 return ctx->inputs[0]->field; \
286
287 return ctx->inputs[0]->frame_rate;
288}286}
289 287
288MAKE_AVFILTERLINK_ACCESSOR(enum AVMediaType , type );
289MAKE_AVFILTERLINK_ACCESSOR(AVRational , time_base );
290MAKE_AVFILTERLINK_ACCESSOR(int , format );
291
292MAKE_AVFILTERLINK_ACCESSOR(AVRational , frame_rate );
293MAKE_AVFILTERLINK_ACCESSOR(int , w );
294MAKE_AVFILTERLINK_ACCESSOR(int , h );
295MAKE_AVFILTERLINK_ACCESSOR(AVRational , sample_aspect_ratio);
296
297MAKE_AVFILTERLINK_ACCESSOR(int , channels );
298MAKE_AVFILTERLINK_ACCESSOR(uint64_t , channel_layout );
299MAKE_AVFILTERLINK_ACCESSOR(int , sample_rate );
300
301MAKE_AVFILTERLINK_ACCESSOR(AVBufferRef * , hw_frames_ctx );
302
290static av_cold int vsink_init(AVFilterContext *ctx, void *opaque)303static av_cold int vsink_init(AVFilterContext *ctx, void *opaque)
291{304{
292 BufferSinkContext *buf = ctx->priv;305 BufferSinkContext *buf = ctx->priv;
libavfilter/buffersink.h+20−2
@@ -101,9 +101,27 @@ AVABufferSinkParams *av_abuffersink_params_alloc(void); · 100 unmodified lines
101void av_buffersink_set_frame_size(AVFilterContext *ctx, unsigned frame_size);101void av_buffersink_set_frame_size(AVFilterContext *ctx, unsigned frame_size);
102 102
103/**103/**
104 * Get the frame rate of the input.104 * @defgroup lavfi_buffersink_accessors Buffer sink accessors
105 * Get the properties of the stream
106 * @{
105 */107 */
106AVRational av_buffersink_get_frame_rate(AVFilterContext *ctx);108
109enum AVMediaType av_buffersink_get_type (const AVFilterContext *ctx);
110AVRational av_buffersink_get_time_base (const AVFilterContext *ctx);
111int av_buffersink_get_format (const AVFilterContext *ctx);
112
113AVRational av_buffersink_get_frame_rate (const AVFilterContext *ctx);
114int av_buffersink_get_w (const AVFilterContext *ctx);
115int av_buffersink_get_h (const AVFilterContext *ctx);
116AVRational av_buffersink_get_sample_aspect_ratio (const AVFilterContext *ctx);
117
118int av_buffersink_get_channels (const AVFilterContext *ctx);
119uint64_t av_buffersink_get_channel_layout (const AVFilterContext *ctx);
120int av_buffersink_get_sample_rate (const AVFilterContext *ctx);
121
122AVBufferRef * av_buffersink_get_hw_frames_ctx (const AVFilterContext *ctx);
123
124/** @} */
107 125
108/**126/**
109 * Get a frame with filtered data from sink and put it in frame.127 * Get a frame with filtered data from sink and put it in frame.
libavfilter/version.h+1−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
30#include "libavutil/version.h"30#include "libavutil/version.h"
31 31
32#define LIBAVFILTER_VERSION_MAJOR 632#define LIBAVFILTER_VERSION_MAJOR 6
33#define LIBAVFILTER_VERSION_MINOR 6833#define LIBAVFILTER_VERSION_MINOR 69
34#define LIBAVFILTER_VERSION_MICRO 10034#define LIBAVFILTER_VERSION_MICRO 100
35 35
36#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \36#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