56 #define INPUT_SAMPLERATE 48000
57 #define INPUT_FORMAT AV_SAMPLE_FMT_FLTP
58 #define INPUT_CHANNEL_LAYOUT AV_CH_LAYOUT_5POINT0
60 #define VOLUME_VAL 0.90
84 fprintf(stderr,
"Unable to create filter graph.\n");
92 fprintf(stderr,
"Could not find the abuffer filter.\n");
98 fprintf(stderr,
"Could not allocate the abuffer instance.\n");
113 fprintf(stderr,
"Could not initialize the abuffer filter.\n");
120 fprintf(stderr,
"Could not find the volume filter.\n");
126 fprintf(stderr,
"Could not allocate the volume instance.\n");
136 fprintf(stderr,
"Could not initialize the volume filter.\n");
144 fprintf(stderr,
"Could not find the aformat filter.\n");
150 fprintf(stderr,
"Could not allocate the aformat instance.\n");
156 snprintf(options_str,
sizeof(options_str),
157 "sample_fmts=%s:sample_rates=%d:channel_layouts=0x%"PRIx64,
170 fprintf(stderr,
"Could not find the abuffersink filter.\n");
175 if (!abuffersink_ctx) {
176 fprintf(stderr,
"Could not allocate the abuffersink instance.\n");
183 fprintf(stderr,
"Could not initialize the abuffersink instance.\n");
195 fprintf(stderr,
"Error connecting filters\n");
208 *sink = abuffersink_ctx;
219 int planes = planar ? channels : 1;
221 int plane_size = bps * frame->
nb_samples * (planar ? 1 : channels);
224 for (i = 0; i < planes; i++) {
230 fprintf(stdout,
"plane %d: 0x", i);
231 for (j = 0; j <
sizeof(checksum); j++)
232 fprintf(stdout,
"%02X", checksum[j]);
233 fprintf(stdout,
"\n");
235 fprintf(stdout,
"\n");
246 #define FRAME_SIZE 1024
260 for (i = 0; i < 5; i++) {
264 data[j] = sin(2 *
M_PI * (frame_num + j) * (i + 1) / FRAME_SIZE);
270 int main(
int argc,
char *argv[])
278 int err, nb_frames, i;
281 fprintf(stderr,
"Usage: %s <duration>\n", argv[0]);
285 duration = atof(argv[1]);
287 if (nb_frames <= 0) {
288 fprintf(stderr,
"Invalid duration: %s\n", argv[1]);
297 fprintf(stderr,
"Error allocating the frame\n");
303 fprintf(stderr,
"Error allocating the MD5 context\n");
310 fprintf(stderr,
"Unable to init filter graph:");
315 for (i = 0; i < nb_frames; i++) {
319 fprintf(stderr,
"Error generating input frame:");
327 fprintf(stderr,
"Error submitting the frame to the filtergraph:");
336 fprintf(stderr,
"Error processing the filtered frame:");
348 }
else if (err < 0) {
350 fprintf(stderr,
"Error filtering the data:");
363 fprintf(stderr,
"%s\n", errstr);