55 #define INPUT_SAMPLERATE 48000
56 #define INPUT_FORMAT AV_SAMPLE_FMT_FLTP
57 #define INPUT_CHANNEL_LAYOUT AV_CH_LAYOUT_5POINT0
59 #define VOLUME_VAL 0.90
83 fprintf(stderr,
"Unable to create filter graph.\n");
91 fprintf(stderr,
"Could not find the abuffer filter.\n");
97 fprintf(stderr,
"Could not allocate the abuffer instance.\n");
112 fprintf(stderr,
"Could not initialize the abuffer filter.\n");
119 fprintf(stderr,
"Could not find the volume filter.\n");
125 fprintf(stderr,
"Could not allocate the volume instance.\n");
135 fprintf(stderr,
"Could not initialize the volume filter.\n");
143 fprintf(stderr,
"Could not find the aformat filter.\n");
149 fprintf(stderr,
"Could not allocate the aformat instance.\n");
155 snprintf(options_str,
sizeof(options_str),
156 "sample_fmts=%s:sample_rates=%d:channel_layouts=0x%"PRIx64,
169 fprintf(stderr,
"Could not find the abuffersink filter.\n");
174 if (!abuffersink_ctx) {
175 fprintf(stderr,
"Could not allocate the abuffersink instance.\n");
182 fprintf(stderr,
"Could not initialize the abuffersink instance.\n");
194 fprintf(stderr,
"Error connecting filters\n");
207 *sink = abuffersink_ctx;
218 int planes = planar ? channels : 1;
220 int plane_size = bps * frame->
nb_samples * (planar ? 1 : channels);
223 for (i = 0; i < planes; i++) {
229 fprintf(stdout,
"plane %d: 0x", i);
230 for (j = 0; j <
sizeof(checksum); j++)
231 fprintf(stdout,
"%02X", checksum[j]);
232 fprintf(stdout,
"\n");
234 fprintf(stdout,
"\n");
245 #define FRAME_SIZE 1024
259 for (i = 0; i < 5; i++) {
263 data[j] = sin(2 *
M_PI * (frame_num + j) * (i + 1) / FRAME_SIZE);
269 int main(
int argc,
char *argv[])
277 int err, nb_frames, i;
280 fprintf(stderr,
"Usage: %s <duration>\n", argv[0]);
284 duration = atof(argv[1]);
286 if (nb_frames <= 0) {
287 fprintf(stderr,
"Invalid duration: %s\n", argv[1]);
296 fprintf(stderr,
"Error allocating the frame\n");
302 fprintf(stderr,
"Error allocating the MD5 context\n");
309 fprintf(stderr,
"Unable to init filter graph:");
314 for (i = 0; i < nb_frames; i++) {
318 fprintf(stderr,
"Error generating input frame:");
326 fprintf(stderr,
"Error submitting the frame to the filtergraph:");
335 fprintf(stderr,
"Error processing the filtered frame:");
347 }
else if (err < 0) {
349 fprintf(stderr,
"Error filtering the data:");
362 fprintf(stderr,
"%s\n", errstr);