Revision e98b8e2f libavcore/samplefmt.h

View differences:

libavcore/samplefmt.h
69 69
 */
70 70
int av_get_bits_per_sample_fmt(enum AVSampleFormat sample_fmt);
71 71

  
72
/**
73
 * Fill channel data pointers and linesizes for samples with sample
74
 * format sample_fmt.
75
 *
76
 * The pointers array is filled with the pointers to the samples data:
77
 * data[c] points to the first sample of channel c.
78
 * data[c] + linesize[0] points to the second sample of channel c
79
 *
80
 * @param pointers array to be filled with the pointer for each plane, may be NULL
81
 * @param linesizes array to be filled with the linesize, may be NULL
82
 * @param buf the pointer to a buffer containing the samples
83
 * @param nb_samples the number of samples in a single channel
84
 * @param planar 1 if the samples layout is planar, 0 if it is packed
85
 * @param nb_channels the number of channels
86
 * @return the total size of the buffer, a negative
87
 * error code in case of failure
88
 */
89
int av_samples_fill_arrays(uint8_t *pointers[8], int linesizes[8],
90
                           uint8_t *buf, int nb_channels, int nb_samples,
91
                           enum AVSampleFormat sample_fmt, int planar, int align);
92

  
93
/**
94
 * Allocate a samples buffer for nb_samples samples, and
95
 * fill pointers and linesizes accordingly.
96
 * The allocated samples buffer has to be freed by using
97
 * av_freep(&pointers[0]).
98
 *
99
 * @param nb_samples number of samples per channel
100
 * @param planar 1 if the samples layout is planar, 0 if packed,
101
 * @param align the value to use for buffer size alignment
102
 * @return the size in bytes required for the samples buffer, a negative
103
 * error code in case of failure
104
 * @see av_samples_fill_arrays()
105
 */
106
int av_samples_alloc(uint8_t *pointers[8], int linesizes[8],
107
                     int nb_samples, int nb_channels,
108
                     enum AVSampleFormat sample_fmt, int planar,
109
                     int align);
110

  
72 111
#endif /* AVCORE_SAMPLEFMT_H */

Also available in: Unified diff