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
2626 #include "libavutil/samplefmt.h"
2727
2828 #define LIBAVFILTER_VERSION_MAJOR 2
29−#define LIBAVFILTER_VERSION_MINOR 13
29+#define LIBAVFILTER_VERSION_MINOR 14
3030 #define LIBAVFILTER_VERSION_MICRO 0
3131
3232 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
@@ -98,8 +98,7 @@ typedef struct AVFilterBuffer { · 65 unmodified lines
9898 */
9999 typedef struct AVFilterBufferRefAudioProps {
100100 int64_t channel_layout; ///< channel layout of audio buffer
101− int nb_samples; ///< number of audio samples
102− int size; ///< audio buffer size
101+ int nb_samples; ///< number of audio samples per channel
103102 uint32_t sample_rate; ///< audio buffer sample rate
104103 int planar; ///< audio buffer - planar or packed
105104 } AVFilterBufferRefAudioProps;
@@ -372,7 +371,7 @@ struct AVFilterPad { · 266 unmodified lines
372371 * Input audio pads only.
373372 */
374373 AVFilterBufferRef *(*get_audio_buffer)(AVFilterLink *link, int perms,
375− enum AVSampleFormat sample_fmt, int size,
374+ enum AVSampleFormat sample_fmt, int nb_samples,
376375 int64_t channel_layout, int planar);
377376
378377 /**
@@ -461,7 +460,7 @@ AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, · 82 unmodified lines
461460
462461 /** default handler for get_audio_buffer() for audio inputs */
463462 AVFilterBufferRef *avfilter_default_get_audio_buffer(AVFilterLink *link, int perms,
464− enum AVSampleFormat sample_fmt, int size,
463+ enum AVSampleFormat sample_fmt, int nb_samples,
465464 int64_t channel_layout, int planar);
466465
467466 /**
@@ -684,14 +683,14 @@ avfilter_get_video_buffer_ref_from_arrays(uint8_t * const data[4], const int lin · 216 unmodified lines
684683 * be requested
685684 * @param perms the required access permissions
686685 * @param sample_fmt the format of each sample in the buffer to allocate
687− * @param size the buffer size in bytes
686+ * @param nb_samples the number of samples per channel
688687 * @param channel_layout the number and type of channels per sample in the buffer to allocate
689688 * @param planar audio data layout - planar or packed
690689 * @return A reference to the samples. This must be unreferenced with
691690 * avfilter_unref_buffer when you are finished with it.
692691 */
693692 AVFilterBufferRef *avfilter_get_audio_buffer(AVFilterLink *link, int perms,
694− enum AVSampleFormat sample_fmt, int size,
693+ enum AVSampleFormat sample_fmt, int nb_samples,
695694 int64_t channel_layout, int planar);
696695
697696 /**

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