History

lavfi: prefer nb_samples over size in AVFilterBufferRefAudioProps

Remove AVFilterBufferRefAudioProps.size, and use nb_samples in avfilter_get_audio_buffer() and avfilter_default_get_audio_buffer() in place of size. This is required as the size in the audio buffer may be aligned, so it may not contain a well defined number of samples.

Stefano Sabatini committed 15 years ago

Commit 95a02421 parent 0bc2cca4 files · +24 −20Browse files

Showing the changes to libavfilter/avfilter.h (1 of 4 files). Show all

Unified · Split

libavfilter/avfilter.h+6−7
@@ -26,7 +26,7 @@ · 25 unmodified lines
26#include "libavutil/samplefmt.h"26#include "libavutil/samplefmt.h"
27 27
28#define LIBAVFILTER_VERSION_MAJOR 228#define LIBAVFILTER_VERSION_MAJOR 2
29#define LIBAVFILTER_VERSION_MINOR 1329#define LIBAVFILTER_VERSION_MINOR 14
30#define LIBAVFILTER_VERSION_MICRO 030#define LIBAVFILTER_VERSION_MICRO 0
31 31
32#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \32#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
@@ -98,8 +98,7 @@ typedef struct AVFilterBuffer { · 65 unmodified lines
98 */98 */
99typedef struct AVFilterBufferRefAudioProps {99typedef struct AVFilterBufferRefAudioProps {
100 int64_t channel_layout; ///< channel layout of audio buffer100 int64_t channel_layout; ///< channel layout of audio buffer
101 int nb_samples; ///< number of audio samples101 int nb_samples; ///< number of audio samples per channel
102 int size; ///< audio buffer size
103 uint32_t sample_rate; ///< audio buffer sample rate102 uint32_t sample_rate; ///< audio buffer sample rate
104 int planar; ///< audio buffer - planar or packed103 int planar; ///< audio buffer - planar or packed
105} AVFilterBufferRefAudioProps;104} AVFilterBufferRefAudioProps;
@@ -372,7 +371,7 @@ struct AVFilterPad { · 266 unmodified lines
372 * Input audio pads only.371 * Input audio pads only.
373 */372 */
374 AVFilterBufferRef *(*get_audio_buffer)(AVFilterLink *link, int perms,373 AVFilterBufferRef *(*get_audio_buffer)(AVFilterLink *link, int perms,
375 enum AVSampleFormat sample_fmt, int size,374 enum AVSampleFormat sample_fmt, int nb_samples,
376 int64_t channel_layout, int planar);375 int64_t channel_layout, int planar);
377 376
378 /**377 /**
@@ -461,7 +460,7 @@ AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, · 82 unmodified lines
461 460
462/** default handler for get_audio_buffer() for audio inputs */461/** default handler for get_audio_buffer() for audio inputs */
463AVFilterBufferRef *avfilter_default_get_audio_buffer(AVFilterLink *link, int perms,462AVFilterBufferRef *avfilter_default_get_audio_buffer(AVFilterLink *link, int perms,
464 enum AVSampleFormat sample_fmt, int size,463 enum AVSampleFormat sample_fmt, int nb_samples,
465 int64_t channel_layout, int planar);464 int64_t channel_layout, int planar);
466 465
467/**466/**
@@ -684,14 +683,14 @@ avfilter_get_video_buffer_ref_from_arrays(uint8_t * const data[4], const int lin · 216 unmodified lines
684 * be requested683 * be requested
685 * @param perms the required access permissions684 * @param perms the required access permissions
686 * @param sample_fmt the format of each sample in the buffer to allocate685 * @param sample_fmt the format of each sample in the buffer to allocate
687 * @param size the buffer size in bytes686 * @param nb_samples the number of samples per channel
688 * @param channel_layout the number and type of channels per sample in the buffer to allocate687 * @param channel_layout the number and type of channels per sample in the buffer to allocate
689 * @param planar audio data layout - planar or packed688 * @param planar audio data layout - planar or packed
690 * @return A reference to the samples. This must be unreferenced with689 * @return A reference to the samples. This must be unreferenced with
691 * avfilter_unref_buffer when you are finished with it.690 * avfilter_unref_buffer when you are finished with it.
692 */691 */
693AVFilterBufferRef *avfilter_get_audio_buffer(AVFilterLink *link, int perms,692AVFilterBufferRef *avfilter_get_audio_buffer(AVFilterLink *link, int perms,
694 enum AVSampleFormat sample_fmt, int size,693 enum AVSampleFormat sample_fmt, int nb_samples,
695 int64_t channel_layout, int planar);694 int64_t channel_layout, int planar);
696 695
697/**696/**

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