| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 127 |
| 128 if (vpx_codec_dec_init(&codec, decoder->interface(), NULL, 0)) | 128 if (vpx_codec_dec_init(&codec, decoder->interface(), NULL, 0)) |
| 129 die_codec(&codec, "Failed to initialize decoder."); | 129 die_codec(&codec, "Failed to initialize decoder."); |
| 130 | 130 |
| 131 while (vpx_video_reader_read_frame(reader)) { | 131 while (vpx_video_reader_read_frame(reader)) { |
| 132 vpx_codec_iter_t iter = NULL; | 132 vpx_codec_iter_t iter = NULL; |
| 133 vpx_image_t *img = NULL; | 133 vpx_image_t *img = NULL; |
| 134 size_t frame_size = 0; | 134 size_t frame_size = 0; |
| 135 const unsigned char *frame = vpx_video_reader_get_frame(reader, | 135 const unsigned char *frame = vpx_video_reader_get_frame(reader, |
| 136 &frame_size); | 136 &frame_size); |
| 137 if (vpx_codec_decode(&codec, frame, frame_size, NULL, 0)) | 137 if (vpx_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 0)) |
| 138 die_codec(&codec, "Failed to decode frame."); | 138 die_codec(&codec, "Failed to decode frame."); |
| 139 | 139 |
| 140 while ((img = vpx_codec_get_frame(&codec, &iter)) != NULL) { | 140 while ((img = vpx_codec_get_frame(&codec, &iter)) != NULL) { |
| 141 vpx_img_write(img, outfile); | 141 vpx_img_write(img, outfile); |
| 142 ++frame_cnt; | 142 ++frame_cnt; |
| 143 } | 143 } |
| 144 } | 144 } |
| 145 | 145 |
| 146 printf("Processed %d frames.\n", frame_cnt); | 146 printf("Processed %d frames.\n", frame_cnt); |
| 147 if (vpx_codec_destroy(&codec)) | 147 if (vpx_codec_destroy(&codec)) |
| 148 die_codec(&codec, "Failed to destroy codec"); | 148 die_codec(&codec, "Failed to destroy codec"); |
| 149 | 149 |
| 150 printf("Play: ffplay -f rawvideo -pix_fmt yuv420p -s %dx%d %s\n", | 150 printf("Play: ffplay -f rawvideo -pix_fmt yuv420p -s %dx%d %s\n", |
| 151 info->frame_width, info->frame_height, argv[2]); | 151 info->frame_width, info->frame_height, argv[2]); |
| 152 | 152 |
| 153 vpx_video_reader_close(reader); | 153 vpx_video_reader_close(reader); |
| 154 | 154 |
| 155 fclose(outfile); | 155 fclose(outfile); |
| 156 | 156 |
| 157 return EXIT_SUCCESS; | 157 return EXIT_SUCCESS; |
| 158 } | 158 } |
| OLD | NEW |