Showing the changes to doc/examples/decoding_encoding.c (1 of 1 file). Show all
Unified · Split
| @@ -116,7 +116,7 @@ static void audio_encode_example(const char *filename) · 115 unmodified lines | ||
| 116 | 116 | /* find the MP2 encoder */ |
| 117 | 117 | codec = avcodec_find_encoder(AV_CODEC_ID_MP2); |
| 118 | 118 | if (!codec) { |
| 119 | − fprintf(stderr, "codec not found\n"); | |
| 119 | + fprintf(stderr, "Codec not found\n"); | |
| 120 | 120 | exit(1); |
| 121 | 121 | } |
| 122 | 122 | |
| @@ -128,7 +128,7 @@ static void audio_encode_example(const char *filename) · 5 unmodified lines | ||
| 128 | 128 | /* check that the encoder supports s16 pcm input */ |
| 129 | 129 | c->sample_fmt = AV_SAMPLE_FMT_S16; |
| 130 | 130 | if (!check_sample_fmt(codec, c->sample_fmt)) { |
| 131 | − fprintf(stderr, "encoder does not support %s", | |
| 131 | + fprintf(stderr, "Encoder does not support sample format %s", | |
| 132 | 132 | av_get_sample_fmt_name(c->sample_fmt)); |
| 133 | 133 | exit(1); |
| 134 | 134 | } |
| @@ -140,20 +140,20 @@ static void audio_encode_example(const char *filename) · 5 unmodified lines | ||
| 140 | 140 | |
| 141 | 141 | /* open it */ |
| 142 | 142 | if (avcodec_open2(c, codec, NULL) < 0) { |
| 143 | − fprintf(stderr, "could not open codec\n"); | |
| 143 | + fprintf(stderr, "Could not open codec\n"); | |
| 144 | 144 | exit(1); |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | f = fopen(filename, "wb"); |
| 148 | 148 | if (!f) { |
| 149 | − fprintf(stderr, "could not open %s\n", filename); | |
| 149 | + fprintf(stderr, "Could not open %s\n", filename); | |
| 150 | 150 | exit(1); |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | /* frame containing input raw audio */ |
| 154 | 154 | frame = avcodec_alloc_frame(); |
| 155 | 155 | if (!frame) { |
| 156 | − fprintf(stderr, "could not allocate audio frame\n"); | |
| 156 | + fprintf(stderr, "Could not allocate audio frame\n"); | |
| 157 | 157 | exit(1); |
| 158 | 158 | } |
| 159 | 159 | |
| @@ -167,7 +167,7 @@ static void audio_encode_example(const char *filename) · 7 unmodified lines | ||
| 167 | 167 | c->sample_fmt, 0); |
| 168 | 168 | samples = av_malloc(buffer_size); |
| 169 | 169 | if (!samples) { |
| 170 | − fprintf(stderr, "could not allocate %d bytes for samples buffer\n", | |
| 170 | + fprintf(stderr, "Could not allocate %d bytes for samples buffer\n", | |
| 171 | 171 | buffer_size); |
| 172 | 172 | exit(1); |
| 173 | 173 | } |
| @@ -175,7 +175,7 @@ static void audio_encode_example(const char *filename) · 1 unmodified line | ||
| 175 | 175 | ret = avcodec_fill_audio_frame(frame, c->channels, c->sample_fmt, |
| 176 | 176 | (const uint8_t*)samples, buffer_size, 0); |
| 177 | 177 | if (ret < 0) { |
| 178 | − fprintf(stderr, "could not setup audio frame\n"); | |
| 178 | + fprintf(stderr, "Could not setup audio frame\n"); | |
| 179 | 179 | exit(1); |
| 180 | 180 | } |
| 181 | 181 | |
| @@ -197,7 +197,7 @@ static void audio_encode_example(const char *filename) · 15 unmodified lines | ||
| 197 | 197 | /* encode the samples */ |
| 198 | 198 | ret = avcodec_encode_audio2(c, &pkt, frame, &got_output); |
| 199 | 199 | if (ret < 0) { |
| 200 | − fprintf(stderr, "error encoding audio frame\n"); | |
| 200 | + fprintf(stderr, "Error encoding audio frame\n"); | |
| 201 | 201 | exit(1); |
| 202 | 202 | } |
| 203 | 203 | if (got_output) { |
| @@ -210,7 +210,7 @@ static void audio_encode_example(const char *filename) · 6 unmodified lines | ||
| 210 | 210 | for (got_output = 1; got_output; i++) { |
| 211 | 211 | ret = avcodec_encode_audio2(c, &pkt, NULL, &got_output); |
| 212 | 212 | if (ret < 0) { |
| 213 | − fprintf(stderr, "error encoding frame\n"); | |
| 213 | + fprintf(stderr, "Error encoding frame\n"); | |
| 214 | 214 | exit(1); |
| 215 | 215 | } |
| 216 | 216 | |
| @@ -247,7 +247,7 @@ static void audio_decode_example(const char *outfilename, const char *filename) · 30 unmodified lines | ||
| 247 | 247 | /* find the mpeg audio decoder */ |
| 248 | 248 | codec = avcodec_find_decoder(AV_CODEC_ID_MP2); |
| 249 | 249 | if (!codec) { |
| 250 | − fprintf(stderr, "codec not found\n"); | |
| 250 | + fprintf(stderr, "Codec not found\n"); | |
| 251 | 251 | exit(1); |
| 252 | 252 | } |
| 253 | 253 | |
| @@ -255,13 +255,13 @@ static void audio_decode_example(const char *outfilename, const char *filename) · 1 unmodified line | ||
| 255 | 255 | |
| 256 | 256 | /* open it */ |
| 257 | 257 | if (avcodec_open2(c, codec, NULL) < 0) { |
| 258 | − fprintf(stderr, "could not open codec\n"); | |
| 258 | + fprintf(stderr, "Could not open codec\n"); | |
| 259 | 259 | exit(1); |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | f = fopen(filename, "rb"); |
| 263 | 263 | if (!f) { |
| 264 | − fprintf(stderr, "could not open %s\n", filename); | |
| 264 | + fprintf(stderr, "Could not open %s\n", filename); | |
| 265 | 265 | exit(1); |
| 266 | 266 | } |
| 267 | 267 | outfile = fopen(outfilename, "wb"); |
| @@ -279,7 +279,7 @@ static void audio_decode_example(const char *outfilename, const char *filename) · 11 unmodified lines | ||
| 279 | 279 | |
| 280 | 280 | if (!decoded_frame) { |
| 281 | 281 | if (!(decoded_frame = avcodec_alloc_frame())) { |
| 282 | − fprintf(stderr, "out of memory\n"); | |
| 282 | + fprintf(stderr, "Could not allocate audio frame\n"); | |
| 283 | 283 | exit(1); |
| 284 | 284 | } |
| 285 | 285 | } else |
| @@ -341,7 +341,7 @@ static void video_encode_example(const char *filename, int codec_id) · 55 unmodified lines | ||
| 341 | 341 | /* find the mpeg1 video encoder */ |
| 342 | 342 | codec = avcodec_find_encoder(codec_id); |
| 343 | 343 | if (!codec) { |
| 344 | − fprintf(stderr, "codec not found\n"); | |
| 344 | + fprintf(stderr, "Codec not found\n"); | |
| 345 | 345 | exit(1); |
| 346 | 346 | } |
| 347 | 347 | |
| @@ -363,13 +363,13 @@ static void video_encode_example(const char *filename, int codec_id) · 15 unmodified lines | ||
| 363 | 363 | |
| 364 | 364 | /* open it */ |
| 365 | 365 | if (avcodec_open2(c, codec, NULL) < 0) { |
| 366 | − fprintf(stderr, "could not open codec\n"); | |
| 366 | + fprintf(stderr, "Could not open codec\n"); | |
| 367 | 367 | exit(1); |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | f = fopen(filename, "wb"); |
| 371 | 371 | if (!f) { |
| 372 | − fprintf(stderr, "could not open %s\n", filename); | |
| 372 | + fprintf(stderr, "Could not open %s\n", filename); | |
| 373 | 373 | exit(1); |
| 374 | 374 | } |
| 375 | 375 | |
| @@ -387,7 +387,7 @@ static void video_encode_example(const char *filename, int codec_id) · 11 unmodified lines | ||
| 387 | 387 | ret = av_image_alloc(picture->data, picture->linesize, c->width, c->height, |
| 388 | 388 | c->pix_fmt, 32); |
| 389 | 389 | if (ret < 0) { |
| 390 | − fprintf(stderr, "could not alloc raw picture buffer\n"); | |
| 390 | + fprintf(stderr, "Could not allocate raw picture buffer\n"); | |
| 391 | 391 | exit(1); |
| 392 | 392 | } |
| 393 | 393 | |
| @@ -419,12 +419,12 @@ static void video_encode_example(const char *filename, int codec_id) · 25 unmodified lines | ||
| 419 | 419 | /* encode the image */ |
| 420 | 420 | ret = avcodec_encode_video2(c, &pkt, picture, &got_output); |
| 421 | 421 | if (ret < 0) { |
| 422 | − fprintf(stderr, "error encoding frame\n"); | |
| 422 | + fprintf(stderr, "Error encoding frame\n"); | |
| 423 | 423 | exit(1); |
| 424 | 424 | } |
| 425 | 425 | |
| 426 | 426 | if (got_output) { |
| 427 | − printf("encoding frame %3d (size=%5d)\n", i, pkt.size); | |
| 427 | + printf("Write frame %3d (size=%5d)\n", i, pkt.size); | |
| 428 | 428 | fwrite(pkt.data, 1, pkt.size, f); |
| 429 | 429 | av_free_packet(&pkt); |
| 430 | 430 | } |
| @@ -436,12 +436,12 @@ static void video_encode_example(const char *filename, int codec_id) · 5 unmodified lines | ||
| 436 | 436 | |
| 437 | 437 | ret = avcodec_encode_video2(c, &pkt, NULL, &got_output); |
| 438 | 438 | if (ret < 0) { |
| 439 | − fprintf(stderr, "error encoding frame\n"); | |
| 439 | + fprintf(stderr, "Error encoding frame\n"); | |
| 440 | 440 | exit(1); |
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | if (got_output) { |
| 444 | − printf("write frame %3d (size=%5d)\n", i, pkt.size); | |
| 444 | + printf("Write frame %3d (size=%5d)\n", i, pkt.size); | |
| 445 | 445 | fwrite(pkt.data, 1, pkt.size, f); |
| 446 | 446 | av_free_packet(&pkt); |
| 447 | 447 | } |
| @@ -496,7 +496,7 @@ static void video_decode_example(const char *outfilename, const char *filename) · 48 unmodified lines | ||
| 496 | 496 | /* find the mpeg1 video decoder */ |
| 497 | 497 | codec = avcodec_find_decoder(AV_CODEC_ID_MPEG1VIDEO); |
| 498 | 498 | if (!codec) { |
| 499 | − fprintf(stderr, "codec not found\n"); | |
| 499 | + fprintf(stderr, "Codec not found\n"); | |
| 500 | 500 | exit(1); |
| 501 | 501 | } |
| 502 | 502 | |
| @@ -510,7 +510,7 @@ static void video_decode_example(const char *outfilename, const char *filename) · 7 unmodified lines | ||
| 510 | 510 | |
| 511 | 511 | /* open it */ |
| 512 | 512 | if (avcodec_open2(c, codec, NULL) < 0) { |
| 513 | − fprintf(stderr, "could not open codec\n"); | |
| 513 | + fprintf(stderr, "Could not open codec\n"); | |
| 514 | 514 | exit(1); |
| 515 | 515 | } |
| 516 | 516 | |
| @@ -518,7 +518,7 @@ static void video_decode_example(const char *outfilename, const char *filename) · 1 unmodified line | ||
| 518 | 518 | |
| 519 | 519 | f = fopen(filename, "rb"); |
| 520 | 520 | if (!f) { |
| 521 | − fprintf(stderr, "could not open %s\n", filename); | |
| 521 | + fprintf(stderr, "Could not open %s\n", filename); | |
| 522 | 522 | exit(1); |
| 523 | 523 | } |
| 524 | 524 | |
| @@ -557,7 +557,7 @@ static void video_decode_example(const char *outfilename, const char *filename) · 32 unmodified lines | ||
| 557 | 557 | exit(1); |
| 558 | 558 | } |
| 559 | 559 | if (got_picture) { |
| 560 | − printf("saving frame %3d\n", frame); | |
| 560 | + printf("Saving frame %3d\n", frame); | |
| 561 | 561 | fflush(stdout); |
| 562 | 562 | |
| 563 | 563 | /* the picture is allocated by the decoder. no need to |
| @@ -579,7 +579,7 @@ static void video_decode_example(const char *outfilename, const char *filename) · 15 unmodified lines | ||
| 579 | 579 | avpkt.size = 0; |
| 580 | 580 | len = avcodec_decode_video2(c, picture, &got_picture, &avpkt); |
| 581 | 581 | if (got_picture) { |
| 582 | − printf("saving last frame %3d\n", frame); | |
| 582 | + printf("Saving last frame %3d\n", frame); | |
| 583 | 583 | fflush(stdout); |
| 584 | 584 | |
| 585 | 585 | /* the picture is allocated by the decoder. no need to |